Skip to content

Commit

Permalink
[2255] Added routes and template for allowing users to request member…
Browse files Browse the repository at this point in the history
…ship of organizations
  • Loading branch information
rossjones committed Mar 28, 2012
1 parent e8208a0 commit 41cce2b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ckanext/organizations/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,9 @@ def users(self, id, data=None, errors=None, error_summary=None):

return render('organization_users.html')

def _add_publisher_list(self):
c.possible_parents = model.Session.query(model.Group).\
filter(model.Group.state == 'active').\
filter(model.Group.type == 'organization').\
order_by(model.Group.title).all()

4 changes: 3 additions & 1 deletion ckanext/organizations/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class OrganizationForm(SingletonPlugin):
implements(IConfigurer)

def before_map(self, map):
map.connect('/organization/{id}/users', controller='ckanext.organizations.controllers:OrganizationController', action='users')
map.connect('/organization/users/{id}', controller='ckanext.organizations.controllers:OrganizationController', action='users')
map.connect('/organization/apply/{id}', controller='ckanext.organizations.controllers:OrganizationController', action='apply')
map.connect('/organization/apply', controller='ckanext.organizations.controllers:OrganizationController', action='apply')
map.connect('/organization/edit/{id}', controller='group', action='edit')
map.connect('/organization/{id}', controller='group', action='read')

Expand Down
12 changes: 12 additions & 0 deletions ckanext/organizations/templates/email/join_publisher_request.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Dear administrator,

A request has been made for membership of your organization $group.title by $requester.name {% if requester.fullname %}( $requester.fullname ){% end %}

The reason given for the request was:

"$reason"

Please contact the user to verify and then if you would like to add this user you can do so by visiting ${ '%s' % g.site_url }${h.url_for(controller='ckanext.organizers.controllers:OrganizationController', action='users', id=group.name) }

If you do not wish to add this user you can safely disregard this email.

5 changes: 4 additions & 1 deletion ckanext/organizations/templates/organization_layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@
<a href="${h.url_for(controller='package', action='new')}?groups__0__id=${c.group.id}">${h.icon('add') + _('Add Dataset')}</a>
</li>
<li class="${'active' if c.action=='edit' else ''}" py:if="can_update">
<!-- TODO: We need to be able to change the URL below based on the type of the group -->
${h.subnav_named_route( c,h.icon('group_edit') + _('Edit'), 'organization_action', action='edit', id=c.group.name )}
</li>
<li class="${'active' if c.action=='apply' else ''}">
<a href="${h.url_for(controller='ckanext.organizations.controllers:OrganizationController', action='apply')}?parent=${c.group.name}">${h.icon('group_edit') + _('Join')}</a>
</li>

</py:when>
<py:otherwise>
<li class="${'active' if c.action=='index' else ''}">
Expand Down

0 comments on commit 41cce2b

Please sign in to comment.