Skip to content

Commit

Permalink
Merge pull request #4917 from freelawproject/4888-feat-adds-button-to…
Browse files Browse the repository at this point in the history
…-open-admin-from-top-prayers

feat(prayers): Adds admin action in top prayers page
  • Loading branch information
mlissner authored Jan 14, 2025
2 parents f867bbd + b3b8f38 commit 9a492d6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cl/favorites/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,8 @@ class UserTagInline(admin.StackedInline):
class PrayerAdmin(admin.ModelAdmin):
raw_id_fields = ("user", "recap_document")
readonly_fields = ("date_created",)
list_display = (
"id",
"user",
"recap_document",
)
12 changes: 12 additions & 0 deletions cl/favorites/templates/top_prayers.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ <h3 class="text-center"><b>{{ waiting_stats.prayer_count|intcomma }}</b> prayers
<th>Document Number</th>
<th>Document Description</th>
<th>Buy on Pacer</th>
{% if perms.favorites.change_prayer %}
<th>Action</th>
{% endif %}
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -66,6 +69,15 @@ <h3 class="text-center"><b>{{ waiting_stats.prayer_count|intcomma }}</b> prayers
{% endif %}
target="_blank"
rel="nofollow">Buy on PACER {% if prayer.page_count %}(${{ prayer|price }}){% endif %}</td>
{% if perms.favorites.change_prayer %}
<td>
<div class="flex">
<a href="{% url 'admin:favorites_prayer_changelist' %}?recap_document={{prayer.id}}" class="btn btn-default btn-xs">
<i class="fa fa-pencil"></i>&nbsp;Edit
</a>
</div>
</td>
{% endif %}
</tr>
{% empty %}
<tr>
Expand Down

0 comments on commit 9a492d6

Please sign in to comment.