1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ihatemoney_ynh.git synced 2024-09-03 19:26:15 +02:00

Addition of an auto hiding user information message in the add user text field (with translation).

This commit is contained in:
Tinmn 2011-11-20 14:37:32 +01:00
parent 9962b6d60f
commit a5cc50b0c2
7 changed files with 365 additions and 312 deletions

View file

@ -141,7 +141,7 @@ class BillForm(Form):
class MemberForm(Form): class MemberForm(Form):
name = TextField(_("Name"), validators=[Required()]) name = TextField(_("Name"), validators=[Required()], default=_("Type user name here"))
submit = SubmitField(_("Add")) submit = SubmitField(_("Add"))
def __init__(self, project, *args, **kwargs): def __init__(self, project, *args, **kwargs):
@ -149,6 +149,8 @@ class MemberForm(Form):
self.project = project self.project = project
def validate_name(form, field): def validate_name(form, field):
if field.data == form.name.default:
raise ValidationError(_("User name incorrect"))
if Person.query.filter(Person.name == field.data)\ if Person.query.filter(Person.name == field.data)\
.filter(Person.project == form.project)\ .filter(Person.project == form.project)\
.filter(Person.activated == True).all(): .filter(Person.activated == True).all():

View file

@ -1,16 +1,16 @@
# Translations template for PROJECT. # Translations template for PROJECT.
# Copyright (C) 2011 ORGANIZATION # Copyright (C) 2011 ORGANIZATION
# This file is distributed under the same license as the PROJECT project. # This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011. # Alexis Métaireau <alexis@notmyidea.org>, 2011.
# #
#, fuzzy #, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PROJECT VERSION\n" "Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2011-11-01 13:04+0100\n" "POT-Creation-Date: 2011-11-20 14:05+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Quentin Roy <royque@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
@ -21,31 +21,27 @@ msgstr ""
msgid "Select All/None" msgid "Select All/None"
msgstr "" msgstr ""
#: forms.py:51 #: forms.py:57
msgid "Project name" msgid "Project name"
msgstr "" msgstr ""
#: forms.py:52 forms.py:77 forms.py:88 #: forms.py:58 forms.py:82 forms.py:93
msgid "Private code" msgid "Private code"
msgstr "" msgstr ""
#: forms.py:53 #: forms.py:59
msgid "Email" msgid "Email"
msgstr "" msgstr ""
#: forms.py:54 #: forms.py:81 forms.py:92 forms.py:98
msgid "Edit the project"
msgstr ""
#: forms.py:76 forms.py:87 forms.py:93
msgid "Project identifier" msgid "Project identifier"
msgstr "" msgstr ""
#: forms.py:78 templates/send_invites.html:5 #: forms.py:83 templates/send_invites.html:5
msgid "Create the project" msgid "Create the project"
msgstr "" msgstr ""
#: forms.py:83 #: forms.py:88
msgid "" msgid ""
"The project identifier is used to log in and for the URL of the project. " "The project identifier is used to log in and for the URL of the project. "
"We tried to generate an identifier for you but a project with this " "We tried to generate an identifier for you but a project with this "
@ -53,80 +49,88 @@ msgid ""
"able to remember." "able to remember."
msgstr "" msgstr ""
#: forms.py:89 #: forms.py:94
msgid "Get in" msgid "Get in"
msgstr "" msgstr ""
#: forms.py:94 #: forms.py:99
msgid "Send me the code by email" msgid "Send me the code by email"
msgstr "" msgstr ""
#: forms.py:98 #: forms.py:103
msgid "This project does not exists" msgid "This project does not exists"
msgstr "" msgstr ""
#: forms.py:102 #: forms.py:107
msgid "Date" msgid "Date"
msgstr "" msgstr ""
#: forms.py:103 #: forms.py:108
msgid "What?" msgid "What?"
msgstr "" msgstr ""
#: forms.py:104 #: forms.py:109
msgid "Payer" msgid "Payer"
msgstr "" msgstr ""
#: forms.py:105 #: forms.py:110
msgid "Amount paid" msgid "Amount paid"
msgstr "" msgstr ""
#: forms.py:106 templates/list_bills.html:98 #: forms.py:111 templates/list_bills.html:154
msgid "For whom?" msgid "For whom?"
msgstr "" msgstr ""
#: forms.py:108 #: forms.py:113
msgid "Send the bill" msgid "Send the bill"
msgstr "" msgstr ""
#: forms.py:132 #: forms.py:139
msgid "Bills can't be negative" msgid "Bills can't be null"
msgstr "" msgstr ""
#: forms.py:137 #: forms.py:144
msgid "Name" msgid "Name"
msgstr "" msgstr ""
#: forms.py:138 templates/forms.html:91 #: forms.py:144
msgid "Type user name here"
msgstr ""
#: forms.py:145 templates/forms.html:94
msgid "Add" msgid "Add"
msgstr "" msgstr ""
#: forms.py:148 #: forms.py:153
msgid "User name incorrect"
msgstr ""
#: forms.py:157
msgid "This project already have this member" msgid "This project already have this member"
msgstr "" msgstr ""
#: forms.py:158 #: forms.py:167
msgid "People to notify" msgid "People to notify"
msgstr "" msgstr ""
#: forms.py:159 #: forms.py:168
msgid "Send invites" msgid "Send invites"
msgstr "" msgstr ""
#: forms.py:165 #: forms.py:174
#, python-format #, python-format
msgid "The email %(email)s is not valid" msgid "The email %(email)s is not valid"
msgstr "" msgstr ""
#: forms.py:170 #: forms.py:179
msgid "Start date" msgid "Start date"
msgstr "" msgstr ""
#: forms.py:171 #: forms.py:180
msgid "End date" msgid "End date"
msgstr "" msgstr ""
#: forms.py:172 #: forms.py:181
msgid "Name for this archive (optional)" msgid "Name for this archive (optional)"
msgstr "" msgstr ""
@ -148,52 +152,52 @@ msgstr ""
msgid "a mail has been sent to you with the password" msgid "a mail has been sent to you with the password"
msgstr "" msgstr ""
#: web.py:224 #: web.py:229
#, python-format #, python-format
msgid "You have been invited to share your expenses for %(project)s" msgid "You have been invited to share your expenses for %(project)s"
msgstr "" msgstr ""
#: web.py:231 #: web.py:236
msgid "Your invitations have been sent" msgid "Your invitations have been sent"
msgstr "" msgstr ""
#: web.py:256 #: web.py:261
#, python-format #, python-format
msgid "%(member)s had been added" msgid "%(member)s had been added"
msgstr "" msgstr ""
#: web.py:268 #: web.py:273
#, python-format #, python-format
msgid "%(name)s is part of this project again" msgid "%(name)s is part of this project again"
msgstr "" msgstr ""
#: web.py:276 #: web.py:281
#, python-format #, python-format
msgid "User '%(name)s' has been deactivated" msgid "User '%(name)s' has been deactivated"
msgstr "" msgstr ""
#: web.py:278 #: web.py:283
#, python-format #, python-format
msgid "User '%(name)s' has been removed" msgid "User '%(name)s' has been removed"
msgstr "" msgstr ""
#: web.py:295 #: web.py:300
msgid "The bill has been added" msgid "The bill has been added"
msgstr "" msgstr ""
#: web.py:310 #: web.py:315
msgid "The bill has been deleted" msgid "The bill has been deleted"
msgstr "" msgstr ""
#: web.py:328 #: web.py:333
msgid "The bill has been modified" msgid "The bill has been modified"
msgstr "" msgstr ""
#: web.py:352 #: web.py:357
msgid "The data from XX to XX has been archived" msgid "The data from XX to XX has been archived"
msgstr "" msgstr ""
#: templates/add_bill.html:4 templates/edit_bill.html:4 #: templates/add_bill.html:19
msgid "Back to the list" msgid "Back to the list"
msgstr "" msgstr ""
@ -215,11 +219,12 @@ msgstr ""
msgid "Create a new project" msgid "Create a new project"
msgstr "" msgstr ""
#: templates/edit_bill.html:8 #: templates/edit_project.html:6 templates/list_bills.html:77
msgid "Edit a bill" #: templates/list_bills.html:87
msgid "you sure?"
msgstr "" msgstr ""
#: templates/edit_project.html:4 #: templates/edit_project.html:11
msgid "Edit this project" msgid "Edit this project"
msgstr "" msgstr ""
@ -231,27 +236,36 @@ msgstr ""
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
#: templates/forms.html:75 #: templates/forms.html:69
msgid "Edit the project"
msgstr ""
#: templates/forms.html:70 templates/list_bills.html:139
#: templates/list_bills.html:167
msgid "delete"
msgstr ""
#: templates/forms.html:78
msgid "Edit this bill" msgid "Edit this bill"
msgstr "" msgstr ""
#: templates/forms.html:75 #: templates/forms.html:78
msgid "Add a bill" msgid "Add a bill"
msgstr "" msgstr ""
#: templates/forms.html:99 #: templates/forms.html:102
msgid "Send the invitations" msgid "Send the invitations"
msgstr "" msgstr ""
#: templates/forms.html:100 #: templates/forms.html:103
msgid "No, thanks" msgid "No, thanks"
msgstr "" msgstr ""
#: templates/forms.html:106 #: templates/forms.html:109
msgid "Create an archive" msgid "Create an archive"
msgstr "" msgstr ""
#: templates/forms.html:112 #: templates/forms.html:115
msgid "Create the archive" msgid "Create the archive"
msgstr "" msgstr ""
@ -303,103 +317,95 @@ msgstr ""
msgid "Account manager" msgid "Account manager"
msgstr "" msgstr ""
#: templates/layout.html:52 #: templates/layout.html:54
msgid "Bills" msgid "Bills"
msgstr "" msgstr ""
#: templates/layout.html:56 #: templates/layout.html:58
msgid "options" msgid "options"
msgstr "" msgstr ""
#: templates/layout.html:58 #: templates/layout.html:60
msgid "Project settings" msgid "Project settings"
msgstr "" msgstr ""
#: templates/layout.html:62 #: templates/layout.html:64
msgid "switch to" msgid "switch to"
msgstr "" msgstr ""
#: templates/layout.html:65 #: templates/layout.html:67
msgid "Start a new project" msgid "Start a new project"
msgstr "" msgstr ""
#: templates/layout.html:67 #: templates/layout.html:69
msgid "Logout" msgid "Logout"
msgstr "" msgstr ""
#: templates/layout.html:93 #: templates/layout.html:95
msgid "This is a free software" msgid "This is a free software"
msgstr "" msgstr ""
#: templates/layout.html:93 #: templates/layout.html:95
msgid "you can contribute and improve it!" msgid "you can contribute and improve it!"
msgstr "" msgstr ""
#: templates/list_bills.html:43 #: templates/list_bills.html:115
msgid "you sure?"
msgstr ""
#: templates/list_bills.html:62
msgid "Balance" msgid "Balance"
msgstr "" msgstr ""
#: templates/list_bills.html:78 templates/list_bills.html:108 #: templates/list_bills.html:140
msgid "delete"
msgstr ""
#: templates/list_bills.html:78
msgid "reactivate" msgid "reactivate"
msgstr "" msgstr ""
#: templates/list_bills.html:89 #: templates/list_bills.html:144
msgid "The project identifier is" msgid "The project identifier is"
msgstr "" msgstr ""
#: templates/list_bills.html:89 #: templates/list_bills.html:144
msgid "remember it!" msgid "remember it!"
msgstr "" msgstr ""
#: templates/list_bills.html:90 #: templates/list_bills.html:145
msgid "Add a new bill" msgid "Add a new bill"
msgstr "" msgstr ""
#: templates/list_bills.html:92 #: templates/list_bills.html:148
msgid "hide this form" msgid "hide this form"
msgstr "" msgstr ""
#: templates/list_bills.html:98 #: templates/list_bills.html:154
msgid "When?" msgid "When?"
msgstr "" msgstr ""
#: templates/list_bills.html:98 #: templates/list_bills.html:154
msgid "Who paid?" msgid "Who paid?"
msgstr "" msgstr ""
#: templates/list_bills.html:98 #: templates/list_bills.html:154
msgid "For what?" msgid "For what?"
msgstr "" msgstr ""
#: templates/list_bills.html:98 #: templates/list_bills.html:154
msgid "How much?" msgid "How much?"
msgstr "" msgstr ""
#: templates/list_bills.html:98 #: templates/list_bills.html:154
msgid "Actions" msgid "Actions"
msgstr "" msgstr ""
#: templates/list_bills.html:106 #: templates/list_bills.html:162
msgid "each" msgid "each"
msgstr "" msgstr ""
#: templates/list_bills.html:107 #: templates/list_bills.html:164
msgid "edit" msgid "edit"
msgstr "" msgstr ""
#: templates/list_bills.html:115 #: templates/list_bills.html:177
msgid "Nothing to list yet. You probably want to" msgid "Nothing to list yet. You probably want to"
msgstr "" msgstr ""
#: templates/list_bills.html:115 #: templates/list_bills.html:177
msgid "add a bill" msgid "add a bill"
msgstr "" msgstr ""

