Skip to content

Commit

Permalink
Merge pull request #492 from rafsaf/djhtml
Browse files Browse the repository at this point in the history
add and run djhtml
  • Loading branch information
rafsaf committed Jul 13, 2024
2 parents b7c0dac + eb50f41 commit 75b16bb
Show file tree
Hide file tree
Showing 32 changed files with 3,163 additions and 3,165 deletions.
2 changes: 0 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@ repos:
rev: "3.0.6"
hooks:
- id: djhtml
- id: djcss
- id: djjs
662 changes: 331 additions & 331 deletions base/templates/base/base.html

Large diffs are not rendered by default.

174 changes: 87 additions & 87 deletions base/templates/base/base_planer.html
Original file line number Diff line number Diff line change
@@ -1,98 +1,98 @@
{% extends 'base/base.html' %}
{% load i18n %}
{% extends 'base/base.html' %}
{% load i18n %}
{% block title %}{% trans 'My outlines' %}{% endblock %}
{% block content %}
<div class="table-responsive">
<table class="table table-striped mt-3">
<thead style="background-color: teal;">
<tr style="color: white;">
<th class='text-nowrap' scope="col" style="border:1px solid teal">{% trans 'Outline Name' %}</th>
<th scope="col" style="border:1px solid teal">{% trans 'Date' %}</th>
<th scope="col" style="border:1px solid teal">{% trans 'Created' %}</th>
<th scope="col" style="border:1px solid teal">{% trans 'World' %}</th>
<th scope="col" style="border:1px solid teal">{% trans 'Ally' %}</th>
<th scope="col" style="border:1px solid teal">{% trans 'Enemy' %}</th>
<th scope="col" style="border:1px solid teal">{% trans 'Hide' %}</th>
<th scope="col" style="border:1px solid teal">{% trans 'Delete' %}</th>
</tr>
</thead>
<tbody>

{% for instance in object_list %}
<tr>
<td>
<a class="btn btn-secondary my-2" href="{% url 'base:planer_detail' instance.id %}" role="button">{{instance.name}}</a>
</td>
<td><p class="my-2 mt-3">{{instance.date}}</p></td>
<td><p class="my-2 mt-3">{{instance.created}}<br>{{instance.expires_in|safe}}</p></td>
<td><p class="my-2 mt-3">{{instance.world_human}}</p></td>
<td><p class="my-2 mt-3">{{instance.ally_tribe_tag}}</p></td>
<td><p class="my-2 mt-3">{{instance.enemy_tribe_tag}}</p></td>
<td>
{% if instance.status == 'active' %}

<form action="{% url 'base:planer_status' instance.id %}" method="POST">
{% csrf_token %}
<button onclick="this.disabled=true;this.form.submit();" class="btn btn-secondary my-2">{% trans 'Hide' %}</button>
</form>

{% else %}

<form action="{% url 'base:planer_status' instance.id %}" method="POST">
{% csrf_token %}
<button onclick="this.disabled=true;this.form.submit();" class="btn btn-secondary my-2">{% trans 'Show' %}</button>
</form>

{% endif %}

</td>
<td>
<div>
<button type="button" class="btn btn-secondary my-2" data-toggle="modal" data-target="#ValidationModal-{{instance.id}}">{% trans 'Delete' %}</button>
</div>

<div class="modal fade" id="ValidationModal-{{instance.id}}" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">{% trans 'Warning' %}</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<h4 class="md-correct2">{{instance.name}}</h4>
<p>{% trans "You will lose all progress on this outline. The orders (weights), targets, entered script results and any data will be deleted forever too. The generated links will remain valid as is, but you will no longer be able to access them through the Results tab. You may consider hiding this outline instead of deleting it." %}</p>
<div class="table-responsive">
<table class="table table-striped mt-3">
<thead style="background-color: teal;">
<tr style="color: white;">
<th class='text-nowrap' scope="col" style="border:1px solid teal">{% trans 'Outline Name' %}</th>
<th scope="col" style="border:1px solid teal">{% trans 'Date' %}</th>
<th scope="col" style="border:1px solid teal">{% trans 'Created' %}</th>
<th scope="col" style="border:1px solid teal">{% trans 'World' %}</th>
<th scope="col" style="border:1px solid teal">{% trans 'Ally' %}</th>
<th scope="col" style="border:1px solid teal">{% trans 'Enemy' %}</th>
<th scope="col" style="border:1px solid teal">{% trans 'Hide' %}</th>
<th scope="col" style="border:1px solid teal">{% trans 'Delete' %}</th>
</tr>
</thead>
<tbody>

<h5 class="md-error mt-2">{% trans "This operation cannot be undone!" %}</h5>

</div>
<div class="modal-footer">
{% for instance in object_list %}
<tr>
<td>
<a class="btn btn-secondary my-2" href="{% url 'base:planer_detail' instance.id %}" role="button">{{instance.name}}</a>
</td>
<td><p class="my-2 mt-3">{{instance.date}}</p></td>
<td><p class="my-2 mt-3">{{instance.created}}<br>{{instance.expires_in|safe}}</p></td>
<td><p class="my-2 mt-3">{{instance.world_human}}</p></td>
<td><p class="my-2 mt-3">{{instance.ally_tribe_tag}}</p></td>
<td><p class="my-2 mt-3">{{instance.enemy_tribe_tag}}</p></td>
<td>
{% if instance.status == 'active' %}

