diff --git a/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.mo b/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.mo index cef945a8afa87f4e86460ece41951d9de3fdfc29..8be79d9fd27fdd19815a279d577a8af7bd65b6ed 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 8190419fdfb29c2a78a3dcd176b9f8733f2fe151..43b3fa3427fa45fda80caa70fad17077ee4f9521 100644 --- a/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.po +++ b/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.po @@ -439,6 +439,15 @@ msgstr "Fertig" msgid "Data Proposal" msgstr "Datenvorschlag" +msgid "Create Data Proposal" +msgstr "Datensatz vorschlagen" + +msgid "Close Data Proposal" +msgstr "Datenvorschlag abschließen" + +msgid "Edit Data Proposal" +msgstr "Datenvorschlag bearbeiten" + msgid "No data proposal found" msgstr "Kein Datenvorschlag gefunden" diff --git a/ckanext/odsh/plugin.py b/ckanext/odsh/plugin.py index 396a6f0079133b23791c8c8b5b4df052843666d4..add7226bd682d4e49eaff5ff131bf3975f875378 100644 --- a/ckanext/odsh/plugin.py +++ b/ckanext/odsh/plugin.py @@ -367,6 +367,9 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm m.connect('user_datasets', '/user/{id:.*}', action='read', ckan_icon='sitemap') + map.connect('comment_datarequest', '/datarequest/new', + controller='ckanext.datarequests.controllers.ui_controller:DataRequestsUI', + action='new', conditions=dict(method=['GET', 'POST']), ckan_icon='comment') map.connect('comment_datarequest', '/datarequest/{id}', controller='ckanext.datarequests.controllers.ui_controller:DataRequestsUI', action='comment', conditions=dict(method=['GET', 'POST']), ckan_icon='comment') diff --git a/ckanext/odsh/public/odsh.css b/ckanext/odsh/public/odsh.css index ce86103655a9db1b12d06bb04376d4ffa348653f..de9f959d270ec810ef6e65d121615a208d3a2ce6 100644 --- a/ckanext/odsh/public/odsh.css +++ b/ckanext/odsh/public/odsh.css @@ -1,5 +1,11 @@ /* FONTS */ +@media (max-width: 767px){ +.span9 { + width: 100%; +} +} + @font-face{ font-family:"MuseoSans"; src:url("/base/fonts/Fonts/905300/fd479df2-01b0-4e3a-a411-915c477f1352.eot?#iefix"); @@ -180,8 +186,8 @@ input[type=radio], input[type=checkbox] { background-color: #f2f2f2; } -.secondary.span3 { - width: 193px; +.is-table-row .secondary.span3 { + width: 191px; max-width: 1970px; padding: 20px 16px 0px; } @@ -198,8 +204,9 @@ input[type=radio], input[type=checkbox] { padding-left: 0px; } -.primary.span9 { - width: 725px; +.is-table-row .primary.span9 { + width: 717px; + float: right; } .primary.logout { @@ -207,6 +214,20 @@ input[type=radio], input[type=checkbox] { padding-left: 0px; } +@media (max-width: 767px){ +.is-table-row .primary.span9 { + padding-left: 0px; + width: 100%; + margin-left: 0; +} +.primary.span9{ + width: 100%; +} +.primary{ + padding: 0px; +} +} + .wrapper { -webkit-box-shadow: none !important; -moz-box-shadow: none !important; @@ -309,6 +330,28 @@ input[type=checkbox]:checked + label.mylabel { margin-bottom: 0px; } + +@media (max-width: 768px) +{ +input[type=checkbox] + label.mylabel, +input[type=checkbox]:checked + label.mylabel { + height: 20px; + width: 20px; + background-size: 20px 20px; + vertical-align: text-bottom; +} +.facet_label { + font-size: 18px; + vertical-align: text-bottom; +} +.nav-simple>li{ + width: 100%; +} +.js [role=main] .secondary .filters { + background-color: white; +} +} + .checklabel input[type="checkbox"] { float: inherit; @@ -468,6 +511,11 @@ a:hover.organization-item ,a:focus.organization-item text-decoration: none; } +.dataset-spacer{ + display: table-cell; + width: 25px; +} + .dataset-empty { margin-right: 30px; color: darkgrey; @@ -475,12 +523,26 @@ a:hover.organization-item ,a:focus.organization-item .dataset-meta { width: 225px; - /* width: 30%; */ height: 100%; display: table-cell; position: relative; } +@media (max-width: 719px) +{ +.dataset-content { + width: 100%; + display: block; +} +.dataset-meta { + width: 100%; + display: block; +} +.dataset-spacer{ + display: none; +} +} + ul.dataset-resources { margin: 0px 0px 10px 0px; } @@ -1123,6 +1185,15 @@ element.style { float:left; } +@media (max-width: 767px) +{ +.is-table-row .resource-details-left { + /* padding-right: 0px; */ + width: 100%; + /* float:none; */ +} +} + .resource-icons { font-size: 24px; margin-left: 5px; @@ -1439,7 +1510,10 @@ element.style { display: inherit; } @media (max-width: 767px){ -aside.secondary.span3{ +#dataset-map { +display: none; +} +#dataset-map { display: none; } } @@ -1470,6 +1544,31 @@ display: none; width:auto; padding: 6px; } + +.site-title{ + color:black; + font-size: 2.5rem; + margin-top: 30px; + color: #333; + text-align: center; + line-height: 1.47; + font-weight: 100; +} + +@media (max-width: 767px){ +.logo img{ + height: 25px; + width:auto; + padding: 6px; +} +.site-title{ + font-size: 1.5rem; + margin-top: 15px; + color: #333; + line-height: 1.0; +} +} + .filter-list .filtered.pill, .filter-list .filtered.pill .fa{ background-color: #003064; @@ -1479,18 +1578,6 @@ display: none; background-color: #d4004b; } -.site-title{ - color:black; - /* text-align:center; */ - /* margin-top: 40px; - margin-left: 400px; */ - font-size: 2.5rem; -margin-top: 30px; -color: #333; -text-align: center; -line-height: 1.47; -font-weight: 100; -} .share-links { display: flex; @@ -1681,7 +1768,8 @@ a:hover.tooltips_cls span { #testsystem { position:fixed; padding:0 65px 0 65px; top:40px; right:-60px; background-color:#a60000; color:#fff; font-size:1em; z-index:100; transform:rotate(+45deg); text-align:center; font-weight:bolder; border:#c14646; - border-style:dashed; border-width:1px + border-style:dashed; border-width:1px ; + pointer-events: none; } #testsystem p { margin:0 } @@ -1783,11 +1871,6 @@ p.package-info-categorie margin-bottom: 0px; } -.dataset-spacer{ - display: table-cell; - width: 25px; -} - .multiselect-native-select, .multiselect-native-select .btn-group { @@ -1959,16 +2042,15 @@ p.package-info-categorie background-color: #003064; } -.label.label-open +.label.label-closed { color: white; - background-color: #003064; + background-color: #DBDBDB; } -.label.label-closed +.datarequest .dataset-heading .label { - color: white; - background-color: #DBDBDB; + vertical-align: top; } .datarequest-subtitle @@ -2076,4 +2158,105 @@ p.package-info-categorie .datarequest .dataset-content .icon-comment { margin-top: 10px; +} + +.datarequest .dataset-form{ + width: 715px; +} +.datarequest .dataset-form .row-fluid .span6 { + width: 715px; +} + +@media (max-width: 767px) +{ +[role=main] .secondary.span3 { + display: block; + width: 100%; + margin-left: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 0; + order: 2; +} +#testsystem +{ + display: none; +} +.simple-input .field .btn-search +{ + display: none; +} +#field-sitewide-search { + padding: 0px; + width: 100%; + margin: 0px; +} +} + +@media (max-width: 767px) +{ + .masthead .container, + body { + padding-left: 0px; + padding-right: 0px; +} +#content +{ + margin-left: 0px; + padding-right: 0px; +} +.dataset-heading { + max-width: unset; + width: 100%; + margin: 0px; +} +/* .dataset-heading a { + max-width: unset; + width: 100%; + margin: 0px; +} */ +.js body.filters-modal .secondary .filters .hide-filters i { + font-size: 32px; +} +.container-fluid.odsh-dataset-item { + width: 100%; + padding: 20px 15px 20px 15px; + box-sizing: border-box; +} +.row.wrapper.is-table-row +{ + width: 100%; + display: flex; + flex-direction: column; +} +.dataset-info.issued +{ + position: relative; +} +ul.dataset-resources +{ + margin: 5px 0px 5px 0px; +} +.stages li .highlight { + text-indent: unset; +} +.tag-container +{ + width: 100%; +} +} +.module-content.page-header +{ + background-color: unset; +} + +@media (max-width: 768px) +{ +.wrapper { + margin: 0; +} +.dataset-edit-form .span6 { + width: 100%; +} } \ No newline at end of file diff --git a/ckanext/odsh/public/odsh_header.css b/ckanext/odsh/public/odsh_header.css index a20e89cde5b543d172e2d3d8974b1b906574445f..13406da5d0baef850855331ea4dc2a51513ed0ad 100644 --- a/ckanext/odsh/public/odsh_header.css +++ b/ckanext/odsh/public/odsh_header.css @@ -251,12 +251,34 @@ float: right; } +@media (max-width: 767px) +{ +.navbar.masthead .navigation .nav-pills li.dropdown +{ + float: none; +} +.nav-pills li a:hover, .nav-pills li:hover { + background-color: rgb(242, 242, 242)!important; +} +.dropdown-backdrop +{ + display: none; +} +.navigation-row { + width: 100%; + padding-left: 0px; + margin-left: auto; + margin-right: auto; +} +} + .navbar.masthead .navigation .nav-pills li.dropdown > .dropdown-toggle { padding-bottom: 12px; padding-top: 12px; } + .user-icon { fill:#003064; @@ -285,4 +307,20 @@ .navbar.masthead .navigation .nav-pills li a:hover .user-icon { fill:white; +} + +@media (max-width: 767px) +{ +.navbar-fixed-top, .navbar-fixed-bottom, .navbar-static-top { + margin-left: 0px; + margin-right: 0px; +} + +.navbar.masthead .nav>li:hover a, +.navbar.masthead .navigation .nav-pills li.open .user-icon, .navbar.masthead .navigation .nav-pills li a:hover .user-icon, +.navbar.masthead .navigation .nav-pills li.dropdown.open > a.dropdown-toggle:hover, .navbar .nav li.dropdown.open > .dropdown-toggle +{ + color: #003064; + fill: #003064; +} } \ No newline at end of file diff --git a/ckanext/odsh/templates/datarequests/close.html b/ckanext/odsh/templates/datarequests/close.html new file mode 100644 index 0000000000000000000000000000000000000000..65d168a68f2e43c4ec8c3eb5046e61a02d07ac7b --- /dev/null +++ b/ckanext/odsh/templates/datarequests/close.html @@ -0,0 +1,16 @@ +{% extends "datarequests/base.html" %} + +{% block subtitle %}{{ _('Close Data Proposal') }}{% endblock %} + +{% block breadcrumb_content %} + <li>{% link_for _('Data Proposal'), controller='ckanext.datarequests.controllers.ui_controller:DataRequestsUI', action='index' %}</li> + <li>{% link_for c.datarequest.get('title')|truncate(30), controller='ckanext.datarequests.controllers.ui_controller:DataRequestsUI', action='show', id=c.datarequest.get('id') %}</li> + <li class="active"><a href="">{{ _('Close Data Proposal') }}</a></li> +{% endblock %} + +{% block primary_content_inner %} + <h1 class="{% block page_heading_class %}page-heading{% endblock %}">{% block page_heading %}{{ _('Close Data Proposal') }}{% endblock %}</h1> + {% snippet "datarequests/snippets/close_datarequest_form.html", datarequest=c.datarequest, datasets=c.datasets, errors=c.errors, errors_summary=c.errors_summary %} +{% endblock %} + +{% block page_header %}{% endblock %} \ No newline at end of file diff --git a/ckanext/odsh/templates/datarequests/comment.html b/ckanext/odsh/templates/datarequests/comment.html index 5b550518566001705af9fc2e5ea735027d2d861e..25e9567b0f5fa200620be7986c8a6f402394ac53 100644 --- a/ckanext/odsh/templates/datarequests/comment.html +++ b/ckanext/odsh/templates/datarequests/comment.html @@ -57,7 +57,7 @@ <div class="dataset-details"> {% if c.datarequest.get('closed', False) %} <div class="label label-closed"> - {% trans %}Closed{% endtrans %} + {% trans %}Done{% endtrans %} </div> {% else %} <div class="label label-open"> diff --git a/ckanext/odsh/templates/datarequests/edit.html b/ckanext/odsh/templates/datarequests/edit.html new file mode 100644 index 0000000000000000000000000000000000000000..6ca7fb6681ad5547c8db6a683489c50a14422885 --- /dev/null +++ b/ckanext/odsh/templates/datarequests/edit.html @@ -0,0 +1,16 @@ +{% extends "datarequests/base.html" %} + +{% block subtitle %}{{ _('Edit Data Proposal') }}{% endblock %} + +{% block breadcrumb_content %} + <li>{% link_for _('Data Proposal'), controller='ckanext.datarequests.controllers.ui_controller:DataRequestsUI', action='index' %}</li> + <li>{% link_for c.original_title|truncate(30), controller='ckanext.datarequests.controllers.ui_controller:DataRequestsUI', action='show', id=c.datarequest.get('id') %}</li> + <li class="active"><a href="">{{ _('Edit Data Proposal') }}</a></li> +{% endblock %} + +{% block primary_content_inner %} + <h1 class="{% block page_heading_class %}page-heading{% endblock %}">{% block page_heading %}{{ _('Edit Data Proposal') }}{% endblock %}</h1> + {% snippet "datarequests/snippets/edit_datarequest_form.html", data=c.datarequest, errors=c.errors, errors_summary=c.errors_summary, offering=c.offering %} +{% endblock %} + +{% block page_header %}{% endblock %} \ No newline at end of file diff --git a/ckanext/odsh/templates/datarequests/new.html b/ckanext/odsh/templates/datarequests/new.html index 46dd7b08fbd3716cc611f2e189bae31e5f3553be..e8f5807d55b31ecaf67cff57ef77ee4b785fa103 100644 --- a/ckanext/odsh/templates/datarequests/new.html +++ b/ckanext/odsh/templates/datarequests/new.html @@ -3,8 +3,8 @@ {% block subtitle %}{{ _('Create Data Request') }}{% endblock %} {% block breadcrumb_content %} - <li>{% link_for _('Data Requests'), controller='ckanext.datarequests.controllers.ui_controller:DataRequestsUI', action='index' %}</li> - <li class="active"><a href="">{{ _('Create Data Request') }}</a></li> + <li>{% link_for _('Data Proposal'), controller='ckanext.datarequests.controllers.ui_controller:DataRequestsUI', action='index' %}</li> + <li class="active"><a href="">{{ _('Create Data Proposal') }}</a></li> {% endblock %} {% block primary_content_inner %} @@ -12,9 +12,7 @@ {% snippet "datarequests/snippets/new_datarequest_form.html", data=c.datarequest, errors=c.errors, errors_summary=c.errors_summary, offering=c.offering %} {% endblock %} -{% block secondary_content_additional_info %} - <p>{% trans %}To create a data request, fill the form and specify a title and a description for your request. Please, be as clear as you can in order to ease the task of accomplishing your request. You can also specify an organization if your data request is closely related with it. {% endtrans %} - </p> +{% block secondary %} {% endblock %} {% block page_header %}{% endblock %} \ No newline at end of file diff --git a/ckanext/odsh/templates/datarequests/snippets/datarequest_form.html b/ckanext/odsh/templates/datarequests/snippets/datarequest_form.html index 54b823f03052ce44a56499e410d684959504548d..9bebd010423455b00b0e56874bd835d13c3af9ce 100644 --- a/ckanext/odsh/templates/datarequests/snippets/datarequest_form.html +++ b/ckanext/odsh/templates/datarequests/snippets/datarequest_form.html @@ -4,22 +4,21 @@ {% set description = data.get('description', '') %} {% set organization_id = data.get('organization_id', h.get_request_param('organization')) %} {% set organizations_available = h.organizations_available('read') %} -{% set form_horizontal = 'form-horizontal' if h.ckan_version()[:3] <= '2.7' else '' %} {# This provides a full page that renders a form for publishing a dataset. It can then itself be extended to add/remove blocks of functionality. #} -<form class="dataset-form {{ form_horizontal }}" method="post" data-module="basic-form" action enctype="multipart/form-data"> +<form class="dataset-form" method="post" data-module="basic-form" action enctype="multipart/form-data"> <input type="hidden" id="id" name="id" value="{{ data.get('id', '') }}" /> {% block errors %}{{ form.errors(errors_summary) }}{% endblock %} {% block offering_title %} - {{ form.input('title', id='field-title', label=_('Title'), placeholder=_('eg. Data Request Name'), value=title, error=errors['Title'], classes=['control-full', 'control-large'], is_required=true) }} + {{ form.input('title', id='field-title', label=_('Title'), placeholder=_('eg. Data Request Name'), value=title, error=errors['Title'], classes=['control-full'], is_required=true) }} {% endblock %} {% block offering_description %} - {{ form.markdown('description', id='field-description', label=_('Description'), placeholder=_('eg. Data Request description'), value=description, error=errors['Description']) }} + {{ form.markdown('description', id='field-description', label=_('Description'), placeholder=_('eg. Data Request description'), value=description, error=errors['Description'], is_required=true) }} {% endblock %} @@ -31,7 +30,7 @@ then itself be extended to add/remove blocks of functionality. #} <a class="btn btn-danger pull-left" href="{% url_for controller='ckanext.datarequests.controllers.ui_controller:DataRequestsUI', action='delete', id=data.get('id') %}" data-module="confirm-action" data-module-i18n="{{ locale }}">{% block delete_button_text %}{{ _('Delete') }}{% endblock %}</a> {% endif %} {% endblock %} - <button class="btn btn-primary" type="submit" name="save">{% block save_button_text %}{{ _('Create Data Request') }}{% endblock %}</button> + <button class="btn btn-primary btn-arrow-right" type="submit" name="save">{% block save_button_text %}{{ _('Create Data Request') }}{% endblock %}</button> </div> {% endblock %} diff --git a/ckanext/odsh/templates/package/search.html b/ckanext/odsh/templates/package/search.html index 101b54a72b29481c961e011b10fc93eab3b273e1..75ce5e4e537d2d1edecf4eed5d6987f71f8e2f30 100644 --- a/ckanext/odsh/templates/package/search.html +++ b/ckanext/odsh/templates/package/search.html @@ -47,7 +47,6 @@ default_extent="{ \"type\": \"Polygon\", \"coordinates\": [[[7.6574,53.1632],[11 {% for facet in c.facet_titles %} {{ h.snippet('snippets/facet_list.html', title=c.facet_titles[facet], name=facet) }} {% endfor %} - </div> {% block datereange_search %} {% set has_range_filter = request.params.get('ext_startdate') or request.params.get('ext_enddate') %} @@ -86,6 +85,8 @@ default_extent="{ \"type\": \"Polygon\", \"coordinates\": [[[7.6574,53.1632],[11 </div> </nav> </section> + </div> + <a class="close no-text hide-filters"><i class="fa fa-times-circle"></i><span class="text">close</span></a> {% endblock %} </div> diff --git a/ckanext/odsh/tests/test_datarequest.py b/ckanext/odsh/tests/test_datarequest.py index d94695c39bbdce33b6d54810375ec8896b95cafc..a37c7e4eace8a3696bca01c83a118c47d2a022ae 100644 --- a/ckanext/odsh/tests/test_datarequest.py +++ b/ckanext/odsh/tests/test_datarequest.py @@ -38,8 +38,9 @@ class TestDatarequest: form['description'] = markdown final_response = self.app.submit_form(form) + id = re.search( - '/datarequest/comment/([a-zA-Z0-9\-]*)">', final_response.body).group(1) + '/datarequest/edit/([a-zA-Z0-9\-]*)">', final_response.body).group(1) return id def test_create_datarequest(self): @@ -50,6 +51,22 @@ class TestDatarequest: response = self.app.get('/datarequest') assert id in response + def test_edit_datarequest(self): + # Arrange + id = self._create_request() + + # Act + response = self.app.get('/datarequest/edit/'+id) + form = response.forms[0] + form['title'] = id+'edit_title' + form['description'] = id+'edit_desc' + final_response = self.app.submit_form(form) + + # Assert + response = self.app.get('/datarequest/'+id) + assert id+'edit_title' in response + assert id+'edit_desc' in response + def test_comment_datarequest(self): # Arrange id = self._create_request() @@ -64,6 +81,19 @@ class TestDatarequest: # Assert assert guid in final_response + def test_close_datarequest(self): + # Arrange + id = self._create_request() + + # Act + response = self.app.get('/datarequest/close/'+id) + form = response.forms[0] + final_response = self.app.submit_form(form) + + # Assert + response = self.app.get('/datarequest/'+id) + assert 'label-closed' in response + def _get_app(self): if not hasattr(self, 'app'): app = AppProxy() diff --git a/ckanext/odsh/tests/test_helpers.py b/ckanext/odsh/tests/test_helpers.py index 678af9b055dc1e7afd1479375226c3c22c98e955..f033b573fb4b8b14e3bbb48a0bb1c244719a6379 100644 --- a/ckanext/odsh/tests/test_helpers.py +++ b/ckanext/odsh/tests/test_helpers.py @@ -5,6 +5,7 @@ from ckan.common import config import ckan.config.middleware import ckan.tests.helpers as helpers import sys +import pdb def odsh_test():