Skip to content

Commit

Permalink
Add extra metadata attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lenninlasd committed Oct 10, 2017
1 parent 3e9bc3e commit fe93dbc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions geonode/layers/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,18 @@ class Attribute(models.Model):
default=True)
display_order = models.IntegerField(_('display order'), help_text=_(
'specifies the order in which attribute should be displayed in identify results'), default=1)

searchable = models.BooleanField(
_('Searchable?'),
default=False)
created_dttm = models.DateTimeField(
auto_now_add=True)
date_format = models.CharField(
_('Date Format'),
max_length=255,
blank=True,
null=True)
last_modified = models.DateTimeField(auto_now=True)

# statistical derivations
count = models.IntegerField(
Expand Down
4 changes: 4 additions & 0 deletions geonode/layers/templates/layouts/panels.html
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,8 @@ <h4 class="modal-title" id="exampleModalLabel">Message box</h4>
<th>{% trans "Label" %}</th>
<th>{% trans "Description" %}</th>
<th>{% trans "Display Order" %}</th>
<th>{% trans "Visible" %}</th>
<th>{% trans "Searchable" %}</th>
</tr>
{% for form in attribute_form.forms %}
{% if form.attribute %}
Expand All @@ -527,6 +529,8 @@ <h4 class="modal-title" id="exampleModalLabel">Message box</h4>
<td>{{form.attribute_label}}</td>
<td>{{form.description}}</td>
<td>{{form.display_order}}</td>
<td>{{form.visible}}</td>
<td>{{form.searchable}}</td>
</tr>
{% endif %}
{% endfor %}
Expand Down
1 change: 1 addition & 0 deletions geonode/layers/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,7 @@ def layer_metadata(
la.attribute_label = form["attribute_label"]
la.visible = form["visible"]
la.display_order = form["display_order"]
la.searchable = form["searchable"]
la.save()

if new_poc is not None or new_author is not None:
Expand Down

0 comments on commit fe93dbc

Please sign in to comment.