<form action="{% url 'base:planer_status' instance.id %}" method="POST">
{% csrf_token %}
<button onclick="this.disabled=true;this.form.submit();" class="btn btn-secondary my-2">{% trans 'Hide' %}</button>
</form>

<button id="dismiss-{{instance.id}}-btn" type="button" class="btn btn-secondary" data-dismiss="modal">
<b>{% trans 'Close' %}</b>
</button>
{% else %}

<form id="form-{{instance.id}}-form" action="{% url 'base:planer_delete' instance.id %}" method="POST">
<form action="{% url 'base:planer_status' instance.id %}" method="POST">
{% csrf_token %}
<button onclick="removeOutline(this,`dismiss-{{instance.id}}-btn`,`form-{{instance.id}}-form`,`{% trans 'Processing...' %}`)" class="btn btn-danger">{% trans 'Delete forever' %}</button>

<button onclick="this.disabled=true;this.form.submit();" class="btn btn-secondary my-2">{% trans 'Show' %}</button>
</form>

{% endif %}

</td>
<td>
<div>
<button type="button" class="btn btn-secondary my-2" data-toggle="modal" data-target="#ValidationModal-{{instance.id}}">{% trans 'Delete' %}</button>
</div>
</div>
</div>
</div>
</td>
{% endfor %}
</tbody>
</table>
</div>

{% if show_all == True %}
<p><a class="btn btn-outline-ocean my-3" href="{% url 'base:planer' %}" role="button">{% trans "Don't show hidden" %}</a></p>
{% else %}
<p><a class="btn btn-outline-ocean my-3" href="{% url 'base:planer_all' %}" role="button">{% trans 'Show hidden' %}</a></p>
{% endif %}

<div class="modal fade" id="ValidationModal-{{instance.id}}" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">{% trans 'Warning' %}</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<h4 class="md-correct2">{{instance.name}}</h4>
<p>{% trans "You will lose all progress on this outline. The orders (weights), targets, entered script results and any data will be deleted forever too. The generated links will remain valid as is, but you will no longer be able to access them through the Results tab. You may consider hiding this outline instead of deleting it." %}</p>

<h5 class="md-error mt-2">{% trans "This operation cannot be undone!" %}</h5>

</div>
<div class="modal-footer">

<button id="dismiss-{{instance.id}}-btn" type="button" class="btn btn-secondary" data-dismiss="modal">
<b>{% trans 'Close' %}</b>
</button>

<form id="form-{{instance.id}}-form" action="{% url 'base:planer_delete' instance.id %}" method="POST">
{% csrf_token %}
<button onclick="removeOutline(this,`dismiss-{{instance.id}}-btn`,`form-{{instance.id}}-form`,`{% trans 'Processing...' %}`)" class="btn btn-danger">{% trans 'Delete forever' %}</button>

</form>
</div>
</div>
</div>
</div>
</td>
{% endfor %}
</tbody>
</table>
</div>

{% if show_all == True %}
<p><a class="btn btn-outline-ocean my-3" href="{% url 'base:planer' %}" role="button">{% trans "Don't show hidden" %}</a></p>
{% else %}
<p><a class="btn btn-outline-ocean my-3" href="{% url 'base:planer_all' %}" role="button">{% trans 'Show hidden' %}</a></p>
{% endif %}

{% endblock %}

Expand Down
24 changes: 12 additions & 12 deletions base/templates/base/documentation.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{% extends 'base/base.html' %}
{% load i18n %} {% load static %}
{% load i18n %} {% load static %}
{% block title %}{% trans 'Documentation' %}{% endblock %}
{% block meta-content %}<meta name="description" content="{% trans 'Documentation of Tribal Wars Planer, professional tool for creating outlines for off-game coordinators.' %}"/>{% endblock %}
{% block content %}{% autoescape off %}
{% block content %}{% autoescape off %}

<div class="container" style="font-size: larger;max-width:900px;">
<article style="margin-left:-15px!important;margin-right:-15px;">
<div id="docs" ></div>
</article>
</div>
<div class="container" style="font-size: larger;max-width:900px;">
<article style="margin-left:-15px!important;margin-right:-15px;">
<div id="docs" ></div>
</article>
</div>
{% endautoescape %}
{% get_current_language as LANG %}
<script>
imagePopupActivate();
loadDocsPage(1, "docs", "{% static 'markdown/'|add:LANG|add:'/documentation.md' %}", true);
</script>
{% get_current_language as LANG %}
<script>
imagePopupActivate();
loadDocsPage(1, "docs", "{% static 'markdown/'|add:LANG|add:'/documentation.md' %}", true);
</script>

{% endblock %}
Loading

0 comments on commit 75b16bb

Please sign in to comment.