Replaced edit links with buttons

This commit is contained in:
Jeremy Stretch
2016-07-28 15:04:27 -04:00
parent e6c06b39e8
commit b6e5bafd65
4 changed files with 46 additions and 36 deletions

View File

@@ -6,9 +6,9 @@ from utilities.tables import BaseTable, ToggleColumn
from .models import SecretRole, Secret
SECRETROLE_EDIT_LINK = """
SECRETROLE_ACTIONS = """
{% if perms.secrets.change_secretrole %}
<a href="{% url 'secrets:secretrole_edit' slug=record.slug %}">Edit</a>
<a href="{% url 'secrets:secretrole_edit' slug=record.slug %}" class="btn btn-xs btn-warning"><i class="glyphicon glyphicon-pencil" aria-hidden="true"></i></a>
{% endif %}
"""
@@ -22,11 +22,12 @@ class SecretRoleTable(BaseTable):
name = tables.LinkColumn(verbose_name='Name')
secret_count = tables.Column(verbose_name='Secrets')
slug = tables.Column(verbose_name='Slug')
edit = tables.TemplateColumn(template_code=SECRETROLE_EDIT_LINK, verbose_name='')
actions = tables.TemplateColumn(template_code=SECRETROLE_ACTIONS, attrs={'td': {'class': 'text-right'}},
verbose_name='')
class Meta(BaseTable.Meta):
model = SecretRole
fields = ('pk', 'name', 'secret_count', 'slug', 'edit')
fields = ('pk', 'name', 'secret_count', 'slug', 'actions')
#