File tree Expand file tree Collapse file tree
ckanext/datavic_odp_theme Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,9 +123,17 @@ $primary-color: #0052C2;
123123}
124124
125125.dataset-api {
126+ ul {
127+ padding-right : 50px ;
128+ display : inline-flex ;
129+
130+ i {
131+ margin-right : 3px ;
132+ }
133+ }
134+
126135 li {
127136 display : inline ;
128- padding-right : 50px ;
129137 & :last-child {
130138 padding-right : 0 ;
131139 }
Original file line number Diff line number Diff line change @@ -79,19 +79,27 @@ <h4 class="search-result-organisation">
7979 {% endblock %}
8080 {% endif %}
8181 < ul class ="list-unstyled dataset-api ">
82- {% set digital_twin_resources = h.get_digital_twin_resources(package.id) %}
83- {% set featured_resource = h.featured_resource_preview(package) %}
84- {% if digital_twin_resources or featured_resource %}
85- < li class ="preview ">
86- {% if digital_twin_resources %}
87- < i class ="fa-solid fa-map-location-dot "> </ i >
88- {% endif %}
89- {% if featured_resource %}
90- < i class ="fa-solid fa-table "> </ i >
91- {% endif %}
92- {{ _('Preview') }}
93- </ li >
94- {% endif %}
82+ < ul >
83+ {% set dtv_resources = h.get_digital_twin_resources(package.id)|map(attribute="id")|list %}
84+ {% set featured_resource = h.featured_resource_preview(package) %}
85+
86+ {% if dtv_resources %}
87+ {% set dtv_preview_enabled = package.dtv_preview %}
88+ {% set dtv_exceeds_limit = h.dtv_exceeds_max_size_limit(dtv_resources[0]) %}
89+
90+ < li class ="preview {{ 'hidden' if dtv_exceeds_limit or not dtv_preview_enabled }} ">
91+ < i class ="fa-solid fa-map-location-dot "> </ i >
92+ < span class ="{{ 'hidden' if featured_resource }} "> {{ _('Preview') }}</ span >
93+ </ li >
94+ {% endif %}
95+
96+ {% if featured_resource %}
97+ < li class ="preview ">
98+ < i class ="fa-solid fa-table "> </ i > {{ _('Preview') }}
99+ </ li >
100+ {% endif %}
101+ </ ul >
102+
95103 {% set datastore_loaded_resources = h.datastore_loaded_resources(package) %}
96104 {% if datastore_loaded_resources %}
97105 < li class ="api ">
Original file line number Diff line number Diff line change @@ -1728,9 +1728,13 @@ nav {
17281728 float : right;
17291729 color : # 465870 ;
17301730 font-size : 0.875rem ; }
1731+ .dataset-api ul {
1732+ padding-right : 50px ;
1733+ display : inline-flex; }
1734+ .dataset-api ul i {
1735+ margin-right : 3px ; }
17311736 .dataset-api li {
1732- display : inline;
1733- padding-right : 50px ; }
1737+ display : inline; }
17341738 .dataset-api li : last-child {
17351739 padding-right : 0 ; }
17361740 .dataset-api i {
You can’t perform that action at this time.
0 commit comments