changing some accordion

This commit is contained in:
marco_carollo 2024-11-29 15:00:31 +01:00
parent 1deabd3aba
commit 82d2b368d9
8 changed files with 163 additions and 120 deletions

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"version":3,"sourceRoot":"","sources":["../scss/d4science_theme.scss","../scss/_variables.scss"],"names":[],"mappings":"AACQ,oFAER,0BACE,KACE,UAEF,GACE,WAGJ,kBACE,KACE,UAEF,GACE,WAGJ,KACE,sBACA,4CACA,sBACA,4BAEF,cACE,WACA,cAIA,cAHA,yBAHF,cAII,gBAGF,iBACE,eACA,kBACA,gBACA,iBACA,MClCU,QDmCV,sBACE,MCtCS,QDwCX,yBATF,iBAUI,gBAGJ,gBACE,eACA,kBACA,gBACA,yBAJF,gBAKI,gBAKN,iBACE,wBACA,sBACE,gCACA,0BACE,MC3DS,QD8Db,uBACE,gBACA,gCACA,YACA,6BACE,gBACA,aCpES,QDyEX,mCACE,aC1ES,QD8Eb,2BACE,YACA,mBACA,6BACE,MClFS,QDqFb,4BACE,WACA,mBACA,8BACE,MCzFS,QD8Ff,WACE,aACA,eACA,mBACA,uBACA,SACA,gBACA,wBACE,4BACA,kBACA,WCrGY,KDsGZ,mBACA,YACA,aACA,mBACA,eACA,gBACA,6BACA,yBACA,wBACA,8BACE,iBC9GgB,QDgHlB,iCACE,cACA,gBACA,WCnHgB,QDoHhB,mBACA,oBACA,aACA,uBACA,mBACA,MC9HS,QDmIf,eACE,6BACA,gBACA,kBACA,+BACE,aACA,eAEA,kBACA,UACA,SAEA,oCACE,OACA,2BACA,aACA,mBACA,QACA,kBACA,wBACA,MCtJY,QDwJZ,2CACE,MC1JO,QD2JP,iBACA,qDACE,8FAMN,0CACE,kBACA,YACA,WACA,UACA,iBCxKS,QDyKT,6CAEF,4CACE,aACA,aACA,sBAGF,mDACE,cAKN,QACE,eACA,gBACA,mBAGF,gBAEE,YACA,sBACA,gBAKA,iEACE,aACA,kBACA,yBACA,wBACA,6EACE,iBCvMgB,QD2MpB,yEACE,YACA,aACA,sBACA,uBACA,mBACA,kBACA,SACA,eACA,gBACA,iFACE,cACA,YAEF,6EACE,eACA,eACA,cACA,WClOS,QDmOT,kBACA,WAMJ,UACE,MCzOU,QD0OV,gBACA,eACA,eACE,MC/OS,QDmPX,8BACE,eACA,MCjPY,QDmPd,+BACE,eACA,gBACA,MC1PS,QD2PT,iBAOJ,sEAEE,YACA,mBACA,aACA,uBACA,yBACA,kBACA,iBCrQkB,QDsQlB,qBACA,wBACA,8EACE,MC9QS,QD+QT,gBAEF,8FACE,iBClRS,QDmRT,yBACA,sGACE,MChRc,QDiRd,gBACA,qBAQN,UACE,MChSW,QDoSf,MACE,iBClSc,KDmSd,eACE,YACA,gBAEF,qCACE","file":"d4science_theme.css"} {"version":3,"sourceRoot":"","sources":["../scss/d4science_theme.scss","../scss/_variables.scss"],"names":[],"mappings":"AACQ,oFAER,0BACE,KACE,UAEF,GACE,WAGJ,kBACE,KACE,UAEF,GACE,WAGJ,KACE,sBACA,4CACA,sBACA,4BAGF,GACE,eACA,gBAEF,cACE,WACA,cAIA,cAHA,yBAHF,cAII,gBAGF,iBACE,eACA,kBACA,gBACA,iBACA,MCvCU,QDwCV,sBACE,MC3CS,QD6CX,yBATF,iBAUI,gBAGJ,gBACE,eACA,kBACA,gBACA,yBAJF,gBAKI,gBAKN,6BACE,wBACA,uCACE,gCACA,+CACE,MChES,QDmEb,yCACE,gBACA,gCACA,YACA,qDACE,gBACA,aCzES,QD8EX,iEACE,aC/ES,QDmFb,iDACE,YACA,mBACA,qDACE,MCvFS,QD0Fb,mDACE,WACA,mBACA,uDACE,MC9FS,QDmGf,YACE,mBACA,iBACE,8BAGF,kBACE,8BAIJ,WACE,aACA,eACA,mBACA,uBACA,SACA,gBACA,wBACE,4BACA,kBACA,WCrHY,KDsHZ,mBACA,YACA,aACA,mBACA,eACA,gBACA,6BACA,yBACA,wBACA,8BACE,iBC9HgB,QDgIlB,iCACE,cACA,gBACA,WCnIgB,QDoIhB,mBACA,oBACA,aACA,uBACA,mBACA,MC9IS,QDmJf,eACE,6BACA,gBACA,kBACA,+BACE,aACA,eAEA,kBACA,UACA,SAEA,oCACE,OACA,2BACA,aACA,mBACA,QACA,kBACA,wBACA,MCtKY,QDwKZ,2CACE,MC1KO,QD2KP,iBACA,qDACE,8FAMN,0CACE,kBACA,YACA,WACA,UACA,iBCxLS,QDyLT,6CAEF,4CACE,aACA,aACA,sBAGF,mDACE,cAKN,QACE,eACA,gBACA,mBAGF,gBAEE,YACA,sBACA,gBAKA,iEACE,aACA,kBACA,yBACA,wBACA,6EACE,iBCvNgB,QD2NpB,yEACE,YACA,aACA,sBACA,uBACA,mBACA,kBACA,SACA,eACA,gBACA,iFACE,cACA,YAEF,6EACE,eACA,eACA,cACA,WClPS,QDmPT,kBACA,WAMJ,UACE,MCzPU,QD0PV,gBACA,eACA,eACE,MC/PS,QDmQX,8BACE,eACA,MCjQY,QDmQd,+BACE,eACA,gBACA,MC1QS,QD2QT,iBAOJ,sEAEE,YACA,mBACA,aACA,uBACA,yBACA,kBACA,iBCrRkB,QDsRlB,qBACA,wBACA,8EACE,MC9RS,QD+RT,gBAEF,8FACE,iBClSS,QDmST,yBACA,sGACE,MChSc,QDiSd,gBACA,qBAMR,oBACE,cACA,MC/Sa,QDgTb,gBAGF,iBACE,6BAGF,WACE,eACA,2BACE,SACA,2CACE,UAEE,iDACE,kBACA,YACA,wDACE,iBClUG,QDmUH,YACA,0DACE,MClUE,KDmUF,+DACE,MCpUA,KDwUN,mDACE,aACA,8BACA,MC1UM,QD2UN,gBAEA,wDACE,sCACA,MC/UI,QDqVd,6CACE,cACA,gBACA,eACA,8BACA,yBACA,oDACE,+TACA,wBAEF,mDACE,gBAGF,6DACE,gBACA,oEACE,4PAOV,MACE,iBC/Wc,KDgXd,eACE,YACA,gBAEF,qCACE","file":"d4science_theme.css"}

