Skip to content

Commit b45210e

Browse files
committed
Rediseña el árbol de /organization y oculta la solapa Miembros
- /organization: árbol tipo explorador de directorios con <details>/<summary> nativos (colapsables, se expanden todos con búsqueda activa vía expand_all); flecha, guía vertical + conector por fila, badge de datasets, Montserrat. - Sidebar de organización (info.html): solo cantidad de datasets, sin Seguidores ni Miembros. - organization/read_base.html y group/read_base.html: oculta la solapa "Miembros" salvo que el usuario tenga permiso real (check_access group_show), para no exponer los usuarios del organismo a cualquier visitante.
1 parent 9d7c8a6 commit b45210e

6 files changed

Lines changed: 100 additions & 72 deletions

File tree

ckanext/gobar_theme/assets/css/gobar-base.css

Lines changed: 37 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -143,52 +143,10 @@ footer .lang-select .select2-chosen { color: #333!important; }
143143
}
144144

145145
/* ── ORGANIZACIONES / GRUPOS ──
146-
/organization usa el árbol de ckanext-hierarchy (hierarchy_theme.css: bullets,
147-
líneas punteadas, link teal) en vez del grid de tarjetas del resto del sitio.
148-
/group usa el grid nativo de CKAN (.media-grid), sin estilo propio. Ambos se
149-
llevan acá a la línea visual de tarjetas del theme. */
150-
#publisher-tree {
151-
background: var(--gobar-blanco);
152-
border: 1px solid #E0E0E0;
153-
border-radius: 8px;
154-
padding: .25rem 1rem;
155-
}
156-
ul.hierarchy-tree-top,
157-
ul.hierarchy-tree {
158-
list-style: none !important;
159-
background: none !important;
160-
margin: 0;
161-
padding: 0;
162-
}
163-
ul.hierarchy-tree { margin-left: 1.25rem; }
164-
ul.hierarchy-tree-top > li,
165-
ul.hierarchy-tree li {
166-
background: none !important;
167-
padding: 0 !important;
168-
border-bottom: 1px solid var(--gobar-gris-bg);
169-
}
170-
ul.hierarchy-tree-top > li:last-child { border-bottom: none; }
171-
ul.hierarchy-tree-top li > a,
172-
ul.hierarchy-tree li > a {
173-
display: block;
174-
padding: .6rem .25rem;
175-
font-family: var(--font-cuerpo);
176-
font-weight: 500;
177-
color: var(--gobar-primary) !important;
178-
text-decoration: none;
179-
text-shadow: none !important;
180-
}
181-
ul.hierarchy-tree-top li > a:hover,
182-
ul.hierarchy-tree li > a:hover {
183-
color: var(--gobar-primary-dark) !important;
184-
background: var(--gobar-gris-bg);
185-
border-radius: 6px;
186-
}
187-
ul.hierarchy-tree-top li.highlighted > a,
188-
ul.hierarchy-tree li.highlighted > a {
189-
font-weight: 700;
190-
}
191-
146+
El índice de /organization lo dibuja el árbol propio de más abajo
147+
(.gobar-org-tree, override del snippet de ckanext-hierarchy).
148+
.media-grid es el grid genérico de CKAN que sigue usándose en otros
149+
listados (dashboard, featured), se lleva a la línea visual del theme. */
192150
.media-grid {
193151
list-style: none;
194152
display: grid;
@@ -251,11 +209,37 @@ body.one-column .primary { width: 100%; max-width: 100%; float: none; }
251209
/* ── Listados de /organization (árbol de organismos) y /group (temas) ── */
252210
.gobar-temas-grid { margin-top: 24px; }
253211

254-
.gobar-org-tree { list-style: none; padding: 0; margin: 24px 0 0; max-width: 780px; }
255-
.gobar-org-tree ul.hierarchy-tree { list-style: none; margin: 0 0 8px 24px; padding-left: 20px; border-left: 2px solid #DEE2E6; }
256-
.gobar-org-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; margin-bottom: 8px; background: var(--gobar-blanco); border: 1px solid #DEE2E6; border-radius: 4px; color: var(--gobar-navy) !important; text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
257-
.gobar-org-row:hover { border-color: var(--gobar-primary); box-shadow: 0 1px 3px rgba(33,45,81,.1); }
258-
.gobar-org-row-name { flex: 1; font-family: var(--font-cuerpo); font-size: 15px; font-weight: 600; line-height: 1.35; }
259-
.gobar-org-row-count { font-family: var(--font-cuerpo); font-size: 13px; color: var(--gobar-gris-oscuro); white-space: nowrap; }
212+
/* Árbol de organismos tipo explorador de directorios (handoff diseño 3d, sin
213+
la tarjeta contenedora del mock): padres colapsables (<details> nativo),
214+
guía vertical fina + conector horizontal por hijo, count como badge pegado
215+
al nombre y filas fit-content (no se estiran a lo ancho). Tokens del
216+
handoff; la tipografía queda la del portal (Montserrat), no IBM Plex. */
217+
.gobar-org-tree { margin: 24px 0 0; }
218+
.gobar-org-tree, .gobar-org-children { list-style: none; padding: 0; }
219+
.gobar-org-children { margin: 0; }
220+
.gobar-org-branch { margin: 0; }
221+
.gobar-org-row { display: flex; align-items: center; gap: 8px; padding: 12px 4px; width: fit-content; font-family: var(--font-cuerpo); }
222+
.gobar-org-row::before { content: "\25B8"; color: #9CA0B5; font-size: 11px; line-height: 1; flex: none; }
223+
summary.gobar-org-row { cursor: pointer; list-style: none; user-select: none; }
224+
summary.gobar-org-row::-webkit-details-marker { display: none; }
225+
/* Foco solo cuando se navega con teclado; el click no deja el recuadro azul */
226+
summary.gobar-org-row:focus:not(:focus-visible) { outline: none; box-shadow: none; }
227+
details[open] > summary.gobar-org-row::before { content: "\25BE"; color: #372F86; }
228+
.gobar-org-row-name { font-size: 14.5px; font-weight: 700; color: #312E3D; text-decoration: none; transition: color .15s; }
229+
.gobar-org-row-name:hover { color: #372F86; text-decoration: underline; }
230+
.gobar-org-row-count { background: #F1EFFA; color: #7A76A8; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 5px; white-space: nowrap; }
231+
/* Hijos: guía vertical dibujada por fila (::after) en vez de border-left del
232+
ul, así en la última fila corta justo en su conector y no sigue de largo */
233+
.gobar-org-children { margin-left: 15px; padding-left: 22px; }
234+
.gobar-org-children > li { position: relative; }
235+
.gobar-org-children > li::before { content: ""; position: absolute; left: -22px; top: 50%; width: 16px; height: 1.5px; background: #E4E2F0; }
236+
.gobar-org-children > li::after { content: ""; position: absolute; left: -22px; top: 0; bottom: 0; width: 1.5px; background: #E4E2F0; }
237+
.gobar-org-children > li:last-child::after { bottom: auto; height: 50%; }
238+
.gobar-org-children .gobar-org-row { padding: 11px 4px; }
239+
.gobar-org-children .gobar-org-row::before { content: none; }
240+
.gobar-org-children summary.gobar-org-row::before { content: "\25B8"; }
241+
.gobar-org-children details[open] > summary.gobar-org-row::before { content: "\25BE"; }
242+
.gobar-org-children .gobar-org-row-name { font-size: 13.5px; font-weight: 600; color: #372F86; }
260243
/* Resultado resaltado por la búsqueda del árbol (hierarchy) */
261-
.gobar-org-tree li.highlighted > .gobar-org-row { border-color: var(--gobar-primary); box-shadow: 0 1px 3px rgba(33,45,81,.15); }
244+
.gobar-org-tree li.highlighted > .gobar-org-row .gobar-org-row-name,
245+
.gobar-org-tree li.highlighted > details > summary .gobar-org-row-name { color: #372F86; text-decoration: underline; }
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{% ckan_extends %}
2+
3+
{# Mismo riesgo que en organization/read_base.html: se oculta la solapa
4+
"Miembros" salvo que el usuario tenga permiso real de verla. #}
5+
{% block content_primary_nav %}
6+
{{ h.build_nav_icon(group_type + '.read', h.humanize_entity_type('package', dataset_type, 'content tab') or _('Datasets'), id=group_dict.name, icon='sitemap') }}
7+
{% if h.check_access('group_show', {'id': group_dict.id, 'object_type': 'user'}) %}
8+
{{ h.build_nav_icon(group_type + '.members', _('Members'), id=group_dict.name, icon='users') }}
9+
{% endif %}
10+
{{ h.build_nav_icon(group_type + '.about', _('About'), id=group_dict.name, icon='info-circle') }}
11+
{% endblock %}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{% ckan_extends %}
2+
3+
{# La solapa "Miembros" es un riesgo de privacidad: expone qué usuarios
4+
pertenecen al organismo a cualquier visitante. Se oculta salvo que el
5+
usuario ya tenga permiso real para verla (mismo chequeo que hace de forma
6+
nativa la acción member_list cuando ckan.auth.public_user_details=False). #}
7+
{% block content_primary_nav %}
8+
{{ h.build_nav_icon(group_type + '.read', h.humanize_entity_type('package', dataset_type, 'content tab') or _('Datasets'), id=group_dict.name, icon='sitemap') }}
9+
{% if h.check_access('group_show', {'id': group_dict.id, 'object_type': 'user'}) %}
10+
{{ h.build_nav_icon(group_type + '.members', _('Members'), id=group_dict.name, icon='users') }}
11+
{% endif %}
12+
{{ h.build_nav_icon(group_type + '.about', _('About'), id=group_dict.name, icon='info-circle') }}
13+
{% endblock %}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{% ckan_extends %}
2+
3+
{# Sidebar de la organización: solo la cantidad de datasets — sin seguidores
4+
ni miembros, que no le aportan nada al visitante del portal. #}
5+
{% block nums %}
6+
{% set dataset_type = h.default_package_type() %}
7+
<div class="nums">
8+
<dl>
9+
<dt>{{ h.humanize_entity_type('package', dataset_type, 'facet label') or _('Datasets') }}</dt>
10+
<dd>{{ h.SI_number_span(organization.package_count) }}</dd>
11+
</dl>
12+
</div>
13+
{% endblock %}

ckanext/gobar_theme/templates/organization/snippets/organization_list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
{% else %}
1010
{% set top_nodes = h.group_tree(organizations=organizations, type_='organization') %}
1111
{% endif %}
12-
{% snippet 'organization/snippets/organization_tree.html', top_nodes=top_nodes %}
12+
{% snippet 'organization/snippets/organization_tree.html', top_nodes=top_nodes, expand_all=q %}
Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
{#
2-
Override del árbol de ckanext-hierarchy: misma recursión y highlight de
3-
búsqueda, pero cada nodo como fila con logo y cantidad de datasets, y sin el
4-
asset viejo de hierarchy (los estilos viven en gobar-base.css).
2+
Override del árbol de ckanext-hierarchy según el handoff de diseño 2a:
3+
árbol tipo explorador de directorios, sin contenedor propio. Los padres
4+
son <details> nativos (colapsados por defecto, varios abiertos a la vez); el
5+
nombre navega, el resto de la fila expande/colapsa. Estilos en gobar-base.css.
56

6-
top_nodes - nodos raíz de h.group_tree() (name/title/highlighted/children)
7+
top_nodes - nodos raíz de h.group_tree() (name/title/highlighted/children)
8+
expand_all - abrir todos los padres (se usa cuando hay búsqueda activa)
79
#}
810
{% set org_details = h.gobar_org_details_by_name() %}
911

10-
<ul class="hierarchy-tree-top gobar-org-tree">
11-
{% for node in top_nodes recursive %}
12-
{% set org = org_details.get(node.name) %}
13-
<li id="node_{{ node.name }}"{% if node.highlighted %} class="highlighted"{% endif %}>
14-
<a href="{{ h.url_for('organization.read', id=node.name) }}" class="gobar-org-row">
15-
<span class="gobar-org-row-name">{{ node.title }}</span>
16-
{% if org %}
17-
<span class="gobar-org-row-count">{{ org.package_count }} datasets</span>
12+
<ul class="gobar-org-tree">
13+
{% for node in top_nodes recursive %}
14+
{% set org = org_details.get(node.name) %}
15+
<li id="node_{{ node.name }}"{% if node.highlighted %} class="highlighted"{% endif %}>
16+
{% if node.children %}
17+
<details class="gobar-org-branch"{% if expand_all or node.highlighted %} open{% endif %}>
18+
<summary class="gobar-org-row">
19+
<a href="{{ h.url_for('organization.read', id=node.name) }}" class="gobar-org-row-name">{{ node.title }}</a>
20+
{% if org %}<span class="gobar-org-row-count">{{ org.package_count }} datasets</span>{% endif %}
21+
</summary>
22+
<ul class="gobar-org-children">{{ loop(node.children) }}</ul>
23+
</details>
24+
{% else %}
25+
<div class="gobar-org-row">
26+
<a href="{{ h.url_for('organization.read', id=node.name) }}" class="gobar-org-row-name">{{ node.title }}</a>
27+
{% if org %}<span class="gobar-org-row-count">{{ org.package_count }} datasets</span>{% endif %}
28+
</div>
1829
{% endif %}
19-
</a>
20-
{% if node.children %}
21-
<ul class="hierarchy-tree">{{ loop(node.children) }}</ul>
22-
{% endif %}
23-
</li>
24-
{% endfor %}
30+
</li>
31+
{% endfor %}
2532
</ul>

0 commit comments

Comments
 (0)