Commits (6)
......@@ -126,7 +126,11 @@ class Category(models.Model):
return datasets_categories | dataset_main_category
def get_published_datasets_category_all_count(self):
return self.get_published_datasets_category_all().count()
main_published = list()
for ds in self.get_published_datasets_category_all():
if ds.is_main_published():
main_published.append(ds)
return len(main_published)
def __str__(self):
return self.name
......
......@@ -831,8 +831,6 @@ $sizes: (
height: $size;
width: $size;
$color: encodecolor(theme-color("primary"));
position: relative;
top: calc(1rem / 3);
background-repeat: no-repeat; /** disable repeating */
background-position: center; /** center the background image */
background-size: contain; /** optimal background size to fit in icon */
......@@ -841,6 +839,11 @@ $sizes: (
}
}
.icon-middle {
position: relative;
top: calc(1rem / 3);
}
/* spinner taken from https://tobiasahlin.com/spinkit/ */
@each $size-name, $size in $sizes {
.spinner-#{$size-name} {
......
......@@ -40,9 +40,9 @@
{{ dataset.publication_date }}
</div>
<div class="col-3 text-right">
<span class="i-label-md"></span> <b><a href="{% url "category_page" dataset.get_main_category.slug %}">{{ dataset.get_main_category }}</a></b>
<span class="i-label-md icon-middle"></span> <b><a href="{% url "category_page" dataset.get_main_category.slug %}">{{ dataset.get_main_category }}</a></b>
{% if dataset.get_categories %} <br>
<span class="i-labels-md"></span> {% for field in dataset.get_categories.all %}<a href="{% url "category_page" field.slug %}">{{ field|title }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}
<span class="i-labels-md icon-middle"></span> {% for field in dataset.get_categories.all %}<a href="{% url "category_page" field.slug %}">{{ field|title }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}
{% endif %}
</div>
</div>
......
......@@ -23,11 +23,11 @@
</div>
<div class="smallskip">
<span class="i-label-md"></span> {% trans "Main category" %}: {{ ds.get_main_category }}
<span class="i-label-md icon-middle"></span> {% trans "Main category" %}: <a href="{% url "category_page" ds.get_main_category.slug %}">{{ ds.get_main_category }}</a>
</div>
<div class="smallskip">
<span class="i-glasses-md"></span> {% trans "Curated by" %}:
<span class="i-glasses-md icon-middle"></span> {% trans "Curated by" %}:
{% for curator in ds.get_curators %}
<a href="{% url 'ddusers:detail' curator.uuid %}">{{ curator }}</a>{% if not forloop.last %}, {% endif %}
{% endfor %}
......@@ -35,7 +35,7 @@
{% if ds.get_categories %}
<div class="smallskip">
<span class="i-labels-md"></span> {% trans "Additional categories" %}: {% for field in ds.get_categories.all %}{{ field|title }}{% if not forloop.last %}, {% endif %}{% endfor %}
<span class="i-labels-md icon-middle"></span> {% trans "Additional categories" %}: {% for field in ds.get_categories.all %}<a href="{% url "category_page" field.slug %}">{{ field|title }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}
</div>
{% endif %}
......
......@@ -56,7 +56,7 @@
</button>
{% else %}
<button type="button" class="btn btn-success" ic-get-from="{% url 'dddatasets:prep_edit_publish_start' ds.uuid %}" ic-target="#ds-content">
{% trans "Submit to Curators" %}
{% trans "Submit" %}
</button>
{% endif %}
{% endif %}
......
{% load static i18n %}
<div class="smallskip">
<span class="i-label-md"></span> {% trans "Main category" %}: {{ ds.get_main_category }}
<span class="i-label-md icon-middle"></span> {% trans "Main category" %}: <a href="{% url "category_page" ds.get_main_category.slug %}">{{ ds.get_main_category }}</a>
</div>
<div class="smallskip">
<span class="i-glasses-md"></span> {% trans "Curated by" %}:
<span class="i-glasses-md "></span> {% trans "Curated by" %}:
{% for curator in ds.get_curators %}
<a href="{% url 'ddusers:detail' curator.uuid %}">{{ curator }}</a>{% if not forloop.last %}, {% endif %}
{% endfor %}
</div>
<div class="smallskip">
<span class="i-labels-md"></span> {% trans "Additional categories" %}: {% if ds.get_categories %}{% for field in ds.get_categories.all %}{{ field|title }}{% if not forloop.last %}, {% endif %}{% endfor %}{% else %}–{% endif %}
<span class="i-labels-md icon-middle"></span> {% trans "Additional categories" %}: {% if ds.get_categories %}{% for field in ds.get_categories.all %}<a href="{% url "category_page" field.slug %}">{{ field|title }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}{% else %}–{% endif %}
</div>