View file

@ -15,3 +15,30 @@
} }
} }
// Automatically hide and show the default value of a text field
// handly in order to write user information in the text field.
// jquery selector should return only one text field.
var auto_hide_default_text = function(text_field_selector){
// record the text in the text field before the first text field focus
var default_text;
var hide_text = function(){
if(default_text==undefined){
default_text=this.value;
this.value="";
}
else if(this.value==default_text){
this.value="";
}
}
var show_text = function(){
if(this.value==""){
this.value=default_text;
}
}
var field = $(text_field_selector);
field.focus(hide_text);
field.blur(show_text);
}

View file

@ -1,4 +1,10 @@
{% extends "layout.html" %} {% extends "layout.html" %}
{% block head %}
<script src="{{ url_for("static", filename="ihatemoney/custom.js") }}"></script>
{% endblock %}
{% block js %}
auto_hide_default_text('#name');
{% endblock %}
{% block content %} {% block content %}
<form action="{{ url_for(".add_member") }}" method="post"> <form action="{{ url_for(".add_member") }}" method="post">
{{ forms.add_member(form) }} {{ forms.add_member(form) }}

View file

@ -2,175 +2,180 @@
{% block title %}- {{ g.project.name }}{% endblock %} {% block title %}- {{ g.project.name }}{% endblock %}
{% block head %} {% block head %}
<script src="{{ url_for("static", filename="jquery/js/jquery-ui.js") }}"></script> <script src="{{ url_for("static", filename="jquery/js/jquery-ui.js") }}"></script>
{% if g.lang != "en" %} {% if g.lang != "en" %}
<script src="{{ url_for("static", filename="jquery/i18n/jquery.ui.datepicker-%s.js" % g.lang ) }}"></script> <script src="{{ url_for("static", filename="jquery/i18n/jquery.ui.datepicker-%s.js" % g.lang ) }}"></script>
{% endif %} {% endif %}
<script src="{{ url_for("static", filename="ihatemoney/custom.js") }}"></script> <script src="{{ url_for("static", filename="ihatemoney/custom.js") }}"></script>
{% endblock %} {% endblock %}
{% block js %} {% block js %}
$(window).resize(function() { $(window).resize(function() {
$("#sidebar").height( window.innerHeight-40 ); $("#sidebar").height( window.innerHeight-40 );
$("#table_overflow").height( $("#sidebar").height()-120 ); $("#table_overflow").height( $("#sidebar").height()-120 );
}); });
// display the form when clicking on the "add bill" button // display the form when clicking on the "add bill" button
var show_form = function(){ var show_form = function(){
$('#bill-form').slideDown(100); $('#bill-form').slideDown(100);
$("#hide-bill-form").show(); $("#hide-bill-form").show();
$("#new-bill").hide(); $("#new-bill").hide();
return false; return false;
} }
// and provide a mechanism to hide it back // and provide a mechanism to hide it back
var hide_form = function(){ var hide_form = function(){
$("#bill-form").slideUp(100); $("#bill-form").slideUp(100);
$("#new-bill").show(); $("#new-bill").show();
$("#hide-bill-form").hide(); $("#hide-bill-form").hide();
return false; return false;
} }
$('#new-bill').click(show_form);
$('#empty-new-bill').click(show_form);
$('#hide-bill-form').click(hide_form);
$('#cancel-form').click(hide_form);
var tr_id; auto_hide_default_text('#name');
var id;
// display the remove button on mouse over (and hide them per default) $('#new-bill').click(show_form);
$('.balance tr').hover(function() $('#empty-new-bill').click(show_form);
{ $('#hide-bill-form').click(hide_form);
tr_id = $(this).attr('id'); $('#cancel-form').click(hide_form);
var index = tr_id.indexOf("-");
var action = tr_id.substring(0, index);
id = tr_id.substring(index+1);
var x = $(this).offset().left; var tr_id;
var y = $(this).offset().top; var id;
var width = $(this).width();
var height = $(this).height();
$('#overlay').css({ "left":x+"px", "top":y+"px", "width":width+"px", "height":height+"px", "line-height":height+"px" }).show(); // display the remove button on mouse over (and hide them per default)
$('.balance tr').hover(function()
{
tr_id = $(this).attr('id');
if(!$(this).hasClass("confirm")) var index = tr_id.indexOf("-");
{ var action = tr_id.substring(0, index);
$('#overlay').html(""); id = tr_id.substring(index+1);
if (action == 'delete')
{
$('#overlay-delete').css({ "left":(x+width/2-16)+"px", "top":(y+height/2-16)+"px" }).show();
}
else if (action == 'reactivate')
{
$('#overlay-reactivate').css({ "left":(x+width/2-16)+"px", "top":(y+height/2-16)+"px" }).show();
}
}
else
{
var url = "{{ url_for('.remove_member', member_id=id) }}";
url = url.substring(0, url.lastIndexOf('/'))+id+url.substring(url.lastIndexOf('/'));
$('#overlay').html("<a href='"+url+"' >{{_("you sure?")}}</a>");
}
});
// show confirm message before actually removing the member var x = $(this).offset().left;
$('#overlay-delete').click(function () var y = $(this).offset().top;
{ var width = $(this).width();
$('#'+tr_id).addClass("confirm"); var height = $(this).height();
var url = "{{ url_for('.remove_member', member_id=id) }}";
url = url.substring(0, url.lastIndexOf('/'))+id+url.substring(url.lastIndexOf('/'));
$('#overlay').html("<a href='"+url+"' >{{_("you sure?")}}</a>");
$(this).hide();
});
// re-create reactivation url from hover-ed item and call it $('#overlay').css({ "left":x+"px", "top":y+"px", "width":width+"px", "height":height+"px", "line-height":height+"px" }).show();
$('#overlay-reactivate').click(function ()
{
var url = "{{ url_for('.reactivate', member_id=id) }}";
url = url.substring(0, url.lastIndexOf('/'))+id+url.substring(url.lastIndexOf('/'));
$(location).attr('href', url);
});
$('#overlay').hover(function() if(!$(this).hasClass("confirm"))
{ {
}, function() $('#overlay').html("");
{ if (action == 'delete')
$('#overlay').hide(); {
$('#overlay-delete').hide(); $('#overlay-delete').css({ "left":(x+width/2-16)+"px", "top":(y+height/2-16)+"px" }).show();
$('#overlay-reactivate').hide(); }
}); else if (action == 'reactivate')
{
$('#overlay-reactivate').css({ "left":(x+width/2-16)+"px", "top":(y+height/2-16)+"px" }).show();
}
}
else
{
var url = "{{ url_for('.remove_member', member_id=id) }}";
url = url.substring(0, url.lastIndexOf('/'))+id+url.substring(url.lastIndexOf('/'));
$('#overlay').html("<a href='"+url+"' >{{_("you sure?")}}</a>");
}
});
// show confirm message before actually removing the member
$('#overlay-delete').click(function ()
{
$('#'+tr_id).addClass("confirm");
var url = "{{ url_for('.remove_member', member_id=id) }}";
url = url.substring(0, url.lastIndexOf('/'))+id+url.substring(url.lastIndexOf('/'));
$('#overlay').html("<a href='"+url+"' >{{_("you sure?")}}</a>");
$(this).hide();
});
// re-create reactivation url from hover-ed item and call it
$('#overlay-reactivate').click(function ()
{
var url = "{{ url_for('.reactivate', member_id=id) }}";
url = url.substring(0, url.lastIndexOf('/'))+id+url.substring(url.lastIndexOf('/'));
$(location).attr('href', url);
});
$('#overlay').hover(function()
{
}, function()
{
$('#overlay').hide();
$('#overlay-delete').hide();
$('#overlay-reactivate').hide();
});
$.datepicker.setDefaults({'dateFormat': 'yy-mm-dd'});
$(".datepicker").datepicker($.datepicker.regional['{{ g.lang }}']);
$.datepicker.setDefaults({'dateFormat': 'yy-mm-dd'});
$(".datepicker").datepicker($.datepicker.regional['{{ g.lang }}']);
{% endblock %} {% endblock %}
{% block sidebar %} {% block sidebar %}
<div id="sidebar" class="sidebar"> <div id="sidebar" class="sidebar">
<h2>{{ _("Balance") }}</h2> <h2>{{ _("Balance") }}</h2>
<form action="{{ url_for(".add_member") }}" method="post"> <form action="{{ url_for(".add_member") }}" method="post">
{{ forms.add_member(member_form) }} {{ forms.add_member(member_form) }}
</form> </form>
<div id="table_overflow"> <div id="table_overflow">
<table class="balance"> <table class="balance">
{% set balance = g.project.balance %} {% set balance = g.project.balance %}
{% for member in g.project.members %} {% for member in g.project.members %}
{% if member.activated or balance[member.id] != 0 %} {% if member.activated or balance[member.id] != 0 %}
<tr id="{% if member.activated %}delete{% else %}reactivate{% endif %}-{{ member.id }}"> <tr id="{% if member.activated %}delete{% else %}reactivate{% endif %}-{{ member.id }}">
<td>{{ member.name }}</td> <td>{{ member.name }}</td>
<td class="{% if balance[member.id] > 0 %}positive{% elif balance[member.id] < 0 %}negative{% endif %}"> <td class="{% if balance[member.id] > 0 %}positive{% elif balance[member.id] < 0 %}negative{% endif %}">
{% if balance[member.id] > 0 %}+{% endif %}{{ balance[member.id] }} {% if balance[member.id] > 0 %}+{% endif %}{{ balance[member.id] }}
</td> </td>
</tr> </tr>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</table> </table>
</div> </div>
</div> </div>
<div id="overlay"></div> <div id="overlay"></div>
<img id="overlay-delete" title="{{ _("delete") }}" src="{{ url_for("static", filename="delete.png") }}"> <img id="overlay-delete" title="{{ _("delete") }}" src="{{ url_for("static", filename="delete.png") }}">
<img id="overlay-reactivate" title="{{ _("reactivate") }}" src="{{ url_for("static", filename="refresh.png") }}"> <img id="overlay-reactivate" title="{{ _("reactivate") }}" src="{{ url_for("static", filename="refresh.png") }}">
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="identifier">{{ _("The project identifier is") }} <a href="{{ url_for(".list_bills") }}">{{ g.project.id }}</a>, {{ _("remember it!") }}</div> <div class="identifier">{{ _("The project identifier is") }} <a href="{{ url_for(".list_bills") }}">{{ g.project.id }}</a>, {{ _("remember it!") }}</div>
<a id="new-bill" href="{{ url_for(".add_bill") }}" class="btn primary">{{ _("Add a new bill") }}</a> <a id="new-bill" href="{{ url_for(".add_bill") }}" class="btn primary">{{ _("Add a new bill") }}</a>
<form id="bill-form" action="{{ url_for(".add_bill") }}" method="post" style="display: none"> <form id="bill-form" action="{{ url_for(".add_bill") }}" method="post" style="display: none">
<a class="btn primary" id="hide-bill-form" href="#">{{ _("hide this form") }}</a> <a class="btn primary" id="hide-bill-form" href="#">{{ _("hide this form") }}</a>
{{ forms.add_bill(bill_form) }} {{ forms.add_bill(bill_form) }}
</form> </form>
{% if bills.count() > 0 %} {% if bills.count() > 0 %}
<table class="list_bills common-table zebra-striped"> <table class="list_bills common-table zebra-striped">
<thead><tr><th>{{ _("When?") }}</th><th>{{ _("Who paid?") }}</th><th>{{ _("For what?") }}</th><th>{{ _("For whom?") }}</th><th>{{ _("How much?") }}</th><th>{{ _("Actions") }}</th></tr></thead> <thead><tr><th>{{ _("When?") }}</th><th>{{ _("Who paid?") }}</th><th>{{ _("For what?") }}</th><th>{{ _("For whom?") }}</th><th>{{ _("How much?") }}</th><th>{{ _("Actions") }}</th></tr></thead>
<tbody> <tbody>
{% for bill in bills %} {% for bill in bills %}
<tr class="{{ loop.cycle("odd", "even") }}"> <tr class="{{ loop.cycle("odd", "even") }}">
<td>{{ bill.date }}</td> <td>{{ bill.date }}</td>
<td>{{ bill.payer }}</td> <td>{{ bill.payer }}</td>
<td>{{ bill.what }}</td> <td>{{ bill.what }}</td>
<td>{% for ower in bill.owers %}{{ ower.name }} {% endfor %}</td> <td>{% for ower in bill.owers %}{{ ower.name }} {% endfor %}</td>
<td>{{ "%0.2f"|format(bill.amount) }} ({{ "%0.2f"|format(bill.pay_each()) }} {{ _("each") }})</td> <td>{{ "%0.2f"|format(bill.amount) }} ({{ "%0.2f"|format(bill.pay_each()) }} {{ _("each") }})</td>
<td class="bill-actions"> <td class="bill-actions">
<a class="edit" href="{{ url_for(".edit_bill", bill_id=bill.id) }}" title="{{ _("edit") }}"> <a class="edit" href="{{ url_for(".edit_bill", bill_id=bill.id) }}" title="{{ _("edit") }}">
<img src="{{ url_for("static", filename="pen.png") }}" /> <img src="{{ url_for("static", filename="pen.png") }}" />
</a> </a>
<a class="delete" href="{{ url_for(".delete_bill", bill_id=bill.id) }}" title="{{ _("delete") }}"> <a class="delete" href="{{ url_for(".delete_bill", bill_id=bill.id) }}" title="{{ _("delete") }}">
<img src="{{ url_for("static", filename="scissors.png") }}" /> <img src="{{ url_for("static", filename="scissors.png") }}" />
</a> </a>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
{% else %} {% else %}
<p>{{ _("Nothing to list yet. You probably want to") }} <a id="empty-new-bill" href="{{ url_for(".add_bill") }}">{{ _("add a bill") }}</a> ?</p> <p>{{ _("Nothing to list yet. You probably want to") }} <a id="empty-new-bill" href="{{ url_for(".add_bill") }}">{{ _("add a bill") }}</a> ?</p>
{% endif %} {% endif %}
@ -185,7 +190,7 @@
</div> </div>
<script> <script>
$("#sidebar").height( window.innerHeight-40 ); $("#sidebar").height( window.innerHeight-40 );
$("#table_overflow").height( $("#sidebar").height()-120 ); $("#table_overflow").height( $("#sidebar").height()-120 );
</script> </script>
{% endblock %} {% endblock %}