View File

@ -330,3 +330,4 @@ function openTab(event, tabId) {
indicator.style.transform = `translateX(${tabPosition}px)`; indicator.style.transform = `translateX(${tabPosition}px)`;
indicator.style.width = `${tabWidth}px`; indicator.style.width = `${tabWidth}px`;
} }

View File

@ -23,6 +23,11 @@ body {
background-size: cover; background-size: cover;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
h3{
font-size: 32px;
font-weight: 700;
}
.header-title { .header-title {
padding: 5%; padding: 5%;
max-width: 80%; max-width: 80%;
@ -53,7 +58,7 @@ body {
} }
} }
.search-bar-home { .search-bar-home, .search-bar{
transition: 0.3s all ease; transition: 0.3s all ease;
span { span {
border-radius: 20px 0px 0px 20px; border-radius: 20px 0px 0px 20px;
@ -93,6 +98,17 @@ body {
} }
} }
.search-bar {
margin-bottom: 3rem;
span {
border-radius: 8px 0px 0px 8px;
}
input {
border-radius: 0px 8px 8px 0px;
}
}
.tags-list { .tags-list {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@ -284,10 +300,71 @@ body {
} }
} }
.toolbar .home span {
display: block;
color: $primary_color;
font-weight: 700;
}
li.home { .main .secondary {
i{ padding-right: 0px !important;
color:$primary_color }
.accordion {
margin: 8px 0px;
.accordion-item {
border: 0;
.accordion-body {
padding: 0;
ul {
li {
border-radius: 0px;
border: none;
&.active {
background-color: $primary_color;
border: none;
a {
color: $neutral_color;
span {
color: $neutral_color;
}
}
}
a {
display: flex;
justify-content: space-between;
color: $paragraph_color;
font-weight: 700;
span {
background-color: rgba(241, 242, 242, 0.2);
color: $paragraph_color;
}
}
}
}
}
.accordion-button {
color: #4e4e4f;
font-weight: 700;
font-size: 16px;
border-radius: 8px 8px 0px 0px;
background-color: #f1f2f2;
&::after {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' class='bi bi-plus-lg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 2a.5.5 0 0 1 .5.5v5h5a.5.5 0 0 1 0 1h-5v5a.5.5 0 0 1-1 0v-5h-5a.5.5 0 0 1 0-1h5v-5A.5.5 0 0 1 8 2'/%3E%3C/svg%3E");
transition: 0.3s all ease;
}
&:focus {
box-shadow: none;
}
&:not(.collapsed) {
box-shadow: none;
&::after {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' class='bi bi-dash' viewBox='0 0 16 16'%3E%3Cpath d='M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8'/%3E%3C/svg%3E");
}
}
}
} }
} }
@ -298,6 +375,6 @@ li.home {
box-shadow: none; box-shadow: none;
} }
.toolbar .breadcrumb .active a { .toolbar .breadcrumb .active a {
font-weight:normal font-weight: normal;
} }
} }

