Skip to content

Commit a246a24

Browse files
committed
Restaura el listado de /group y /organization y completa Organismos/Temas
El override de primary_content_inner completo borraba la lista y la paginación que renderiza core; ahora solo se pisa el bloque del buscador. Se completa el renombre en lo que quedaba del core: - h1 accesible de /organization via block page_heading con h.gobar_organizations_label() - h1 de /group y textos de resultados de búsqueda via overrides i18n (Groups -> Temas, 'X grupos encontrados' -> 'X temas encontrados') - textos de resultados de /organization con sustantivo neutro ('N resultados') en un override de search_result_text.html, porque el label es configurable por perfil y no tiene singular derivable
1 parent a8c6ff0 commit a246a24

7 files changed

Lines changed: 114 additions & 10 deletions

File tree

256 Bytes
Binary file not shown.

ckanext/gobar_theme/i18n/es/LC_MESSAGES/ckanext-gobar_theme.po

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,3 +298,26 @@ msgstr "No hay descripción para este dataset"
298298
#~ msgid "Cancel"
299299
#~ msgstr "Cancelar"
300300

301+
302+
# Overrides de CKAN core: /group se llama "Temas" en este portal
303+
msgid "Groups"
304+
msgstr "Temas"
305+
306+
msgid "There are currently no groups for this site"
307+
msgstr "Todavía no hay temas en este portal"
308+
309+
msgid "{number} group found for \"{query}\""
310+
msgid_plural "{number} groups found for \"{query}\""
311+
msgstr[0] "{number} tema encontrado para \"{query}\""
312+
msgstr[1] "{number} temas encontrados para \"{query}\""
313+
314+
msgid "No groups found for \"{query}\""
315+
msgstr "No se encontraron temas para \"{query}\""
316+
317+
msgid "{number} group found"
318+
msgid_plural "{number} groups found"
319+
msgstr[0] "{number} tema encontrado"
320+
msgstr[1] "{number} temas encontrados"
321+
322+
msgid "No groups found"
323+
msgstr "No se encontraron temas"
256 Bytes
Binary file not shown.

ckanext/gobar_theme/i18n/es_AR/LC_MESSAGES/ckanext-gobar_theme.po

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,3 +308,26 @@ msgstr "No hay descripción para este dataset"
308308
#~ msgid "Cancel"
309309
#~ msgstr "Cancelar"
310310

311+
312+
# Overrides de CKAN core: /group se llama "Temas" en este portal
313+
msgid "Groups"
314+
msgstr "Temas"
315+
316+
msgid "There are currently no groups for this site"
317+
msgstr "Todavía no hay temas en este portal"
318+
319+
msgid "{number} group found for \"{query}\""
320+
msgid_plural "{number} groups found for \"{query}\""
321+
msgstr[0] "{number} tema encontrado para \"{query}\""
322+
msgstr[1] "{number} temas encontrados para \"{query}\""
323+
324+
msgid "No groups found for \"{query}\""
325+
msgstr "No se encontraron temas para \"{query}\""
326+
327+
msgid "{number} group found"
328+
msgid_plural "{number} groups found"
329+
msgstr[0] "{number} tema encontrado"
330+
msgstr[1] "{number} temas encontrados"
331+
332+
msgid "No groups found"
333+
msgstr "No se encontraron temas"

ckanext/gobar_theme/templates/group/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
<li class="active">{% link_for "Temas", named_route=group_type+'.index' %}</li>
77
{% endblock %}
88