View file

@ -1,15 +1,15 @@
# French translations for PROJECT. # French translations for PROJECT.
# Copyright (C) 2011 ORGANIZATION # Copyright (C) 2011 ORGANIZATION
# This file is distributed under the same license as the PROJECT project. # This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011. # Alexis Métaireau <alexis@notmyidea.org>, 2011.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PROJECT VERSION\n" "Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2011-11-01 13:04+0100\n" "POT-Creation-Date: 2011-11-20 13:49+0100\n"
"PO-Revision-Date: 2011-10-14 23:51+0200\n" "PO-Revision-Date: 2011-10-14 23:51+0200\n"
"Last-Translator: Alexis Métaireau <alexis@notmyidea.org>\n" "Last-Translator: Quentin Roy <royque@gmail.com>\n"
"Language-Team: fr <LL@li.org>\n" "Language-Team: fr <LL@li.org>\n"
"Plural-Forms: nplurals=2; plural=(n > 1)\n" "Plural-Forms: nplurals=2; plural=(n > 1)\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -21,31 +21,27 @@ msgstr ""
msgid "Select All/None" msgid "Select All/None"
msgstr "Cocher Tous/Aucun" msgstr "Cocher Tous/Aucun"
#: forms.py:51 #: forms.py:57
msgid "Project name" msgid "Project name"
msgstr "Nom de projet" msgstr "Nom de projet"
#: forms.py:52 forms.py:77 forms.py:88 #: forms.py:58 forms.py:82 forms.py:93
msgid "Private code" msgid "Private code"
msgstr "Code d'accès" msgstr "Code d'accès"
#: forms.py:53 #: forms.py:59
msgid "Email" msgid "Email"
msgstr "Email" msgstr "Email"
#: forms.py:54 #: forms.py:81 forms.py:92 forms.py:98
msgid "Edit the project"
msgstr "Éditer le projet"
#: forms.py:76 forms.py:87 forms.py:93
msgid "Project identifier" msgid "Project identifier"
msgstr "Identifiant du projet" msgstr "Identifiant du projet"
#: forms.py:78 templates/send_invites.html:5 #: forms.py:83 templates/send_invites.html:5
msgid "Create the project" msgid "Create the project"
msgstr "Créer le projet" msgstr "Créer le projet"
#: forms.py:83 #: forms.py:88
msgid "" msgid ""
"The project identifier is used to log in and for the URL of the project. " "The project identifier is used to log in and for the URL of the project. "
"We tried to generate an identifier for you but a project with this " "We tried to generate an identifier for you but a project with this "
@ -57,80 +53,89 @@ msgstr ""
"celui ci existe déjà. Merci de créer un nouvel identifiant que vous serez" "celui ci existe déjà. Merci de créer un nouvel identifiant que vous serez"
" capable de retenir" " capable de retenir"
#: forms.py:89 #: forms.py:94
msgid "Get in" msgid "Get in"
msgstr "Entrer" msgstr "Entrer"
#: forms.py:94 #: forms.py:99
msgid "Send me the code by email" msgid "Send me the code by email"
msgstr "Envoyez moi le code par email" msgstr "Envoyez moi le code par email"
#: forms.py:98 #: forms.py:103
msgid "This project does not exists" msgid "This project does not exists"
msgstr "Ce projet n'existe pas" msgstr "Ce projet n'existe pas"
#: forms.py:102 #: forms.py:107
msgid "Date" msgid "Date"
msgstr "Date" msgstr "Date"
#: forms.py:103 #: forms.py:108
msgid "What?" msgid "What?"
msgstr "Quoi ?" msgstr "Quoi ?"
#: forms.py:104 #: forms.py:109
msgid "Payer" msgid "Payer"
msgstr "Payeur" msgstr "Payeur"
#: forms.py:105 #: forms.py:110
msgid "Amount paid" msgid "Amount paid"
msgstr "Montant" msgstr "Montant"
#: forms.py:106 templates/list_bills.html:98 #: forms.py:111 templates/list_bills.html:154
msgid "For whom?" msgid "For whom?"
msgstr "Pour qui ?" msgstr "Pour qui ?"
#: forms.py:108 #: forms.py:113
msgid "Send the bill" msgid "Send the bill"
msgstr "Enregistrer la facture" msgstr "Enregistrer la facture"
#: forms.py:132 #: forms.py:139
msgid "Bills can't be negative" #, fuzzy
msgid "Bills can't be null"
msgstr "Le montant d'une facture ne peut pas être négatif" msgstr "Le montant d'une facture ne peut pas être négatif"
#: forms.py:137 #: forms.py:144
msgid "Name" msgid "Name"
msgstr "Nom" msgstr "Nom"
#: forms.py:138 templates/forms.html:91 #: forms.py:144
msgid "Type user name here"
msgstr "Nouveau participant"
#: forms.py:145 templates/forms.html:94
msgid "Add" msgid "Add"
msgstr "Ajouter" msgstr "Ajouter"
#: forms.py:148 #: forms.py:153
msgid "User name incorrect"
msgstr ""
#: forms.py:157
msgid "This project already have this member" msgid "This project already have this member"
msgstr "Ce membre existe déjà pour ce projet" msgstr "Ce membre existe déjà pour ce projet"
#: forms.py:158 #: forms.py:167
msgid "People to notify" msgid "People to notify"
msgstr "Personnes à prévenir" msgstr "Personnes à prévenir"
#: forms.py:159 #: forms.py:168
msgid "Send invites" msgid "Send invites"
msgstr "Envoyer les invitations" msgstr "Envoyer les invitations"
#: forms.py:165 #: forms.py:174
#, python-format #, python-format
msgid "The email %(email)s is not valid" msgid "The email %(email)s is not valid"
msgstr "L'email %(email)s est invalide" msgstr "L'email %(email)s est invalide"
#: forms.py:170 #: forms.py:179
msgid "Start date" msgid "Start date"
msgstr "Date de départ" msgstr "Date de départ"
#: forms.py:171 #: forms.py:180
msgid "End date" msgid "End date"
msgstr "Date de fin" msgstr "Date de fin"
#: forms.py:172 #: forms.py:181
msgid "Name for this archive (optional)" msgid "Name for this archive (optional)"
msgstr "Nom pour cette archive" msgstr "Nom pour cette archive"
@ -152,52 +157,52 @@ msgstr "L'identifiant de ce projet est '%(project)s'"
msgid "a mail has been sent to you with the password" msgid "a mail has been sent to you with the password"
msgstr "Un email vous a été envoyé avec le mot de passe" msgstr "Un email vous a été envoyé avec le mot de passe"
#: web.py:224 #: web.py:229
#, python-format #, python-format
msgid "You have been invited to share your expenses for %(project)s" msgid "You have been invited to share your expenses for %(project)s"
msgstr "Vous avez été invité à partager vos dépenses pour %(project)s" msgstr "Vous avez été invité à partager vos dépenses pour %(project)s"
#: web.py:231 #: web.py:236
msgid "Your invitations have been sent" msgid "Your invitations have been sent"
msgstr "Vos invitations ont bien été envoyées" msgstr "Vos invitations ont bien été envoyées"
#: web.py:256 #: web.py:261
#, python-format #, python-format
msgid "%(member)s had been added" msgid "%(member)s had been added"
msgstr "%(member)s a bien été ajouté" msgstr "%(member)s a bien été ajouté"
#: web.py:268 #: web.py:273
#, python-format #, python-format
msgid "%(name)s is part of this project again" msgid "%(name)s is part of this project again"
msgstr "%(name)s a rejoint le projet" msgstr "%(name)s a rejoint le projet"
#: web.py:276 #: web.py:281
#, python-format #, python-format
msgid "User '%(name)s' has been deactivated" msgid "User '%(name)s' has been deactivated"
msgstr "Le membre '%(name)s' a été désactivé" msgstr "Le membre '%(name)s' a été désactivé"
#: web.py:278 #: web.py:283
#, python-format #, python-format
msgid "User '%(name)s' has been removed" msgid "User '%(name)s' has been removed"
msgstr "Le membre '%(name)s' a été supprimé" msgstr "Le membre '%(name)s' a été supprimé"
#: web.py:295 #: web.py:300
msgid "The bill has been added" msgid "The bill has been added"
msgstr "La facture a bien été ajoutée" msgstr "La facture a bien été ajoutée"
#: web.py:310 #: web.py:315
msgid "The bill has been deleted" msgid "The bill has been deleted"
msgstr "La facture a été supprimée" msgstr "La facture a été supprimée"
#: web.py:328 #: web.py:333
msgid "The bill has been modified" msgid "The bill has been modified"
msgstr "La facture a été modifiée" msgstr "La facture a été modifiée"
#: web.py:352 #: web.py:357
msgid "The data from XX to XX has been archived" msgid "The data from XX to XX has been archived"
msgstr "Les données de XX à XX ont été archivées" msgstr "Les données de XX à XX ont été archivées"
#: templates/add_bill.html:4 templates/edit_bill.html:4 #: templates/add_bill.html:19
msgid "Back to the list" msgid "Back to the list"
msgstr "Retourner à la liste" msgstr "Retourner à la liste"
@ -219,11 +224,12 @@ msgstr " ?"
msgid "Create a new project" msgid "Create a new project"
msgstr "Créer un nouveau projet" msgstr "Créer un nouveau projet"
#: templates/edit_bill.html:8 #: templates/edit_project.html:6 templates/list_bills.html:77
msgid "Edit a bill" #: templates/list_bills.html:87
msgstr "Éditer une facture" msgid "you sure?"
msgstr "c'est sûr ?"
#: templates/edit_project.html:4 #: templates/edit_project.html:11
msgid "Edit this project" msgid "Edit this project"
msgstr "Éditer ce projet" msgstr "Éditer ce projet"
@ -235,27 +241,36 @@ msgstr "Vous ne vous souvenez plus du code d'accès ?"
msgid "Cancel" msgid "Cancel"
msgstr "Annuler" msgstr "Annuler"
#: templates/forms.html:75 #: templates/forms.html:69
msgid "Edit the project"
msgstr "Éditer le projet"
#: templates/forms.html:70 templates/list_bills.html:139
#: templates/list_bills.html:167
msgid "delete"
msgstr "supprimer"
#: templates/forms.html:78
msgid "Edit this bill" msgid "Edit this bill"
msgstr "Éditer cette facture" msgstr "Éditer cette facture"
#: templates/forms.html:75 #: templates/forms.html:78
msgid "Add a bill" msgid "Add a bill"
msgstr "Ajouter une facture" msgstr "Ajouter une facture"
#: templates/forms.html:99 #: templates/forms.html:102
msgid "Send the invitations" msgid "Send the invitations"
msgstr "Envoyer les invitations" msgstr "Envoyer les invitations"
#: templates/forms.html:100 #: templates/forms.html:103
msgid "No, thanks" msgid "No, thanks"
msgstr "Non merci" msgstr "Non merci"
#: templates/forms.html:106 #: templates/forms.html:109
msgid "Create an archive" msgid "Create an archive"
msgstr "Créer une archive" msgstr "Créer une archive"
#: templates/forms.html:112 #: templates/forms.html:115
msgid "Create the archive" msgid "Create the archive"
msgstr "Créer l'archive" msgstr "Créer l'archive"
@ -307,103 +322,95 @@ msgstr "c'est parti !"
msgid "Account manager" msgid "Account manager"
msgstr "Gestion de comptes" msgstr "Gestion de comptes"
#: templates/layout.html:52 #: templates/layout.html:54
msgid "Bills" msgid "Bills"
msgstr "Factures" msgstr "Factures"
#: templates/layout.html:56 #: templates/layout.html:58
msgid "options" msgid "options"
msgstr "options" msgstr "options"
#: templates/layout.html:58 #: templates/layout.html:60
msgid "Project settings" msgid "Project settings"
msgstr "Options du projet" msgstr "Options du projet"
#: templates/layout.html:62 #: templates/layout.html:64
msgid "switch to" msgid "switch to"
msgstr "aller à" msgstr "aller à"
#: templates/layout.html:65 #: templates/layout.html:67
msgid "Start a new project" msgid "Start a new project"
msgstr "Nouveau projet" msgstr "Nouveau projet"
#: templates/layout.html:67 #: templates/layout.html:69
msgid "Logout" msgid "Logout"
msgstr "Se déconnecter" msgstr "Se déconnecter"
#: templates/layout.html:93 #: templates/layout.html:95
msgid "This is a free software" msgid "This is a free software"
msgstr "Ceci est un logiciel libre" msgstr "Ceci est un logiciel libre"
#: templates/layout.html:93 #: templates/layout.html:95
msgid "you can contribute and improve it!" msgid "you can contribute and improve it!"
msgstr "vous pouvez y contribuer et l'améliorer" msgstr "vous pouvez y contribuer et l'améliorer"
#: templates/list_bills.html:43 #: templates/list_bills.html:115
msgid "you sure?"
msgstr "c'est sûr ?"
#: templates/list_bills.html:62
msgid "Balance" msgid "Balance"
msgstr "Balance" msgstr "Balance"
#: templates/list_bills.html:78 templates/list_bills.html:108 #: templates/list_bills.html:140
msgid "delete"
msgstr "supprimer"
#: templates/list_bills.html:78
msgid "reactivate" msgid "reactivate"
msgstr "ré-activer" msgstr "ré-activer"
#: templates/list_bills.html:89 #: templates/list_bills.html:144
msgid "The project identifier is" msgid "The project identifier is"
msgstr "L'identifiant de ce projet est" msgstr "L'identifiant de ce projet est"
#: templates/list_bills.html:89 #: templates/list_bills.html:144
msgid "remember it!" msgid "remember it!"
msgstr "souvenez vous en !" msgstr "souvenez vous en !"
#: templates/list_bills.html:90 #: templates/list_bills.html:145
msgid "Add a new bill" msgid "Add a new bill"
msgstr "Nouvelle facture" msgstr "Nouvelle facture"
#: templates/list_bills.html:92 #: templates/list_bills.html:148
msgid "hide this form" msgid "hide this form"
msgstr "cacher ce formulaire" msgstr "cacher ce formulaire"
#: templates/list_bills.html:98 #: templates/list_bills.html:154
msgid "When?" msgid "When?"
msgstr "Quand ?" msgstr "Quand ?"
#: templates/list_bills.html:98 #: templates/list_bills.html:154
msgid "Who paid?" msgid "Who paid?"
msgstr "Qui a payé ?" msgstr "Qui a payé ?"
#: templates/list_bills.html:98 #: templates/list_bills.html:154
msgid "For what?" msgid "For what?"
msgstr "Pour quoi ?" msgstr "Pour quoi ?"
#: templates/list_bills.html:98 #: templates/list_bills.html:154
msgid "How much?" msgid "How much?"
msgstr "Combien ?" msgstr "Combien ?"
#: templates/list_bills.html:98 #: templates/list_bills.html:154
msgid "Actions" msgid "Actions"
msgstr "Actions" msgstr "Actions"
#: templates/list_bills.html:106 #: templates/list_bills.html:162
msgid "each" msgid "each"
msgstr "chacun" msgstr "chacun"
#: templates/list_bills.html:107 #: templates/list_bills.html:164
msgid "edit" msgid "edit"
msgstr "éditer" msgstr "éditer"
#: templates/list_bills.html:115 #: templates/list_bills.html:177
msgid "Nothing to list yet. You probably want to" msgid "Nothing to list yet. You probably want to"
msgstr "Rien à lister pour l'instant. Vous voulez surement" msgstr "Rien à lister pour l'instant. Vous voulez surement"
#: templates/list_bills.html:115 #: templates/list_bills.html:177
msgid "add a bill" msgid "add a bill"
msgstr "ajouter une facture" msgstr "ajouter une facture"