View File

@ -45,7 +45,7 @@
</div> </div>
{% endblock %} {% endblock %}
<div class="row wrapper{% block wrapper_class %}{% endblock %}{% if self.secondary()|trim == '' or c.action=='resource_read' %} no-nav{% endif %}"> <div class="row {% block wrapper_class %}{% endblock %}{% if self.secondary()|trim == '' or c.action=='resource_read' %} no-nav{% endif %}">
{# {#
The pre_primary block can be used to add content to before the The pre_primary block can be used to add content to before the
rendering of the main content columns of the page. rendering of the main content columns of the page.

View File

@ -1,100 +1,50 @@
{# {% block facet_list %}
Construct a facet module populated with links to filtered results.
name
The field name identifying the facet field, eg. "tags"
title
The title of the facet, eg. "Tags", or "Tag Cloud"
label_function
Renders the human-readable label for each facet value.
If defined, this should be a callable that accepts a `facet_item`.
eg. lambda facet_item: facet_item.display_name.upper()
By default it displays the facet item's display name, which should
usually be good enough
if_empty
A string, which if defined, and the list of possible facet items is empty,
is displayed in lieu of an empty list.
count_label
A callable which accepts an integer, and returns a string. This controls
how a facet-item's count is displayed.
extras
Extra info passed into the add/remove params to make the url
alternative_url
URL to use when building the necessary URLs, instead of the default
ones returned by url_for. Useful eg for dataset types.
hide_empty
Do not show facet if there are none, Default: false.
within_tertiary
Boolean for when a facet list should appear in the the right column of the
page and not the left column.
#}
{% block facet_list %}
{% set hide_empty = hide_empty or false %} {% set hide_empty = hide_empty or false %}
{% with items = items or h.get_facet_items_dict(name) %} {% with items = items or h.get_facet_items_dict(name) %}
{% if items or not hide_empty %} {% if items or not hide_empty %}
{% if within_tertiary %} <div class="accordion" id="facetAccordion">
{% set nav_class = 'nav nav-pills nav-stacked' %} <div class="accordion-item">
{% set nav_item_class = ' ' %} <h2 class="accordion-header" id="heading-{{ name }}">
{% set wrapper_class = 'nav-facet nav-facet-tertiary' %} <button
{% endif %} class="accordion-button collapsed"
{% block facet_list_item %} type="button"
<section class="{{ wrapper_class or 'module module-narrow module-shallow' }}"> data-bs-toggle="collapse"
{% block facet_list_heading %} data-bs-target="#collapse-{{ name }}"
<h2 class="module-heading"> aria-expanded="false"
<i class="icon-medium icon-filter"></i> aria-controls="collapse-{{ name }}">
{% set title = title or h.get_facet_title(name) %} {% set title = title or h.get_facet_title(name) %}
{{ title }} {{ title }}
</button>
</h2> </h2>
{% endblock %} <div
id="collapse-{{ name }}"
class="accordion-collapse collapse"
aria-labelledby="heading-{{ name }}"
data-bs-parent="#facetAccordion">
<div class="accordion-body">
{% block facet_list_items %} {% block facet_list_items %}
{% with items = items or h.get_facet_items_dict(name) %}
{% if items %}
<nav>
<ul class="{{ nav_class or 'unstyled nav nav-simple nav-facet' }}">
{% for item in items %}
{% if items %}
<ul class="list-group">
{% for item in items %}
{% set href = h.remove_url_param(name, item.name, extras=extras, alternative_url=alternative_url) if item.active else h.add_url_param(new_params={name: item.name}, extras=extras, alternative_url=alternative_url) %} {% set href = h.remove_url_param(name, item.name, extras=extras, alternative_url=alternative_url) if item.active else h.add_url_param(new_params={name: item.name}, extras=extras, alternative_url=alternative_url) %}
{% set label = label_function(item) if label_function else item.display_name %} {% set label = label_function(item) if label_function else item.display_name %}
{# Updated by Francesco Mangiacrapa, see #11747 #}
{#
{% set label_truncated = h.truncate(label, 22) if not label_function else label %}
#}
{% set count = count_label(item['count']) if count_label else ('(%d)' % item['count']) %} {% set count = count_label(item['count']) if count_label else ('(%d)' % item['count']) %}
<li class="{{ nav_item_class or 'nav-item' }}{% if item.active %} active{% endif %}"> <li class="list-group-item {% if item.active %} active{% endif %}">
<a href="{{ href }}" title="{{ label if label != label_truncated else '' }}"> <a href="{{ href }}" title="{{ label }}">
<span>{{ label }} </span><span style="font-size: 12px">{{ count }}</span> {{ label }} <span class="badge">{{ count }}</span>
</a> </a>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
</nav>
<p class="module-footer">
{% if h.get_param_int('_%s_limit' % name) %}
{% if h.has_more_facets(name) %}
<a href="{{ h.remove_url_param('_%s_limit' % name, replace=0, extras=extras, alternative_url=alternative_url) }}" class="read-more">{{ _('Show More {facet_type}').format(facet_type=title) }}</a>
{% endif %}
{% else %} {% else %}
<a href="{{ h.remove_url_param('_%s_limit' % name, extras=extras, alternative_url=alternative_url) }}" class="read-more">{{ _('Show Only Popular {facet_type}').format(facet_type=title) }}</a> <p>{{ _('There are no {facet_type} that match this search').format(facet_type=title) }}</p>
{% endif %} {% endif %}
</p> {% endblock %}
{% else %} </div>
<p class="module-content empty">{{ _('There are no {facet_type} that match this search').format(facet_type=title) }}</p> </div>
</div>
</div>
{% endif %} {% endif %}
{% endwith %} {% endwith %}
{% endblock %} {% endblock %}
</section>
{% endblock %}
{% endif %}
{% endwith %}
{% endblock %}

View File

@ -1,6 +1,6 @@
{# Used to insert the home icon into a breadcrumb #} {# Used to insert the home icon into a breadcrumb #}
<li class="home"> <li class="home">
<a href="{{ h.url_for('home.index') }}" aria-label="{{ _('Home') }}" <a href="{{ h.url_for('home.index') }}" aria-label="{{ _('Home') }}"
><i class="fa fa-home"></i><span> {{ _('Home') }}</span></a ><span> {{ _('Home') }}</span></a
> >
</li> </li>

View File

@ -9,16 +9,31 @@
<form {% if form_id %}id="{{ form_id }}" {% endif %}class="search-form{% if no_bottom_border %} no-bottom-border{% endif %}" method="get" data-module="select-switch"> <form {% if form_id %}id="{{ form_id }}" {% endif %}class="search-form{% if no_bottom_border %} no-bottom-border{% endif %}" method="get" data-module="select-switch">
{% block search_input %} {% block search_input %}
<div class="input-group search-input-group"> <div class="search-bar">
<input aria-label="{% block header_site_search_label %}{{ placeholder }}{% endblock %}" id="field-giant-search" type="text" class="form-control input-lg" name="q" value="{{ query }}" autocomplete="off" placeholder="{{ placeholder }}"> <div class="input-group mb-3">
{% block search_input_button %} <span class="input-group-text border-end-0 bg-white" id="basic-addon1">
<span class="input-group-btn"> <img
<button class="btn btn-default btn-lg" type="submit" value="search" aria-label="{{_('Submit')}}"> src="/catalog/searchIcon.svg"
<i class="fa fa-search"></i> alt="Search Icon"
</button> width="16"
height="16"
/>
</span> </span>
{% endblock %} <input
type="text"
id="field-main-search"
name="q"
value="{{ query }}"
autocomplete="off"
class="form-control border-start-0"
placeholder="{{ placeholder }}"
aria-label="{% block header_site_search_label %}{{ placeholder }}{% endblock %}"
/>
</div> </div>
</div>
{% endblock %} {% endblock %}
{% block search_search_fields %} {% block search_search_fields %}
@ -47,9 +62,9 @@
{% block search_title %} {% block search_title %}
{% if not error %} {% if not error %}
<h1>{% snippet 'snippets/search_result_text.html', query=query, count=count, type=type %}</h1> <h3>{% snippet 'snippets/search_result_text.html', query=query, count=count, type=type %}</h3>
{% else %} {% else %}
<h2>Error</h2> <h3>Error</h3>
{% endif %} {% endif %}
{% endblock %} {% endblock %}