From e852a2810568ef45916bf9b96a1ce22fddfe5026 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 19 Dec 2017 12:36:21 +0000 Subject: [PATCH] edit button --- camp/static/css/main.css | 10 ++++++++++ content/templates/base.html | 1 - content/templates/edit.html | 6 ++++++ content/templates/events.html | 1 + content/templates/projects.html | 1 + content/views.py | 2 +- 6 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 content/templates/edit.html diff --git a/camp/static/css/main.css b/camp/static/css/main.css index 2400ab5..878ce88 100644 --- a/camp/static/css/main.css +++ b/camp/static/css/main.css @@ -142,3 +142,13 @@ ul.clearing-thumbs li { .pagination button:hover { background: #1779ba !important; } +.admin-menu { + position: absolute; + top: 15px; + right: 65px; +} + +.admin-menu a { + color: #fff; +} + diff --git a/content/templates/base.html b/content/templates/base.html index 9ff4111..b6b81b7 100644 --- a/content/templates/base.html +++ b/content/templates/base.html @@ -36,7 +36,6 @@ - {% block content %} {% endblock %} diff --git a/content/templates/edit.html b/content/templates/edit.html new file mode 100644 index 0000000..56be2f7 --- /dev/null +++ b/content/templates/edit.html @@ -0,0 +1,6 @@ +{% if request.user.is_staff %} +
+ Edit +
+{% endif %} + diff --git a/content/templates/events.html b/content/templates/events.html index c8f2c4b..47558ef 100644 --- a/content/templates/events.html +++ b/content/templates/events.html @@ -3,6 +3,7 @@ {% extends 'base.html' %} {% block content %} + {% include "edit.html" with content=events %}
{% if events.image %} diff --git a/content/templates/projects.html b/content/templates/projects.html index e89d245..da42b03 100644 --- a/content/templates/projects.html +++ b/content/templates/projects.html @@ -3,6 +3,7 @@ {% extends 'base.html' %} {% block content %} + {% include "edit.html" with content=projects %}
{% if projects.image %} diff --git a/content/views.py b/content/views.py index 02acfc7..4e424b6 100644 --- a/content/views.py +++ b/content/views.py @@ -125,7 +125,7 @@ def page(request, shortname): def search(request): q = request.GET.get('q') - results = Content.objects.filter(Q(body__icontains=q) | Q(title__icontains=q)).distinct() + results = Content.objects.filter(Q(body__icontains=q) | Q(title__icontains=q) | Q(header__icontains=q)).distinct() results = results.filter(published=True) results = results.order_by('-datestart') page = request.GET.get('page', 1)