Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
311 additions
and
40 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
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
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,23 @@ | ||
{% extends "package/view_edit_base.html" %} | ||
|
||
{% block subtitle %}{{ _('Add View') }} - {{ h.resource_display_name(c.resource) }}{% endblock %} | ||
{% block form_title %}{{ _('Add view') }}{% endblock %} | ||
|
||
{% block breadcrumb_content %} | ||
<li class="active"><a href="#">{{ _('Edit View') }}</a></li> | ||
{% endblock %} | ||
|
||
{% block form %} | ||
<form class="dataset-form dataset-resource-form form-horizontal" method="post" data-module="basic-form resource-form"> | ||
{% snippet 'package/snippets/view_form.html', data=data, errors=errors, error_summary=error_summary, form_template=form_template %} | ||
<div class="form-actions"> | ||
<button class="btn btn-danger pull-left" name="delete" value="Delete"> {{ _('Delete') }} </button> | ||
<button class="btn btn-primary" name="save" value="Save" type="submit">{{ _('Update') }}</button> | ||
</div> | ||
</form> | ||
{% endblock %} | ||
|
||
{% block content_primary_nav %} | ||
<li class="active"><a href="#"><i class="icon-edit"></i> {{ _('Edit View') }}</a></li> | ||
{% 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,22 @@ | ||
{% extends "package/view_edit_base.html" %} | ||
|
||
{% block subtitle %}{{ _('Add View') }} - {{ h.resource_display_name(c.resource) }}{% endblock %} | ||
{% block form_title %}{{ _('Add view') }}{% endblock %} | ||
|
||
{% block breadcrumb_content %} | ||
<li class="active"><a href="#">{{ _('Add New View') }}</a></li> | ||
{% endblock %} | ||
|
||
{% block form %} | ||
<form class="dataset-form dataset-resource-form form-horizontal" method="post" data-module="basic-form resource-form"> | ||
{% snippet 'package/snippets/view_form.html', data=data, errors=errors, error_summary=error_summary, form_template=form_template %} | ||
<div class="form-actions"> | ||
<button class="btn btn-primary" name="save" value="Save" type="submit">{% block save_button_text %}{{ _('Add') }}{% endblock %}</button> | ||
</div> | ||
</form> | ||
{% endblock %} | ||
|
||
{% block content_primary_nav %} | ||
<li class="active"><a href="#"><i class="icon-edit"></i> {{ _('New View') }}</a></li> | ||
{% 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
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,35 @@ | ||
{% import 'macros/form.html' as form %} | ||
{% extends "package/resource_edit_base.html" %} | ||
|
||
{% block subtitle %}{{ _('View') }} - {{ h.resource_display_name(res) }}{% endblock %} | ||
|
||
{% block page_primary_action %} | ||
|
||
<form action={{ h.url_for(controller='package', action='edit_view', id=c.pkg_dict.name, resource_id=c.resource.id) }}> | ||
<select id="field-view_type" name="view_type" data-module="autocomplete"> | ||
{% for option in h.get_allowed_view_types(c.resource, c.pkg_dict) %} | ||
<option value="{{ option[0] }}"> {{ option[1] }}</option> | ||
{% endfor %} | ||
</select> | ||
<button class="btn btn-primary" type="submit"> {{ _('New View') }}</button> | ||
</form> | ||
|
||
{% endblock %} | ||
|
||
{% block primary_content_inner %} | ||
|
||
{% if c.views %} | ||
<ul class="resource-list"> | ||
{% for view in c.views %} | ||
<li> | ||
<a href="{{h.url_for(controller='package', action='edit_view', id=pkg.name, resource_id=view.resource_id, view_id=view.id)}}"> | ||
{{ view.title }} | ||
</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% else %} | ||
<p class="empty">{{ _('This Resource has no Views') }}</p> | ||
{% endif %} | ||
|
||
{% 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,16 @@ | ||
{% import 'macros/form.html' as form %} | ||
|
||
{% set data = data or {} %} | ||
{% set errors = errors or {} %} | ||
|
||
{{ form.errors(error_summary) }} | ||
|
||
{{ form.input('title', id='field-title', label=_('Title'), placeholder=_('eg. My View'), value=data.title, error=errors.title, classes=['control-full', 'control-large'], is_required=true) }} | ||
{{ form.markdown('description', id='field-description', label=_('Description'), placeholder=_('eg. Information about my view'), value=data.description, error=errors.description) }} | ||
|
||
{# form template is defined in ResouceView extention point #} | ||
{% if form_template %} | ||
{% snippet form_template, data=data, errors=errors %} | ||
{% endif %} | ||
|
||
|
Oops, something went wrong.