Update rules list view

This commit is contained in:
sonny 2020-05-15 20:32:35 +02:00
parent 1ec81ff48c
commit ba2b5d0547
2 changed files with 63 additions and 33 deletions

View file

@ -6,42 +6,52 @@
<form class="form rules-form"> <form class="form rules-form">
{% csrf_token %} {% csrf_token %}
<div class="form__actions"> <section class="section form__section form__section--actions">
<input type="submit" class="button button--primary" formaction="{% url "news:collection:rules-enable" %}" formmethod="post" value="{% trans "Enable" %}" /> <fieldset class="fieldset form__fieldset">
<input type="submit" class="button button--primary" formaction="{% url "news:collection:rules-disable" %}" formmethod="post" value="{% trans "Disable" %}" /> <input type="submit" class="button button--primary" formaction="{% url "news:collection:rules-enable" %}" formmethod="post" value="{% trans "Enable" %}" />
<input type="submit" class="button button--error" formaction="{% url "news:collection:rules-delete" %}" formmethod="post" value="{% trans "Delete" %}"/> <input type="submit" class="button button--primary" formaction="{% url "news:collection:rules-disable" %}" formmethod="post" value="{% trans "Disable" %}" />
</div> <input type="submit" class="button button--error" formaction="{% url "news:collection:rules-delete" %}" formmethod="post" value="{% trans "Delete" %}"/>
<table class="table rules-table"> </fieldset>
<thead class="table__header rules-table__header">
<tr class="table__row rules-table__row"> <div class="form__actions">
<th class="table__heading rules-table__heading--select"> <a class="link button button--confirm" href="{% url "news:collection:rule-create" %}">{% trans "Add a rule" %}</a>
<input type="checkbox" id="select-all" data-input="rules" /> </div>
</th> </section>
<th class="table__heading rules-table__heading--name">{% trans "Name" %}</th>
<th class="table__heading rules-table__heading--category">{% trans "Category" %}</th> <section class="section form__section">
<th class="table__heading rules-table__heading--url">{% trans "URL" %}</th> <table class="table rules-table">
<th class="table__heading rules-table__heading--succeeded">{% trans "Successfuly ran" %}</th> <thead class="table__header rules-table__header">
<th class="table__heading rules-table__heading--enabled">{% trans "Enabled" %}</th>
<th class="table__heading rules-table__heading--link"></th>
</tr>
</thead>
<tbody class="table__body">
{% for rule in rules %}
<tr class="table__row rules-table__row"> <tr class="table__row rules-table__row">
<td class="table__item rules-table__item"><input name="rules" type="checkbox" value="{{ rule.pk }}" /></td> <th class="table__heading rules-table__heading--select">
<td class="table__item rules-table__item" title="{{ rule.name }}">{{ rule.name }}</td> <input type="checkbox" id="select-all" data-input="rules" />
<td class="table__item rules-table__item" title="{{ rule.category.name }}">{{ rule.category.name }}</td> </th>
<td class="table__item rules-table__item" title="{{ rule.url }}">{{ rule.url }}</td> <th class="table__heading rules-table__heading--name">{% trans "Name" %}</th>
<td class="table__item rules-table__item" title="{{ rule.succeeded }}">{{ rule.succeeded }}</td> <th class="table__heading rules-table__heading--category">{% trans "Category" %}</th>
<td class="table__item rules-table__item" title="{{ rule.enabled }}">{{ rule.enabled }}</td> <th class="table__heading rules-table__heading--url">{% trans "URL" %}</th>
<td class="table__item rules-table__item"> <th class="table__heading rules-table__heading--succeeded">{% trans "Successfuly ran" %}</th>
<a class="link" href="{% url "news:collection:rule-update" rule.pk %}"><i class="gg-pen"></i></a> <th class="table__heading rules-table__heading--enabled">{% trans "Enabled" %}</th>
</td> <th class="table__heading rules-table__heading--link"></th>
</tr> </tr>
{% endfor %} </thead>
</tbody> <tbody class="table__body">
</table> {% for rule in rules %}
<tr class="table__row rules-table__row">
<td class="table__item rules-table__item"><input name="rules" type="checkbox" value="{{ rule.pk }}" /></td>
<td class="table__item rules-table__item" title="{{ rule.name }}">{{ rule.name }}</td>
<td class="table__item rules-table__item" title="{{ rule.category.name }}">{{ rule.category.name }}</td>
<td class="table__item rules-table__item" title="{{ rule.url }}">{{ rule.url }}</td>
<td class="table__item rules-table__item" title="{{ rule.succeeded }}">{{ rule.succeeded }}</td>
<td class="table__item rules-table__item" title="{{ rule.enabled }}">{{ rule.enabled }}</td>
<td class="table__item rules-table__item">
<a class="link" href="{% url "news:collection:rule-update" rule.pk %}"><i class="gg-pen"></i></a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</section>
</form> </form>
<div class="table__footer"> <div class="table__footer">
<div class="pagination"> <div class="pagination">
<span class="pagination__previous"> <span class="pagination__previous">

View file

@ -16,6 +16,19 @@
justify-content: space-between; justify-content: space-between;
} }
} }
&--actions {
display: flex;
flex-direction: row !important;
& .form__fieldset {
flex-direction: row;
& > * {
margin: 0 0 0 5px;
}
}
}
} }
&__fieldset { &__fieldset {
@ -29,6 +42,13 @@
padding: 15px; padding: 15px;
} }
&__actions {
display: flex;
flex-direction: row;
padding: 15px;
}
&__title { &__title {
font-size: 18px; font-size: 18px;
} }