kopia lustrzana https://github.com/jointakahe/takahe
pass page index to announcement edit
rodzic
f88ad38294
commit
c8efa76076
|
@ -16,7 +16,7 @@
|
|||
{% include "forms/_field.html" with field=form.end %}
|
||||
</fieldset>
|
||||
<div class="buttons">
|
||||
<a href="{{ announcement.urls.admin_root }}" class="button secondary left">Back</a>
|
||||
<a href="{{ announcement.urls.admin_root }}?page={{ page }}" class="button secondary left">Back</a>
|
||||
<a href="{{ announcement.urls.admin_delete }}" class="button delete">Delete</a>
|
||||
<button>Save</button>
|
||||
</div>
|
||||
|
|
|
@ -10,11 +10,11 @@
|
|||
{% for announcement in page_obj %}
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<a href="{{ announcement.urls.admin_edit }}" class="overlay"></a>
|
||||
<a href="{{ announcement.urls.admin_edit }}?page={{ page_obj.number }}" class="overlay"></a>
|
||||
<i class="fa-solid fa-bullhorn"></i>
|
||||
</td>
|
||||
<td class="name">
|
||||
<a href="{{ announcement.urls.admin_edit }}" class="overlay"></a>
|
||||
<a href="{{ announcement.urls.admin_edit }}?page={{ page_obj.number }}" class="overlay"></a>
|
||||
{{ announcement.html|truncatewords_html:"10" }}
|
||||
<small>
|
||||
{% if announcement.service_announcement %}{{ domain.service_domain }}{% endif %}
|
||||
|
|
|
@ -49,7 +49,11 @@ class AnnouncementEdit(UpdateView):
|
|||
model = Announcement
|
||||
template_name = "admin/announcement_edit.html"
|
||||
extra_context = {"section": "announcements"}
|
||||
success_url = Announcement.urls.admin_root
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["page"] = self.request.GET.get("page")
|
||||
return context
|
||||
|
||||
class form_class(AnnouncementCreate.form_class):
|
||||
pass
|
||||
|
|
Ładowanie…
Reference in New Issue