diff --git a/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.mo b/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.mo index 576a6bd0debc01348d49798878a4f0a5227af050..df98f848b8ed36651acda1d0be0cca2610f49b6f 100644 Binary files a/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.mo and b/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.mo differ diff --git a/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.po b/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.po index 1b053cfb191d238eee646119e38833bcf4b1ab29..a830fe668b37f59dd1df844b9d0b968da244f9f5 100644 --- a/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.po +++ b/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.po @@ -36,6 +36,9 @@ msgstr "Kategorien bearbeiten" msgid "Manage Dataset" msgstr "Datensatz bearbeiten" +msgid "Manage Dataset {name}" +msgstr "Datensatz {name} bearbeiten" + msgid "Organizations" msgstr "Herausgeber" diff --git a/ckanext/odsh/public/odsh.css b/ckanext/odsh/public/odsh.css index 544d896b6faa5b8839eb33a333cd7622f4000bd0..63be49a19db3a4ccf40c4635e36155b183dbfa1e 100644 --- a/ckanext/odsh/public/odsh.css +++ b/ckanext/odsh/public/odsh.css @@ -118,7 +118,10 @@ font-size:18px; color: #003064; } -.search-form h2, .odsh-dataset-heading h2 { +.search-form h2, +.odsh-dataset-heading h2, +.odsh-dataset-heading span + { margin-top: 0px; font-size: 25px; color: #003064; @@ -366,6 +369,11 @@ label.rangesearch.disabled { vertical-align: top; } +.is-table-row .row-fluid [class*="span"] { + float: none; + display: block; +} + .pill { background-color: #F6F7F9; border-radius: 0px; @@ -1083,16 +1091,18 @@ element.style { } .resource-icons { - font-size: 28px; + font-size: 24px; + margin-left: 5px; + margin-top: 5px; } .resource-icons img { width: 28px; } .icon{ background-repeat: no-repeat; - background-size: 28px 28px; - width: 28px; - height: 28px; + background-size: 24px 24px; + width: 24px; + height: 24px; padding-right: 10px; } .icon-edit{ @@ -1663,7 +1673,7 @@ a:hover.tooltips_cls span { { display: inline-block; background-color: #dbdbdb; - padding: 12px; + padding: 8px 20px; border-radius: 10px; margin-right:20px; margin-top: 20px; @@ -1672,9 +1682,45 @@ a:hover.tooltips_cls span { { color: black; text-decoration: none; + font-size: 12px; } .tag-pill:hover { cursor: pointer; +} + +.package-form-column +{ + width: 460px; +} + +.dataset-edit-form .span6 +{ + width:60%; +} + +.dataset-edit-form .span6 +{ + width:60%; +} + +.dataset-edit-form .span6.inline-error +{ + width:30%; + display: inline-block; +} +.dataset-edit-form .control-group .row-fluid .span6 +{ + display: inline-block; +} +.dataset-edit-form .row-fluid .span3 +{ + display: inline-block; + width:28.5%; +} + +span.clear { + clear: right; + display: block; } \ No newline at end of file diff --git a/ckanext/odsh/templates/package/edit_base.html b/ckanext/odsh/templates/package/edit_base.html index 1ce1afcf653623930eadd37961e96c35051d2d83..477564d51b77bc643f6cc79bbd83e87d086ab037 100644 --- a/ckanext/odsh/templates/package/edit_base.html +++ b/ckanext/odsh/templates/package/edit_base.html @@ -14,12 +14,19 @@ {% endblock %} {% block content_action %} -{% link_for _('View dataset'), controller='package', action='read', id=pkg.name, class_='btn', icon='eye' %} {% endblock %} {% block content_primary_nav %} -{{ h.build_nav_icon('dataset_edit', _('Edit metadata'), id=pkg.name) }} -{{ h.build_nav_icon('dataset_resources', _('Resources'), id=pkg.name) }} +{% endblock %} + + +{% block primary_content %} +<div class="odsh-dataset-heading"> + <span>Datensatz "{{pkg.name}}" bearbeiten</span> + {% link_for _('back'), controller='package', action='read', id=pkg.name, class_='btn pull-right', icon='arrow-left' %} +<span class="clear"></span> +</div> +{{ super() }} {% endblock %} {% block secondary_content %} diff --git a/ckanext/odsh/templates/package/snippets/package_basic_fields.html b/ckanext/odsh/templates/package/snippets/package_basic_fields.html index 503a34f79b04c00cb47a701275891caa3ac57fa6..f461de15ed45f2d0740f2e609ef2c0c530684000 100644 --- a/ckanext/odsh/templates/package/snippets/package_basic_fields.html +++ b/ckanext/odsh/templates/package/snippets/package_basic_fields.html @@ -1,5 +1,6 @@ {% import 'macros/form.html' as form %} {% resource 'odsh/odsh_form.js' %} +{% set dataset_is_draft = data.get('state', 'draft').startswith('draft') or data.get('state', 'none') == 'none' %} <!-- field title --> {% block package_basic_fields_title %} @@ -10,16 +11,19 @@ is_required=true,placeholder=_('Enter title')) }} {% endblock %} {% block package_basic_fields_url %} -{% set prefix = h.url_for(controller='package', action='read', id='') %} -{% set domain = h.url_for(controller='package', action='read', id='', qualified=true) %} -{% set domain = domain|replace("http://", "")|replace("https://", "") %} -{% set attrs = {'data-module': 'slug-preview-slug', 'data-module-prefix': domain, 'data-module-placeholder': '<dataset>'} - %} +{% if(dataset_is_draft)%} + {% set prefix = h.url_for(controller='package', action='read', id='') %} + {% set domain = h.url_for(controller='package', action='read', id='', qualified=true) %} + {% set domain = domain|replace("http://", "")|replace("https://", "") %} + {% set attrs = {'data-module': 'slug-preview-slug', 'data-module-prefix': domain, 'data-module-placeholder': '<dataset>'} + %} - <!-- field name --> + <!-- field name/url --> {{ form.prepend('name', id='field-name', label=_('URL'), prepend=prefix, value=data.name, error=errors.name, attrs=attrs, is_required=true) }} - {% endblock %} + {% endif %} + {% endblock %} + <!-- field notes --> {% block package_basic_fields_description %} @@ -33,8 +37,6 @@ is_required=true,placeholder=_('Enter title')) }} <input type="hidden" name="groups__0__id" value="{{ data.group_id }}" /> {% endif %} - {% set dataset_is_draft = data.get('state', 'draft').startswith('draft') or data.get('state', 'none') == 'none' - %} {% set dataset_has_organization = data.owner_org or data.group_id %} {% set organizations_available = h.organizations_available('create_dataset') %} {% set user_is_sysadmin = h.check_access('sysadmin') %} diff --git a/ckanext/odsh/templates/package/snippets/package_form.html b/ckanext/odsh/templates/package/snippets/package_form.html index 9e5fe6a9c93b7ab9acefc793fb3c53bd10731203..aea803a5c2b19298971b253295fa8a2de5e196f5 100644 --- a/ckanext/odsh/templates/package/snippets/package_form.html +++ b/ckanext/odsh/templates/package/snippets/package_form.html @@ -1,9 +1,8 @@ {% import 'macros/form.html' as form %} {% set action = c.form_action or '' %} +{% set form_style = c.form_style or c.action %} -{# This provides a full page that renders a form for adding a dataset. It can -then itself be extended to add/remove blocks of functionality. #} -<form id="dataset-edit" class="dataset-form" method="post" action="{{ action }}" data-module="basic-form" novalidate> +<form id="dataset-edit" class="dataset-form {% if(form_style=='edit') %} dataset-edit-form {%endif%} " method="post" action="{{ action }}" data-module="basic-form" novalidate> {% block stages %} {{ h.snippet('package/snippets/stages.html', stages=stage) }} {% endblock %} @@ -24,20 +23,20 @@ then itself be extended to add/remove blocks of functionality. #} {% block form_actions %} <div class="form-actions"> - {% block delete_button %} - {% if h.check_access('package_delete', {'id': data.id}) and not data.state == 'deleted' %} - <a class="btn btn-danger pull-left" href="{% url_for controller='package', action='delete', id=data.id %}" - data-module="confirm-action" data-module-content="{{ _('Are you sure you want to delete this dataset?') }}">{% - block delete_button_text %}{{ _('Delete') }}{% endblock %}</a> - {% endif %} - {% endblock %} - {% block save_button %} <div class="row-fluid"> <div class="span6"> - <button class="btn btn-primary btn-arrow-right" type="submit" name="save"> - {% block save_button_text %}{{ - _('Next: Add Data') - }}{% endblock %}</button> + {% block delete_button %} + {% if h.check_access('package_delete', {'id': data.id}) and not data.state == 'deleted' %} + <a class="btn btn-danger pull-left" href="{% url_for controller='package', action='delete', id=data.id %}" + data-module="confirm-action" data-module-content="{{ _('Are you sure you want to delete this dataset?') }}">{% + block delete_button_text %}{{ _('Delete') }}{% endblock %}</a> + {% endif %} + {% endblock %} + {% block save_button %} + <button class="btn btn-primary btn-arrow-right" type="submit" name="save"> + {% block save_button_text %}{{ + _('Next: Add Data') + }}{% endblock %}</button> </div> </div> {% endblock %} diff --git a/ckanext/odsh/templates/package/snippets/resource_item.html b/ckanext/odsh/templates/package/snippets/resource_item.html index da1062e2817737ff0efc804eb3d70e17a951c2cf..d2ee7839346e85d4cc4ddab3bb1caafae57b5a97 100644 --- a/ckanext/odsh/templates/package/snippets/resource_item.html +++ b/ckanext/odsh/templates/package/snippets/resource_item.html @@ -17,11 +17,6 @@ </div> </div> <div class="row resource-description-container"> - <p class="description"> - {% if res.description %} - {{ h.markdown_extract(h.get_translated(res, 'description'))}} - {% endif %} - </p> </div> <div class="resource-icons"> {% block resource_item_explore_links %} diff --git a/ckanext/odsh/templates/package/view_edit_base.html b/ckanext/odsh/templates/package/view_edit_base.html new file mode 100644 index 0000000000000000000000000000000000000000..d8a9736f896697e9ccef754ae2987f3ed4bb9702 --- /dev/null +++ b/ckanext/odsh/templates/package/view_edit_base.html @@ -0,0 +1,55 @@ +{% extends "package/resource_edit_base.html" %} + +{% set logged_in = true if c.userobj else false %} +{% set res = c.resource %} + +{% block breadcrumb_edit_selected %}{% endblock %} + +{% block content_action %} + {% link_for _('All views'), controller='package', action='resource_views', id=pkg.name, resource_id=res.id, class_='btn', icon='arrow-left' %} + {% if res %} + {% set url = h.url_for(controller='package', action='resource_read', id=pkg.name, resource_id=res.id) ~ '?view_id=' ~ resource_view.id %} + <a href="{{ url }}" class="btn"><i class="fa fa-eye"></i> {{ _('View view') }}</a> + {% endif %} +{% endblock %} + +{% block content_primary_nav %}{% endblock %} + +{% block primary_content_inner %} + {% block form %}{% endblock %} +{% endblock %} + +{% block main_content %} + {% if h.resource_view_full_page(resource_view) %} + {{ self.flash() }} + {{ self.toolbar() }} + <div class="wrapper no-nav"> + {{ self.primary_content() }} + </div> + {% else %} + {{ super() }} + {% endif %} + + {% if to_preview and h.resource_view_display_preview(resource_view) %} + <div class="wrapper no-nav"> + <section class="module module-narrow module-shallow"> + <h2 class="module-heading"> + <i class="fa fa-picture-o"></i> {{ _('View preview') }} + </h2> + <div class="module-content"> + {% snippet 'package/snippets/resource_view.html', resource_view=resource_view, resource=resource, package=package, to_preview=True %} + </div> + </section> + </div> + {% endif %} +{% endblock %} + +{% block secondary %} + {% if not h.resource_view_full_page(resource_view) %} + {{ super() }} + {% endif %} +{% endblock %} + +{% block secondary_content %} + {% snippet 'package/snippets/view_help.html' %} +{% endblock %}