mirror of
https://github.com/YunoHost-Apps/ihatemoney_ynh.git
synced 2024-09-03 19:26:15 +02:00
Some more theming and fixes.
This commit is contained in:
parent
37be0f4fa1
commit
548101d8bb
12 changed files with 71 additions and 216 deletions
|
@ -1,106 +0,0 @@
|
|||
/*
|
||||
awesome buttons are based on a blog post by ZERB
|
||||
Read there blog post for more information:
|
||||
"Super awesome Buttons with CSS3 and RGBA":http://www.zurb.com/article/266/super-awesome-buttons-with-css3-and-rgba
|
||||
|
||||
this buttons are even more awesome, as the need only one color for all three states,
|
||||
and have an super awesome onclick state
|
||||
*/
|
||||
|
||||
/* set an awesome color for the buttons, feel free to add new colors like an .awesome.green or .awesome.secondary */
|
||||
.awesome {
|
||||
background-color: #111 !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
/* the awesome size gets set here. Feel Free to add new sizes, like .awesome.small or .small.large */
|
||||
.awesome { padding: 5px 10px 6px !important; font-size: 13px !important; }
|
||||
.awesome:active { padding: 6px 10px 5px !important; }
|
||||
|
||||
/* Touch the rest at your onw risk. */
|
||||
.awesome {
|
||||
border: 0 !important;
|
||||
cursor: pointer !important;
|
||||
font-style: normal !important;
|
||||
font-weight: bold !important;
|
||||
font: inherit !important;
|
||||
line-height: 1 !important;
|
||||
position: relative !important;
|
||||
text-align: cente !important;
|
||||
text-decoration: none !important;
|
||||
|
||||
/* vertical margin is the oposite of button's awesomeness */
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
|
||||
/* not all browser support these, but who cares? */
|
||||
text-shadow: 0 -1px 1px rgba(0,0,0,0.25), -2px 0 1px rgba(0,0,0,0.25) !important;
|
||||
|
||||
border-radius: 5px !important;
|
||||
-moz-border-radius: 5px !important;
|
||||
-webkit-border-radius: 5px !important;
|
||||
box-shadow: 0 1px 2px rgba(0,0,0,0.5) !important;
|
||||
-moz-box-shadow: 0 1px 2px rgba(0,0,0,0.5) !important;
|
||||
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.5) !important;
|
||||
|
||||
/* who needs images these days? */
|
||||
background-image: -moz-linear-gradient(top, rgba(255,255,255,.2), rgba(150,150,150,.2), rgba(0,0,0,.0)) !important;
|
||||
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(255,255,255,.2)), color-stop(0.5, rgba(150,150,150,.2)), to(rgba(0,0,0,.0))) !important;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#30ffffff,endColorstr=#10000000) progid:DXImageTransform.Microsoft.Shadow(color=#000000,direction=135,strength=2);
|
||||
|
||||
/* cross browser inline block hack
|
||||
see http://blog.mozilla.com/webdev/2009/02/20/cross-browser-inline-block/ */
|
||||
display: -moz-inline-stack;
|
||||
display: inline-block;
|
||||
vertical-align: middle !important;
|
||||
*display: inline !important;
|
||||
position: relative;
|
||||
|
||||
/* IE luv */
|
||||
zoom: 1;
|
||||
|
||||
/*disable text selection (Firefox only)*/
|
||||
-moz-user-select: none;
|
||||
}
|
||||
|
||||
/* OPERA only
|
||||
if there is no border set, Opera shows a transparent background-color if border-radius is set. */
|
||||
@media all and (-webkit-min-device-pixel-ratio:10000),not all and (-webkit-min-device-pixel-ratio:0) {
|
||||
input.awesome {
|
||||
border: 1px solid RGBa(0,0,0,0) !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* hide selection background color */
|
||||
.awesome::selection {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.awesome {
|
||||
outline: 0; /*remove dotted line, works for links only*/
|
||||
}
|
||||
.awesome::-moz-focus-inner {
|
||||
border: none; /* remove dotted lines for buttons */
|
||||
}
|
||||
.awesome:focus,
|
||||
.awesome:hover {
|
||||
background-image: -moz-linear-gradient(top, rgba(255,255,255,.4), rgba(150,150,150,.3), rgba(0,0,0,.0)) !important;
|
||||
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(255,255,255,.4)), color-stop(0.5, rgba(150,150,150,.3)), to(rgba(0,0,0,.0))) !important;
|
||||
#filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#50ffffff,endColorstr=#20000000) progid:DXImageTransform.Microsoft.Shadow(color=#000000,direction=135,strength=2);
|
||||
}
|
||||
.awesome:active {
|
||||
background-image: -moz-linear-gradient(top, rgba(0,0,0,.2), rgba(150,150,150,.2), rgba(255,255,255,.2)) !important;
|
||||
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(0,0,0,.2)), color-stop(0.5, rgba(150,150,150,.2)), to(rgba(255,255,255,.2))) !important;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#20000000,endColorstr=#50ffffff) progid:DXImageTransform.Microsoft.Shadow(color=#000000,direction=315,strength=1);
|
||||
|
||||
box-shadow: inset 0 1px 2px rgba(0,0,0,0.7) !important;
|
||||
-moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.7) !important;
|
||||
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.7) !important;
|
||||
}
|
||||
|
||||
/* Safari doesn't support inset box shadow, so we better remove it */
|
||||
@media screen and (-webkit-min-device-pixel-ratio:0){
|
||||
.awesome:active {
|
||||
-webkit-box-shadow: none;
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
@import url('awesome-buttons.css');
|
||||
|
||||
/* awesome buttons extensions */
|
||||
.awesome.blue {
|
||||
background-color: #0A50FF !important;
|
||||
}
|
||||
.awesome.red {
|
||||
background-color: #e33100 !important;
|
||||
}
|
||||
.awesome.green {
|
||||
background-color: #3ACC00 !important;
|
||||
}
|
||||
.awesome.orange {
|
||||
background-color: #ff8f0b !important;
|
||||
}
|
||||
.awesome.small {
|
||||
padding: 4px 7px 5px !important;
|
||||
font-size: 10px !important;
|
||||
}
|
||||
.awesome.small:active {
|
||||
padding: 5px 7px 4px !important;
|
||||
}
|
||||
.awesome.large {
|
||||
padding: 8px 14px 9px !important;
|
||||
font-size: 14px !important;
|
||||
}
|
||||
.awesome.large:active {
|
||||
padding: 9px 14px 8px !important;
|
||||
}
|
|
@ -35,9 +35,11 @@
|
|||
|
||||
.uniForm legend{ font-weight: bold; font-size: 100%; margin: 0; padding: 1.5em 0; }
|
||||
|
||||
.uniForm .ctrlHolder{ padding: 1em; }
|
||||
.uniForm .ctrlHolder.focused{ background: #e1f0f6; }
|
||||
|
||||
.uniForm label { float: left; line-height: 300%;}
|
||||
.uniForm input, .uniForm select { float: right }
|
||||
|
||||
.uniForm .buttonHolder{ background: #c4ced1; text-align: right; margin: 1.5em 0 0 0; padding: 1.5em;
|
||||
/* CSS3 */
|
||||
border-radius: 4px;
|
||||
|
|
|
@ -5,26 +5,11 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Let's add a bill</h2>
|
||||
<h2>Add a new bill</h2>
|
||||
|
||||
{% if form.errors %}
|
||||
<p class=error><strong>Your form contains errors.</strong></p>
|
||||
<ul>
|
||||
{% for field, errors in form.errors.items() %}
|
||||
{% for error in errors %}
|
||||
<li>{{ field }} : {{ error }}</li>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
<form action="{{ url_for('add_bill', project_id=project.id) }}" method=post class="container span-24 add-bill">
|
||||
{{ form.hidden_tag() }}
|
||||
|
||||
<p>{{ form.payer.label }}<br /> {{ form.payer }}</p>
|
||||
<p>{{ form.what.label }}<br /> {{ form.what }}</p>
|
||||
<p>{{ form.amount.label }}<br />{{ form.amount }}</p>
|
||||
<p>{{ form.payed_for.label }}<br /> {{ form.payed_for(multiple=True) }}</p>
|
||||
<p>{{ form.submit }}</p>
|
||||
<div class="container span-24 add-bill uniForm" style="width: 400px">
|
||||
<form action="{{ url_for('add_bill', project_id=project.id) }}" method="post" class=uniForm">
|
||||
{{ forms.add_bill(form) }}
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
{% extends "layout.html" %}
|
||||
{% block content %}
|
||||
{% include "member_form.html" %}
|
||||
<form action="{{ url_for("add_member", project_id=project.id) }}" method="post">
|
||||
{{ forms.add_member(form) }}
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
{% import "forms.html" as forms %}
|
||||
<div class="uniForm">
|
||||
<form action="{{ url_for('add_bill', project_id=project.id) }}" method="post" class=uniForm">
|
||||
{{ form.hidden_tag() }}
|
||||
{{ forms.input(form.what) }}
|
||||
{{ forms.input(form.payer) }}
|
||||
{{ forms.input(form.amount) }}
|
||||
{{ forms.input(form.payed_for, multiple=True) }}
|
||||
<p>{{ form.submit }}</p>
|
||||
</form>
|
||||
</div>
|
|
@ -2,20 +2,10 @@
|
|||
|
||||
{% block content %}
|
||||
<h2>Create a new project</h2>
|
||||
|
||||
{% if form.errors %}
|
||||
<p class=error><strong>Your form contains errors.</strong></p>
|
||||
<ul>{% for error in form.errors %}<li>{{ error }}</li>{% endfor %}</ul>
|
||||
{% endif %}
|
||||
|
||||
<div class="uniForm">
|
||||
<form method="post" class="container span-24 add-bill">
|
||||
{{ form.hidden_tag() }}
|
||||
|
||||
<p>{{ form.name.label }}<br /> {{ form.name }}</p>
|
||||
<p>{{ form.id.label }}<br /> {{ form.id }}</p>
|
||||
<p>{{ form.password.label }}<br /> {{ form.password }}</p>
|
||||
<p>{{ form.contact_email.label }}<br /> {{ form.contact_email }}</p>
|
||||
<p>{{ form.submit }}</p>
|
||||
{{ forms.create_project(form) }}
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -11,3 +11,46 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro authenticate(form) %}
|
||||
|
||||
{% include "display_errors.html" %}
|
||||
{{ form.hidden_tag() }}
|
||||
{{ input(form.id) }}
|
||||
{{ input(form.password) }}
|
||||
{{ input(form.submit) }}
|
||||
|
||||
{% endmacro %}
|
||||
|
||||
{% macro create_project(form) %}
|
||||
|
||||
{% include "display_errors.html" %}
|
||||
{{ form.hidden_tag() }}
|
||||
{{ input(form.name) }}
|
||||
{{ input(form.id) }}
|
||||
{{ input(form.password) }}
|
||||
{{ input(form.contact_email) }}
|
||||
{{ input(form.submit) }}
|
||||
|
||||
{% endmacro %}
|
||||
|
||||
{% macro add_bill(form) %}
|
||||
|
||||
{% include "display_errors.html" %}
|
||||
{{ form.hidden_tag() }}
|
||||
{{ input(form.what) }}
|
||||
{{ input(form.payer) }}
|
||||
{{ input(form.amount) }}
|
||||
{{ input(form.payed_for, multiple=True) }}
|
||||
{{ input(form.submit) }}
|
||||
|
||||
{% endmacro %}
|
||||
|
||||
{% macro add_member(form) %}
|
||||
|
||||
{% include "display_errors.html" %}
|
||||
{{ form.hidden_tag() }}
|
||||
{{ input(form.name) }}
|
||||
{{ input(form.submit) }}
|
||||
|
||||
{% endmacro %}
|
||||
|
|
|
@ -1,37 +1,21 @@
|
|||
{% extends "layout.html" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h2>Welcome on the budget manager</h2>
|
||||
<div class="span-12 prepend-2">
|
||||
<form action="{{ url_for('authenticate') }}" method="post" accept-charset="utf-8">
|
||||
<div class="span-12 prepend-2 uniForm" >
|
||||
<form action="{{ url_for('authenticate') }}" method="post" style="width: 300px">
|
||||
<h3>Log to an existing project...</h3>
|
||||
|
||||
{{ auth_form.hidden_tag() }}
|
||||
|
||||
<p>{{ auth_form.id.label }}<br /> {{ auth_form.id }}</p>
|
||||
<p>{{ auth_form.password.label }}<br /> {{ auth_form.password }}</p>
|
||||
<p>{{ auth_form.submit }}</p>
|
||||
{{ forms.authenticate(auth_form) }}
|
||||
</form>
|
||||
{% if 'projects' in session %}
|
||||
<h3>Recently visisted projects</h3>
|
||||
<ul>
|
||||
{% for id, name in session['projects'] %}
|
||||
<li><a href="{{ url_for("list_bills", project_id=id) }}">{{ name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% include "recent_projects.html" %}
|
||||
</div>
|
||||
|
||||
<form class="span-10 last" action="{{ url_for('create_project') }}" method="post" class="container span-24 add-bill">
|
||||
<h3>...or create a new one</h3>
|
||||
|
||||
{{ project_form.hidden_tag() }}
|
||||
|
||||
<p>{{ project_form.name.label }}<br /> {{ project_form.name }}</p>
|
||||
<p>{{ project_form.id.label }}<br /> {{ project_form.id }}</p>
|
||||
<p>{{ project_form.password.label }}<br /> {{ project_form.password }}</p>
|
||||
<p>{{ project_form.contact_email.label }}<br /> {{ project_form.contact_email }}</p>
|
||||
<p>{{ project_form.submit }}</p>
|
||||
</form>
|
||||
<div class="span-10 last uniForm" >
|
||||
<form action="{{ url_for('create_project') }}" method="post" style="width: 300px">
|
||||
<h3>...or create a new one</h3>
|
||||
{{ forms.create_project(project_form) }}</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
{% import "forms.html" as forms %}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
{% include "display_errors.html" %}
|
||||
<form action="{{ url_for("add_member", project_id=project.id) }}" method="post">
|
||||
{{ form.hidden_tag() }}
|
||||
<p>{{ form.name.label }}<br /> {{ form.name }}</p>
|
||||
<p>{{ form.submit }}</p>
|
||||
</form>
|
|
@ -4,10 +4,10 @@ from flask import redirect, url_for, session, request
|
|||
from models import Bill, Project
|
||||
from forms import BillForm
|
||||
|
||||
def get_billform_for(project_id):
|
||||
def get_billform_for(project):
|
||||
"""Return an instance of BillForm configured for a particular project."""
|
||||
form = BillForm()
|
||||
payers = [(str(m.id), m.name) for m in Project.query.get(project_id).members]
|
||||
payers = [(str(m.id), m.name) for m in project.active_members]
|
||||
form.payed_for.choices = form.payer.choices = payers
|
||||
return form
|
||||
|
||||
|
|
Loading…
Reference in a new issue