Commit graph

623 commits

Author SHA1 Message Date
Aurélien Delobelle 5673fabeff Better status management.
Status is mainly computed in Python. That fix inconsistent datetime between
client and server.

Client only receives status and keep timestamp of last received ws msg.
2017-06-22 16:36:08 +02:00
Aurélien Delobelle 19847ac9d8 add token check to raw_open edit view 2017-06-22 15:48:45 +02:00
Aurélien Delobelle 98f5f0c391 update refresh/unknown interval 2017-06-22 05:44:05 +02:00
Aurélien Delobelle 782e105644 typo 2017-06-21 23:31:27 +02:00
Aurélien Delobelle b8110c11a4 kfet.open
kfet.open app
- Base data (raw_open, last_update...) is stored and shared through cache system.
- 2 websockets groups: one for team users, one for other users.
- UI is initialized and kept up-to-date with WS.
- raw_open and force_close can be updated with standard HTTP requests.
  At this time, there isn't any restriction on raw_open view. Common sense tell us
  to change this behavior.

Misc
- Clean channels routing.
- 'PermConsumerMixin': user who sent the message is available as argument in
connection_groups method, which returns groups to which the user should be
appended on websocket connection (and discarded on disconnection).
- New kfet.utils module: should be used for mixins, whatever is useful and not concerns
the kfet app.
- Clean JS dependencies.
2017-06-21 07:08:28 +02:00
Aurélien Delobelle ec59bc2edc Merge branch 'master' into aureplop/kfet_open 2017-06-12 15:18:42 +02:00
Aurélien Delobelle 5bed02c3fc Merge branch 'Kerl/banner' into 'master'
Add an announcement banner

Closes #151

See merge request !236
2017-05-30 23:35:08 +02:00
Martin Pépin ea21b07657 Add an announcement banner 2017-05-25 23:58:59 +01:00
Martin Pepin b13e992a30 Merge branch 'aureplop/clean_scroll' into 'master'
Misc UI

Closes #90 and #115

See merge request !225
2017-05-25 23:03:40 +02:00
Aurélien Delobelle 0815c96c1c Merge branch 'Kerl/postgres' into 'master'
Préparation au passage à postgres
- Suppression du champ num du modèle CofProfile.
- Suppression des LOCK (spécifique MySQL).
- Le code devient compatible avec tous les backends supportés par Django.
- Suppressions de code servant à la compatibilité python2.
- Corrige le message de succès à la fin de l'inscription. Celui-ci ne prenait pas en compte le statut is_cof à jour du profil.

See merge request !234
2017-05-23 22:50:10 +02:00
Martin Pépin 3a69c3371f Simple test: we can query the account-read page 2017-05-23 20:38:53 +01:00
Aurélien Delobelle 1d269ef4f9 Update migration to keep perms.
If content type for old kfet.GlobalPermissions exists:
- custom permissions related to this content type are updated to new content types,
- then we can safely remove this content type.
2017-05-23 16:48:33 +02:00
Aurélien Delobelle cd5a2e0591 Move K-Fêt global permissions. 2017-05-23 13:47:40 +02:00
Aurélien Delobelle e60e347a53 Add base templates to extend
- kfet/base_col_1.html for one column content.
- kfet/base_col_2.html for two columns content (left for fixed content,
right for main content).
2017-05-20 13:57:21 +02:00
Aurélien Delobelle 1845ce825f jpp
Fixes #90
2017-05-19 20:13:36 +02:00
Aurélien Delobelle 109a692cea Order creation improvements.
- colspan takes into account the scale length.
- add box_capacity
2017-05-19 17:55:31 +02:00
Aurélien Delobelle c0b8430a12 Better scale management for order creation
+ Extends labels formatting of scale.
2017-05-19 17:40:06 +02:00
Aurélien Delobelle c11c3f84ed clean big tables forms 2017-05-19 16:42:26 +02:00
Aurélien Delobelle 4344b7d537 chrome support 2017-05-19 15:13:27 +02:00
Aurélien Delobelle 0995f712ca clean hover/focus/disabled btn 2017-05-19 14:48:57 +02:00
Aurélien Delobelle ecce2fda21 Merge branch 'master' into aureplop/clean_scroll 2017-05-19 14:08:57 +02:00
Aurélien Delobelle 51dca32d05 shorter transitions 2017-05-19 14:01:13 +02:00
Aurélien Delobelle ae27065626 Group permissions select multiple -> checkboxes
- Add handler for CheckboxSelectMultiple in form_field_snippet.html.
- Add template filter "widget_type" to get widget class name.
- Group permissions selection becomes easier.
2017-05-19 13:42:41 +02:00
Aurélien Delobelle e9073e2265 Improve multiple select inputs
+ Group edition form gains success message, is prettier
+ Fix: K-Fêt prefix for group name on this form
2017-05-18 21:41:23 +02:00
Aurélien Delobelle 1a661c1fd3 revert 2017-05-18 20:29:29 +02:00
Aurélien Delobelle 5776c81764 Clean navbar + content_center only
- Add css transitions on buttons + navbar links.
- Clean css of navbar.
- Clean templates with only centered form/content.
- Page opened when login as generic team user close itself (only for
  non-CAS users).
- A message is added when generic team user connects.
- Fix extra space on right when messages are prompted.
2017-05-18 20:17:05 +02:00
Aurélien Delobelle 95a8b484e0 Merge branch 'Aufinal/fix_history' into 'master'
Fix asynchronous calls with resetSettings

