Commit graph

494 commits

Author SHA1 Message Date
Ludovic Stephan 6d92df4155 Merge branch 'aureplop/kpsul_js_refactor' of git.eleves.ens.fr:cof-geek/gestioCOF into Aufinal/dialog_utils 2017-03-26 15:21:33 -03:00
Ludovic Stephan 946182f1fe Simpler migration revert 2017-03-26 15:06:45 -03:00
Aurélien Delobelle 842f2cecc1 fix import, fix ope with addcost enabled, move Config location 2017-03-26 15:12:03 +02:00
Aurélien Delobelle bc6ecda0c8 fix addcost kspul 2017-03-26 14:59:21 +02:00
Aurélien Delobelle 24f72ae7d4 add missing ; 2017-03-26 14:52:23 +02:00
Aurélien Delobelle b81b33c056 allow chaining on container in display method 2017-03-26 14:51:16 +02:00
Aurélien Delobelle 485ae86a42 add update method to ModelObject 2017-03-26 14:46:46 +02:00
Ludovic Stephan 3bf7a066a2 Adapt history.html to new functions 2017-03-26 00:33:33 -03:00
Ludovic Stephan 3f07bf56fa Remove console log 2017-03-26 00:25:51 -03:00
Ludovic Stephan dbcfc6df46 Remove duplicate kfet.js import 2017-03-26 00:21:17 -03:00
Ludovic Stephan 87943ea7b9 Adapt kpsul to new functions 2017-03-26 00:20:47 -03:00
Ludovic Stephan 6be2f086df Add generic functions for confirm dialogs 2017-03-26 00:20:28 -03:00
Ludovic Stephan 06a89055c4 Simpler migration 2017-03-25 10:46:18 -03:00
Ludovic Stephan 9a081ddae0 PEP8 on Operation model 2017-03-25 10:43:02 -03:00
Ludovic Stephan f645121fb1 Add error when editing LIQ 2017-03-25 10:39:53 -03:00
Ludovic Stephan 14e0d8090f Add euros symbols 2017-03-25 10:01:35 -03:00
Ludovic Stephan d8f572bb01 Remove group check in is_checkout 2017-03-25 09:57:44 -03:00
Ludovic Stephan bc0affc038 Remove autocomplete leftovers 2017-03-25 09:56:36 -03:00
Aurélien Delobelle ae82c34023 add missing migration 2017-03-25 11:21:21 +01:00
Aurélien Delobelle 215d4a63ad Merge branch 'Aufinal/create_opes' into 'master'
K-Fêt - Dev :
- new command - createopes: Création d'opérations et transferts aléatoires

See merge request !193
2017-03-25 11:08:22 +01:00
Aurélien Delobelle 6afbcb44a1 delete array comprehesion 2017-03-25 10:26:45 +01:00
Aurélien Delobelle 967748ded3 details link to read instead of update
- It was the old behaviour.
2017-03-25 09:58:20 +01:00
Aurélien Delobelle 72970c6be7 Fix api call on new transfers
- Use django-js-reverse
- Replace old url (deleted) with standard url
2017-03-25 09:44:55 +01:00
Ludovic Stephan 794527772f Add more explicit migration name 2017-03-24 23:41:33 -03:00
Ludovic Stephan 5f3f044084 Add revert function to migration 2017-03-24 23:27:55 -03:00
Ludovic Stephan 608e67fe6a Add RunPython script to migration 2017-03-24 21:23:04 -03:00
Ludovic Stephan 44fbc92893 Merge branch 'master' of git.eleves.ens.fr:cof-geek/gestioCOF into Aufinal/editions 2017-03-24 21:07:32 -03:00
Ludovic Stephan d7740e66fe adapt code to is_checkout removal 2017-03-24 20:52:49 -03:00
Ludovic Stephan cadaf43131 Remove is_checkout field from Operation model 2017-03-24 18:50:57 -03:00
Aurélien Delobelle ac18cbd9d9 fix by on last statement 2017-03-24 22:10:34 +01:00
Aurélien Delobelle 0d02d47d33 move utils functions 2017-03-24 22:05:04 +01:00
Aurélien Delobelle 2e3bd5bd7a fix search box 2017-03-24 21:41:34 +01:00
Aurélien Delobelle abce961d91 use django-js-reverse 2017-03-24 21:28:33 +01:00
Aurélien Delobelle a9d1a6aae9 clean array iteration 2017-03-24 21:24:06 +01:00
Aurélien Delobelle f063c3470c Merge branch 'Aufinal/fix_password_freeze' into 'master'
K-Psul:
- fix freeze when no-team password

