Skip to content

Commit

Permalink
description if available
Browse files Browse the repository at this point in the history
  • Loading branch information
Davide Arcuri committed Apr 5, 2024
1 parent 940383a commit 6d31a1c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
6 changes: 6 additions & 0 deletions orochi/templates/website/partial_indices.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
{% endif %}

<div class="btn-group float-end" role="group">
{% if status != 5 and description %}
<button type="button" class="btn btn-info-warning btn-sm error-index btn-log" data-log="{{description}}"
data-toggle="tooltip" data-placement="top" title="Dump Error">
<i class="fas fa-list-check"></i>
</button>
{% endif %}
<a href="{% url 'website:hex_view' index %}" class="btn btn-outline-dark hex-index btn-sm"
data-toggle="tooltip" data-placement="top" title="Hex View">
<i class="fas fa-asterisk"></i>
Expand Down
31 changes: 17 additions & 14 deletions orochi/templates/website/partial_note.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,30 @@ <h1 class="h4">
<i class="fas fa-robot me-1"></i>
{% endif %}
<span style="width: 90px; display: inline-block;">{{item.dump_name|truncatechars:10}}</span>

<span style="width: 85px; display: inline-block;" class="badge
{% if item.result == 'Not Started' %}
<span style="width: 85px; display: inline-block;" class="badge text-bg-light">{{item.result}}</span>
text-bg-light
{% elif item.result == 'Empty' %}
<span style="width: 85px; display: inline-block;" class="badge text-bg-success">{{item.result}}</span>
text-bg-success
{% elif item.result == 'Success' %}
<span style="width: 85px; display: inline-block;" class="badge text-bg-success">{{item.result}}</span>
text-bg-success
{% elif item.result == 'Running' %}
<span style="width: 85px; display: inline-block;" class="badge text-bg-info">{{item.result}}</span>
text-bg-info
{% elif item.result == 'Unsatisfied' %}
<span style="width: 85px; display: inline-block;" class="badge text-bg-warning">{{item.result}}</span>
{% elif item.result == 'Error' and item.description %}
<span style="width: 85px; display: inline-block;" class="badge text-bg-danger btn-log"
data-log="{{item.description}}">
{{item.result}} <i class="fas fa-indent" title="Log"></i>
</span>
{% elif item.result == 'Error' and not item.description %}
<span style="width: 85px; display: inline-block;" class="badge text-bg-danger btn-log"> {{item.result}}
</span>
text-bg-warning
{% elif item.result == 'Error' %}
text-bg-danger
{% elif item.result == 'Disabled' %}
<span style="width: 85px; display: inline-block;" class="badge text-bg-dark">{{item.result}}</span>
text-bg-dark
{% endif%}
{% if item.description %}
btn-log" data-log="{{item.description}}">{{item.result}} <i class="fas fa-indent" title="Log"></i>
{% else %}
">{{item.result}}
{% endif %}
</span>
</button>
</div>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion orochi/website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,7 @@ def index_f_and_f(dump_pk, user_pk, password=None, restart=None, move=True):
def create(request):
"""Manage new index creation"""
data = {}
errors = None

if request.method == "POST":
form = DumpForm(current_user=request.user, data=request.POST)
Expand Down Expand Up @@ -1316,7 +1317,6 @@ def create(request):
data["form_is_valid"] = False
else:
form = DumpForm(current_user=request.user)
errors = None

context = {"form": form, "errors": errors}
data["html_form"] = render_to_string(
Expand Down

0 comments on commit 6d31a1c

Please sign in to comment.