Skip to content

Commit

Permalink
Display tags
Browse files Browse the repository at this point in the history
  • Loading branch information
U039b committed Sep 22, 2024
1 parent 8730207 commit f7ecac6
Show file tree
Hide file tree
Showing 18 changed files with 71 additions and 11 deletions.
5 changes: 4 additions & 1 deletion colander/templates/actor/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

<div class="row justify-content-center">
<div class="col-md-12 mt-2">
<h2><i class="nf {{ actor.type.nf_icon }} text-primary"></i> {{ actor.name }}</h2>
<h2>{% include "icons/pills.html" with elt=actor %} {{ actor.name }}</h2>
{% if actor.attributes.tags %}
<div class="my-2">{% include "helpers/tags.html" with entity=actor %}</div>
{% endif %}
<div class="mb-3">
{% if actor.description %}
{{ actor.description | markdownify }}
Expand Down
12 changes: 11 additions & 1 deletion colander/templates/actor/list_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="card m-1 shadow-sm bg-secondary-light border-secondary">
<div class="card-body p-2">
<div class="row">
<div class="col-md-12 text-truncate">
<div class="col-md-8 text-truncate border-end border-secondary">
<div class="border-bottom border-secondary">
{% include "icons/actor_icon.html" with c="h4 text-primary" %}
<a class="h4" href="{% url "collect_actor_details_view" case_id=actor.case.id pk=actor.id %}">
Expand Down Expand Up @@ -32,6 +32,16 @@
</div>
</div>
</div>
<div class="col-md-4 text-truncate ">
<div class="row">
<div class="col">
{% include "tlp/show_tlp_pap.html" with element=actor %}
{% if actor.attributes.tags %}
{% include "helpers/tags.html" with entity=actor %}
{% endif %}
</div>
</div>
</div>
</div>
</div>
<div class="card-footer bg-transparent border-secondary m-0 p-1 text-end">
Expand Down
3 changes: 3 additions & 0 deletions colander/templates/artifact/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<div class="row justify-content-center">
<div class="col-md-12 mt-2">
<h2>{% include "icons/pills.html" with elt=artifact %} {{ artifact.original_name }}</h2>
{% if artifact.attributes.tags %}
<div class="my-2">{% include "helpers/tags.html" with entity=artifact %}</div>
{% endif %}
<div class="mb-3">
{% if artifact.description %}
{{ artifact.description | markdownify }}
Expand Down
3 changes: 3 additions & 0 deletions colander/templates/artifact/list_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
<div class="row">
<div class="col">
{% include "tlp/show_tlp_pap.html" with element=artifact %}
{% if artifact.attributes.tags %}
{% include "helpers/tags.html" with entity=artifact %}
{% endif %}
<div class="small">
{% if artifact.has_been_processed %}
{% include "icons/id_icon.html" with c="text-primary" %}
Expand Down
5 changes: 4 additions & 1 deletion colander/templates/data_fragment/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

<div class="row justify-content-center">
<div class="col-md-12 mt-2">
<h2><i class="nf {{ data_fragment.type.nf_icon }} text-primary"></i> {{ data_fragment.name }}</h2>
<h2>{% include "icons/pills.html" with elt=data_fragment %} {{ data_fragment.name }}</h2>
{% if data_fragment.attributes.tags %}
<div class="my-2">{% include "helpers/tags.html" with entity=data_fragment %}</div>
{% endif %}
<div class="mb-3">
{% if data_fragment.description %}
{{ data_fragment.description | markdownify }}
Expand Down
12 changes: 11 additions & 1 deletion colander/templates/data_fragment/list_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="card m-1 shadow-sm bg-secondary-light border-secondary">
<div class="card-body p-2">
<div class="row">
<div class="col-md-12 text-truncate">
<div class="col-md-8 text-truncate border-end border-secondary">
<div class="border-bottom border-secondary">
{% include "icons/data_fragment_icon.html" with c="h4 text-primary" %}
<a class="h4" href="{% url "collect_data_fragment_details_view" case_id=data_fragment.case.id pk=data_fragment.id %}">
Expand Down Expand Up @@ -32,6 +32,16 @@
</div>
</div>
</div>
<div class="col-md-4 text-truncate ">
<div class="row">
<div class="col">
{% include "tlp/show_tlp_pap.html" with element=data_fragment %}
{% if data_fragment.attributes.tags %}
{% include "helpers/tags.html" with entity=data_fragment %}
{% endif %}
</div>
</div>
</div>
</div>
</div>
<div class="card-footer bg-transparent border-secondary m-0 p-1 text-end">
Expand Down
3 changes: 3 additions & 0 deletions colander/templates/device/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<div class="row justify-content-center">
<div class="col-md-12 mt-2">
<h2>{% include "icons/pills.html" with elt=device %} {{ device.name }}</h2>
{% if device.attributes.tags %}
<div class="my-2">{% include "helpers/tags.html" with entity=device %}</div>
{% endif %}
<div class="mb-3">
{% if device.description %}
{{ device.description | markdownify }}
Expand Down
3 changes: 3 additions & 0 deletions colander/templates/device/list_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
<div class="row">
<div class="col">
{% include "tlp/show_tlp_pap.html" with element=device %}
{% if device.attributes.tags %}
{% include "helpers/tags.html" with entity=device %}
{% endif %}
{% if device.operated_by %}
<div class="small">
{% include "icons/actor_icon.html" with c="text-primary" %}
Expand Down
3 changes: 3 additions & 0 deletions colander/templates/event/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<div class="row justify-content-center">
<div class="col-md-12 mt-2">
<h2>{% include "icons/pills.html" with elt=event %} {{ event.name }}</h2>
{% if event.attributes.tags %}
<div class="my-2">{% include "helpers/tags.html" with entity=event %}</div>
{% endif %}
<div class="mb-3">
{% if event.description %}
{{ event.description | markdownify }}
Expand Down
3 changes: 3 additions & 0 deletions colander/templates/event/list_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
<div class="row">
<div class="col">
{% include "tlp/show_tlp_pap.html" with element=event %}
{% if event.attributes.tags %}
{% include "helpers/tags.html" with entity=event %}
{% endif %}
<div class="">
<span class="">
{% include "icons/date_icon.html" with c="text-primary" %}
Expand Down
7 changes: 7 additions & 0 deletions colander/templates/helpers/tags.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% load colander_tags %}