Closes #153

See merge request !196
2017-03-24 20:53:44 +01:00
Aurélien Delobelle ff5959638b fix missing bracket 2017-03-24 20:32:04 +01:00
Aurélien Delobelle cb13280458 Merge branch 'master' into 'Aufinal/merge_k-fet'
# Conflicts:
#   kfet/static/kfet/css/index.css
2017-03-24 20:23:32 +01:00
Ludovic Stephan 7520effe53 Fix K-Psul freeze when no-team password
L'erreur 403 est renvoyée dans ce cas par le décorateur
`@teamkfet_required`, donc sans data associé, ce qui faisait buguer
`getErrorsHtml`. On rajoute donc le cas correspondant.
2017-03-24 15:45:47 -03:00
Martin Pepin 33b3d558b5 Merge branch 'Aufinal/decorators' into 'master'
Utilise les bons décorateurs

See merge request !195
2017-03-21 00:25:50 +01:00
Ludovic Stephan 5e802217fd Remove lambda operators 2017-03-20 20:24:44 -03:00
Ludovic Stephan dd4d1f3061 Improves creation efficiency 2017-03-20 20:19:04 -03:00
Ludovic Stephan aa247b465a Fix search box (hackish) 2017-03-20 19:08:48 -03:00
Martin Pepin ae38b5d1e7 Merge branch 'hotfix/prevent_ldap_injection' into 'master'
Hotfix/prevent ldap injection

Closes #150

See merge request !188
2017-03-20 23:06:59 +01:00
Martin Pépin 59f57793ba typo 2017-03-20 22:05:48 +00:00
Martin Pépin 0aed975615 Fix the empty-query test in autocomplete
If there is no valid word to search in the LDAP database, no query is
performed. Since 74f0b63e, that behaviour was broken because of a typo
2017-03-20 08:14:20 +00:00
Ludovic Stephan 6d36d50e9a Fix 'at' property for transfergroups 2017-03-20 01:56:59 -03:00
Ludovic Stephan 2c63e6b667 Use django.contrib.auth decorators 2017-03-20 00:11:50 -03:00
Ludovic Stephan 36dc6439a8 Plug createopes into loadkfetdevdata 2017-03-19 16:03:39 -03:00
Ludovic Stephan 0356ec34ae Add createopes command 2017-03-19 16:03:19 -03:00
Martin Pépin 74f0b63e96 Change ldap query behaviour if multiple inputs
It is now consistent with the other lookups over the User database
2017-03-19 15:10:08 +00:00
Martin Pépin dc50a23b10 Escape the content of the regex in highligh_text 2017-03-19 14:48:04 +00:00
Martin Pépin 4899bba1f7 Replace list comprehensions by iterators in dal 2017-03-19 14:05:25 +00:00
Ludovic Stephan 51fba4da21 Log messages 2017-03-18 19:02:08 -03:00
Ludovic Stephan 47b7d934e0 PEP8 on imports 2017-03-18 19:01:51 -03:00
Ludovic Stephan 29d7654052 Root kfet account 2017-03-18 18:02:33 -03:00
Ludovic Stephan f512c1bdd7 Add better checkout creation 2017-03-18 18:02:23 -03:00
Martin Pépin 55b67f38c8 Notice the users about the α-numeric restriction
Add a help text above the two autocompletion inputs letting the users
know that non-alphanumeric characters will not be used.
2017-03-16 23:16:56 +00:00
Martin Pépin 741f0183e6 Prevent ldap injections in autocompletion views
We only allow alphanumeric characters in the query in order to avoid
injections
2017-03-16 22:43:43 +00:00
Ludovic Stephan 3793863bab Merge remote-tracking branch 'origin/k-fet' into Aufinal/merge_k-fet 2017-03-15 22:58:54 -03:00
Martin Pépin 3acc8bca75 s/username/clipper in highlight_clipper
There was typo, the `Clipper` object has no `username` attribute. We
want to use the `clipper` attribute
2017-03-15 19:11:38 +00:00
Martin Pépin e98a407982 Rename bits -> search_words in kfet.autocomplete
This is typo, this variable has not the same name in
`gestioncof.autocomplete` and `kfet.autocomplete`
2017-03-15 19:02:31 +00:00
Qwann 5ddcd2f1ff Merge branch 'k-fet' into qwann/k-fet/home 2017-03-10 16:58:10 +01:00
Qwann ca17e36b5a clean display for is_sold 2017-03-06 02:03:19 +01:00
Qwann dcc19bd9e8 article.hidden in article & article_read 2017-03-06 01:58:33 +01:00
Ludovic Stephan 8e31fae340 last tweaks 2017-03-05 21:29:20 -03:00
Ludovic Stephan 61e2fedb08 Merge branch 'k-fet' of git.eleves.ens.fr:cof-geek/gestioCOF into Aufinal/command_interface 2017-03-05 21:12:53 -03:00
Qwann 197da29366 css include added... 2017-03-05 20:05:35 +01:00
Qwann b0b2210e93 Merge branch 'qwann/k-fet/home' of git.eleves.ens.fr:cof-geek/gestioCOF into qwann/k-fet/home 2017-03-05 19:44:08 +01:00
Qwann 9f94262b82 removing inapropriate message 2017-03-05 19:43:26 +01:00
Qwann f52aba8ca6 Merge branch 'k-fet' into qwann/k-fet/home 2017-03-05 19:21:20 +01:00
Aurélien Delobelle 95b129e396 resolved merge conflict in kfet views imports 2017-02-25 02:00:56 +01:00
Aurélien Delobelle a9cb50b38d Better k-fet js and more
JavaScript
----------
- Basic classes that can be inherited to define a new class for a
  django model in javascript.
