From bc33331889695379a02d49b7dcfe014217fa1d19 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 1 Jan 2018 13:31:30 +0000 Subject: [PATCH] fixes --- .gitignore | 2 +- camp/static/css/main.css | 6 +++--- camp/static/png/searchicon.png | Bin 0 -> 1122 bytes content/admin.py | 2 +- content/models.py | 4 ++-- content/templates/event.html | 1 + content/views.py | 10 +++++----- 7 files changed, 13 insertions(+), 12 deletions(-) create mode 100644 camp/static/png/searchicon.png diff --git a/.gitignore b/.gitignore index 1955533..b414a22 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -static +/static data *.pyc __pycache__ diff --git a/camp/static/css/main.css b/camp/static/css/main.css index 1e9bb94..9eb6b00 100644 --- a/camp/static/css/main.css +++ b/camp/static/css/main.css @@ -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; diff --git a/camp/static/png/searchicon.png b/camp/static/png/searchicon.png new file mode 100644 index 0000000000000000000000000000000000000000..7b674723317d288376d055b3ab48574a06b76fbd GIT binary patch literal 1122 zcmaJ=TWHfz7*4H<8_cPQxS@E=1Qpk&=_OlZ>((``tC}&o$_gTwC1-24B_}3lHk&A$ zmwH14MG*C6US34Jpn@_%(JA_-2tx$H%Y!~C>Vpd6JelkC!5WgB3*Yzs|M~y#9B6G> zTTxzJPEk}vs#!>rvC{cw%_RTTW5?H#p$aFmxD9pUyktTurl1Z8Qkv8S(@;|Sw?2ju zigMFxCX2J;23|&*S8_03TQdloq9P5pA;~=ugAUlG>QVaR$Q>G}N|bI7i9XSY!<^bY zV8XV6mW({mBZn2bVGW4bJQ2_!mVmAG>K1QD=?Pt)%$;q91``n66QzGAl@(h-9GMV= zyaA8wV_Cp)UN#uwIJOq}eXO7Hk(cwZK|aLs{yH%E&?K6vbnpgJ+n0 zKJU#3yvXcg*l;-PX!!jeg78@VI+kpYZq*bO1Zc^oYG4)Vz)_SsP#=!cB-7tV(2OZr z-I^>DDHvl*2E%%N&XI~hQT#tt)27fCPQyR>{!`e>^c#>#LksnpGHG0AjT6e?<0h0a zGBXJE7OU8rLl{{(WPo@Z2UfJJx`Oi7$_czE@+sZIk}kuP5T%KNS5*~0To?AS^~r>v zt8Zf2M4+DK>Y4;07!1@Uxd4|aas?#!X;8;SuJVVQEXj4Opcy2x08MopRFWprz{HVx zwRA4=l6sR|rF1SrNiIW@VVuVP)#&0DagQ^dvMpIm86WDz?IyAH&h6dL$(0yO39*d* zqT|Q-c!T@aVA;N#wR66@KUIL8g+1?FSGf&yYZjb}9qk!9QF-M2-p1SWHU}O(eA!&x zKJ8Nr_&I&_L*wa#=eRwtb5&)87FaQR?J>8cE&CpNe{}iqypgN9(JO;x>l=se&W`-t zv1`@!C2_SfauOQqn!@}yud_k=&=NUz>~>*v=7Vc9=3Fj(_B?GGsSIDZH(b5n^~x@U zM;3~2H|7?d-M#qLx4n;tA9!j{etYs}tbEh;p&u7_cgntCV(B4i259&ad**j9IBdHb a2VK;S(fcR5U!DQZtxqLdgiB3ZcKrgH9CKIz literal 0 HcmV?d00001 diff --git a/content/admin.py b/content/admin.py index 0718973..372a1db 100644 --- a/content/admin.py +++ b/content/admin.py @@ -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] diff --git a/content/models.py b/content/models.py index 8aa26ee..1d01248 100644 --- a/content/models.py +++ b/content/models.py @@ -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 diff --git a/content/templates/event.html b/content/templates/event.html index d9e8831..81a01ed 100644 --- a/content/templates/event.html +++ b/content/templates/event.html @@ -16,6 +16,7 @@ {% include "event_preview.html" with events=past_events %} {% endif %} + more {% endblock %} diff --git a/content/views.py b/content/views.py index b0d2a91..c32d203 100644 --- a/content/views.py +++ b/content/views.py @@ -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):