[ckan-changes] [okfn/ckan] 386b2c: Organization template fixes for disappearing users...
GitHub
noreply at github.com
Tue Apr 17 13:49:21 UTC 2012
Branch: refs/heads/master
Home: https://github.com/okfn/ckan
Commit: 386b2c15c0c2112c348ad275a485458e25158bff
https://github.com/okfn/ckan/commit/386b2c15c0c2112c348ad275a485458e25158bff
Author: Ross Jones <rossdjones at gmail.com>
Date: 2012-04-17 (Tue, 17 Apr 2012)
Changed paths:
M ckanext/organizations/templates/organization_form.html
Log Message:
-----------
Organization template fixes for disappearing users after edit
diff --git a/ckanext/organizations/templates/organization_form.html b/ckanext/organizations/templates/organization_form.html
index df0b9d7..f774043 100644
--- a/ckanext/organizations/templates/organization_form.html
+++ b/ckanext/organizations/templates/organization_form.html
@@ -50,7 +50,6 @@
</div>
</div>
-
<dt class="parent-label" py:if="c.is_superuser_or_groupadmin">
<label class="field_opt" for="parent">Parent Organization</label>
</dt>
@@ -109,14 +108,27 @@
</dl>
</fieldset>
+<?python
+ import ckan.model as model
+ users = []
+ users.extend( { "name": user.name,
+ "capacity": "admin" }
+ for user in c.group.members_of_type( model.User, "admin" ).all() )
+ users.extend( { "name": user.name,
+ "capacity": "editor" }
+ for user in c.group.members_of_type( model.User, 'editor' ).all() )
+?>
<fieldset id="users">
<h3>Users <span py:if="c.users">(${len(c.users.all())})</span></h3>
<a py:if="c.group" href="${h.url_for(controller='ckanext.organizations.controllers:OrganizationController', action='users', id=c.group.name)}">Manage users</a>
- <dl py:if="c.users">
- <py:for each="user in c.users">
+ <dl py:if="users">
+ <py:for each="num, user in enumerate(users)">
<dd>
<label>${user['name']}</label>
+ <input type="hidden" name="users__${num}__name" value="${user['name']}"/>
+ <input type="hidden" name="users__${num}__capacity" value="${user['capacity']}"/>
+
</dd>
</py:for>
</dl>
================================================================
Commit: 1ee9e8e611ea5d43c29e29603898de95193705e8
https://github.com/okfn/ckan/commit/1ee9e8e611ea5d43c29e29603898de95193705e8
Author: Ross Jones <rossdjones at gmail.com>
Date: 2012-04-17 (Tue, 17 Apr 2012)
Changed paths:
M ckan/public/scripts/application.js
Log Message:
-----------
Merge branch 'master' of https://github.com/okfn/ckan
diff --git a/ckan/public/scripts/application.js b/ckan/public/scripts/application.js
index 40513fd..995e703 100644
--- a/ckan/public/scripts/application.js
+++ b/ckan/public/scripts/application.js
@@ -537,7 +537,7 @@ CKAN.View.Resource = Backbone.View.extend({
}
self.updateIconTimer = setTimeout(function() {
// AJAX to server API
- $.getJSON('/api/2/util/resource/format_icon?format='+encodeURIComponent(self.formatBox.val()), function(data) {
+ $.getJSON(CKAN.SITE_URL + '/api/2/util/resource/format_icon?format='+encodeURIComponent(self.formatBox.val()), function(data) {
if (data && data.icon && data.format==self.formatBox.val()) {
self.li.find('.js-resource-icon').attr('src',data.icon);
self.table.find('.js-resource-icon').attr('src',data.icon);
================================================================
Compare: https://github.com/okfn/ckan/compare/ba48fb5...1ee9e8e
More information about the ckan-changes
mailing list