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

Commit

Permalink
layout improvments
Browse files Browse the repository at this point in the history
  • Loading branch information
foxmask committed Jun 24, 2015
1 parent 6bf3d52 commit 51eab7e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 24 deletions.
41 changes: 19 additions & 22 deletions django_th/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@
{% block content %}

{% if user.is_authenticated %}
<div class="col-md-12">
<div class="col-md-7">
<span class="glyphicon glyphicon-flash"></span>{% trans "My Triggers" %}
</div>
<div class="col-md-5">
<span class="badge">{{ nb_services }}</span> {% trans "activated" %} {% trans "services" %} - <span class="badge">{{ nb_triggers.enabled }}</span> {% trans "enabled" %} {% trans "triggers" %} - <span class="badge">{{ nb_triggers.disabled }}</span> {% trans "disabled" %} {% trans "triggers" %}
</div>
<div class="col-xs-12 col-md-12">
<span class="glyphicon glyphicon-flash"></span>{% trans "My Triggers" %}
</div>
{% if triggers_list %}
{% if is_paginated %}
<div class="col-md-12 ">
<div class="col-xs-12 col-md-12">
<ul class="pagination">
{% if page_obj.has_previous %}
<li><a href="{{ page_link }}?page={{ page_obj.previous_page_number }}">{% trans "previous" %}</a></li>
Expand All @@ -35,26 +30,25 @@
</div>
{% endif %}
{% for trigger in triggers_list %}
<div id="trigger-record-{{ trigger.id }}"class="trigger-record col-md-12">
<div class="col-md-12 trigger-text">

<a class="btn btn-md btn-info" href="{% url 'edit_trigger' trigger.id %}" title="{% trans 'Edit the description' %} "><span class="glyphicon glyphicon-pencil icon-white"></span> {{ trigger.description|safe|escape }}</a>
<div id="trigger-record-{{ trigger.id }}"class="trigger-record col-xs-12 col-md-12">
<div class="col-xs-7 col-md-xxi512">
<a class="btn btn-sm btn-md btn-info" href="{% url 'edit_trigger' trigger.id %}" title="{% trans 'Edit the description' %} "><span class="glyphicon glyphicon-pencil icon-white"></span> {{ trigger.description|safe|escape }}</a>

<a class="btn btn-md 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-md 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-md 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-md 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>
</div>
<div class="col-xs-5 col-md-5">
{% if trigger.status %}
<a class="btn btn-md 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-md 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-md 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-md 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-md 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>
<a class="btn btn-sm btn-md 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>
<footer>
<div class="col-md-12">
<div class="col-xs-12 col-md-12">
<p>
<span class="glyphicon glyphicon-calendar"></span>&nbsp;{% trans "Created" %}&nbsp;{{ trigger.date_created }}
&nbsp;-&nbsp;
Expand All @@ -65,7 +59,7 @@
</div>
{% endfor %}
{% if is_paginated %}
<div class="col-md-12">
<div class="col-xs-12 col-md-12">
<ul class="pagination">
{% if page_obj.has_previous %}
<li><a href="{% url 'home' %}?page={{ page_obj.previous_page_number }}">{% trans "previous" %}</a></li>
Expand All @@ -81,6 +75,9 @@
</ul>
</div>
{% endif %}
<div class="col-xs-12 col-md-5 col-md-offset-8">
<span class="badge">{{ nb_services }}</span> {% trans "activated" %} {% trans "services" %} - <span class="badge">{{ nb_triggers.enabled }}</span> {% trans "enabled" %} {% trans "triggers" %} - <span class="badge">{{ nb_triggers.disabled }}</span> {% trans "disabled" %} {% trans "triggers" %}
</div>
{% else %}
<div class="trigger-record col-md-12">
<div class="alert alert-info">
Expand Down
2 changes: 1 addition & 1 deletion django_th/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def get_paginate_by(self, queryset):
def get_queryset(self):
filtered_by = None
# by default, sort by date_created
ordered_by = (str('-date_created'), )
ordered_by = (str('-date_triggered'), )
# get the Trigger of the connected user
if self.request.user.is_authenticated():
# if the user selected a filter, get its ID
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def reqs(*f):
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Framework :: Django',
],
Expand Down

0 comments on commit 51eab7e

Please sign in to comment.