-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from liip/fix/fix-org-edit-template
Fix/fix org edit template
- Loading branch information
Showing
2 changed files
with
68 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{% extends "organization/base_form_page.html" %} | ||
|
||
{% block subtitle %}{{ _('Edit') }} {{ g.template_title_delimiter }} {{ super() }}{% endblock %} | ||
|
||
{% block breadcrumb_content %} | ||
<li>{% link_for h.humanize_entity_type('organization', group_type, 'breadcrumb') or _('Organizations'), named_route=group_type+'.index' %}</li> | ||
{% block breadcrumb_content_inner %} | ||
<li>{% link_for h.get_localized_value(organization.title)|truncate(35), named_route=group_type+'.read', id=organization.name %}</li> | ||
<li class="active">{% link_for _('Manage'), named_route=group_type+'.edit', id=organization.name %}</li> | ||
{% endblock %} | ||
{% endblock %} | ||
|
||
{% block page_heading_class %}hide-heading{% endblock %} | ||
{% block page_heading %}{{ _('Edit Organization') }}{% endblock %} |
54 changes: 54 additions & 0 deletions
54
ckanext/switzerland/templates/scheming/organization/group_form.html
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,54 @@ | ||
{% import 'macros/form.html' as form %} | ||
{% if group_type is not defined %} | ||
{% set group_type = c.group_type %} | ||
{% endif %} | ||
|
||
|
||
{%- if not group_type -%} | ||
<p> | ||
group_type not passed to template. your version of CKAN | ||
might not be compatible with ckanext-scheming | ||
</p> | ||
{%- endif -%} | ||
|
||
<form class="dataset-form form-horizontal" method="post" data-module="basic-form" enctype="multipart/form-data"> | ||
{{ h.csrf_input() if 'csrf_input' in h }} | ||
{%- set schema = h.scheming_get_organization_schema(group_type) -%} | ||
{%- for field in schema['fields'] -%} | ||
{%- if field.form_snippet is not none -%} | ||
{%- snippet 'scheming/snippets/form_field.html', | ||
field=field, data=data, errors=errors, licenses=licenses, | ||
entity_type='organization', object_type=group_type -%} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
|
||
{{ form.required_message() }} | ||
|
||
<div class="form-actions"> | ||
{% block delete_button %} | ||
{% if action == 'edit' %} | ||
{% if h.check_access('group_delete', {'id': data.id}) and action=='edit' %} | ||
{% set locale = h.dump_json({'content': _('Are you sure you want to delete this Organization?')}) %} | ||
<a class="btn btn-danger pull-left" href="{% url_for controller=group_type, action='delete', id=data.id %}" data-module="confirm-action" data-module-i18n="{{ locale }}">{% block delete_button_text %}{{ _('Delete') }}{% endblock %}</a> | ||
{% endif %} | ||
{% endif %} | ||
{% endblock %} | ||
<button class="btn btn-primary" name="save" type="submit"> | ||
{% block save_text %} | ||
{%- if action == "edit" -%} | ||
{%- if 'humanize_entity_type' in h -%} | ||
{{ h.humanize_entity_type('organization', group_type, 'update label') or _('Update Organization') }} | ||
{%- else -%} | ||
{{ _('Update Organization') }} | ||
{%- endif -%} | ||
{%- else -%} | ||
{%- if 'humanize_entity_type' in h -%} | ||
{{ h.humanize_entity_type('organization', group_type, 'create label') or _('Create Organization') }} | ||
{%- else -%} | ||
{{ _('Create Organization') }} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{% endblock %} | ||
</button> | ||
</div> | ||
</form> |