See merge request !229
2017-05-15 23:43:28 +02:00
Ludovic Stephan 647b32e727 Move displayAddcost function 2017-05-15 17:52:49 -03:00
Martin Pepin 6871945dcd Merge branch 'aureplop/fix_perms' into 'master'
Fix UserGroupForm

Closes #161

See merge request !228
2017-05-15 11:29:33 +02:00
Ludovic Stephan bf0e345301 Fix asynchronous calls with resetSettings
The `resetSettings` function now returns the ajax object, allowing to
chain other calls to it, e.g. the `getHistory` function.
2017-05-14 23:50:09 -03:00
Aurélien Delobelle e0b1db1e1e more robust tests 2017-05-14 22:19:25 +02:00
Martin Pepin 5d8427e601 Merge branch 'aureplop/fewer_requests' into 'master'
Moins de requêtes

See merge request !217
2017-05-12 21:13:35 +02:00
Aurélien Delobelle 4ac7b30bdd Fix UserGroupForm + tests for this form.
- Non-K-Fêt group membership is no longer erased by the account edit
  form.
- Add some tests to ensure proposed choices in this form corresponds to
  K-Fêt groups + test case for #161.

Fixes #161
2017-05-12 16:55:18 +02:00
Aurélien Delobelle b1e46792c8 (little) cleaning of order_create view 2017-05-10 13:11:47 +02:00
Aurélien Delobelle b0e7ebfbc5 fix typo + pep8 + del future imports 2017-05-10 12:49:14 +02:00
Ludovic Stephan 5c5fc6da1b Merge branch 'aureplop/less_prices_history' into 'master'
Less articles prices history

Closes #142

See merge request !224
2017-04-25 14:32:18 +02:00
Aurélien Delobelle 739990cdb6 Add total boxes to new inventory view + fix/clean
- Add total boxes in cellar and bar to new inventory view.
- On this view, table is "minified".
- Revert background color for some templates.
- Clean some margin (responsively).
- Clean tab pills on account read.
2017-04-22 01:17:23 +02:00
Aurélien Delobelle 2eee8f58aa Merge branch 'master' into aureplop/fewer_requests 2017-04-17 20:45:01 +02:00
Aurélien Delobelle ce23eece6a Fix display on small screen devices.
- Remove useless margin on small screens.
- Better pills display on small screens.
- Revert to transparent background for section title.
2017-04-15 13:03:01 +02:00
Aurélien Delobelle ea81ab7b25 Few display improvements.
- Current day remains on the screen on history.
- Message for generic team user connection is sended only if user is
  connecting from a k-fet url.
- Less contrast on history.
2017-04-15 12:36:11 +02:00
Aurélien Delobelle 0a21858b33 Use css for scroll positionning
- Better rendering on scroll on pages with a left block
(- It removes the warning on Firefox about scroll positionning)
2017-04-14 13:08:03 +02:00
Aurélien Delobelle 7db497d095 Less articles prices history
- Prices given with order_to_inventory are saved to db only if they are
  updated (it doesn't create a new price row each time)

Fixes #142.
2017-04-13 16:34:29 +02:00
Aurélien Delobelle 9668f1d1ec Account: check_negative() -> update_negative() 2017-04-13 15:48:13 +02:00
Aurélien Delobelle 18425b82c2 Check negative on cancellation.
- Like perform operations, cancel_operations can add/remove an account
  from negative accounts system.
- Balances checks are now performed against real_balance instead of
  balance.
  So if someone with a balance_offset go, for real, to positive land (ie even
  without taking into account the balance offset), its account is removed from
  the negative system.
- Fix bug on real_balance when negative exists but balance_offset is
  not set.

Fixes #156.
2017-04-13 15:15:59 +02:00
Aurélien Delobelle 06572f0bb5 Order create use Scale.
Order create view use WeekScale. No query improvements, only shorter
code.

Scale/ScaleMixin:
- Two methods directly relative to the Scale class move to... the Scale
  class.

- Fix order create on Chrome.
2017-04-13 14:11:44 +02:00
Aurélien Delobelle 3f4a1adbb9 Fewer queries on stats/scales + Fix
Scales:
- Fix #chunks when used with std_chunk=True (there was one too many at
  the beginning)
- Scale.end gives the end of the last chunk (instead of its start)
  So scale.begin -> scale.end gives the full range of the scale.

`kfet_day` now returns an aware datetime.

ScaleMixin:
- new method `get_by_chunks` which use only one query and ranks
  elements according to the scale. Elements are returned by a generator
  for each scale chunk (and all chunks are returned as a generator too).

ArticlesStatSales and AccountStatOperations use this new method to
avoid issuing #scale_chunks queries.

ArticleStat:
- fixed on Chrome
2017-04-12 18:03:31 +02:00
Aurélien Delobelle e97e0081d7 Fewer queries on stats of an account balance.
- Remove labels, should be replaced to an anchor to the relative
  operation in history.
- Add select_related as necessary.
2017-04-11 23:13:54 +02:00
Aurélien Delobelle b5cc26bb1b Merge branch 'master' into aureplop/fewer_requests 2017-04-11 22:46:18 +02:00
Aurélien Delobelle b357283f87 Merge branch 'master' into aureplop/clean_channels 2017-04-11 00:32:07 +02:00
Martin Pepin a68002d0f6 Merge branch 'aureplop/fix_double_js' into 'master'
Fix stats on some browsers

See merge request !219
2017-04-10 23:59:02 +02:00