Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Organizations member admin now has new template
- Loading branch information
1 parent
7f37d12
commit b96f72e
Showing
7 changed files
with
146 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Module for the organizations users table | ||
*/ | ||
this.ckan.module('organization-users', function ($, _) { | ||
return { | ||
initialize: function () { | ||
// convert all the keep labels into buttons | ||
$('.orginization-remove', this.el).each(function() { | ||
$(this).addClass('btn btn-danger pull-right checkbox'); | ||
$('span', this).html('').addClass('icon-remove'); | ||
}); | ||
// ok checkbox change toggle the disabled state for display | ||
this.el.on('change', '.orginization-remove :checkbox', function() { | ||
var row = $(this).parents('tr'); | ||
row.toggleClass('disabled'); | ||
$('input[type=radio]', row).prop('disabled', !$(this).prop('checked')); | ||
$('.btn', row).toggleClass('btn-info'); | ||
}); | ||
} | ||
} | ||
}); |
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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{% extends "page.html" %} | ||
|
||
{% block subtitle %}{{ c.organization.display_name }}{% endblock %} | ||
|
||
{% block breadcrumb_content %} | ||
<li>{% link_for _('Organizations'), controller='organization', action='index' %}</li> | ||
<li class="active">{% link_for c.organization.display_name|truncate(35), controller='organization', action='users', id=c.organization.name %}</li> | ||
{% endblock %} | ||
|
||
{% block actions_content %} | ||
<li>{% link_for _('Back to organization'), controller='organization', action='read', id=c.organization.name, class_='btn', icon='caret-left' %}</li> | ||
{% endblock %} | ||
|
||
{% block primary_content %} | ||
<section class="module"> | ||
<div class="module-content"> | ||
<h1 class="page-heading">{% block page_heading %}{{ _('Manage Users') }}{% endblock %}</h1> | ||
{% block form %} | ||
{{ c.form | safe }} | ||
{% endblock %} | ||
</div> | ||
</section> | ||
{% endblock %} | ||
|
||
{% block secondary_content %} | ||
{% snippet 'snippets/organization.html', organization=c.organization %} | ||
{% endblock %} |
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{% import 'macros/form.html' as form %} | ||
|
||
<form class="form-horizontal organization-form-users" method="post" data-module="organization-users"> | ||
<input type="hidden" name="type" value="organization"> | ||
|
||
{{ form.errors(error_summary) }} | ||
|
||
<table class="table table-bordered table-striped"> | ||
<colgroup> | ||
<col width="58%"> | ||
<col width="30%"> | ||
<col width="12%"> | ||
</colgroup> | ||
<thead> | ||
<tr> | ||
<th>{{ _('User') }}</th> | ||
<th>{{ _('Role') }}</th> | ||
<th><span class="pull-right">{{ _('Actions') }}</span></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for user in data.users %} | ||
<tr> | ||
<td class="username">{{ user.name }}</td> | ||
<td> | ||
<div class="control-group"> | ||
<label class="radio inline"> | ||
<input type="radio" name="users__{{ loop.index0 + 1 }}__capacity" value="admin" {{"checked" if (user or {}).get('capacity','') == 'admin' else ''}}> | ||
{{ _('Admin') }} | ||
</label> | ||
<label class="radio inline"> | ||
<input type="radio" name="users__{{ loop.index0 + 1 }}__capacity" value="editor" {{"checked" if (user or {}).get('capacity','') in ['editor', 'member', ''] else ''}}> | ||
{{ _('Editor') }} | ||
</label> | ||
</div> | ||
</td> | ||
<td> | ||
<div class="control-group"> | ||
<label class="orginization-remove"> | ||
<input id="users__{{ loop.index0 + 1 }}__name" name="users__{{ loop.index0 + 1 }}__name" type="checkbox" value="{{ user.name }}" checked="checked"> | ||
<span>{{ _('Keep this user?') }}</span> | ||
</label> | ||
</div> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
|
||
<legend>{{ _('Add user') }}</legend> | ||
<div class="control-group organization-adduser"> | ||
<label for="users__0__name" class="control-label">{{ _('Username') }}</label> | ||
<div class="controls"> | ||
<input id="users__0__name" name="users__0__name" type="text"> | ||
</div> | ||
</div> | ||
|
||
<div class="form-actions"> | ||
<button name="save" type="submit" class="btn btn-primary">{{ _('Save') }}</button> | ||
</div> | ||
|
||
</form> |
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