fixes
This commit is contained in:
parent
72372527b5
commit
bc33331889
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,4 +1,4 @@
|
|||
static
|
||||
/static
|
||||
data
|
||||
*.pyc
|
||||
__pycache__
|
||||
|
|
|
@ -146,7 +146,7 @@ ul.clearing-thumbs li {
|
|||
.admin-menu {
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
right: 65px;
|
||||
right: 320px;
|
||||
}
|
||||
|
||||
.admin-menu a {
|
||||
|
@ -163,7 +163,7 @@ table thead, table tbody, table tfoot {
|
|||
border: 0.125rem solid #e6e6e6;
|
||||
box-shadow: 0 0 3.125rem rgba(0, 0, 0, 0.18);
|
||||
border-radius: 0;
|
||||
background-image: url("http://media.yardhouse.com/images/site/searchicon.png");
|
||||
background-image: url("/static/png/searchicon.png");
|
||||
background-position: 4px center;
|
||||
background-repeat: no-repeat;
|
||||
background-color: #111111;
|
||||
|
@ -172,7 +172,7 @@ table thead, table tbody, table tfoot {
|
|||
color: #ffffff !important;
|
||||
font-size: 10px !important;
|
||||
top: 13px;
|
||||
right: 110px;
|
||||
right: 65px;
|
||||
height: 25px;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
|
|
BIN
camp/static/png/searchicon.png
Normal file
BIN
camp/static/png/searchicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
|
@ -52,7 +52,7 @@ class GalleryAdmin(GalleryAdminDefault):
|
|||
|
||||
class ContentAdmin(admin.ModelAdmin):
|
||||
save_on_top = True
|
||||
list_display = ('__str__', 'datestart', 'shortname', 'type')
|
||||
list_display = ('id', '__str__', 'datestart', 'shortname', 'type')
|
||||
list_filter = ['datestart', 'type']
|
||||
search_fields = ['title', 'body', 'header', 'shortname']
|
||||
inlines = [ContentParentsInline, FileInline, LinkInline]
|
||||
|
|
|
@ -110,7 +110,7 @@ class Content(models.Model):
|
|||
@property
|
||||
def formatted_teaser(self):
|
||||
if self.teaser:
|
||||
value = self.teaser
|
||||
value = markdownify(self.teaser)
|
||||
elif self.header:
|
||||
value = ox.strip_tags(ox.decode_html(markdownify(self.header)))[:100]
|
||||
else:
|
||||
|
@ -124,7 +124,7 @@ class Content(models.Model):
|
|||
@property
|
||||
def image_url(self):
|
||||
if self.image:
|
||||
if self.image.startswith('http'):
|
||||
if self.image.startswith('http') or self.image.startswith('/'):
|
||||
return self.image
|
||||
return settings.IMAGE_PREFIX + self.image
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
<h4 class="sidebar-h4"> Past Events </h4>
|
||||
{% include "event_preview.html" with events=past_events %}
|
||||
{% endif %}
|
||||
<a href="index/">more</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -16,7 +16,7 @@ from photologue.models import Photo, Gallery
|
|||
|
||||
from .models import Content, ContentContent
|
||||
|
||||
# Create your views here.
|
||||
ITEMS_PER_PAGE = 30
|
||||
|
||||
def index(request):
|
||||
now = datetime.now()
|
||||
|
@ -73,7 +73,7 @@ def section_list(request, section):
|
|||
content = limit_content(content, q)
|
||||
|
||||
page = request.GET.get('page', 1)
|
||||
paginator = Paginator(content, 5)
|
||||
paginator = Paginator(content, ITEMS_PER_PAGE)
|
||||
try:
|
||||
content = paginator.page(page)
|
||||
except PageNotAnInteger:
|
||||
|
@ -103,7 +103,7 @@ def event(request):
|
|||
|
||||
upcoming_events = base.filter(datestart__gt=now).order_by('-datestart')
|
||||
ongoing_events = base.filter(datestart__lt=now, dateend__gte=now).order_by('-datestart')
|
||||
past_events = base.filter(Q(dateend__lt=now) | Q(dateend=None, datestart__lt=now))[:10]
|
||||
past_events = base.filter(Q(dateend__lt=now) | Q(dateend=None, datestart__lt=now)).order_by('-datestart')[:10]
|
||||
|
||||
context = {
|
||||
'upcoming_events': upcoming_events,
|
||||
|
@ -178,7 +178,7 @@ def search(request):
|
|||
q = request.GET.get('q')
|
||||
content = limit_content(content, q)
|
||||
page = request.GET.get('page', 1)
|
||||
paginator = Paginator(content, 5)
|
||||
paginator = Paginator(content, ITEMS_PER_PAGE)
|
||||
try:
|
||||
content = paginator.page(page)
|
||||
except PageNotAnInteger:
|
||||
|
@ -199,7 +199,7 @@ def search(request):
|
|||
|
||||
class GalleryListViews(ListView):
|
||||
queryset = Gallery.objects.on_site().is_public()
|
||||
paginate_by = 20
|
||||
paginate_by = ITEMS_PER_PAGE
|
||||
template_name = 'gallery_list.html'
|
||||
|
||||
def get_or_none(classmodel, **kwargs):
|
||||
|
|
Loading…
Reference in New Issue
Block a user