- Formatters classes are used to render properties and attributes of
  the instances of models classes.
- New classes to handle Account, Checkout, Statement models.
- Refactor K-Psul JS (part n/m).
- Better file organization.

Views
-----
- 'kpsul.checkout_data' is cleaner. Last statement is added to the JSON
  response with GET paramater 'last_statement'.
- 'account.read.json' is merged in account.read. JSON response is sent if
  GET parametter 'format' is set to 'json'.
- Fix PEP8 of concerned views.

New requirement: django-js-reverse
----------------------------------
Used to resolve the URLs defined in the project in JavaScript.
See https://github.com/ierror/django-js-reverse
2017-02-23 22:07:38 +01:00
Evarin ddbcfe0c69 JS commenté et plus propre 2017-02-15 22:25:26 +01:00
Evarin 0fcb29252b Frontend tout en JS 2017-02-15 21:01:54 +01:00
Qwann 46f343b1ab la K-Fêt se réveille à 7h 2017-02-15 14:44:58 +01:00
Qwann 1c90608f6d some cleaning 2017-02-15 14:21:00 +01:00
Aurélien Delobelle ee848d210e refactor account k-psul js - part 2/?
- les événements de AccountSearch sont enregistrés depuis ces classes (plus depuis le manager)
- ajout d'une classe AccountSelection s'occupant de la sélection d'un
  compte par l'utilisateur
- la méthode update de AccountManager peut maintenant prendre un
  trigramme et le set correctement, à défaut elle récupère le trigramme
  via AccountSelection
2017-02-15 14:09:20 +01:00
Aurélien Delobelle ef864cec32 Merge branch 'Aufinal/visibilite_stock' into 'k-fet'
K-Psul

Articles
- Ajout d'une surbrillance pour les articles dont le stock est bas
  (entre -5 et 5)

Panier
- Ajout d'indications de stocks sur chaque ligne (stock, warning visuel)
- Les ajouts/retraits d'articles déjà dans le panier mettent à jour la
  ligne associée à celui-ci déjà existante
- Les flèches haut/bas permettent de modifier la quantité d'un article

Fix #111

See merge request !133
2017-02-13 16:42:22 +01:00
Aurélien Delobelle 2e8fc45a1b Merge branch 'Aufinal/own_password' into 'k-fet'
Changement de son propre mot de passe

Permet à un K-Fêteux (disposant de la permission `kfet.is_team`) de modifier son propre mot de passe sur la page `account/XXX/edit`.

