From 36c78950bbd5943ae470a9a00a06a4f27b5da420 Mon Sep 17 00:00:00 2001 From: toavina Date: Thu, 5 Dec 2024 16:44:03 +0300 Subject: [PATCH 1/3] Groups moved in fjelltopp-theme --- .../who_romania/assets/css/who-romania.css | 90 ------------------- ckanext/who_romania/templates/group/edit.html | 13 +-- .../who_romania/templates/group/index.html | 39 -------- ckanext/who_romania/templates/group/new.html | 26 +----- .../templates/group/new_group_form.html | 8 -- .../templates/group/read_base.html | 5 -- .../templates/group/snippets/group_form.html | 42 +-------- .../templates/group/snippets/group_item.html | 6 -- .../templates/group/snippets/group_list.html | 8 -- .../who_romania/templates/home/layout1.html | 14 --- .../templates/package/group_list.html | 29 +----- .../templates/package/read_base.html | 11 --- 12 files changed, 4 insertions(+), 287 deletions(-) diff --git a/ckanext/who_romania/assets/css/who-romania.css b/ckanext/who_romania/assets/css/who-romania.css index a1ed0c8..b39d7a6 100644 --- a/ckanext/who_romania/assets/css/who-romania.css +++ b/ckanext/who_romania/assets/css/who-romania.css @@ -47,96 +47,6 @@ } /* hide insights */ -/* groups */ -.categories-page { - .wrapper { - border: none; - box-shadow: none; - } - .wrapper:before { - content: none; - } - .secondary { - display: none; - } - .primary { - width: 100%; - } - .module-content .page_primary_action .btn { - margin-bottom: 24px; - } -} -.topics-background { - margin-top: 48px; - margin-bottom: 64px; - background-color: white; -} -.topics-background H1:first-child { - font-size: 36px; - font-weight: 400; - line-height: 48px; - letter-spacing: -0.04em; - text-align: left; -} -.topics-background .container { - width: 100%; -} - -.topics { - display: flex; - flex-wrap: wrap; - gap: 24px; - list-style-type: none; - padding: 0; - width: 100%; - margin-top: 24px; - align-items: flex-start; - margin-left: -28px; -} - -.topics li:last-child { - margin-right: 0; -} -.topics li { - display: inline flex; - margin-right: 21px; - margin-top: 24px; - width: 124px; - height: 96px; - border-radius: 4px; -} -.topics li a { - margin: 16px; - width: 92px; - height: 64px; -} - -.topics li a .topic-top-square { - background-color: var(--primary25); - width: 40px; - height: 40px; - margin-left: 26px; - margin-right: 26px; - margin-bottom: 6px; - border-radius: 4px; - text-align: center; - display: flex; - justify-content: center; - align-items: center; -} - -.topics li a .topic-top-square img { - max-width: 36px; - max-height: 36px; -} -.topics li a .topic-link { - text-align: center; - font-size: 12px; - font-weight: 700; - line-height: 16px; - color: #13240F; -} - /* category box */ .dataset .category-box { background: var(--light); diff --git a/ckanext/who_romania/templates/group/edit.html b/ckanext/who_romania/templates/group/edit.html index bd88874..4e308a5 100644 --- a/ckanext/who_romania/templates/group/edit.html +++ b/ckanext/who_romania/templates/group/edit.html @@ -1,12 +1 @@ -{% extends "group/base_form_page.html" %} - -{% block breadcrumb_content %} -
  • {% link_for h.humanize_entity_type('group', group_type, 'breadcrumb') or _('Categories'), named_route=group_type+'.index' %}
  • - {% block breadcrumb_content_inner %} -
  • {% link_for group.display_name|truncate(35), named_route=group_type+'.read', id=group.name, title=group.display_name %}
  • -
  • {% link_for _('Manage'), named_route=group_type+'.edit', id=group.name %}
  • - {% endblock %} -{% endblock %} - -{% block page_heading_class %}hide-heading{% endblock %} -{% block page_heading %}{{ h.humanize_entity_type('group', group_type, 'edit label') or _('Edit Category') }}{% endblock %} +{% ckan_extends %} \ No newline at end of file diff --git a/ckanext/who_romania/templates/group/index.html b/ckanext/who_romania/templates/group/index.html index cfcdef9..c58cded 100644 --- a/ckanext/who_romania/templates/group/index.html +++ b/ckanext/who_romania/templates/group/index.html @@ -1,40 +1 @@ {% ckan_extends %} - - -{% block subtitle %}{{ h.humanize_entity_type('group', group_type, 'page title') or _('Categories') }}{% endblock %} - -{% block breadcrumb_content %} -
  • {% link_for h.humanize_entity_type('group', group_type, 'breadcrumb') or _('Categories'), named_route=group_type+'.index' %}
  • -{% endblock %} - -{% block maintag %}
    {% endblock %} - -{% block page_primary_action %} - {% if h.check_access('group_create') %} - {% link_for h.humanize_entity_type('group', group_type, 'add link') or _('Add Category'), named_route=group_type+'.new', class_='btn btn-primary', icon='plus-square' %} - {% endif %} -{% endblock %} - - -{% block primary_content_inner %} - {% block groups_list %} - {% if page.items or request.args %} - {% if page.items %} - {% snippet "group/snippets/group_list.html", groups=page.items %} - {% endif %} - {% else %} -

    - {{ h.humanize_entity_type('group', group_type, 'no any objects') or _('There are currently no categories for this site') }}. - {% if h.check_access('group_create') %} - {% link_for _('How about creating one?'), named_route=group_type+'.new' %}. - {% endif %} -

    - {% endif %} - {% endblock %} - {% block page_pagination %} - {{ page.pager(q=q or '', sort=sort_by_selected or '') }} - {% endblock %} -{% endblock %} - -{% block secondary_content %} -{% endblock %} \ No newline at end of file diff --git a/ckanext/who_romania/templates/group/new.html b/ckanext/who_romania/templates/group/new.html index c4a1773..4e308a5 100644 --- a/ckanext/who_romania/templates/group/new.html +++ b/ckanext/who_romania/templates/group/new.html @@ -1,25 +1 @@ -{% extends "group/base_form_page.html" %} - -{% set label = h.humanize_entity_type('group', group_type, 'create title') or _('Create a Category') %} - - -{% block subtitle %}{{ label }}{% endblock %} - -{% block page_heading %}{{ label }}{% endblock %} - -{% block breadcrumb_content %} -
  • {{ h.nav_link( - h.humanize_entity_type('group', group_type, 'breadcrumb') or _('Categories'), - named_route=group_type+'.index') }}
  • -
  • - {{ h.nav_link( - label, - named_route=group_type~'.new') }} -
  • -{% endblock %} - -{% block page_header %}{% endblock %} - -{% block secondary_content %} - {% snippet "group/snippets/helper.html", group_type=group_type %} -{% endblock %} +{% ckan_extends %} \ No newline at end of file diff --git a/ckanext/who_romania/templates/group/new_group_form.html b/ckanext/who_romania/templates/group/new_group_form.html index dc9ff8c..c58cded 100644 --- a/ckanext/who_romania/templates/group/new_group_form.html +++ b/ckanext/who_romania/templates/group/new_group_form.html @@ -1,9 +1 @@ {% ckan_extends %} - -{% block save_text %} - {%- if action == "edit" -%} - {{ h.humanize_entity_type('group', group_type, 'update label') or _('Update Category') }} - {%- else -%} - {{ h.humanize_entity_type('group', group_type, 'create label') or _('Create Category') }} - {%- endif -%} -{% endblock %} \ No newline at end of file diff --git a/ckanext/who_romania/templates/group/read_base.html b/ckanext/who_romania/templates/group/read_base.html index cee2d55..1c8a044 100644 --- a/ckanext/who_romania/templates/group/read_base.html +++ b/ckanext/who_romania/templates/group/read_base.html @@ -1,8 +1,3 @@ {% ckan_extends %} -{% block subtitle %}{{ group_dict.display_name }} {{ g.template_title_delimiter }} {{ _('Category') }}{% endblock %} -{% block breadcrumb_content %} -
  • {% link_for _('Categories'), named_route=group_type+'.index' %}
  • -
  • {% link_for group_dict.display_name|truncate(35), named_route=group_type+'.read', id=group_dict.name %}
  • -{% endblock %} diff --git a/ckanext/who_romania/templates/group/snippets/group_form.html b/ckanext/who_romania/templates/group/snippets/group_form.html index 549a616..4e308a5 100644 --- a/ckanext/who_romania/templates/group/snippets/group_form.html +++ b/ckanext/who_romania/templates/group/snippets/group_form.html @@ -1,41 +1 @@ -{% import 'macros/form.html' as form %} - - -
    - {{ h.csrf_input() }} - {% block error_summary %} - {{ form.errors(error_summary) }} - {% endblock %} - - {% block basic_fields %} - {% set attrs = {'data-module': 'slug-preview-target', 'class': 'form-control'} %} - {{ form.input('title', label=_('Name'), id='field-name', placeholder=h.humanize_entity_type('group', group_type, 'name placeholder') or _('My category'), value=data.title, error=errors.title, classes=['control-full'], attrs=attrs) }} - - {# Perhaps these should be moved into the controller? #} - {% set prefix = h.url_for(group_type + '.read', id='') %} - {% set domain = h.url_for(group_type + '.read', id='', qualified=true) %} - {% set domain = domain|replace("http://", "")|replace("https://", "") %} - {% set attrs = {'data-module': 'slug-preview-slug', 'class': 'form-control input-sm', 'data-module-prefix': domain, 'data-module-placeholder': '<' + group_type + '>'} %} - - {{ form.prepend('name', label=_('URL'), prepend=prefix, id='field-url', placeholder=_('my-' + group_type), value=data.name, error=errors.name, attrs=attrs, is_required=true) }} - - {{ form.markdown('description', label=_('Description'), id='field-description', placeholder=h.humanize_entity_type('group', group_type, 'description placeholder') or _('A little information about this category ...'), value=data.description, error=errors.description) }} - - {% set is_upload = data.image_url and not data.image_url.startswith('http') %} - {% set is_url = data.image_url and data.image_url.startswith('http') %} - - {{ form.image_upload(data, errors, is_upload_enabled=h.uploads_enabled(), is_url=is_url, is_upload=is_upload) }} - - {% endblock %} - - {{ form.required_message() }} - -
    - {% block delete_button %} - {% if h.check_access('group_delete', {'id': data.id}) %} - {% block delete_button_text %}{{ _('Delete') }}{% endblock %} - {% endif %} - {% endblock %} - -
    -
    +{% ckan_extends %} \ No newline at end of file diff --git a/ckanext/who_romania/templates/group/snippets/group_item.html b/ckanext/who_romania/templates/group/snippets/group_item.html index 011c4a7..22ec5a4 100644 --- a/ckanext/who_romania/templates/group/snippets/group_item.html +++ b/ckanext/who_romania/templates/group/snippets/group_item.html @@ -1,8 +1,2 @@ {% ckan_extends %} -{% set type = group.type or 'group' %} -{% set url = h.url_for(type ~ '.read', id=group.name) %} - -{% block item %} -
  • -{% endblock %} diff --git a/ckanext/who_romania/templates/group/snippets/group_list.html b/ckanext/who_romania/templates/group/snippets/group_list.html index d595809..22ec5a4 100755 --- a/ckanext/who_romania/templates/group/snippets/group_list.html +++ b/ckanext/who_romania/templates/group/snippets/group_list.html @@ -1,10 +1,2 @@ {% ckan_extends %} -{% block group_list %} - {% set groups = groups %} - -{% endblock %} diff --git a/ckanext/who_romania/templates/home/layout1.html b/ckanext/who_romania/templates/home/layout1.html index 7888f9b..ad49e14 100644 --- a/ckanext/who_romania/templates/home/layout1.html +++ b/ckanext/who_romania/templates/home/layout1.html @@ -1,19 +1,5 @@ {% ckan_extends %} -{% block groups %} - {% set categories = h.get_all_groups() %} - {% if categories != [] %} -
    -
    -

    {{_('Dataset categories')}}

    - {% block document_categories %} - {% snippet "group/snippets/group_list.html", groups=h.get_all_groups(), origin='homepage' %} - {% endblock %} -
    -
    - {% endif %} -{% endblock %} - {% block fx_bg %}{% endblock %} {% block title %}{{ _('Featured data') }}{% endblock %} diff --git a/ckanext/who_romania/templates/package/group_list.html b/ckanext/who_romania/templates/package/group_list.html index b6072ea..4e308a5 100644 --- a/ckanext/who_romania/templates/package/group_list.html +++ b/ckanext/who_romania/templates/package/group_list.html @@ -1,28 +1 @@ -{% extends "package/read_base.html" %} -{% import 'macros/form.html' as form %} - -{% block primary_content_inner %} -

    {{ _('Categories') }}

    - - {% if group_dropdown %} -
    - {{ h.csrf_input() }} - - -
    - {% endif %} - - {% if pkg_dict.groups %} -
    - {{ h.csrf_input() }} - {% snippet 'group/snippets/package_group_list.html', groups=pkg_dict.groups %} -
    - {% else %} -

    {{ _('There are no categories associated with this dataset') }}

    - {% endif %} - -{% endblock %} +{% ckan_extends %} \ No newline at end of file diff --git a/ckanext/who_romania/templates/package/read_base.html b/ckanext/who_romania/templates/package/read_base.html index 53722ad..c58cded 100644 --- a/ckanext/who_romania/templates/package/read_base.html +++ b/ckanext/who_romania/templates/package/read_base.html @@ -1,12 +1 @@ {% ckan_extends %} - -{% block content_primary_nav %} - {{ h.build_nav(dataset_type ~ '.read', _('Dataset'), id=pkg.name) }} - {{ h.build_nav(dataset_type ~ '.groups', h.humanize_entity_type('group', default_group_type, 'content tab') or _('Categories'), id=pkg.name) }} - {{ h.build_nav('activity.package_activity', _('Activity'), id=pkg.id if is_activity_archive else pkg.name) }} - {% if h.check_access('package_update', {'id':pkg.id }) %} -
  • - {% link_for _('Manage'), named_route=pkg.type ~ '.edit', id=pkg.name, icon='wrench' %} -
  • - {% endif %} -{% endblock %} From 5cf380f9bdb6f09b1f04ec2e3e12fa0be43646da Mon Sep 17 00:00:00 2001 From: toavina Date: Fri, 6 Dec 2024 10:28:49 +0300 Subject: [PATCH 2/3] Removed templates that will be managed from fjelltopp-theme --- ckanext/who_romania/templates/group/edit.html | 1 - ckanext/who_romania/templates/group/index.html | 1 - ckanext/who_romania/templates/group/new.html | 1 - ckanext/who_romania/templates/group/read_base.html | 3 --- ckanext/who_romania/templates/group/snippets/group_form.html | 1 - ckanext/who_romania/templates/group/snippets/group_item.html | 2 -- ckanext/who_romania/templates/group/snippets/group_list.html | 2 -- ckanext/who_romania/templates/package/group_list.html | 1 - ckanext/who_romania/templates/package/read_base.html | 1 - 9 files changed, 13 deletions(-) delete mode 100644 ckanext/who_romania/templates/group/edit.html delete mode 100644 ckanext/who_romania/templates/group/index.html delete mode 100644 ckanext/who_romania/templates/group/new.html delete mode 100644 ckanext/who_romania/templates/group/read_base.html delete mode 100644 ckanext/who_romania/templates/group/snippets/group_form.html delete mode 100644 ckanext/who_romania/templates/group/snippets/group_item.html delete mode 100755 ckanext/who_romania/templates/group/snippets/group_list.html delete mode 100644 ckanext/who_romania/templates/package/group_list.html delete mode 100644 ckanext/who_romania/templates/package/read_base.html diff --git a/ckanext/who_romania/templates/group/edit.html b/ckanext/who_romania/templates/group/edit.html deleted file mode 100644 index 4e308a5..0000000 --- a/ckanext/who_romania/templates/group/edit.html +++ /dev/null @@ -1 +0,0 @@ -{% ckan_extends %} \ No newline at end of file diff --git a/ckanext/who_romania/templates/group/index.html b/ckanext/who_romania/templates/group/index.html deleted file mode 100644 index c58cded..0000000 --- a/ckanext/who_romania/templates/group/index.html +++ /dev/null @@ -1 +0,0 @@ -{% ckan_extends %} diff --git a/ckanext/who_romania/templates/group/new.html b/ckanext/who_romania/templates/group/new.html deleted file mode 100644 index 4e308a5..0000000 --- a/ckanext/who_romania/templates/group/new.html +++ /dev/null @@ -1 +0,0 @@ -{% ckan_extends %} \ No newline at end of file diff --git a/ckanext/who_romania/templates/group/read_base.html b/ckanext/who_romania/templates/group/read_base.html deleted file mode 100644 index 1c8a044..0000000 --- a/ckanext/who_romania/templates/group/read_base.html +++ /dev/null @@ -1,3 +0,0 @@ -{% ckan_extends %} - - diff --git a/ckanext/who_romania/templates/group/snippets/group_form.html b/ckanext/who_romania/templates/group/snippets/group_form.html deleted file mode 100644 index 4e308a5..0000000 --- a/ckanext/who_romania/templates/group/snippets/group_form.html +++ /dev/null @@ -1 +0,0 @@ -{% ckan_extends %} \ No newline at end of file diff --git a/ckanext/who_romania/templates/group/snippets/group_item.html b/ckanext/who_romania/templates/group/snippets/group_item.html deleted file mode 100644 index 22ec5a4..0000000 --- a/ckanext/who_romania/templates/group/snippets/group_item.html +++ /dev/null @@ -1,2 +0,0 @@ -{% ckan_extends %} - diff --git a/ckanext/who_romania/templates/group/snippets/group_list.html b/ckanext/who_romania/templates/group/snippets/group_list.html deleted file mode 100755 index 22ec5a4..0000000 --- a/ckanext/who_romania/templates/group/snippets/group_list.html +++ /dev/null @@ -1,2 +0,0 @@ -{% ckan_extends %} - diff --git a/ckanext/who_romania/templates/package/group_list.html b/ckanext/who_romania/templates/package/group_list.html deleted file mode 100644 index 4e308a5..0000000 --- a/ckanext/who_romania/templates/package/group_list.html +++ /dev/null @@ -1 +0,0 @@ -{% ckan_extends %} \ No newline at end of file diff --git a/ckanext/who_romania/templates/package/read_base.html b/ckanext/who_romania/templates/package/read_base.html deleted file mode 100644 index c58cded..0000000 --- a/ckanext/who_romania/templates/package/read_base.html +++ /dev/null @@ -1 +0,0 @@ -{% ckan_extends %} From 63ae33a6691ed259e66cd1ff658685b5f6d5bd3e Mon Sep 17 00:00:00 2001 From: toavina Date: Fri, 6 Dec 2024 10:29:51 +0300 Subject: [PATCH 3/3] Removed templates that will be managed from fjelltopp-theme --- ckanext/who_romania/templates/group/new_group_form.html | 1 - 1 file changed, 1 deletion(-) delete mode 100644 ckanext/who_romania/templates/group/new_group_form.html diff --git a/ckanext/who_romania/templates/group/new_group_form.html b/ckanext/who_romania/templates/group/new_group_form.html deleted file mode 100644 index c58cded..0000000 --- a/ckanext/who_romania/templates/group/new_group_form.html +++ /dev/null @@ -1 +0,0 @@ -{% ckan_extends %}