File tree Expand file tree Collapse file tree 7 files changed +67
-106
lines changed
client/themes/geonode/less
templates/geonode-mapstore-client/snippets Expand file tree Collapse file tree 7 files changed +67
-106
lines changed Original file line number Diff line number Diff line change 145145 font-size : 1.5rem ;
146146 padding : 0.5rem 0.75rem ;
147147 }
148- .gn-metadata-group {
148+ .gn-metadata-group : not ( .gn-metadata-group-view ) {
149149 max-width : 60ch ;
150150 }
151151 .field-description {
152152 font-size : @font-size-sm ;
153153 font-style : italic ;
154154 }
155- .gn-metadata-group-value {
156- padding : 0.5rem 0 ;
157- }
158155 .field {
159156 padding : 0 0.75rem ;
160- > label {
161- a {
162- position : absolute ;
163- transform : translate (-100% );
164- opacity : 0 ;
165- padding : 0 0.2rem ;
166- }
167- & :hover {
168- a {
169- opacity : 1 ;
170- }
171- }
172- }
173157 }
174158 .gn-metadata-group > .field-object {
175159 padding : 0.75rem ;
181165 font-size : 0.9rem ;
182166 border : none ;
183167 }
168+
169+ dl {
170+ display : grid ;
171+ grid-template-columns : max-content auto ;
172+ padding : 0 0.75rem ;
173+ dt {
174+ padding : 0.25rem ;
175+ text-align : right ;
176+ grid-column-start : 1 ;
177+ > label {
178+ margin : 0 ;
179+ a {
180+ position : absolute ;
181+ transform : translate (-100% );
182+ opacity : 0 ;
183+ padding : 0 0.2rem ;
184+ }
185+ & :hover {
186+ a {
187+ opacity : 1 ;
188+ }
189+ }
190+ }
191+ }
192+ dd {
193+ padding : 0.25rem ;
194+ grid-column-start : 2 ;
195+ }
196+ }
184197}
185198
186199.gn-metadata-page {
Original file line number Diff line number Diff line change 1+ < dt >
2+ < label id ="{{prefix}}_{{name}}__label " class ="control-label " for ="{{prefix}}_{{name}} ">
3+ < a href ="#{{prefix}}_{{name}}__label "> < i class ="fa fa-link "> </ i > </ a >
4+ {{ property.schema.title|default:name }}
5+ </ label >
6+ </ dt >
7+ < dd >
8+ < div class ="gn-metadata-group-value " id ="{{prefix}}_{{name}} ">
9+ {% include 'geonode-mapstore-client/snippets/metadata_field_value.html' with name=name property=property %}
10+ </ div >
11+ </ dd >
Original file line number Diff line number Diff line change 1+ {% if property.schema.format == 'date-time' %}
2+ {{property.value|date:"DATETIME_FORMAT"}}
3+ {% elif name == 'tkeywords' %}
4+ < ul >
5+ {% for t_id, tkeyword in property.value.items %}
6+ < li > {{tkeyword.schema.title|default:t_id}}</ li >
7+ < ul >
8+ {%for tkeyword_item in tkeyword.value %}
9+ < li >
10+ {{tkeyword_item.label}}
11+ </ li >
12+ {% endfor %}
13+ </ ul >
14+ {% endfor %}
15+ </ ul >
16+ {% else %}
17+ {{property.value}}
18+ {% endif %}
Original file line number Diff line number Diff line change 1-
1+ < dl >
22{% for name, property in metadata.items %}
3- < div class ="form-group field field-{{property.schema.type}} ">
4- < label id ="{{prefix}}_{{name}}__label " class ="control-label " for ="{{prefix}}_{{name}} ">
5- < a href ="#{{prefix}}_{{name}}__label "> < i class ="fa fa-link "> </ i > </ a >
6- {{ property.schema.title|default:name }}
7- </ label >
8- {% if property.schema.description %}
9- < p id ="{{prefix}}_{{name}}__description " class ="field-description ">
10- {{property.schema.description}}
11- </ p >
12- {% endif %}
13- {% if property.schema.type == 'object' %}
14- < div class ="gn-metadata-group-value " id ="{{prefix}}_{{name}} ">
15- {%with prefix=""|add:prefix|add:'_'|add:name metadata=property.value template_name="geonode-mapstore-client/snippets/metadata_fields.html" %}
16- {%include template_name %}
17- {%endwith%}
18- </ div >
19- {% elif property.schema.type == 'array' %}
20- < div class ="gn-metadata-group-value " id ="{{prefix}}_{{name}} ">
21- {% if property.schema.items.type == 'object' %}
22- < table class ="table ">
23- < thead >
24- {% for entry in property.schema.items.properties %}
25- < th > {{entry}}</ th >
26- {% endfor %}
27- </ thead >
28- < tbody >
29- {% for entry in property.value %}
30- < tr >
31- {% for key, val in entry.items %}
32- < td > {{val}}</ td >
33- {% endfor %}
34- </ tr >
35- {% endfor %}
36- </ tbody >
37- </ table >
38- {% else %}
39- {% for entry in property.value %}
40- {{entry}}
41- {% endfor %}
42- {% endif %}
43- </ div >
44- {% else %}
45- < div class ="gn-metadata-group-value " id ="{{prefix}}_{{name}} ">
46- {{property.value}}
47- </ div >
48- {% endif %}
49- </ div >
3+ {% block property %}
4+ {% include 'geonode-mapstore-client/snippets/metadata_field.html' with prefix=prefix name=name property=property %}
5+ {% endblock property %}
506{% endfor %}
7+ </ dl >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 22 < div class ="gn-metadata ">
33 < div class ="gn-metadata-container ">
44 < div class ="gn-metadata-layout ">
5- {% include 'geonode-mapstore-client/snippets/metadata_list.html' with metadata_groups=metadata_groups prefix='metadata' title=resource.title title_id='gn-metadata-title' %}
65 < div class ="gn-metadata-groups ">
76 < div id ="gn-metadata-title " class ="gn-metadata-title "> Metadata: {{resource.title}}</ div >
87 {% for group_key, metadata in metadata_groups.items %}
9- < div class ="gn-metadata-group ">
8+ < div class ="gn-metadata-group gn-metadata-group-view ">
109 < div class ="gn-metadata-group-title "> {{group_key}}</ div >
1110 {% include 'geonode-mapstore-client/snippets/metadata_fields.html' with metadata=metadata prefix='metadata' %}
1211 </ div >
Original file line number Diff line number Diff line change 11
22from django .shortcuts import render
33from django .utils .translation .trans_real import get_language_from_request
4- from django .utils import formats
54from dateutil import parser
65
76def _parse_value (value , schema ):
87 schema_type = schema .get ('type' )
98 format = schema .get ('format' )
109 if schema_type == 'string' and format in ['date-time' ]:
1110 if type (value ) == str :
12- return formats . date_format ( parser .parse (value ), "DATETIME_FORMAT" )
13- return formats . date_format ( value , "DATETIME_FORMAT" )
11+ return parser .parse (value )
12+ return value
1413 if schema_type == 'string' :
1514 if 'oneOf' in schema :
1615 for option in schema .get ('oneOf' ):
You can’t perform that action at this time.
0 commit comments