From 5431af1e02af58d0682a6c0e6ea696022436bb54 Mon Sep 17 00:00:00 2001 From: anonymous <anonymous> Date: Tue, 6 Nov 2018 17:39:58 +0100 Subject: [PATCH] save current changes --- ckanext/odsh/helpers.py | 14 +- .../odsh/i18n/de/LC_MESSAGES/ckanext-odsh.mo | Bin 2977 -> 3385 bytes .../odsh/i18n/de/LC_MESSAGES/ckanext-odsh.po | 27 ++++ ckanext/odsh/plugin.py | 5 +- ckanext/odsh/public/odsh.css | 48 +++++- ckanext/odsh/templates/header.html | 138 ++++++++++-------- .../odsh/templates/organization/index.html | 47 ++++++ .../snippets/odsh_organization_list.html | 18 +++ .../snippets/organization_item.html | 28 ++++ .../snippets/search_result_text.html | 47 ++++++ ckanext/odsh/templates/user/login.html | 36 +---- .../templates/user/snippets/login_form.html | 44 ++++++ 12 files changed, 358 insertions(+), 94 deletions(-) create mode 100644 ckanext/odsh/templates/organization/index.html create mode 100644 ckanext/odsh/templates/organization/snippets/odsh_organization_list.html create mode 100644 ckanext/odsh/templates/organization/snippets/organization_item.html create mode 100644 ckanext/odsh/templates/snippets/search_result_text.html create mode 100644 ckanext/odsh/templates/user/snippets/login_form.html diff --git a/ckanext/odsh/helpers.py b/ckanext/odsh/helpers.py index 0e85161b..302a5a32 100644 --- a/ckanext/odsh/helpers.py +++ b/ckanext/odsh/helpers.py @@ -1,10 +1,13 @@ import logging import traceback import ast +import ckan.logic as logic +import ckan.model as model +from ckan.common import c +get_action = logic.get_action log = logging.getLogger(__name__) - def odsh_openness_score_dataset_html(dataset): score = 0 #dataset = json.loads(dataset) @@ -23,3 +26,12 @@ def odsh_openness_score_dataset_html(dataset): log.error('Error while calculating openness score %s: %s\nException: %s', e.__class__.__name__, unicode(e), traceback.format_exc()) return score + +def odsh_get_resource_views(pkg_dict, resource): + + context = {'model': model, 'session': model.Session, + 'user': c.user, 'for_view': True, + 'auth_user_obj': c.userobj} + return get_action('resource_view_list')( + context, {'id': resource['id']}) + diff --git a/ckanext/odsh/i18n/de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%uSuF%Jyip1N%EBPVdB$ h)b#wK%+$#NT&a@}a{ZXRk6W6>FEKZDGZzmlBLFWiTQUFu diff --git a/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.po b/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.po index a92d3053..1e389241 100644 --- a/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.po +++ b/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.po @@ -19,6 +19,33 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.3.4\n" +msgid "Organizations" +msgstr "Herausgeber" + +#: ckan/templates/snippets/search_result_text.html:29 +msgid "{number} organization found" +msgid_plural "{number} organizations found" +msgstr[0] "{number} Herausgeber" +msgstr[1] "{number} Herausgeber" + +msgid "Login" +msgstr "Login" + +msgid "do Login" +msgstr "Einloggen" + +msgid "Forgotten your password?" +msgstr "Passwort vergessen" + +msgid "change password" +msgstr "Passwort ändern" + +msgid "Username" +msgstr "Name" + +msgid "enter password" +msgstr "Passwort eingeben" + msgid "odsh Create Dataset" msgstr "Datensatz-Upload" diff --git a/ckanext/odsh/plugin.py b/ckanext/odsh/plugin.py index aad1ae8c..501d67c9 100644 --- a/ckanext/odsh/plugin.py +++ b/ckanext/odsh/plugin.py @@ -6,6 +6,7 @@ from ckan.lib.plugins import DefaultDatasetForm from ckan.common import OrderedDict import ckan.lib.helpers as helpers import helpers as odsh_helpers +from routes.mapper import SubMapper import logging @@ -85,6 +86,7 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm 'odsh_group_id_selected': odsh_group_id_selected, 'odsh_get_facet_items_dict': odsh_get_facet_items_dict, 'odsh_openness_score_dataset_html': odsh_helpers.odsh_openness_score_dataset_html, + 'odsh_get_resource_views': odsh_helpers.odsh_get_resource_views } def before_map(self, map): @@ -122,7 +124,8 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm # # toolkit.get_converter('not_empty'), # toolkit.get_converter('odsh_convert_groups_string')] }) schema['resources'].update({ - 'url' : [ toolkit.get_converter('not_empty') ] + 'url' : [ toolkit.get_converter('not_empty') ], + 'name' : [ toolkit.get_converter('not_empty') ] }) def create_package_schema(self): diff --git a/ckanext/odsh/public/odsh.css b/ckanext/odsh/public/odsh.css index 12ea178d..d03a801a 100644 --- a/ckanext/odsh/public/odsh.css +++ b/ckanext/odsh/public/odsh.css @@ -51,7 +51,10 @@ input, button, select, textarea { } - +h1{ + color:#003064; + font-weight: normal ; +} /* css for searchresults */ @@ -88,6 +91,14 @@ input, button, select, textarea { padding: 0; } +.page-heading{ + font-size: 25px; + color: #003064; + font-weight: 300; + border-bottom: 4px solid #dbdbdb; + padding-bottom: 10px +} + input[type=radio], input[type=checkbox] { top: 0px; } @@ -189,10 +200,11 @@ input[type=radio], input[type=checkbox] { /* checkbox customize trick, see: https://stackoverflow.com/questions/24322599/css-why-cannot-change-checkbox-color-whatever-i-do */ -input[type=checkbox] { +.facet_label input[type=checkbox] { display:none; } +/* input[type=checkbox] + label.checkbox, */ input[type=checkbox] + label.mylabel { background: #fff; border: 1px solid white; @@ -200,8 +212,15 @@ input[type=checkbox] + label.mylabel { width: 8px; display: inline-block; padding: 0 0 0 0px; + margin-bottom: 0px; + min-height: 8px; } +/* input[type=checkbox] + label.checkbox{ + + border: 1px solid black; +} */ +/* input[type=checkbox]:checked + label.checkbox, */ input[type=checkbox]:checked + label.mylabel { background: url(/base/images/checked.png); background-color: #fff; @@ -209,10 +228,19 @@ input[type=checkbox]:checked + label.mylabel { border: 1px solid black; height: 8px; width: 8px; + min-height: 8px; display:inline-block; padding: 0 0px 0 0px; + margin-bottom: 0px; } +/* .checklabel .controls > .checkbox:first-child { + padding-top: 0px; +} */ +.checklabel input[type="checkbox"] +{ + float: inherit; +} label.mylabel { margin-right: 3px; @@ -473,6 +501,15 @@ label:after { background-color: #0089ca; } +.btn-forget-password{ + background-color: white; + font-size: 10pt; + padding:2px 10px; + margin-left: 2px; + margin-top: 4px; + display: inline-block; +} + /* remove icon in upload button */ .image-upload .fa-cloud-upload:before { content: unset; @@ -606,4 +643,9 @@ label:after { } .create-dataset-form{ - width: 50%;} \ No newline at end of file + width: 50%;} + +.organization-image{ + height:100px; + max-width: unset; +} \ No newline at end of file diff --git a/ckanext/odsh/templates/header.html b/ckanext/odsh/templates/header.html index 6970982b..a79412dd 100644 --- a/ckanext/odsh/templates/header.html +++ b/ckanext/odsh/templates/header.html @@ -1,73 +1,91 @@ {% block header_wrapper %} {% block header_account %} <header class="navbar navbar-static-top masthead"> - {% block header_debug %} - {% if g.debug and not g.debug_supress_header %} - <div class="debug">Controller : {{ c.controller }}<br />Action : {{ c.action }}</div> - {% endif %} - {% endblock %} - <div class="container"> - <button data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar" type="button"> - <span class="fa fa-bars"></span> - </button> - {# The .header-image class hides the main text and uses image replacement for the title #} - <div class='row'> + {% block header_debug %} + {% if g.debug and not g.debug_supress_header %} + <div class="debug">Controller : {{ c.controller }}<br />Action : {{ c.action }}</div> + {% endif %} + {% endblock %} + <div class="container"> + <button data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar" type="button"> + <span class="fa fa-bars"></span> + </button> + {# The .header-image class hides the main text and uses image replacement for the title #} + <div class='row'> - <div class='span3 span-navigation'> - <hgroup class="{{ g.header_class }} pull-left"> + <div class='span3 span-navigation'> + <hgroup class="{{ g.header_class }} pull-left"> - {% block header_logo %} - {% if g.site_logo %} - <a class="logo" href="{{ h.url_for('home') }}"><img src="{{ h.url_for_static_or_external(g.site_logo) }}" - alt="{{ g.site_title }}" title="{{ g.site_title }}" /></a> - {% else %} - <h1> - <a href="{{ h.url_for('home') }}">{{ g.site_title }}</a> - </h1> - {% if g.site_description %}<h2>{{ g.site_description }}</h2>{% endif %} - {% endif %} - {% endblock %} - </hgroup> - </div> + {% block header_logo %} + {% if g.site_logo %} + <a class="logo" href="{{ h.url_for('home') }}"><img src="{{ h.url_for_static_or_external(g.site_logo) }}" alt="{{ g.site_title }}" + title="{{ g.site_title }}" /></a> + {% else %} + <h1> + <a href="{{ h.url_for('home') }}">{{ g.site_title }}</a> + </h1> + {% if g.site_description %}<h2>{{ g.site_description }}</h2>{% endif %} + {% endif %} + {% endblock %} + </hgroup> + </div> - <div class='span9 span-navigation pull-right'> - {% snippet "snippets/language_selector.html" %} + <div class='span9 span-navigation pull-right'> + {% snippet "snippets/language_selector.html" %} - {% block header_site_search %} - <div class='top-search-form'> - <form class="section site-search simple-input" action="{% url_for controller='package', action='search' %}" - method="get"> - <div class="field"> - <input id="field-sitewide-search" type="text" name="q" placeholder="{{ _('Suchbegriff') }}" /> - <button class="btn-search" type="submit"> - </div> - </form> - </div> - {% endblock %} + {% block header_site_search %} + <div class='top-search-form'> + <form class="section site-search simple-input" action="{% url_for controller='package', action='search' %}" + method="get"> + <div class="field"> + <input id="field-sitewide-search" type="text" name="q" placeholder="{{ _('Suchbegriff') }}" /> + <button class="btn-search" type="submit"> + </div> + </form> </div> - + {% endblock %} </div> + </div> - - <div class="container navigation-container"> - <div class='row navigation-row'> - <div class="nav-collapse collapse"> - <nav class="section navigation"> - <ul class="nav nav-pills"> - {% block header_site_navigation_tabs %} - {{ h.build_nav_main( - ('home', _('Startseite')), - ('search', _('Daten')), - ('organizations_index', _('Herausgeber')), - ('info_page', _('Infos')) - ) }} - {% endblock %} - </ul> - </nav> - {% endblock %} - </div> + </div> + + <div class="container navigation-container"> + <div class='row navigation-row'> + <div class="nav-collapse collapse"> + <nav class="section navigation"> + <ul class="nav nav-pills"> + {% block header_site_navigation_tabs %} + {{ h.build_nav_main( + ('home', _('Startseite')), + ('search', _('Daten')), + ('organizations_index', _('Herausgeber')), + ('info_page', _('Infos')) + ) }} + {% endblock %} + </ul> + </nav> + {% endblock %} </div> + <nav class="navigation pull-right"> + <ul class="nav nav-pills "> + {% set clazz='active' if c.action=='login' else ''%} + {% if c.userobj %} + <li class='{{clazz}}'> + <a href="{{ h.url_for('/user/_logout') }}" title="logout"> + <span class="text">Logout</span> + </a> + </li> + {% else %} + <li class='{{clazz}}'> + <a href="{{ h.url_for('/user/login') }}" title="login"> + <span class="text">Login</span> + </a> + </li> + {% endif %} + </nav> + </ul> </div> -</div> + </div> + </div> </header> -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/ckanext/odsh/templates/organization/index.html b/ckanext/odsh/templates/organization/index.html new file mode 100644 index 00000000..873dc798 --- /dev/null +++ b/ckanext/odsh/templates/organization/index.html @@ -0,0 +1,47 @@ +{% extends "page.html" %} + +{% block subtitle %}{{ _('Organizations') }}{% endblock %} + +{% block breadcrumb_content %} +<li class="active">{% link_for _('Organizations'), controller='organization', action='index' %}</li> +{% endblock %} + +{% block page_header %}{% endblock %} + +{% block page_primary_action %} +{% if h.check_access('organization_create') %} +{% link_for _('Add Organization'), controller='organization', action='new', class_='btn btn-primary', +icon='plus-square' %} +{% endif %} +{% endblock %} + +{% block primary_content_inner %} +<h1 class="hide-heading">{% block page_heading %}{{ _('Organizations') }}{% endblock %}</h1> +{% block organizations_search_form %} +<div class="row"> + {% snippet 'snippets/search_form.html', form_id='organization-search-form', type='organization', query=c.q, + sorting_selected=c.sort_by_selected, count=c.page.item_count, placeholder=_('Search organizations...'), + show_empty=request.params, no_bottom_border=true if c.page.items, hide_sorting=true %} +</div> +{% endblock %} +{% block organizations_list %} +{% if c.page.items or request.params %} +{% if c.page.items %} +{% snippet "organization/snippets/odsh_organization_list.html", organizations=c.page.items %} +{% endif %} +{% else %} +<p class="empty"> + {{ _('There are currently no organizations for this site') }}. + {% if h.check_access('organization_create') %} + {% link_for _('How about creating one?'), controller='organization', action='new' %}</a>. + {% endif %} +</p> +{% endif %} +{% endblock %} +{% block page_pagination %} +{{ c.page.pager(q=c.q or '', sort=c.sort_by_selected or '') }} +{% endblock %} +{% endblock %} + +{% block secondary%} +{% endblock %} \ No newline at end of file diff --git a/ckanext/odsh/templates/organization/snippets/odsh_organization_list.html b/ckanext/odsh/templates/organization/snippets/odsh_organization_list.html new file mode 100644 index 00000000..02fd6618 --- /dev/null +++ b/ckanext/odsh/templates/organization/snippets/odsh_organization_list.html @@ -0,0 +1,18 @@ +{# +Display a grid of organization items. + +organizations - A list of organizations. + +Example: + +{% snippet "organization/snippets/organization_list.html" %} + +#} +{% block organization_list %} +{% block organization_list_inner %} +{% for organization in organizations %} +{% snippet "organization/snippets/organization_item.html", organization=organization, position=loop.index, +show_capacity=show_capacity %} +{% endfor %} +{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/ckanext/odsh/templates/organization/snippets/organization_item.html b/ckanext/odsh/templates/organization/snippets/organization_item.html new file mode 100644 index 00000000..ca7ea5c4 --- /dev/null +++ b/ckanext/odsh/templates/organization/snippets/organization_item.html @@ -0,0 +1,28 @@ +{# +Renders a media item for a organization. This should be used in a list. + +organization - A organization dict. + +Example: + +<ul class="media-grid"> + {% for organization in organizations %} + {% snippet "organization/snippets/organization_item.html", organization=organization %} + {% endfor %} +</ul> +#} +{% set url = h.url_for(organization.type ~ '_read', action='read', id=organization.name) %} +<div class="row"> + <div class="span11"> + <p>{{ organization.display_name }}</p> + {% if organization.description %} + <p>{{ h.markdown_extract(organization.description, extract_length=300) }}</p> + {% endif %} + </div> + <div class="span1"> + <a href="{{ url }}" title="{{ _('View {organization_name}').format(organization_name=organization.display_name) }}"> + <img src="{{ organization.image_display_url or h.url_for_static('/base/images/placeholder-organization.png') }}" + alt="{{ organization.name }}" class="organization-image"> + </a> + </div> +</div> \ No newline at end of file diff --git a/ckanext/odsh/templates/snippets/search_result_text.html b/ckanext/odsh/templates/snippets/search_result_text.html new file mode 100644 index 00000000..a764d458 --- /dev/null +++ b/ckanext/odsh/templates/snippets/search_result_text.html @@ -0,0 +1,47 @@ +{# + +Displays a test for results of a search. + +query - The text that was searched for +count - The number of results for the search +type - Search result type (dataset, group, organization) + +Example: + +{% snippet 'snippets/search_result_text.html', query=query, count=count, type='dataset' %} + +#} +{% if type == 'dataset' %} +{% set text_query = ungettext('{number} dataset found for "{query}"', '{number} datasets found for "{query}"', count) +%} +{% set text_query_none = _('No datasets found for "{query}"') %} +{% set text_no_query = ungettext('{number} dataset found', '{number} datasets found', count) %} +{% set text_no_query_none = _('No datasets found') %} + +{% elif type == 'group' %} +{% set text_query = ungettext('{number} group found for "{query}"', '{number} groups found for "{query}"', count) %} +{% set text_query_none = _('No groups found for "{query}"') %} +{% set text_no_query = ungettext('{number} group found', '{number} groups found', count) %} +{% set text_no_query_none = _('No groups found') %} + +{% elif type == 'organization' %} +{% set text_query = ungettext('{number} organization found for "{query}"', '{number} organizations found for +"{query}"', count) %} +{% set text_query_none = _('No organizations found for "{query}"') %} +{% set text_no_query = ungettext('{number} organization found', '{number} organizations found', count) %} +{% set text_no_query_none = _('No organizations found') %} +{%- endif -%} + +{% if query %} +{%- if count -%} +{{ text_query.format(number=h.localised_number(count), query=query) }} +{%- else -%} +{{ text_query_none.format(query=query) }} +{%- endif -%} +{%- else -%} +{%- if count -%} +{{ text_no_query.format(number=h.localised_number(count)) }} +{%- else -%} +{{ text_no_query_none }} +{%- endif -%} +{%- endif -%} \ No newline at end of file diff --git a/ckanext/odsh/templates/user/login.html b/ckanext/odsh/templates/user/login.html index cd389e28..874fd1bf 100644 --- a/ckanext/odsh/templates/user/login.html +++ b/ckanext/odsh/templates/user/login.html @@ -1,6 +1,6 @@ {% extends "page.html" %} -{% block subtitle %}{{ _('Login') }}{% endblock %} +{% block subtitle %} {{ _('Login') }} {% endblock %} {% block breadcrumb_content %} <li class="active">{{ h.nav_link(_('Login'), controller='user', action='login') }}</li> @@ -9,7 +9,7 @@ {% block primary_content %} <section class="module"> <div class="module-content"> - <h1 class="page-heading">{% block page_heading %}{{ _('Login') }}{% endblock %}</h1> + <h2 class="page-heading">{% block page_heading %}{{ _('Login') }}{% endblock %}</h2> {% block form %} {% snippet "user/snippets/login_form.html", action=c.login_handler, error_summary=error_summary %} {% endblock %} @@ -18,37 +18,15 @@ {% endblock %} {% block secondary_content %} -{% if h.check_access('user_create') %} -{% block help_register %} -<section class="module module-narrow module-shallow"> - {% block help_register_inner %} - <h2 class="module-heading">{{ _('Need an Account?') }}</h2> - <div class="module-content"> - <p>{% trans %}Then sign right up, it only takes a minute.{% endtrans %}</p> - <p class="action"> - {% block help_register_button %} - <a class="btn" href="{{ h.url_for(controller='user', action='register') }}">{{ _('Create an Account') }}</a> - {% endblock %} - </p> - </div> - {% endblock %} -</section> -{% endblock %} -{% endif %} {% block help_forgotten %} <section class="module module-narrow module-shallow"> {% block help_forgotten_inner %} - <h2 class="module-heading">{{ _('Forgotten your password?') }}</h2> - <div class="module-content"> - <p>{% trans %}No problem, use our password recovery form to reset it.{% endtrans %}</p> - <p class="action"> - {% block help_forgotten_button %} - <a class="btn" href="{{ h.url_for(controller='user', action='request_reset') }}">{{ _('Forgot your - password?') }}</a> - {% endblock %} - </p> - </div> + <span>{{ _('Forgotten your password?') }}:</span> + {% block help_forgotten_button %} + <a class="btn-forget-password" href="{{ h.url_for(controller='user', action='request_reset') }}"> + {{ _('change password') }}</a> + {% endblock %} {% endblock %} </section> {% endblock %} diff --git a/ckanext/odsh/templates/user/snippets/login_form.html b/ckanext/odsh/templates/user/snippets/login_form.html new file mode 100644 index 00000000..07e7d6f3 --- /dev/null +++ b/ckanext/odsh/templates/user/snippets/login_form.html @@ -0,0 +1,44 @@ +{# +Renders the login form. + +action - The url that the form should be submitted to. +error_summary - A tuple/list of form errors. + +Example: + +{% snippet "user/snippets/login_form.html", action=c.login_handler, error_summary=error_summary %} + +#} +{% import 'macros/form.html' as form %} + +{% set username_error = true if error_summary %} +{% set password_error = true if error_summary %} + +<form action="{{ action }}" method="post" class="form"> + {{ form.errors(errors=error_summary) }} + + <div class='row'> + <div class="span6"> + {{ form.input('login', label=_("Username"), id='field-login', value="", error=username_error, + classes=["control-full"], placeholder=_('enter name')) }} + </div> + </div> + + <div class='row'> + <div class="span6"> + {{ form.input('password', label=_("Password"), id='field-password', type="password", value="", + error=password_error, classes=["control-full"],placeholder=_('enter password')) }} + </div> + </div> + + {{ form.checkbox('remember', classes=["checklabel"], label=_("Remember me"), id='field-remember', checked=true, + value="63072000") }} + + <div class='row'> + <div class="form-actions span6"> + {% block login_button %} + <button class="btn btn-primary" type="submit">{{ _('do Login') }}</button> + {% endblock %} + </div> + </div> +</form> \ No newline at end of file -- GitLab