edit button

This commit is contained in:
root 2017-12-19 12:36:21 +00:00
parent fd976735d6
commit e852a28105
6 changed files with 19 additions and 2 deletions

View File

@ -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;
}

View File

@ -36,7 +36,6 @@
</div>
</div>
{% block content %}
{% endblock %}

View File

@ -0,0 +1,6 @@
{% if request.user.is_staff %}
<div class="admin-menu">
<a href="{% url 'admin:content_content_change' content.id %}">Edit</a>
</div>
{% endif %}

View File

@ -3,6 +3,7 @@
{% extends 'base.html' %}
{% block content %}
{% include "edit.html" with content=events %}
<div class="large-8 medium-8 columns special-column">
{% if events.image %}

View File

@ -3,6 +3,7 @@
{% extends 'base.html' %}
{% block content %}
{% include "edit.html" with content=projects %}
<div class="large-8 medium-8 columns special-column">
{% if projects.image %}

View File

@ -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)