Move badge code to separate file
This commit is contained in:
20
_includes/badge.html
Normal file
20
_includes/badge.html
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{% if include.link %}
|
||||||
|
<a
|
||||||
|
href="{{ link }}" class="badge badge-{{ include.color | default: "info" }}"
|
||||||
|
{% if include.tooltip %}
|
||||||
|
data-toggle="tooltip"
|
||||||
|
title="{{ include.tooltip }}"><i class="{{ include.icon | default: "far fa-question-circle"}}"></i> {{ include.text }}
|
||||||
|
{% else %}><i class="{{ include.icon | default: "fas fa-external-link-alt"}}"></i> {{ include.text }}{% endif %}
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
|
<span
|
||||||
|
class="badge badge-{{ include.color | default: "info" }}"
|
||||||
|
{% if include.tooltip %}
|
||||||
|
data-toggle="tooltip"
|
||||||
|
title="{{ include.tooltip }}"
|
||||||
|
> <i class="{{ include.icon | default: "far fa-question-circle"}}"></i> {{include.text}}
|
||||||
|
{% else %}
|
||||||
|
> {% if include.icon %}<i class="{{ include.icon }}"></i>{% endif %} {{include.text}}
|
||||||
|
{% endif %}
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
@ -45,7 +45,7 @@
|
|||||||
{% assign label_data = label | split:"::" %}
|
{% assign label_data = label | split:"::" %}
|
||||||
{% for label_attr in label_data %}
|
{% for label_attr in label_data %}
|
||||||
{% assign attr = label_attr | split:"==" %}
|
{% assign attr = label_attr | split:"==" %}
|
||||||
{% if attr[0] == "color" }
|
{% if attr[0] == "color" %}
|
||||||
{% assign color = attr[1] %}
|
{% assign color = attr[1] %}
|
||||||
{% elsif attr[0] == "link" %}
|
{% elsif attr[0] == "link" %}
|
||||||
{% assign link = attr[1] %}
|
{% assign link = attr[1] %}
|
||||||
@ -57,26 +57,13 @@
|
|||||||
{% assign tooltip = attr[1] %}
|
{% assign tooltip = attr[1] %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if link %}
|
{% include badge.html
|
||||||
<a
|
link=link
|
||||||
href="{{ link }}" class="badge badge-{{ color | default: "info" }}"
|
color=color
|
||||||
{% if tooltip %}
|
text=text
|
||||||
data-toggle="tooltip"
|
icon=icon
|
||||||
title="{{ tooltip }}"><i class="{{ icon | default: "far fa-question-circle"}}"></i> {{ text }}
|
tooltip=tooltip
|
||||||
{% else %}><i class="{{ icon | default: "fas fa-external-link-alt"}}"></i> {{ text }}{% endif %}
|
%}
|
||||||
</a>
|
|
||||||
{% else %}
|
|
||||||
<span
|
|
||||||
class="badge badge-{{ color | default: "info" }}"
|
|
||||||
{% if tooltip %}
|
|
||||||
data-toggle="tooltip"
|
|
||||||
title="{{ tooltip }}"
|
|
||||||
> <i class="{{ icon | default: "far fa-question-circle"}}"> {{text}}
|
|
||||||
{% else %}
|
|
||||||
> {% if icon %}<i class="{{ icon }}"></i>{% endif %} {{text}}
|
|
||||||
{% endif %}
|
|
||||||
</span>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
|
Reference in New Issue
Block a user