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> <p>{% trans "Delete this snapshot permanently?" %}</p>
<div class="row"> <table class="table table-bordered table-condensed table-striped">
<div class="col-lg-12"> <thead>
<table class="table table-bordered table-condensed table-striped"> <th>{% trans "Number" %}</th>
<thead> <th>{% trans "Date" %}</th>
<th>{% trans "Number" %}</th> <th>{% trans "Description" %}</th>
<th>{% trans "Date" %}</th> </thead>
<th>{% trans "Description" %}</th> <tbody>
</thead> <tr>
<tbody> <td>{{ snapshot.number }}</td>
<tr> <td>{{ snapshot.date }}</td>
<td>{{ snapshot.number }}</td> <td>{{ snapshot.description }}</td>
<td>{{ snapshot.date }}</td> </tr>
<td>{{ snapshot.description }}</td> </tbody>
</tr> </table>
</tbody>
</table>
</div>
</div>
<p> <p>
<form class="form" method="post"> <form class="form" method="post">

View File

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

View File

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

View File

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

View File

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