9-
{% block primary_content_inner %}
10-
<h1 class="hide-heading">Temas</h1>
11-
{% block groups_search_form %}
12-
{% snippet 'snippets/search_form.html', form_id='group-search-form', type=group_type, query=q, sorting_selected=sort_by_selected, count=page.item_count, placeholder='Buscar temas...', show_empty=request.args, no_bottom_border=true if page.items, sorting = [(_('Name Ascending'), 'title asc'), (_('Name Descending'), 'title desc')] %}
13-
{% endblock %}
9+
{# Solo se cambia el buscador; el listado (groups_list) y la paginación los
10+
sigue renderizando core. Overridear todo primary_content_inner borraba la
11+
lista. #}
12+
{% block groups_search_form %}
13+
{% snippet 'snippets/search_form.html', form_id='group-search-form', type=group_type, query=q, sorting_selected=sort_by_selected, count=page.item_count, placeholder='Buscar temas...', show_empty=request.args, no_bottom_border=true if page.items, sorting = [(_('Name Ascending'), 'title asc'), (_('Name Descending'), 'title desc')] %}
1414
{% endblock %}
1515

1616
{% block secondary %}{% endblock %}

ckanext/gobar_theme/templates/organization/index.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@
66
<li class="active">{% link_for h.gobar_organizations_label(), named_route=group_type+'.index' %}</li>
77
{% endblock %}
88

9-
{% block primary_content_inner %}
10-
<h1 class="hide-heading">{{ h.gobar_organizations_label() }}</h1>
11-
{% block organizations_search_form %}
12-
{% snippet 'snippets/search_form.html', form_id='organization-search-form', type=group_type, query=q, sorting_selected=sort_by_selected, count=page.item_count, placeholder='Buscar ' ~ h.gobar_organizations_label()|lower ~ '...', show_empty=request.args, no_bottom_border=true if page.items, sorting = [(_('Name Ascending'), 'title asc'), (_('Name Descending'), 'title desc')] %}
13-
{% endblock %}
9+
{# h1 accesible (hide-heading) del core, con el label configurable #}
10+
{% block page_heading %}{{ h.gobar_organizations_label() }}{% endblock %}
11+
12+
{# Solo se cambia el buscador; el listado (organizations_list) y la paginación
13+
los sigue renderizando core. Overridear todo primary_content_inner borraba la
14+
lista. #}
15+
{% block organizations_search_form %}
16+
{% snippet 'snippets/search_form.html', form_id='organization-search-form', type=group_type, query=q, sorting_selected=sort_by_selected, count=page.item_count, placeholder='Buscar ' ~ h.gobar_organizations_label()|lower ~ '...', show_empty=request.args, no_bottom_border=true if page.items, sorting = [(_('Name Ascending'), 'title asc'), (_('Name Descending'), 'title desc')] %}
1417
{% endblock %}
1518

1619
{% block secondary %}{% endblock %}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{#
2+
Override del snippet del core. Única diferencia: la rama type == 'organization'
3+
usa "resultado(s)" como sustantivo neutro, porque el nombre de la sección es
4+
configurable (h.gobar_organizations_label(), ej. "Organismos") y no tiene
5+
forma singular derivable. Las demás ramas son copia del core.
6+
7+
query - The text that was searched for
8+
count - The number of results for the search
9+
type - Search result type (dataset, group, organization)
10+
#}
11+
{% if type == 'dataset' %}
12+
{% set text_query = ungettext('{number} dataset found for "{query}"', '{number} datasets found for "{query}"', count) %}
13+
{% set text_query_none = _('No datasets found for "{query}"') %}
14+
{% set text_no_query = ungettext('{number} dataset found', '{number} datasets found', count) %}
15+
{% set text_no_query_none = _('No datasets found') %}
16+
17+
{% elif type == 'group' %}
18+
{% set text_query = ungettext('{number} group found for "{query}"', '{number} groups found for "{query}"', count) %}
19+
{% set text_query_none = _('No groups found for "{query}"') %}
20+
{% set text_no_query = ungettext('{number} group found', '{number} groups found', count) %}
21+
{% set text_no_query_none = _('No groups found') %}
22+
23+
{% elif type == 'organization' %}
24+
{% set text_query = ungettext('{number} resultado para "{query}"', '{number} resultados para "{query}"', count) %}
25+
{% set text_query_none = _('No se encontraron resultados para "{query}"') %}
26+
{% set text_no_query = ungettext('{number} resultado', '{number} resultados', count) %}
27+
{% set text_no_query_none = _('No se encontraron resultados') %}
28+
29+
{% else %}
30+
{% set text_query_singular = '{number} ' + type + ' found for "{query}"' %}
31+
{% set text_query_plural = '{number} ' + type + 's found for "{query}"' %}
32+
{% set text_query_none_plural = 'No ' + type + 's found for "{query}"' %}
33+
{% set text_no_query_singular = '{number} ' + type + ' found' %}
34+
{% set text_no_query_plural = '{number} ' + type + 's found' %}
35+
{% set text_no_query_none_plural = 'No ' + type + 's found' %}
36+
37+
{% set text_query = ungettext(text_query_singular, text_query_plural, count) %}
38+
{% set text_query_none = _(text_query_none_plural) %}
39+
{% set text_no_query = ungettext(text_no_query_singular, text_no_query_plural, count) %}
40+
{% set text_no_query_none = _(text_no_query_none_plural) %}
41+
{%- endif -%}
42+
43+
{% if query %}
44+
{%- if count -%}
45+
{{ text_query.format(number=h.localised_number(count), query=query, type=type) }}
46+
{%- else -%}
47+
{{ text_query_none.format(query=query, type=type) }}
48+
{%- endif -%}
49+
{%- else -%}
50+
{%- if count -%}
51+
{{ text_no_query.format(number=h.localised_number(count), type=type) }}
52+
{%- else -%}
53+
{{ text_no_query_none.format(type=type) }}
54+
{%- endif -%}
55+
{%- endif -%}

0 commit comments

Comments
 (0)