Show website information related to each domain.

This commit is contained in:
Santiago Lamora 2020-01-20 17:27:11 +01:00
parent 81fa9b57fd
commit b277b9a2e4
1 changed files with 33 additions and 11 deletions

View File

@ -43,11 +43,15 @@
<strong>{{ domain.name }}</strong> <strong>{{ domain.name }}</strong>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
{% with domain.websites.0 as website %}
{% with website.contents.0 as content %}
<button type="button" class="btn text-secondary" data-toggle="modal" data-target="#configDetailsModal" <button type="button" class="btn text-secondary" data-toggle="modal" data-target="#configDetailsModal"
data-domain="{{ domain.name }}" data-username="john" data-password="s3cre3t" data-root="/domainname/" data-domain="{{ domain.name }}" data-website="{{ website|yesno:'true,false' }}" data-webapp-type="{{ content.webapp.type }}" data-root-path="{{ content.path }}"
data-url="{% url 'musician:domain-detail' domain.id %}"> data-url="{% url 'musician:domain-detail' domain.id %}">
{% trans "view configuration" %} <strong class="fas fa-tools"></strong> {% trans "view configuration" %} <strong class="fas fa-tools"></strong>
</button> </button>
{% endwith %}
{% endwith %}
</div> </div>
<div class="col-md text-right"> <div class="col-md text-right">
{% comment "@slamora: orchestra doesn't have this information [won't fix] See issue #2" %} {% comment "@slamora: orchestra doesn't have this information [won't fix] See issue #2" %}
@ -117,13 +121,22 @@
</button> </button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="domain-ftp pb-3 border-bottom">
<h6 class="pl-4 mb-4">{% trans "FTP access:" %}</h6> <h6 class="pl-4 mb-4">{% trans "FTP access:" %}</h6>
<div class=""> {# Translators: domain configuration detail modal #}
<p> <p>{% trans "Contact with the support team to get details concerning FTP access." %}</p>
{% comment %}
<!-- hidden until API provides FTP information -->
<label>{% trans "Username" %}:</label> <span id="config-username" class="font-weight-bold">username</span><br/> <label>{% trans "Username" %}:</label> <span id="config-username" class="font-weight-bold">username</span><br/>
<label>{% trans "Password:" %}</label> <span id="config-password" class="font-weight-bold">password</span> <label>{% trans "Password:" %}</label> <span id="config-password" class="font-weight-bold">password</span>
</p> {% endcomment %}
<p class="border-top pt-3"><label>Root directory:</label> <span id="config-root" class="font-weight-bold">root directory</span></p> </div>
<div class="domain-website pt-4">
<div id="no-website"><h6 class="pl-4">{% trans "No website configured." %}</h6></div>
<div id="config-website">
<label>Root directory:</label> <span id="config-root-path" class="font-weight-bold">root directory</span>
<label>Type:</label><span id="config-webapp-type" class="font-weight-bold">type</span>
</div>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
@ -141,10 +154,19 @@ $('#configDetailsModal').on('show.bs.modal', function (event) {
// Extract info from data-* attributes // Extract info from data-* attributes
modal.find('.modal-title').text(button.data('domain')); modal.find('.modal-title').text(button.data('domain'));
modal.find('.modal-body #config-username').text(button.data('username')); modal.find('.modal-body #config-webapp-type').text(button.data('webapp-type'));
modal.find('.modal-body #config-password').text(button.data('password')); modal.find('.modal-body #config-root-path').text(button.data('root-path'));
modal.find('.modal-body #config-root').text(button.data('root'));
modal.find('.modal-footer .btn').attr('href', button.data('url')); modal.find('.modal-footer .btn').attr('href', button.data('url'));
var nowebsite = modal.find('.modal-body #no-website');
var websitecfg = modal.find('.modal-body #config-website');
if(button.data('website')) {
nowebsite.hide();
websitecfg.show();
} else {
nowebsite.show();
websitecfg.hide();
}
}) })
</script> </script>
{% endblock %} {% endblock %}