snapshot: Remove unnecessary column sizing

- Implement button-table class for tables with buttons about them.

Signed-off-by: Manish Tripathy <manisht@thougtworks.com>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Sunil Mohan Adapa 2018-06-18 19:17:20 +05:30
parent a596ad5f37
commit fd72909712
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
5 changed files with 99 additions and 110 deletions

View File

@ -26,24 +26,20 @@
<p>{% trans "Delete this snapshot permanently?" %}</p>
<div class="row">
<div class="col-lg-12">
<table class="table table-bordered table-condensed table-striped">
<thead>
<th>{% trans "Number" %}</th>
<th>{% trans "Date" %}</th>
<th>{% trans "Description" %}</th>
</thead>
<tbody>
<tr>
<td>{{ snapshot.number }}</td>
<td>{{ snapshot.date }}</td>
<td>{{ snapshot.description }}</td>
</tr>
</tbody>
</table>
</div>
</div>
<table class="table table-bordered table-condensed table-striped">
<thead>
<th>{% trans "Number" %}</th>
<th>{% trans "Date" %}</th>
<th>{% trans "Description" %}</th>
</thead>
<tbody>
<tr>
<td>{{ snapshot.number }}</td>
<td>{{ snapshot.date }}</td>
<td>{{ snapshot.description }}</td>
</tr>
</tbody>
</table>
<p>
<form class="form" method="post">

View File

@ -26,28 +26,24 @@
<p>{% trans "Delete the following snapshots permanently?" %}</p>
<div class="row">
<div class="col-lg-12">
<table class="table table-bordered table-condensed table-striped">
<thead>
<th>{% trans "Number" %}</th>
<th>{% trans "Date" %}</th>
<th>{% trans "Description" %}</th>
</thead>
<tbody>
{% for snapshot in snapshots %}
{% if not snapshot.is_default %}
<tr>
<td>{{ snapshot.number }}</td>
<td>{{ snapshot.date }}</td>
<td>{{ snapshot.description }}</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
</div>
<table class="table table-bordered table-condensed table-striped">
<thead>
<th>{% trans "Number" %}</th>
<th>{% trans "Date" %}</th>
<th>{% trans "Description" %}</th>
</thead>
<tbody>
{% for snapshot in snapshots %}
{% if not snapshot.is_default %}
<tr>
<td>{{ snapshot.number }}</td>
<td>{{ snapshot.date }}</td>
<td>{{ snapshot.description }}</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
<p>
<form class="form" method="post">

View File

@ -23,8 +23,9 @@
{% block content %}
{% block configuration %}
<p>
<div class="row">
<div class="button-table">
<div class="button-row row">
<form class="form" method="post">
{% csrf_token %}
<div class="col-xs-6 text-left">
@ -44,62 +45,57 @@
</a>
</div>
</div>
</p>
<div class="row">
<div class="col-lg-12">
<table class="table table-bordered table-condensed table-striped">
<thead>
<th>{% trans "Number" %}</th>
<th>{% trans "Date" %}</th>
<th>{% trans "Description" %}</th>
<th>{% trans "Rollback" %}</th>
<th>{% trans "Delete" %}</th>
</thead>
<tbody>
{% for snapshot in snapshots %}
{% if snapshot.description != "current" %}
<tr>
<td>
{{ snapshot.number }}
{% if snapshot.is_default %}
<span class="label label-primary">
{% trans "active" %}
</span>
{% endif %}
</td>
<td>{{ snapshot.date }}</td>
<td>{{ snapshot.description }}</td>
<td>
<a href="{% url 'snapshot:rollback' snapshot.number %}"
<table class="table table-bordered table-condensed table-striped">
<thead>
<th>{% trans "Number" %}</th>
<th>{% trans "Date" %}</th>
<th>{% trans "Description" %}</th>
<th>{% trans "Rollback" %}</th>
<th>{% trans "Delete" %}</th>
</thead>
<tbody>
{% for snapshot in snapshots %}
{% if snapshot.description != "current" %}
<tr>
<td>
{{ snapshot.number }}
{% if snapshot.is_default %}
<span class="label label-primary">
{% trans "active" %}
</span>
{% endif %}
</td>
<td>{{ snapshot.date }}</td>
<td>{{ snapshot.description }}</td>
<td>
<a href="{% url 'snapshot:rollback' snapshot.number %}"
class="btn btn-default btn-sm" role="button"
title="{% blocktrans trimmed with number=snapshot.number %}
Rollback to snapshot #{{ number }}
{% endblocktrans %}">
<span class="glyphicon glyphicon-repeat"
aria-hidden="true"></span>
</a>
</td>
<td>
{% if not snapshot.is_default %}
<a href="{% url 'snapshot:delete' snapshot.number %}"
class="btn btn-default btn-sm" role="button"
title="{% blocktrans trimmed with number=snapshot.number %}
Rollback to snapshot #{{ number }}
Delete snapshot #{{ number }}
{% endblocktrans %}">
<span class="glyphicon glyphicon-repeat"
<span class="glyphicon glyphicon-trash"
aria-hidden="true"></span>
</a>
</td>
<td>
{% if not snapshot.is_default %}
<a href="{% url 'snapshot:delete' snapshot.number %}"
class="btn btn-default btn-sm" role="button"
title="{% blocktrans trimmed with number=snapshot.number %}
Delete snapshot #{{ number }}
{% endblocktrans %}">
<span class="glyphicon glyphicon-trash"
aria-hidden="true"></span>
</a>
{% endif %}
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}
{% endblock %}

View File

@ -34,24 +34,20 @@
{% endblocktrans %}
</p>
<div class="row">
<div class="col-lg-12">
<table class="table table-bordered table-condensed table-striped">
<thead>
<th>{% trans "Number" %}</th>
<th>{% trans "Date" %}</th>
<th>{% trans "Description" %}</th>
</thead>
<tbody>
<tr>
<td>{{ snapshot.number }}</td>
<td>{{ snapshot.date }}</td>
<td>{{ snapshot.description }}</td>
</tr>
</tbody>
</table>
</div>
</div>
<table class="table table-bordered table-condensed table-striped">
<thead>
<th>{% trans "Number" %}</th>
<th>{% trans "Date" %}</th>
<th>{% trans "Description" %}</th>
</thead>
<tbody>
<tr>
<td>{{ snapshot.number }}</td>
<td>{{ snapshot.date }}</td>
<td>{{ snapshot.description }}</td>
</tr>
</tbody>
</table>
<p>
<form class="form" method="post">

View File

@ -280,3 +280,8 @@ a.menu_link_active {
height: 100px;
font-size: 80px
}
/* Button table - Tables with a list of actions as buttons on top */
.button-table > .button-row + .table {
margin-top: 10px;
}