Commit graph

311 commits

Author SHA1 Message Date
Lucas Verney
32f2339c47 More responsive layout (#213)
Fix navbar responsiveness on mobile.
2017-06-11 19:33:22 +02:00
0livd
ea8eda35a7 Public project creation and admin permissions (#210)
* Add a @requires_admin decorator

It can be used to protect specific endpoints with ADMIN_PASSWORD
(a password that is stored unencrypted in the settings)
The decorator has no effect if ADMIN_PASSWORD is an empty string (default value)

* Require admin permissions to access create project endpoint

When ADMIN_PASSWORD is not empty, project creation form on the
home page will be replaced by a link to the create project endpoint
so one is able to enter the admin password before filling the form
2017-05-18 11:48:09 +02:00
0livd
091553be56 Add ACTIVATE_DEMO_PROJECT setting (#209)
When set to False (True by default), it deactivates
the demo project
2017-05-17 00:21:41 +02:00
0livd
e3da3b3b7f Externalize the settings (#193)
Default settings from app's root path are loaded first
Settings are then overriden by /etc/ihatemoney/ihatemoney.cfg
or by another file which path is set in an env var
Fixes #187
2017-04-23 18:32:37 +02:00
0livd
fb84135fe5 Move tests to budget.tests (#205)
* Move tests to budget.tests

Update tox.ini to call the unittest dicovery module
Closes #196

* Fix typo in Readme
2017-04-22 23:07:24 +02:00
Jocelyn Delalande
95d0c71827 Use propper base64 encoding version for py3
Removes py3-only warning (this alias might be removed in future py3 version):

> DeprecationWarning: encodestring() is a deprecated alias, use encodebytes()
>  ('%s:%s' % (username, password)).encode('utf-8')).decode('utf-8').replace('\n', '')

py2-compatible change.
2017-03-29 15:31:28 +02:00
Jocelyn Delalande
f6236b43ca Remove ExtDeprecationWarning from manage.py
Using new-style flask extensions imports.
grep tells me there were the only flask.ext.* occurences remaining in ihatemoney code.
2017-03-29 15:15:47 +02:00
Jocelyn Delalande
ec75e55416 Remove deprecated wtforms TextField
It is a bare alias of StringField (thus, no alembic migration is required),
deprecated since wtforms v2.0 (2013).

Removes the following warning:

> DeprecationWarning: The TextField alias for StringField has been deprecated and will be removed in WTForms 3.0

Ref f07729dd45
2017-03-29 15:11:40 +02:00
Jocelyn Delalande
c7f4547d5d Use non-deprecated way to disable CSRF for API
See also https://github.com/lepture/flask-wtf/pull/287
2017-03-29 14:32:43 +02:00
Jocelyn Delalande
7380b6f9f7 Explicitly disables SQLALCHEMY_TRACK_MODIFICATIONS
That noisy warning was everywhere in our test/CI logs before that commit:

> ./home/travis/build/spiral-project/ihatemoney/.tox/py27/lib/python2.7/site-packages/flask_sqlalchemy/__init__.py:839: FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future.  Set it to True or False to suppress this warning.
>
>  'SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhe
2017-03-29 12:11:24 +02:00
JocelynDelalande
bf2c11f8a9 Merge pull request #190 from spiral-project/use-app-root
Use app.root_path instead of __HERE__
2017-03-29 11:47:12 +02:00
Jocelyn Delalande
dfe8297fae Add Python 3.4 support
Note that py3.4 is the version shipped in current Debian version (Jessie).
2017-03-29 11:21:39 +02:00
f43b3dc41d Use app.root_path instead of __HERE__ 2017-03-29 00:07:53 +02:00
d1facecc69 Create a Makefile to ease development 2017-03-28 17:41:34 +02:00
3dac51208d Merge pull request #181 from 0livd/remove_archive
Remove unused archive feature
2017-03-20 14:00:51 +01:00
0livd
ceab95b444 Remove unused archive feature
The archive table is not removed from the database model
because it would involve a tricky migration
fixes #170
2017-03-19 20:16:06 +01:00
0livd
735c12ea45 Use project.id in export filename as it is already slugified 2017-03-19 17:30:55 +01:00
0livd
59a050e020 Make ihatemoney Py2/3 compatible
Flask-wtf>=0.13 is now required and Form is replaced by FlaskForm
Py2/3 compatibility is assured by six
2017-03-17 19:37:57 +01:00
0livd
10a16a3b5c Fix broken authentication test 2017-03-12 22:47:54 +01:00
0livd
108970eb50 Fix tab indentation 2017-03-12 22:23:24 +01:00
0livd
e35480d6b7 Add export feature
Bills and transactions can now be exported to json or csv

ref #28
2017-03-09 23:24:18 +01:00
Jocelyn Delalande
8c412b391f Add non-regression test for member name XSS
ref #173
2017-02-22 00:31:52 +01:00
Alexandre Avenel
38d4534c69 Fix id in form label
Checking item was broken when clicking on the label instead of the checkbox
2017-02-16 23:36:45 +01:00
Alexandre Avenel
4c02ad51ac Remove obsolete code 2017-02-16 23:34:07 +01:00
Alexandre Avenel
baba943e62 Fix xss (#173)
Fix #173
Rewrite multi select widget as a template in order to have all values properly escaped.
2017-02-16 23:11:30 +01:00
3dd7c67ecf Merge pull request #172 from JocelynDelalande/jd-bootstrap-4
WIP: Upgrade to bootstrap 4
2017-02-15 20:42:48 +01:00
Jocelyn Delalande
57596b5f46 Prevent "Add new bill" button flickering 2017-02-09 16:49:01 +01:00
Jocelyn Delalande
7d3ebe5378 Prevent dancing cells while hovering sidebar lines
Fix a regression introduced with BS4 update.
2017-02-09 16:41:19 +01:00
Jocelyn Delalande
8b96dcb257 Prevent modal overflow
Allowing the modal to extend; thus "natural" page scrolling allows to see the
whole popup.
2017-02-09 15:47:28 +01:00
Jocelyn Delalande
0aafbcc0b3 Update bootstrap-datepicker to 1.6.4
Actually switching to maintained fork at
https://github.com/uxsolutions/bootstrap-datepicker ; the original project
being unmaintained since 2012.

- Works with recent jQuery
- BS4 is not supported by bootstrap-datepicker, but actually, it works :-)

ref https://github.com/uxsolutions/bootstrap-datepicker/issues/1670
2017-02-07 15:38:18 +01:00
Jocelyn Delalande
fe39258630 Adapt list bills view to bootstrap 4
- modal classes and hierarchy changed since BS2
- striped tables are now handled by css3 pseudo-class rather than classes
- fix placement/alignment for the button and comment above the table
2017-02-04 00:41:28 +01:00
Jocelyn Delalande
a47d91fab9 Do not force huge add member button
BS4 provides larger touch-friendly controls anyway.
2017-02-04 00:41:28 +01:00
Jocelyn Delalande
f9856cb991 Adapt tryout button to bootstrap 4
Trying to keep same look'n'feel.
2017-02-04 00:41:28 +01:00
Jocelyn Delalande
c6c5f8657e Adapt navigation bar to bootstrap 4
Also fixed some weird alignment issues.
I think this will need more work later (revamp the navbar layout to avoid that
sensation of thing which are floating at random places in the navbar).
2017-02-04 00:41:28 +01:00
Jocelyn Delalande
e148d19e96 Add a label for screen-readers on user add form
There was no label, which is bad for accessibility.
2017-02-04 00:41:28 +01:00
Jocelyn Delalande
a3cbede680 Refactor layout based on bootstrap 4 grid 2017-02-04 00:41:20 +01:00
Jocelyn Delalande
2862130269 Adapt to bootstrap 4 forms
- Adapt to BS4 class names and hierarchy
- Redesign some forms to have the label above the input (mobile-friendly)
- For the remaining inline form (add bill), use the grid, as BS no longer
  provides inline form alignment helpers
2017-02-04 00:41:05 +01:00
Jocelyn Delalande
37da1db38a Update bootstrap dependency to bootstrap 4 2017-02-04 00:40:59 +01:00
Berteh
c9b5e87b90 Improve translation for user edit form. 2017-02-01 22:30:59 +01:00
Jocelyn Delalande
87d2dea9c8 Factor navbar between list_bills and settle_bill 2017-01-30 23:23:03 +01:00
Alexandre Avenel
5d009d839b Fix deprecation issues (ExtDeprecationWarning) 2017-01-21 15:03:58 +01:00
Alexandre Avenel
58aebf1069 Fix unit test rounding :
Test was Ok but failed due to some floating point errors.
2017-01-21 14:12:49 +01:00
963fcf0af1 Merge pull request #166 from JocelynDelalande/jd-fix-prefixed-test
Fix ServerTestCase.test_unprefixed test
2017-01-17 09:34:47 +01:00
8615fde00a Merge pull request #161 from zorun/optimise_sql
Optimise sql queries
2017-01-16 21:15:43 +01:00
dc75a72dd0 Merge pull request #164 from zorun/fix_zero_transfers
Fix zero-amount transfers and other rounding issues
2017-01-16 21:13:56 +01:00
Jocelyn Delalande
376a0b37e3 Fix ServerTestCase.test_unprefixed test
The test was always failing, actual reason is the `app.run.configure()` fails
to reset the `APPLICATION_ROOT` setting which `ServerTestCase.test_prefixed`
overloads (side effect).

This patch *do not* fix app.run.configure as it seems uneasy, but takes a
different approach which has the advantage of making the test more explicit.

Would still be a good thing to investigate more on configure().

Fix #163
2017-01-09 10:11:50 +01:00
Baptiste Jonglez
d6cf89008f Workaround rounding issues when displaying balance of users
A user with a "0.00" balance would have either a "+0.00" in green or a
"-0.00" in red, depending on the exact value of the floating-point value.

Fix this by simply rounding to 2 digits before comparing to zero.
2017-01-03 21:37:19 +01:00
Baptiste Jonglez
b507a5afa1 Prevent transfers with a zero amount in the settle page
This workarounds a rounding issue caused by the (incorrect) usage of
floats for bill amounts.

This fixes #138
2017-01-03 21:37:19 +01:00
Baptiste Jonglez
543df7c1d4 Add a test to catch zero-amount transfers in the settle page 2017-01-03 21:37:19 +01:00
Baptiste Jonglez
699db1c4c8 Sort bills by (date.desc, ID.desc) instead of just date.desc
When viewing the list of bills, bills are (correctly) sorted by date.  But
the order of all bills for a given day is not intuitive: I would expect
bills to be sorted by reverse order of insertion.  That is, the last bill
to be added for a given day should appear first, not last.  Otherwise,
when adding several bills in a row for a given day, it's confusing to see
that the new bills do not appear on top of the list.

Fix this by sorting by decreasing ID after sorting by date.
2017-01-02 13:22:28 +01:00