Remove support for link icon strings

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2019-04-22 18:31:10 -04:00
parent e12098abe4
commit 966641c447
6 changed files with 9 additions and 13 deletions

View File

@@ -113,7 +113,8 @@
* Fix issue installing scoped NPM packages.
* Add new icons classes and templates.
* Add support for link icon path imports.
* Remove support for link icon strings.
3.1.11 (2019-04-XX)
===================
* Fix multiple tag selection wizard step.

View File

@@ -145,6 +145,7 @@ Other changes
* Fix issue installing scoped NPM packages.
* Add new icons classes and templates.
* Add support for link icon path imports.
* Remove support for link icon strings.
Removals
--------

View File

@@ -20,9 +20,11 @@ class Collection(object):
def get_all(cls):
return sorted(cls._registry, key=lambda entry: entry._order)
def __init__(self, label, icon=None, icon_class=None, link=None, queryset=None, model=None, order=None):
def __init__(
self, label, icon_class=None, link=None, queryset=None, model=None,
order=None
):
self._label = label
self._icon = icon
self._icon_class = icon_class
self._link = link
self._queryset = queryset
@@ -39,7 +41,6 @@ class Collection(object):
self.label = self._label
self.url = None
if self._link:
self.icon = getattr(self._link, 'icon', self._icon)
self.icon_class = getattr(self._link, 'icon_class', self._icon_class)
self.url = reverse(viewname=self._link.view, args=self._link.args)
return ''

View File

@@ -4,7 +4,7 @@
<li class="text-center link-text-span" >{{ link.text }}</li>
{% else %}
{% if link.disabled %}
<a class="{{ link.html_extra_classes }} {% if link_classes %}{{ link_classes }} {% else %}btn {% if 'dangerous' in link.tags %}btn-danger{% else %}btn-primary{% endif %} btn-xs{% endif %} {% if link.active %}{{ link_class_active }}{% endif %} {% if 'new_window' in link.tags %}new_window{% endif %} disabled" disabled='disabled' style="cursor: default;" href="#">{% if link.icon %}<i class="hidden-xs hidden-sm hidden-md {{ link.icon }}"></i>{% endif %}{% if link.icon_class %}{{ link.icon_class.render }}{% endif %} {{ link.text }}{% if link.error %} - {{ link.error }}{% endif %}</a>{% if horizontal %}{% if not forloop.last %}&nbsp;{% endif %}{% endif %}
<a class="{{ link.html_extra_classes }} {% if link_classes %}{{ link_classes }} {% else %}btn {% if 'dangerous' in link.tags %}btn-danger{% else %}btn-primary{% endif %} btn-xs{% endif %} {% if link.active %}{{ link_class_active }}{% endif %} {% if 'new_window' in link.tags %}new_window{% endif %} disabled" disabled='disabled' style="cursor: default;" href="#">{% if link.icon_class %}{{ link.icon_class.render }}{% endif %} {{ link.text }}{% if link.error %} - {{ link.error }}{% endif %}</a>{% if horizontal %}{% if not forloop.last %}&nbsp;{% endif %}{% endif %}
{% else %}
<a
class="{{ link.html_extra_classes }} {% if link_classes %}{{ link_classes }} {% else %}btn {% if 'dangerous' in link.tags %}btn-danger{% else %}btn-primary{% endif %} btn-xs{% endif %} {% if link.active %}{{ link_class_active }}{% endif %} {% if 'new_window' in link.tags %}new_window{% endif %}"
@@ -13,10 +13,7 @@
{% endfor %}
href="{{ link.url }}"
>{% if link.icon %}{% if not hide_icon %}
<i class="hidden-xs hidden-sm hidden-md {{ link.icon }}"></i>
{% endif %}{% endif %}
{% if link.icon_class and not hide_icon %}{{ link.icon_class.render }}{% endif %}
>{% if link.icon_class and not hide_icon %}{{ link.icon_class.render }}{% endif %}
{{ link.text|default:'' }}{% if link.badge_text %}&nbsp;<span class="badge">{{ link.badge_text }}</span>
{% endif %}{% if link.error %} - {{ link.error }}{% endif %}
</a>{% if horizontal %}{% if not forloop.last %}&nbsp;{% endif %}{% endif %}

View File

@@ -4,9 +4,6 @@
{% if link|get_type == "<class 'mayan.apps.navigation.classes.Menu'>" %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true">
{% if link.icon %}
<i class="hidden-xs hidden-sm hidden-md {{ link.icon }}"></i>
{% endif %}
{% if link.icon_class %}{{ link.icon_class.render }}{% endif %}
{{ link.label }}
<span class="caret"></span>

View File

@@ -1,6 +1,5 @@
<div class="{% if div_class %}{{ div_class }}{% else %}col-xs-12 col-sm-6 col-md-4 col-lg-3{% endif %}">
<a class="btn btn-default btn-lg btn-block {% if 'new_window' in link.tags %}new_window{% endif %}" href="{{ link.url }}">
{% if link.icon %}<i class="{{ link.icon }} fa-2x"></i>{% endif %}
{% if link.icon_class %}<span style="font-size: 200%;">{{ link.icon_class.render }}</span>{% endif %}
<br>
{{ link.text }}