{% if entity.attributes.tags %}
{% for t in entity.attributes.tags|split:"," %}
<span class="badge bg-secondary mx-1"><i class="nf nf-fa-tag"></i> {{ t }}</span>
{% endfor %}
{% endif %}
3 changes: 3 additions & 0 deletions colander/templates/observable/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<div class="row justify-content-center">
<div class="col-md-12 mt-2">
<h2>{% include "icons/pills.html" with elt=observable %} {{ observable.name }}</h2>
{% if observable.attributes.tags %}
<div class="my-2">{% include "helpers/tags.html" with entity=observable %}</div>
{% endif %}
<div class="mb-3">
{% if observable.description %}
{{ observable.description | markdownify }}
Expand Down
5 changes: 4 additions & 1 deletion colander/templates/observable/list_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@
<div class="row">
<div class="col">
{% include "tlp/show_tlp_pap.html" with element=observable %}
{% if observable.attributes.tags %}
{% include "helpers/tags.html" with entity=observable %}
{% endif %}
{% if observable.is_malicious %}
<div class="badge bg-danger">
Malicious
</div>
{% endif %}
{% endif %}
<div class="small">
{% include "icons/event_icon.html" with c="text-primary" %}
{{ observable.event_count }} events
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ <h3>{% include "icons/pills.html" with elt=entity %} <samp>{{ entity.value }}</s
{% endfor %}
{% endif %}
{% if entity.attributes.tags %}
{% for t in entity.attributes.tags|split:"," %}
<span class="badge bg-secondary"><i class="nf nf-fa-tag"></i> {{ t }}</span>
{% endfor %}
{% include "helpers/tags.html" %}
{% endif %}
</div>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
{% endfor %}
{% endif %}
{% if entity.attributes.tags %}
{% for t in entity.attributes.tags|split:"," %}
<span class="badge bg-secondary"><i class="nf nf-fa-tag"></i> {{ t }}</span>
{% endfor %}
{% include "helpers/tags.html" %}
{% endif %}
</div>
{% endif %}
Expand Down
1 change: 1 addition & 0 deletions colander/templates/pages/quick_search/m_result_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ <h3>{{ results|length }} entities found</h3>
<td>
{% include "icons/pills.html" with elt=r %}
<a href="{{ r.absolute_url }}"><samp>{{ r.value }}</samp></a>
{% include "helpers/tags.html" with entity=r %}
</td>
<td>
{{ r|model_name|capfirst }}
Expand Down
3 changes: 3 additions & 0 deletions colander/templates/threat/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<div class="row justify-content-center">
<div class="col-md-12 mt-2">
<h2>{% include "icons/pills.html" with elt=threat %} {{ threat.name }}</h2>
{% if threat.attributes.tags %}
<div class="my-2">{% include "helpers/tags.html" with entity=threat %}</div>
{% endif %}
<div class="mb-3">
{% if threat.description %}
{{ threat.description | markdownify }}
Expand Down
3 changes: 3 additions & 0 deletions colander/templates/threat/list_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
<div class="row">
<div class="col">
{% include "tlp/show_tlp_pap.html" with element=threat %}
{% if threat.attributes.tags %}
{% include "helpers/tags.html" with entity=threat %}
{% endif %}
</div>
</div>
</div>
Expand Down

0 comments on commit f7ecac6

Please sign in to comment.