Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:crypotex/taas into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
crypotex committed Dec 7, 2015
2 parents 952b1df + 7447d80 commit e097876
Show file tree
Hide file tree
Showing 19 changed files with 148 additions and 70 deletions.
18 changes: 9 additions & 9 deletions taas/reservation/static/css/history.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
border-top: 1px solid #c8c8c8;
padding: 10px;
vertical-align:top;
word-break: break-word;
word-break: keep-all;
}

#bookings tr:last-child {
Expand Down Expand Up @@ -45,7 +45,7 @@
margin: 10px;
}

#reservation_update_header {
.reservation_update_header {
text-align: center;
color: #666666;
}
Expand Down Expand Up @@ -82,9 +82,10 @@
ul.pagination {
text-align: center;
list-style-type: none;
padding-right: 40px;
}

li.previous, li.next, .pagewrap {
li.previous, li.next, li.current {
display: inline;
}

Expand All @@ -108,13 +109,12 @@ li.next:after {
clear: right;
}

.pagewrap {
margin: 0 auto;
width: 25%;
text-align: center;
}

.fc-header-title h2 {
font-size: 16px;
color: #666666;
}


th.delete, th.update {
display: none;
}
8 changes: 4 additions & 4 deletions taas/reservation/static/css/jquery-ui.css
Original file line number Diff line number Diff line change
Expand Up @@ -1473,10 +1473,10 @@
#datepicker td a.ui-state-active,
#datepicker td a.ui-state-active.ui-state-hover {
color: #fff;
background-color: #8ab8ed;
text-shadow: 0 1px 0 rgba(0, 0, 0, .26);
-moz-box-shadow: inset 0 4px 9px rgba(0, 0, 0, .24);
-webkit-box-shadow: inset 0 4px 9px rgba(0, 0, 0, .24);
background-color: #4b79ae;
text-shadow: 0 1px 0 rgba(230, 230, 230, 0.26);
-moz-box-shadow: inset 0 4px 9px rgba(210, 210, 210, 0.24);
-webkit-box-shadow: inset 0 4px 9px rgba(232, 232, 232, 0.24);
box-shadow: inset 0 4px 9px rgba(0, 0, 0, .24);
}

Expand Down
2 changes: 1 addition & 1 deletion taas/reservation/static/js/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function addReservation(start, end, ev) {
}

