ui: Create reusable CSS class for collapsible-button

.collapsible-button is used by both "Client Apps" and the "How to verify?"
button in backups:verify-ssh-hostkey page.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
This commit is contained in:
Joseph Nuthalapati 2019-06-14 20:33:12 +05:30
parent 3a6dcbe7a7
commit 9f71c5867e
No known key found for this signature in database
GPG Key ID: 5398F00A2FA43C35
3 changed files with 30 additions and 33 deletions

View File

@ -20,41 +20,39 @@
{% load bootstrap %}
{% load i18n %}
{% block content %}
<h3>{{ title }}</h3>
<form class="form" method="post">
{% csrf_token %}
<h3>{{ title }}</h3>
<br/>
<form class="form" method="post">
{% csrf_token %}
<br/>
<p>
The authenticity of host {{ hostname }} cannot be established.<br/> The SSH host advertises the following public keys. Please verify any one of them.
</p>
<section>
<p>
The authenticity of host {{ hostname }} cannot be established.<br/>
The SSH host advertises the following public keys. Please verify any one of them.
<a class="btn btn-default collapsed collapsible-button" data-toggle="collapse" href="#help" aria-expanded="false"><i class="fa fa-chevron-right fa-fw" aria-hidden="true"></i> {% trans "How to verify?" %}</a>
</p>
<section>
<div class="collapse panel-body" id="help">
{% blocktrans trimmed %}
<p>Run the following command on the SSH host machine. The output should match one of the provided options. You can also use dsa, ecdsa, ed25519 etc. instead of rsa, by choosing the corresponding file.</p>
{% endblocktrans %}
<p>
<a class="btn btn-default" data-toggle="collapse" href="#help" aria-expanded="false">{% trans "How to verify?" %} <i class="fa fa-chevron-down fa-fw" aria-hidden="true"></i></a>
<code>sudo ssh-keygen -lf /etc/ssh/ssh_host_rsa_key</code>
</p>
<div class="collapse" id="help">
{% blocktrans trimmed %}
<p>Run the following command on the SSH host machine. The output should match one of the provided options. You can also use dsa, ecdsa, ed25519 etc. instead of rsa, by choosing the corresponding file.</p>
{% endblocktrans %}
<p>
<code>sudo ssh-keygen -lf /etc/ssh/ssh_host_rsa_key</code>
</p>
</div>
</section>
</div>
</section>
{{ form|bootstrap }}
{{ form|bootstrap }}
<input type="submit" class="btn btn-primary"
value="{% trans "Verify" %}"/>
<a class="btn btn-default" role="button" href="{% url 'backups:index' %}">
{% trans "Cancel" %}
</a>
</form>
<input type="submit" class="btn btn-primary" value="{% trans " Verify " %}"/>
<a class="btn btn-default" role="button" href="{% url 'backups:index' %}">
{% trans "Cancel" %}
</a>
</form>
{% endblock %}

View File

@ -23,10 +23,9 @@
{% if clients %}
<p>
<button id="clients-button" type="button" class="btn btn-default collapsed"
<button type="button" class="btn btn-default collapsed collapsible-button"
data-toggle="collapse" data-target="#clients">
{% trans "Client Apps" %}
<span class="fa fa-chevron-right" aria-hidden="true"></span>
<i class="fa fa-chevron-right fa-fw" aria-hidden="true"></i> {% trans "Client Apps" %}
</button>
</p>

View File

@ -231,16 +231,16 @@ footer {
}
/* Icon when collapsible content is shown */
#clients-button .fa {
.collapsible-button .fa {
margin-left: 5px;
}
#clients-button .fa:before,
.no-js #clients-button.collapsed .fa:before {
.collapsible-button .fa:before,
.no-js .collapsible-button.collapsed .fa:before {
content: "\f078";
}
#clients-button.collapsed .fa:before {
.collapsible-button.collapsed .fa:before {
content: "\f054";
}