Commit graph

161 commits

Author SHA1 Message Date
Aurélien Delobelle 32720c56a6 kfet -- Tables are sortable
Many tables in kfet app templates become sortable:
account list, negative account list, article list, article inventory
list, article supplier list, article category list, checkout list,
checkout statement list, inventory list, inventory details, order list,
order creation, order details.

This is achieved thanks to the jQuery plugin 'tablesorter':
https://mottie.github.io/tablesorter/docs/

- Affected tables also got sticky headers (it stays visible on scroll).
- Dates format are modified in order to ease the date sorting with the
plugin (it avoids writing a custom parser, or an extractor from
additional hidden element in the table cells).
- Tables whose content is classified by category (of articles) now uses
several tbodies. This has minor effects on the tables style.
- Tags of the header help signs become 'i', instead of 'span', in order
to avoid weird spacing.
2017-11-27 18:24:22 +01:00
Aurélien Delobelle b42452080f Mass cleaning of kfet' authentication machinery
AccountBackend
- Should now work if used in AUTHENTICATION_BACKENDS settings.
- It does not retieve itself the password, as it should not be used
this way.

GenericBackend
- Delete useless 'username' arg of its 'authenticate()' method.
- Now delete the token in DB.

TemporaryAuthMiddleware
- New name of the middleware is more meaningful.
- Is now responsible to retrieve the password from the request, instead
of the AccountBackend.

GenericTeamToken model
- Add a manager' method to create token, avoiding possible error due to
unicity constraint.

GenericLoginView (authentication with the kfet generic user)
- Replace obscure system with a 100% HTTP handling.
- See comments for more information.

Misc
- More docstrings!
- More tests!
- Add some i18n.
- Add kfet/confirm_form.html template:
    Ask user to confirm sth via a form (which will send a POST request).
    Context variables:
        * title: the page title
        * confirm_url: action attribute for <form>
        * text: displayed confirmation text
- kfet.js : Add functions allowing to emit POST request from <a> tag.
- Non-link nav items from kfet navbar also get a 'title'.
- A utility has been found for the 'sunglasses' glyphicon!
2017-09-25 17:57:47 +02:00
Aurélien Delobelle 455b730cc3 Merge branch 'master' into aureplop/kfet_cms 2017-06-23 02:53:05 +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 d004287957 Merge branch 'master' into aureplop/kfet_cms 2017-06-12 02:04:28 +02:00
Aurélien Delobelle 1499c0bced Improvements for K-Fêt CMS.
K-Fêt - Wagtail
- Page content becomes a StreamField.
- GroupTeam snippet becomes a block for stream field.
- Navigation menu moved becomes a "flatmenu", preventing possible future conflicts.
- Page layout can be modified in wagtail admin.

K-Fêt
- Add shorthands for ukf account balance/article price.
- Cleaning stylesheets and templates.
2017-06-12 01:51:10 +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
Aurélien Delobelle 8c6d56b27c Add Wagtail CMS for kfet app.
K-Fêt
- Integrate wagtail to serve "static" pages of old K-Fêt website
- Fixture "kfetcms/kfet_wagtail_17_05" contains a copy of old website
(as in May 2017).
- Media files can be got until end of June 17 at
http://partage.eleves.ens.fr//files/604e6dea2ceebc66b1936c6b3f911744/kfet_media.tar.gz

Login/logout
- Update package django_cas_ng to last version.
- Clean COFCASBackend.
- Change CAS version to 3 (version used on eleves.ens). This enables
the logout redirection (for CAS ofc).
- Add messages and clean existing ones on login/logout (for both
outsider and cas users).

Misc
- Update settings to bypass an incompability between debug-toolbar and
wagtailmenus packages.
- Better management of dev/test-specific urls (if debug-toolbar wasn't in
INSTALLED_APPS, media files were not served).
- UI improvements.
2017-05-30 20:44:30 +02:00
Martin Pépin ea21b07657 Add an announcement banner 2017-05-25 23:58:59 +01: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 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 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 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 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 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
Qwann be8d249ed7 remove useless code 2017-04-10 17:47:39 +02:00
Qwann cb9ba76a4f small fixes 2017-04-10 16:47:13 +02:00
Qwann 5c6a73c597 kfet_open uses moment.js 2017-04-09 20:54:30 +02:00
Qwann 15873085e1 small fixes 2017-04-09 20:01:52 +02:00
Ludovic Stephan 4a6bfd5e3d Better button distinction 2017-04-07 12:58:03 -03:00
Ludovic Stephan 052e7b2b6e Move navigation to content-left 2017-04-07 12:17:36 -03:00
Qwann a5671fdf4c Merge branch 'master' into qwann/k-fet/kfet_open 2017-04-05 17:40:19 +02:00
Martin Pepin fe66a6ef6b Merge branch 'aureplop/fix_stats' into 'master'
Stats K-Fêt - Python side

See merge request !208
2017-04-05 00:41:47 +02:00
Ludovic Stephan f46ba0dd6c Merge branch 'master' into Aufinal/inventaires 2017-04-03 16:01:51 -03:00
Aurélien Delobelle 6d2e150aa0 clean align 2017-04-03 16:56:44 +02:00
Aurélien Delobelle 903da795ab clean kfet statistic.js
- no longer dictToArray where it isn't necessary (because already an
  array)
- fix chart height:
  - previous charts were causing bugs
  - height is fixed (even with window resizing)
- clean whitespaces
2017-04-03 16:53:28 +02:00
Aurélien Delobelle 31261fd376 set height canvas graph & fix graph display 2017-04-02 23:38:42 +02:00
Aurélien Delobelle 6ebea6557c Merge branch 'Aufinal/graph_size' into aureplop/fix_stats 2017-04-02 23:19:34 +02:00
Ludovic Stephan 48721b7dca Reduce graph size 2017-04-02 17:54:13 -03:00
Aurélien Delobelle df7e935390 Clean GET params in ajax calls
- Use `data` arg of `$.getJSON` for `format` param
- Delete `dictToArray` call on data returned by `SingleResumeStat` class view since this view now returns stats manifest as an array
2017-04-02 17:16:05 +02:00
Ludovic Stephan ccf5f80685 Merge remote-tracking branch 'origin/master' into Aufinal/editions 2017-04-01 02:43:19 -03:00
Ludovic Stephan 063446efb5 Use columns for authentication and submit 2017-04-01 00:32:09 -03:00
Aurélien Delobelle 1286606f7a Merge branch 'Aufinal/hotfix/liq_withdraw' into 'master'
K-Fêt :
- Empêche les retraits/charges sur LIQ

See merge request !205
2017-03-31 23:49:33 +02:00
Ludovic Stephan aa29621c7c Prevents special opes on LIQ 2017-03-31 18:28:03 -03:00
Ludovic Stephan ab15dbae76 Add handler management 2017-03-31 17:37:39 -03:00
Ludovic Stephan 38bfccf331 Change class name 2017-03-31 15:57:15 -03:00
Ludovic Stephan 8bf1bd5343 Websocket as member 2017-03-31 15:45:15 -03:00
Ludovic Stephan 413df0806d Add url get method 2017-03-31 15:10:41 -03:00
Ludovic Stephan 499c081565 Websocket class and instance 2017-03-31 12:23:27 -03:00
Ludovic Stephan 998838ca3e Add update button 2017-03-30 13:31:16 -03:00