Accessoirement, la fonction `account_update` est maintenant conforme à PEP8.

Fix #121

See merge request !148
2017-02-13 16:32:40 +01:00
Ludovic Stephan 46e9e82da8 move account save 2017-02-13 12:19:47 -02:00
Qwann 9cae3ad0bd Merge branch 'k-fet' into qwann/k-fet/stats 2017-02-13 14:37:29 +01:00
Ludovic Stephan 83e41c292e css tweaks 2017-02-13 11:34:47 -02:00
Ludovic Stephan 43aab26530 Merge branch 'k-fet' of git.eleves.ens.fr:cof-geek/gestioCOF into Aufinal/visibilite_stock 2017-02-13 10:51:24 -02:00
Aurélien Delobelle fdcf4c3ab0 fix property location 2017-02-13 13:48:57 +01:00
Aurélien Delobelle 1a684471c2 Merge branch 'Aufinal/fix_amounts' into 'k-fet'
K-Psul:
- fix #163: different rounding for UKF accounts balances / UKF articles prices

See merge request !171
2017-02-13 08:25:13 +01:00
Aurélien Delobelle d9fc683525 update account_data[] to account_manager.account. 2017-02-13 00:41:41 +01:00
Aurélien Delobelle 890be9b343 refactor account k-psul js - part 1
- nouvelle classe - Account: stocke, sert et récupère les données
  associées à un compte
- nouvelle classe - AccountManager: interface pour le management de la
  partie Account de K-Psul
- nouvelle classe - AccountSearch: module de recherche d'un compte
- nouvelles classes - AccountFormatter, StandardAccountFormatter,
  LIQAccountFormatter: styles de formattage des données d'un compte

- désactive l'autocomplétion dans la recherche d'un compte
- fix #89: "Entrée" dans le champ de trigramme met le compte LIQ
2017-02-13 00:23:32 +01:00
Ludovic Stephan 3fa0e4de6c different rounding for accounts 2017-02-12 19:05:41 -02:00
Ludovic Stephan 3dfd8bf616 interface for order_to_inventory 2017-02-12 18:04:50 -02:00
Ludovic Stephan 031b992fa3 fix brackets & lowstock indication 2017-02-12 11:09:03 -02:00
Ludovic Stephan 99d04fb75e bugfix 2017-02-12 11:02:54 -02:00
Aurélien Delobelle 5c7a1d6874 Refactor JS Settings K-Psul
- change name: Settings -> Config
- provide interface `Config` to get/set parameters
- `Config` uses global object `window.config` to store key/value
- `Config` setters handle types
2017-02-12 13:26:02 +01:00
Aurélien Delobelle 8279bddf4e clean js k-psul
- K-Psul JavaScript uses strict-mode (when JS try to do better things,
  we should follow)
2017-02-12 06:10:17 +01:00
Aurélien Delobelle 4a5d9f880a Merge branch 'Aufinal/fix_amounts' into 'k-fet'
Corrige l'affichage du prix

!124 était overkill ; `amountToUKF` peut prendre en argument des valeurs positives ou négatives, et il me semble que le `round` ne sert quà corriger les erreurs de `float`, ce qui conduit à #128. Du coup, on revert une partie.

fixes #128

See merge request !163
2017-02-12 05:09:30 +01:00
Ludovic Stephan db899a891b css tweaks 2017-02-12 02:03:41 -02:00
Ludovic Stephan 15d79aff2d add help tooltips 2017-02-12 00:48:24 -02:00
Ludovic Stephan be8eb4ac28 add (temporary) better presentation 2017-02-12 00:01:22 -02:00
Aurélien Delobelle 49e6101156 Merge branch 'qwann/k-fet/decimal_issue2' into 'k-fet'
Qwann/k fet/decimal issue2

`grant` is a Decimal and thus can not be casted implicitly to float.

See merge request !158
2017-02-11 22:04:10 +01:00
Aurélien Delobelle db4786abf8 Merge branch 'manet/correction-commandes' into 'k-fet'
Manet/correction commandes

- Fix création de commandes (fournisseur)

Fix #97
See merge request !128
2017-02-11 22:00:45 +01:00
Martin Pépin d41d905366 PEP8 2017-02-11 21:20:51 +01:00