diff --git a/ckan/controllers/group.py b/ckan/controllers/group.py index 1483039e9a2..38ce9b70f0c 100644 --- a/ckan/controllers/group.py +++ b/ckan/controllers/group.py @@ -331,6 +331,7 @@ def edit(self, id, data=None, errors=None, error_summary=None): group = context.get("group") c.group = group + c.group_dict = self._action('group_show')(context, data_dict) try: self._check_access('group_update', context) diff --git a/ckan/public/base/images/editing.png b/ckan/public/base/images/editing.png new file mode 100644 index 00000000000..a0b2779be6e Binary files /dev/null and b/ckan/public/base/images/editing.png differ diff --git a/ckan/public/base/less/profile.less b/ckan/public/base/less/profile.less index 218877f1468..80f201ebfbb 100644 --- a/ckan/public/base/less/profile.less +++ b/ckan/public/base/less/profile.less @@ -1,3 +1,10 @@ +.editing { + [role="main"], + .main { + background: #EFEFEF url("@{imagePath}/editing.png?2") 0 0 repeat-x; + } +} + .profile { .empty, .dataset-list { @@ -60,4 +67,12 @@ } } } + &.editing { + .module-heading { + + } + .module-content { + margin-top: 0; + } + } } diff --git a/ckan/templates/organization/base_form_page.html b/ckan/templates/organization/base_form_page.html index e8576f82447..779a1eddaf5 100644 --- a/ckan/templates/organization/base_form_page.html +++ b/ckan/templates/organization/base_form_page.html @@ -1,28 +1,10 @@ -{% extends "page.html" %} +{% extends "organization/edit_base.html" %} -{% block breadcrumb_content %} -
  • {{ h.nav_link(_('Organizations'), controller='organization', action='index') }}
  • -
  • {% block breadcrumb_link %}{{ h.nav_link(_('Add a Organization'), controller='organization', action='new') }}{% endblock %}
  • -{% endblock %} - -{% block primary_content %} -
    -
    -

    {% block page_heading %}{{ _('Organization Form') }}{% endblock %}

    - {% block form %} - {{ c.form | safe }} - {% endblock %} -
    -
    -{% endblock %} - -{% block secondary_content %} -
    -

    {{ _('What are Organizations?') }}

    -
    - {% trans %} -

    good question

    - {% endtrans %} -

    +{% block primary_content_inner %} +
    +

    {% block page_heading %}{{ _('Organization Form') }}{% endblock %}

    + {% block form %} + {{ c.form | safe }} + {% endblock %}
    {% endblock %} diff --git a/ckan/templates/organization/edit.html b/ckan/templates/organization/edit.html index 09e4f8801f1..4de39ad1385 100644 --- a/ckan/templates/organization/edit.html +++ b/ckan/templates/organization/edit.html @@ -2,6 +2,4 @@ {% block subtitle %}{{ _('Edit a Organization') }}{% endblock %} -{% block breadcrumb_link %}{% link_for _('Edit Organization'), controller='organization', action='edit', id=c.group.name %}{% endblock %} - {% block page_heading %}{{ _('Edit a Organization') }}{% endblock %} diff --git a/ckan/templates/organization/edit_base.html b/ckan/templates/organization/edit_base.html new file mode 100644 index 00000000000..cffc49d7980 --- /dev/null +++ b/ckan/templates/organization/edit_base.html @@ -0,0 +1,52 @@ +{% extends "page.html" %} + +{% set organization = c.group_dict %} + +{% block bodytag %}{{ super() }} class="editing"{% endblock %} + +{% block subtitle %}{{ organization.display_name }}{% endblock %} + +{% block breadcrumb_content %} +
  • {% link_for _('Organizations'), controller='organization', action='index' %}
  • + {% block breadcrumb_content_inner %} +
  • {% link_for organization.display_name|truncate(35), controller='organization', action='read', id=organization.name %}
  • +
  • {% link_for _('Edit Organization'), controller='organization', action='edit', id=organization.name %}
  • + {% endblock %} +{% endblock %} + +{% block actions_content %} + {% if h.check_access('organization_update', {'id': c.group.id}) %} +
  • {{ _('View organization') }}
  • + {% endif %} + {#
  • {% link_for _('History'), controller='organization', action='history', id=organization.name, class_='btn', icon='undo' %}
  • #} +{% endblock %} + +{% block primary_content %} +
    + {% block primary_content_header %} + + {% endblock %} + {% block primary_content_inner %} + {% endblock %} +
    +{% endblock %} + +{% block secondary_content %} + {% snippet 'snippets/organization.html', organization=organization %} +{% endblock %} + +{% block links %} + {{ super() }} + {% include "organization/snippets/feeds.html" %} +{% endblock %} diff --git a/ckan/templates/organization/member_new.html b/ckan/templates/organization/member_new.html index f2efc47bc14..0794d7b8737 100644 --- a/ckan/templates/organization/member_new.html +++ b/ckan/templates/organization/member_new.html @@ -1,4 +1,4 @@ -{% extends "organization/read_base.html" %} +{% extends "organization/edit_base.html" %} {% import 'macros/form.html' as form %} {% block subtitle %}{{ _('Members') }} - {{ c.group_dict.display_name }}{% endblock %} @@ -19,7 +19,20 @@

    {{ _('Add Member') }}

    {% endif %} {% set format_attrs = {'data-module': 'autocomplete'} %} {{ form.select('role', label=_('Role'), options=c.roles, selected='', error='', attrs=format_attrs) }} - +
    + {% if c.user_name %} + + {{ _('Cancel') }} + + + {% else %} + + {% endif %} +
    {% endblock %} diff --git a/ckan/templates/organization/members.html b/ckan/templates/organization/members.html index bedec6353af..fd0e34b6496 100644 --- a/ckan/templates/organization/members.html +++ b/ckan/templates/organization/members.html @@ -1,4 +1,4 @@ -{% extends "organization/read_base.html" %} +{% extends "organization/edit_base.html" %} {% block subtitle %}{{ _('Members') }} - {{ c.group_dict.display_name }}{% endblock %} @@ -6,6 +6,9 @@

    {{ _('Members') }}

    + + + @@ -20,19 +23,21 @@

    {{ _('Members') }}

    {{ h.linked_user(user_id, maxlength=20) }} - {% set locale = h.dump_json({'content': _('Are you sure you want to delete this member?')}) %} {% endfor %}
    {{ _('User') }} {{ role }} + {% set locale = h.dump_json({'content': _('Are you sure you want to delete this member?')}) %}
    - {% link_for _('Edit'), controller='organization', action='member_new', id=c.group_dict.id, class_='btn', icon='wrench', user=user_id %} - {% block delete_button_text %} {{ _('Delete') }}{% endblock %} + + + + {% block delete_button_text %}{% endblock %}
    -

    - {% link_for _('Add member'), controller='organization', action='member_new', id=c.group_dict.id, class_='btn btn-success', icon='plus' %} -

    +
    + {% link_for _('Add member'), controller='organization', action='member_new', id=c.group_dict.id, class_='btn btn-primary' %} +
    {% endblock %} diff --git a/ckan/templates/organization/read_base.html b/ckan/templates/organization/read_base.html index e3e51c8067b..b78fb0bdb3f 100644 --- a/ckan/templates/organization/read_base.html +++ b/ckan/templates/organization/read_base.html @@ -10,13 +10,14 @@ {% block actions_content %} {% if h.check_access('organization_update', {'id': c.group.id}) %}
  • {% link_for _('Add Dataset to Organization'), controller='package', action='new', group=c.group_dict.id, class_='btn', icon='plus' %}
  • -
  • {% link_for _('Edit'), controller='organization', action='edit', id=c.group_dict.name, class_='btn', icon='wrench' %}
  • +
  • {% link_for _('Edit'), controller='organization', action='edit', id=c.group_dict.name, class_='btn btn-primary', icon='wrench' %}
  • {% endif %} {#
  • {% link_for _('History'), controller='organization', action='history', id=c.group_dict.name, class_='btn', icon='undo' %}
  • #} {% endblock %} {% block primary_content %}
    + {# {% block primary_content_header %} {% endblock %} + #} {% block primary_content_inner %} {% endblock %}
    diff --git a/ckan/templates/organization/snippets/info.html b/ckan/templates/organization/snippets/info.html new file mode 100644 index 00000000000..80a5658cfac --- /dev/null +++ b/ckan/templates/organization/snippets/info.html @@ -0,0 +1,20 @@ +{# +Displays a sidebard module with information for given organization + +org - The organization dict. + +Example: + + {% snippet "organization/snippets/info.html", org=org %} + +#} +{% if organization and h.check_access('organization_update', {'id':organization.id }) %} +
    +

    {{ _("Edit Organization") }}

    + +
    +{% endif %} \ No newline at end of file diff --git a/ckan/templates/organization/snippets/organization_form.html b/ckan/templates/organization/snippets/organization_form.html index f6d7c545db3..dae1d26d163 100644 --- a/ckan/templates/organization/snippets/organization_form.html +++ b/ckan/templates/organization/snippets/organization_form.html @@ -49,6 +49,7 @@ {% endfor %} {% endblock %} + {# {% block dataset_fields %} {% if data.packages %}
    @@ -68,6 +69,7 @@ {% set dataset_attrs = {'data-module': 'autocomplete', 'data-module-source': '/dataset/autocomplete?q=?'} %} {{ form.input(dataset_name, label=_('Add Dataset'), id="field-dataset", value=data[dataset_name], classes=['control-medium'], attrs=dataset_attrs) }} {% endblock %} + #}
    {% block delete_button %}