Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Commit

Permalink
Merge pull request #80 from Adrihein/master
Browse files Browse the repository at this point in the history
layout improving
  • Loading branch information
FoxMaSk committed Jan 6, 2015
2 parents ed2e003 + 584633a commit cf672f6
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 74 deletions.
18 changes: 17 additions & 1 deletion django_th/static/css/th.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,29 @@ li {

.trigger-record footer {
font-size: small;
vertical-align: text-bottom;
display: block;
padding-top: 55px;
}

.trigger-record footer p {
padding-top: 5px;
}

.trigger-record .trigger-text {
word-wrap: break-word;
}

.trigger-record .trigger-button {
padding-top: 25px;
}

@media (max-width: 768px) {
.trigger-record .trigger-button {
padding-top: 0px;
}
}


.trigger-summary {
text-align: right;
}
Expand Down
32 changes: 23 additions & 9 deletions django_th/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<body role="document">
{% block navbar %}
<!-- Fixed navbar -->
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
Expand All @@ -42,11 +42,22 @@
<div class="navbar-collapse collapse">
{% if user.is_authenticated %}
<ul class="nav navbar-nav">
<li><a href="{% url 'base' %}" title="{% trans "Home" %}"><span class="glyphicon glyphicon-home"></span></a></li>
<li>{% if nb_services > 1 %}<a href="{% url 'create_service' %}" title="{% trans "Create a new trigger" %}">{% else %}<a href="#" title="You can't create a new trigger until 2 services are activated">{% endif %}<span class="glyphicon glyphicon-plus"></span></a></li>
<li><a href="{% url 'user_services' %}" title="{% trans "List of your own activated services" %}"><span class="glyphicon glyphicon-tasks"></span></a></li>
<li>
<a href="{% url 'base' %}" title="{% trans "Home" %}"><span class="glyphicon glyphicon-home"></span>&nbsp;&nbsp;Home</a>
</li>
<li>
{% if nb_services > 1 %}
<a href="{% url 'create_service' %}" title="{% trans "Create a new trigger" %}">
{% else %}
<a href="#" title="You can't create a new trigger until 2 services are activated">
{% endif %}
<span class="glyphicon glyphicon-plus"></span>&nbsp;&nbsp;Add trigger</a>
</li>
<li>
<a href="{% url 'user_services' %}" title="{% trans "List of your own activated services" %}"><span class="glyphicon glyphicon-tasks"></span>&nbsp;&nbsp;Activated services</a>
</li>
{% block filter_trigger %}
{% include "filter.html" with trigger_filter_by=trigger_filter_by %}
{% include "filter.html" with trigger_filter_by=trigger_filter_by %}
{% endblock %}
<li class="dropdown">
<a class="dropdown-toggle" title="{% trans "Order by..." %}" data-toggle="dropdown" href="#"><span class="glyphicon glyphicon-sort-by-attributes"></span> <b class="caret"></b></a>
Expand All @@ -55,14 +66,17 @@
<li role="presentation"><a role="menuitem" title="{% trans "Sort by " %}" href="{% url 'trigger_order_by' 'consumer' %}">{% trans "Service Consumer" %}</a></li>
</ul>
</li>

{% url 'profiles_profile_detail' request.user.username as profiles_profile_detail %}
<li><a href="{% url 'logout' %}" title="{% trans "log out" %}"><span class="glyphicon glyphicon-off"></span></a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="{% url 'logout' %}" title="{% trans "log out" %}"><span class="glyphicon glyphicon-off"></span></a>
</li>
</ul>
{% endif %}
</div><!--/.nav-collapse -->
</div>
</div>
</div>
</nav>
{% endblock navbar %}
<div class="container">
<div class="row">
Expand Down
25 changes: 14 additions & 11 deletions django_th/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,31 +42,34 @@ <h2><span class="glyphicon glyphicon-flash"></span>{% trans "My Triggers" %}</h2
{% endif %}
{% for trigger in triggers_list %}
<div class="trigger-record col-md-12">
<div class="col-md-7 trigger-text">
<div class="col-md-8 col-sm-6 trigger-text">
<h3><a href="{% url 'edit_trigger' trigger.id %}" title="{% trans 'Edit the description' %} ">{{ trigger.description|safe|escape }}</a></h3>
</div>
<div class="col-md-5">
<div class="col-md-4 col-xs-6 trigger-button">
<div id="all-actions{{ trigger.id }}">

<a class="btn btn-lg btn-info" role="button" href="{% url 'edit_provider' trigger.id %}" title="{% trans 'Edit your service' %} {{ trigger.provider.name|service_readable|lower }}" ><span class="glyphicon glyphicon-pencil icon-white"></span> {{ trigger.provider.name|service_readable|lower }}</a>
<a class="btn btn-sm btn-info" role="button" href="{% url 'edit_provider' trigger.id %}" title="{% trans 'Edit your service' %} {{ trigger.provider.name|service_readable|lower }}" ><span class="glyphicon glyphicon-pencil icon-white"></span> {{ trigger.provider.name|service_readable|lower }}</a>

<a class="btn btn-lg btn-info" role="button" href="{% url 'edit_consumer' trigger.id %}" title="{% trans 'Edit your service' %} {{ trigger.consumer.name|service_readable|lower }}" ><span class="glyphicon glyphicon-pencil icon-white"></span> {{ trigger.consumer.name|service_readable|lower }}</a>
<a class="btn btn-sm btn-info" role="button" href="{% url 'edit_consumer' trigger.id %}" title="{% trans 'Edit your service' %} {{ trigger.consumer.name|service_readable|lower }}" ><span class="glyphicon glyphicon-pencil icon-white"></span> {{ trigger.consumer.name|service_readable|lower }}</a>

{% if trigger.status %}
<a class="btn btn-lg btn-primary" data="{{ trigger.id }}" role="button" href="#" title="{% trans 'Set this trigger off' %}"><span class="glyphicon glyphicon-off icon-white"></span></a>
<a class="btn btn-sm btn-primary" data="{{ trigger.id }}" role="button" href="#" title="{% trans 'Set this trigger off' %}"><span class="glyphicon glyphicon-off icon-white"></span></a>
{% else %}
<a class="btn btn-lg btn-success" data="{{ trigger.id }}" role="button" href="#" title="{% trans 'Set this trigger on' %}"><span class="glyphicon glyphicon-off icon-white"></span></a>
<a class="btn btn-sm btn-success" data="{{ trigger.id }}" role="button" href="#" title="{% trans 'Set this trigger on' %}"><span class="glyphicon glyphicon-off icon-white"></span></a>

{% endif %}
<a class="btn btn-lg btn-danger" role="button" href="{% url 'delete_trigger' trigger.id %}" title="{% trans "Delete this trigger ?" %}"><span class="glyphicon glyphicon-trash icon-white"></span></a><br/>
<a class="btn btn-sm btn-danger" role="button" href="{% url 'delete_trigger' trigger.id %}" title="{% trans "Delete this trigger ?" %}"><span class="glyphicon glyphicon-trash icon-white"></span></a><br/>

</div>
</div>
<footer>
<div class="col-md-12">
<p><span class="glyphicon glyphicon-calendar"></span>{% trans "Created" %} {{ trigger.date_created }} -
<span class="glyphicon glyphicon-calendar"></span>{% trans "Triggered" %} {% if trigger.date_triggered %}{{ trigger.date_triggered }}{% else %} {% trans "Never triggered" %}{% endif %}</p>
</div>
<div class="col-md-12">
<p>
<span class="glyphicon glyphicon-calendar"></span>&nbsp;{% trans "Created" %}&nbsp;{{ trigger.date_created }}
&nbsp;-&nbsp;
<span class="glyphicon glyphicon-calendar"></span>&nbsp;{% trans "Triggered" %}&nbsp;{% if trigger.date_triggered %}{{ trigger.date_triggered }}{% else %}&nbsp;{% trans "Never triggered" %}{% endif %}
</p>
</div>
</footer>
</div>
{% endfor %}
Expand Down
13 changes: 10 additions & 3 deletions django_th/templates/registration/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
{% block content %}
<div class="col-md-12">
<h1 class="page-header">{% trans "Log in" %}</h1>
{% if form.errors %}
<div class="alert alert-error">
<p>{{ form.errors }}</p>

{% if form.non_field_errors %}
<div class="alert alert-danger" role="alert">
<p>{{ form.non_field_errors }}</p>
</div>
{% endif %}

Expand All @@ -18,12 +19,18 @@ <h1 class="page-header">{% trans "Log in" %}</h1>
<label class="form-label col-md-2" for="id_username">{% trans 'Username' %}</label>
<div class="col-md-10">
{{ form.username }}
{% if form.username.errors %}
<p class="help-block">{{ form.username.errors.as_text }}</p>
{% endif %}
</div>
</div>
<div class="form-group">
<label class="form-label col-md-2" for="id_password">{% trans 'Password' %}</label>
<div class="col-md-10">
{{ form.password }}
{% if form.username.errors %}
<p class="help-block">{{ form.username.errors.as_text }}</p>
{% endif %}
</div>
</div>
<div class="form-group">
Expand Down
105 changes: 55 additions & 50 deletions django_th/templates/services/services.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,61 @@
{% endblock %}
{% block content %}
<div class="col-md-12">
{% if user.is_authenticated %}
<h2>My Activated Services</h2>
{% if services_list %}
{% if action == 'display' %}
<div class="col-md-11">
<a class="btn btn-primary" href="{% url 'add_service' %}" title="{% trans "Activate a new service" %}">{% trans 'Activate a new service' %}</a>
</div>
{% endif %}
<div class="row-fluid">
<ul class="thumbnails">
{% for service in services_list %}
<li class="col-md-3">
<div class="thumbnail">
<div class="caption">
<h3>{{ service.name|service_readable|safe|escape }}</h3>
<p>{{ service.name.description }}</p>
<p>
<a class="btn btn-lg btn-danger" role="button" href="{% url 'delete_service' service.id %}" title="{% trans "Delete this service ?" %}"><span class="glyphicon glyphicon-trash icon-white"></span></a> {% if service.name.auth_required == True %}<a class="btn btn-lg btn-warning" role="button" href="{% url 'renew_service' service.name.id %}" title="{% trans "Renew this service ?" %}"><span class="glyphicon glyphicon-repeat icon-white"></span></a>{% endif %}<br/><a class="btn btn-lg btn-info" role="button" href="{% url 'service_related_triggers_switch_to' service.id 'on' %}" title="{% trans "Enable all the triggers of this service" %}"><span class="glyphicon glyphicon-off icon-white"></span></a> <a class="btn btn-lg btn-success" role="button" href="{% url 'service_related_triggers_switch_to' service.id 'off' %}" title="{% trans "Disable all the triggers of this service" %}"><span class="glyphicon glyphicon-off icon-white"></span></a>
</p>
</div>
</div>
</li>
{% endfor %}
</ul>
</div>
{% else %}
<article>
<div class="col-md-8">
{% trans 'No service activated yet, you can now start by' %}
<a href="{% url 'add_service' %}" title="{% trans "Activate a service" %}">{% trans 'Activate one' %}</a>
</div>
</article>
<div class="row-fluid">
<ul class="thumbnails">
{% for service in service_list_available %}
<li class="col-md-3">
<div class="thumbnail">
<div class="caption">
<h3>{{ service.name|service_readable|safe|escape }}</h3>
<p>{{ service.name.description }}</p>
<p>
<a class="btn btn-lg btn-danger" role="button" href="{% url 'delete_service' service.id %}" title="{% trans "Delete this service ?" %}"><i span class="glyphicon glyphicon-trash icon-white"></span>/a> {% if service.name.auth_required == True %} <a class="btn btn-lg btn-warning" role="button" href="{% url 'renew_service' service.name.id %}" title="{% trans "Renew this service ?" %}"><span class="glyphicon glyphicon-repeat icon-white"></span></a> {% endif %}
</p>
</div>
{% if user.is_authenticated %}
<h2>My Activated Services</h2>
{% if services_list %}
{% if action == 'display' %}
<div class="col-md-11">
<a class="btn btn-primary" href="{% url 'add_service' %}" title="{% trans "Activate a new service" %}">{% trans 'Activate a new service' %}</a>
</div>
{% endif %}
<div class="row-fluid">
<ul class="thumbnails">
{% for service in services_list %}
<li class="col-md-3">
<div class="thumbnail">
<div class="caption">
<h3>{{ service.name|service_readable|safe|escape }}</h3>
<p>{{ service.name.description }}</p>
<p>
{% if service.name.auth_required == True %}
<a class="btn btn-xs btn-warning" role="button" href="{% url 'renew_service' service.name.id %}" title="{% trans "Renew this service ?" %}"><span class="glyphicon glyphicon-repeat icon-white"></span></a>
{% endif %}
<a class="btn btn-xs btn-success" role="button" href="{% url 'service_related_triggers_switch_to' service.pk 'off' %}" title="{% trans "Disable all the triggers of this service" %}"><span class="glyphicon glyphicon-off icon-white"></span></a>
<a class="btn btn-xs btn-info" role="button" href="{% url 'service_related_triggers_switch_to' service.pk 'on' %}" title="{% trans "Enable all the triggers of this service" %}"><span class="glyphicon glyphicon-off icon-white"></span></a>
<a class="btn btn-xs btn-danger" role="button" href="{% url 'delete_service' service.id %}" title="{% trans "Delete this service ?" %}"><span class="glyphicon glyphicon-trash icon-white"></span></a>
</p>
</div>
</div>
</li>
{% endfor %}
</ul>
</div>
{% else %}
<article>
<div class="col-md-8">
{% trans 'No service activated yet, you can now start by' %}
<a href="{% url 'add_service' %}" title="{% trans "Activate a service" %}">{% trans 'Activate one' %}</a>
</div>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endif %}
</article>
<div class="row-fluid">
<ul class="thumbnails">
{% for service in service_list_available %}
<li class="col-md-3">
<div class="thumbnail">
<div class="caption">
<h3>{{ service.name|service_readable|safe|escape }}</h3>
<p>{{ service.name.description }}</p>
<p>
<a class="btn btn-lg btn-danger" role="button" href="{% url 'delete_service' service.id %}" title="{% trans "Delete this service ?" %}"><i span class="glyphicon glyphicon-trash icon-white"></span>/a> {% if service.name.auth_required == True %} <a class="btn btn-lg btn-warning" role="button" href="{% url 'renew_service' service.name.id %}" title="{% trans "Renew this service ?" %}"><span class="glyphicon glyphicon-repeat icon-white"></span></a> {% endif %}
</p>
</div>
</div>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endif %}
</div>
{% endblock %}

0 comments on commit cf672f6

Please sign in to comment.