function deleteReservation(calEvent) {
if (calEvent.color != "#b285e0") return;
if (calEvent.color != "#8f62bd") return;

jQuery.post('/reservation/remove/',
{
Expand Down
28 changes: 16 additions & 12 deletions taas/reservation/static/js/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,33 @@ var unpaidOwn;
$(document).ready(function () {
$('#anon').tooltipster({
theme: 'tooltipster-light',
offsetX: -189,
offsetY: 12,
content: paidAnon
touchDevices: true,
trigger: 'hover',
content: paidAnon,
position: 'top'
});

$('#own').tooltipster({
theme: 'tooltipster-light',
offsetX: -189,
offsetY: 12,
content: paidOwn
content: paidOwn,
trigger: 'hover',
touchDevices: true,
position: 'top'
});

$('#unpaid-own').tooltipster({
theme: 'tooltipster-light',
offsetX: -189,
offsetY: 12,
content: unpaidOwn
content: unpaidOwn,
trigger: 'hover',
touchDevices: true,
position: 'top'
});

$('#unpaid-others').tooltipster({
theme: 'tooltipster-light',
offsetX: -189,
offsetY: 12,
content: unpaidAnon
content: unpaidAnon,
trigger: 'hover',
touchDevices: true,
position: 'top'
});
});
14 changes: 7 additions & 7 deletions taas/reservation/tables.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import django_tables2 as tables

from django.core.urlresolvers import reverse
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _

from taas.reservation.models import Reservation


Expand All @@ -13,21 +11,23 @@ class Meta:
fields = ('start', 'end', 'field')
attrs = {"id": "bookings"}

update = tables.Column(attrs={"th": {"hidden": "True"}}, orderable=False, empty_values=())
delete = tables.Column(attrs={"th": {"hidden": "True"}}, orderable=False, empty_values=())
update = tables.Column(orderable=False, empty_values=())
delete = tables.Column(orderable=False, empty_values=())

def render_delete(self, record):
if record.can_delete():
return mark_safe(
'<img id="%s" src="/static/img/clear.png" alt="delete" onClick="remove_reservation(this.id)" />'
'<img class="%s" src="/static/img/clear.png" alt="delete" '
'onClick="remove_reservation(this.className)" />'
% record.id)
return ''

def render_update(self, record):
if record.can_update():
reverse('detail_reservation', kwargs={'pk': record.id})
return mark_safe(
'<img id="%s" alt="update" src="/static/img/change.png" onClick="update_reservation(this.id)" />'
'<img class="%s" alt="update" src="/static/img/change.png" '
'onClick="update_reservation(this.className)" />'
% record.id)
return ''

Expand All @@ -39,7 +39,7 @@ class Meta:
attrs = {"id": "bookings"}

price = tables.Column(verbose_name=_('price (€)'), accessor='field.cost')
delete = tables.Column(attrs={"th": {"hidden": "True"}}, orderable=False, empty_values=())
delete = tables.Column(orderable=False, empty_values=())

def render_delete(self, record):
if record.can_delete():
Expand Down
11 changes: 10 additions & 1 deletion taas/reservation/templates/budget_payment.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends 'base.html' %}
{% load i18n %}
{% load staticfiles %}
{% load widget_tweaks %}

{% block title %}
{% trans 'Budget payment' %}
Expand All @@ -25,9 +26,17 @@
{% block content %}
<form class="form" method="post" action="{% url 'budget_payment' %}">{% csrf_token %}
<h2>{% trans 'Confirmation' %}</h2>

<p class="help-text">{% trans 'Please enter your password to complete the booking(s).' %}</p>
{% for error in form.non_field_errors %}
<p class="error-message">{{ error }}</p>
{% endfor %}

<div class="fieldWrapper">
{{ form }}
{{ form.password.label_tag }}
{% render_field form.password|add_error_class:"field-error" %}
{% for err in form.password.errors %}
<p class="error-message">{{ err|cut:"* " }}</p>{% endfor %}
</div>
<input id="payButton" type="submit" value={% trans 'Pay' %}>
</form>
Expand Down
12 changes: 6 additions & 6 deletions taas/reservation/templates/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ <h2>{% trans 'Help' %}</h2>

<div id="inner">
<div id="anon" class="colorbox" style="background-color:#fe9000;"></div>
<div id="own" class="colorbox" style="background-color:#009800;"></div>
<div id="unpaid-own" class="colorbox" style="background-color:#b285e0;"></div>
<div id="own" class="colorbox" style="background-color:#008a00;"></div>
<div id="unpaid-own" class="colorbox" style="background-color:#8f62bd;"></div>
<div id="unpaid-others" class="colorbox" style="background-color:#a9a9a9;"></div>
</div>
</div>
Expand Down Expand Up @@ -116,8 +116,8 @@ <h2>{% trans 'Help' %}</h2>
<p> {% blocktrans trimmed %}Click on the <samp>"History"</samp> tab, you should see the table with all of
your reservations.
<br><br>
If you can edit a reservation (check <i><a href="#q5">Is it possible to modify an upcoming
reservation?</a></i>),
If you can edit a reservation (check <em><a href="#q5">Is it possible to modify an upcoming
reservation?</a></em>),
then there will be a pencil icon next to the reservation, click on it.
<br><br>
You should see an alert asking for confirmation. If you really want to change the reservation then click
Expand All @@ -134,8 +134,8 @@ <h2>{% trans 'Help' %}</h2>
<p>{% blocktrans trimmed %}Click on the <samp>"History"</samp> tab, you should see the table with all of
your reservations.
<br><br>
If you can remove a reservation (check <i><a href="#q6">Is it possible to cancel an upcoming
reservation?</a></i>),
If you can remove a reservation (check <em><a href="#q6">Is it possible to cancel an upcoming
reservation?</a></em>),
then there will be a cross icon next to the reservation, click on it.
<br><br>
You should see an alert asking for confirmation. If you really want to delete the reservation then click
Expand Down
6 changes: 3 additions & 3 deletions taas/reservation/templates/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@

{% block content %}
<div class="table_wrap">
<form action="" method="get" class="sort_form">
{{ form }}

<form method="get" class="sort_form">
{{ form.month.label_tag }} {{ form.month }}
{{ form.year.label_tag }} {{ form.year }}
<input type="submit" id="sortButton" value={% trans 'Sort' %}>
</form>
{% if table %}
Expand Down
28 changes: 15 additions & 13 deletions taas/reservation/templates/proceed_transaction.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<!DOCTYPE html>
<html>
<head>
{% extends 'base.html' %}
{% load i18n %}
{% load staticfiles %}

{% block scripts %}
<script type="text/javascript">
function load() {
window.onload = function load() {
window.document.test.submit();
}
};
</script>
</head>
<body onload="load()">
<form name="test" method="post" action="{{ host }}">
<input type="hidden" name="json" value="{{ json }}"/>
<input type="hidden" name="mac" value="{{ mac }}"/>
</form>
</body>
</html>
{% endblock scripts %}

{% block content %}
<form name="test" method="post" action="{{ host }}">
<input type="hidden" name="json" value="{{ json }}"/>
<input type="hidden" name="mac" value="{{ mac }}"/>
</form>
{% endblock content %}
29 changes: 27 additions & 2 deletions taas/reservation/templates/reservation_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,38 @@ <h2>{% trans 'Pay for the reservations' %}</h2>

<div class="fieldWrapper">
{% render_table table 'table.html' %}
{% if is_paginated %}
<div class="pagination">
<span class="page-links">
{% if page_obj.has_previous %}
<a href="{% url 'reservation_list' %}?page={{ page_obj.previous_page_number }}">
{% trans 'previous' %}
</a>
{% endif %}
<span class="page-current">
{% trans 'Page' %} {{ page_obj.number }} {% trans 'of' %} {{ page_obj.paginator.num_pages }}.
</span>
{% if page_obj.has_next %}
<a href="{% url 'reservation_list' %}?page={{ page_obj.next_page_number }}">
{% trans 'next' %}
</a>
{% endif %}
</span>
</div>
{% endif %}
</div>

<button formaction="{% url 'budget_payment' %}" type="submit">{% trans 'Budget' %}</button>
<button formaction="{% url 'proceed_transaction' %}"
type="submit">{% trans 'Transaction' %}</button>

</form>
<p>{{ total_price }}</p>

<!--<p>{{ total_price }}</p>
<form method="get" action="{% url 'budget_payment' %}">
<input id="submit-button" type="submit" value={% trans 'Budget' %}>
</form>
<form method="get" action="{% url 'proceed_transaction' %}">
<input id="submit-button" type="submit" value="{% trans 'Transaction' %}">
</form>
</form>-->
{% endblock content %}
4 changes: 2 additions & 2 deletions taas/reservation/templates/reservation_update.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@

{% block content %}
<div class="table_wrap">
<h2 id="reservation_update_header">{% trans 'Choose a new time for the reservation' %}</h2>
<h2 class="reservation_update_header">{% trans 'Choose a new time for the reservation' %}</h2>

<p id="reservation_update_header">{% trans 'Drag the red box to another slot that suits you and is free.' %}</p>
<p class="reservation_update_header">{% trans 'Drag the red box to another slot that suits you and is free.' %}</p>

<div class="wrap">
<div id="updateReservation"></div>
Expand Down
2 changes: 2 additions & 0 deletions taas/reservation/templates/table.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
{% if table.page %}
{% with table.page.paginator.count as total %}
{% with table.page.object_list|length as count %}

<p id="price">{% trans 'Total price: ' %}{{ total_price }}</p>
{% block pagination %}
<ul class="pagination">
{% if table.page.has_previous %}
Expand Down
4 changes: 2 additions & 2 deletions taas/server/base_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@
'paid': {
'anonymous': '#FE9900',
'others': '#FE9900',
'owner': '#009800'
'owner': '#008a00'
},
'unpaid': {
'owner': '#b285e0',
'owner': '#8f62bd',
'others': '#a9a9a9',
},
'update': '#A52A2A'
Expand Down
6 changes: 6 additions & 0 deletions taas/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -345,4 +345,10 @@ a:hover {

#name {
color: #666666;
}

a#et, a#en, a#ru {
line-height: 0;
font-size: 0;
color: transparent;
}
2 changes: 1 addition & 1 deletion taas/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

{% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %}
<a href="#" id="{{ language.code }}" class="change_language"></a>
<a href="#" id="{{ language.code }}" class="change_language">language_change</a>
{% endfor %}
</div>

Expand Down

0 comments on commit e097876

Please sign in to comment.