Skip to content

Commit

Permalink
Merge pull request digitalfox#113 from pyoupyou/add-source-admin-link
Browse files Browse the repository at this point in the history
Active sources list: Add link to source edit for staff
  • Loading branch information
bport authored Oct 23, 2020
2 parents 72bef7d + 6960c23 commit c7d9b0c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions interview/templates/interview/tables/edit_source.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% load i18n %}
{% if request.user.is_staff %}
<a class="btn btn-info btn-xs" href="{{ record.admin_url }}">
<i class="fa fa-pencil" aria-hidden="true"></i>
</a>
{% endif %}
4 changes: 4 additions & 0 deletions interview/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,9 @@ class ActiveSourcesTable(tables.Table):
offers = tables.Column(verbose_name=_("Offers"))
last_state_change = tables.Column(verbose_name=_("Last change"))
details = tables.TemplateColumn(verbose_name="", orderable=False, template_name="interview/tables/source_name.html")
source_admin = tables.TemplateColumn(
verbose_name="", orderable=False, template_name="interview/tables/edit_source.html"
)

class Meta:
order_by = "name"
Expand Down Expand Up @@ -1006,6 +1009,7 @@ def active_sources(request, subsidiary_id=None):
"ratio": 100 * total_hired / total_processes_count if total_processes_count > 0 else None,
"last_state_change": last_state_change["last_state_change__max"],
"url": reverse(viewname="process-list-source", kwargs={"source_id": s.id}),
"admin_url": reverse(viewname="admin:interview_sources_change", kwargs={"object_id": s.id}),
"offers": distinct_offers,
}
)
Expand Down

0 comments on commit c7d9b0c

Please sign in to comment.