Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1102] Improves the groups list within package template
- Loading branch information
1 parent
bfad157
commit d4cd290
Showing
2 changed files
with
23 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,27 @@ | ||
{% import 'macros/form.html' as form %} | ||
{% extends "package/read_base.html" %} | ||
{% import 'macros/form.html' as form %} | ||
|
||
{% block primary_content_inner %} | ||
<h2 class="hide-heading">{% block page_heading %}{{ _('Groups {dataset} belongs to.').format(dataset=h.dataset_display_name(c.pkg)) }}{% endblock %}</h2> | ||
<h2 class="hide-heading">{{ _('Groups') }}</h2> | ||
|
||
{% if c.group_dropdown %} | ||
<form class="module-content form-horizontal" method='post'> | ||
<select id="field-add_group" name="group_added"> | ||
{% for option in c.group_dropdown %} | ||
<option value="{{ option[0] }}"> {{ option[1] }}</option> | ||
{% endfor %} | ||
</select> | ||
<button type="submit"> <span>Add Group</span></button> | ||
</form> | ||
<form method="post" class="form-horizontal"> | ||
{#'data-module': ''#} | ||
<select id="field-add_group" name="group_added" data-module="autocomplete"> | ||
{% for option in c.group_dropdown %} | ||
<option value="{{ option[0] }}"> {{ option[1] }}</option> | ||
{% endfor %} | ||
</select> | ||
<button type="submit" class="btn btn-primary" title="{{ _('Associate this group with this dataset') }}">{{ _('Add group') }}</button> | ||
</form> | ||
{% endif %} | ||
|
||
<ul class="unstyled"> | ||
{% for group in c.pkg_dict.groups %} | ||
<li class="dataset-item"> {{group.display_name}} | ||
<form class="unstyled" method='post'> | ||
{% if group.user_member %} | ||
<button name="group_removed" value="{{group.id}}" type="submit"> <span>Remove Group</span> </button> | ||
{% endif %} | ||
</form> | ||
</li> | ||
|
||
{% endfor %} | ||
</ul> | ||
|
||
{% if c.pkg_dict.groups %} | ||
<form method="post"> | ||
{% snippet 'group/snippets/group_list.html', groups=c.pkg_dict.groups %} | ||
</form> | ||
{% else %} | ||
<p class="empty">{{ _('There are no groups associated with this dataset') }}</p> | ||
{% endif %} | ||
|
||
{% endblock %} |