mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
wip: display tags in maps list
This commit is contained in:
parent
db72bfad8d
commit
e24695b68c
3 changed files with 22 additions and 1 deletions
|
@ -417,6 +417,10 @@ class Map(NamedModel):
|
|||
datalayer.clone(map_inst=new)
|
||||
return new
|
||||
|
||||
def get_tags_display(self):
|
||||
labels = dict(settings.UMAP_TAGS)
|
||||
return [(t, labels.get(t, t)) for t in self.tags]
|
||||
|
||||
@classproperty
|
||||
def extra_schema(self):
|
||||
return {
|
||||
|
|
|
@ -171,7 +171,17 @@ h2.tabs a:hover {
|
|||
.more_button {
|
||||
min-height: var(--map-fragment-height);
|
||||
}
|
||||
|
||||
.tag-list {
|
||||
margin-top: var(--text-margin);
|
||||
margin-bottom: var(--text-margin);
|
||||
}
|
||||
.tag-list li {
|
||||
border: 1px solid var(--color-darkCyan);
|
||||
border-radius: 3vmin;
|
||||
display: inline-block;
|
||||
padding: var(--button-padding-small);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* **************************** */
|
||||
/* colors */
|
||||
|
|
|
@ -4,6 +4,13 @@
|
|||
<div>
|
||||
{% map_fragment map_inst prefix=prefix page=request.GET.p %}
|
||||
<hgroup>
|
||||
{% if map_inst.tags %}
|
||||
<ul class="tag-list">
|
||||
{% for tag, label in map_inst.get_tags_display %}
|
||||
<li><a href="{% url 'search' %}?tags={{ tag }}">{{ label }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
<h3><a href="{{ map_inst.get_absolute_url }}">{{ map_inst.name }}</a></h3>
|
||||
{% with author=map_inst.get_author %}
|
||||
{% if author %}
|
||||
|
|
Loading…
Reference in a new issue