Skip to content

Commit

Permalink
Merge branch 'release-v1.2' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceFox committed Nov 5, 2014
2 parents c02235a + 6bad667 commit de8e15c
Show file tree
Hide file tree
Showing 102 changed files with 1,855 additions and 1,045 deletions.
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Les contributions externes sont les bienvenues !
5. Assurez-vous que le code suit la [PEP-8](http://legacy.python.org/dev/peps/pep-0008/) : `flake8 --exclude=migrations,urls.py,settings.py --max-line-length=120 zds`
6. Si vous avez fait des modifications du _front_, jouez les tests associés : `gulp test`
7. Si vous modifiez le modèle (les fichiers models.py), n'oubliez pas de créer les fichiers de migration : `python manage.py schemamigration app_name --auto`
8. Poussez votre travail et faites une _pull request_
8. Si votre travail nécessite des actions spécifiques lors du déploiement, précisez-les dans le fichier [update.md](update.md).
9. Poussez votre travail et faites une _pull request_

# Quelques bonnes pratiques
* Respectez [les conventions de code de Django](https://docs.djangoproject.com/en/1.6/internals/contributing/writing-code/coding-style/), ce qui inclut la [PEP 8 de Python](http://legacy.python.org/dev/peps/pep-0008/)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
[![Coverage Status](https://coveralls.io/repos/zestedesavoir/zds-site/badge.png?branch=dev)](https://coveralls.io/r/zestedesavoir/zds-site?branch=dev)
[![Licence GPL](http://img.shields.io/badge/license-GPL-yellow.svg)](http://www.gnu.org/licenses/quick-guide-gplv3.fr.html)
[![Documentation Status](https://readthedocs.org/projects/zds-site/badge/?version=latest)](https://readthedocs.org/projects/zds-site/?badge=latest)
[![Requirements Status](https://requires.io/github/zestedesavoir/zds-site/requirements.svg?branch=dev)](https://requires.io/github/zestedesavoir/zds-site/requirements/?branch=dev)
[![Dependency Status](https://david-dm.org/zestedesavoir/zds-site.svg)](https://david-dm.org/zestedesavoir/zds-site)

# Zeste de Savoir

Expand Down
30 changes: 30 additions & 0 deletions assets/js/submit-dbclick.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* ===== Zeste de Savoir ====================================================
Prevent from double clic on submit buttons
---------------------------------
Author: Alex-D / Alexandre Demode
========================================================================== */

(function($, undefined){
"use strict";

var buttonsSelector = "[type=submit], [type=reset]",
$lastButtonClicked = null;

$("body").on("submit", "form", function(){
$(buttonsSelector)
.addClass("disabled");

if($lastButtonClicked === null)
$lastButtonClicked = $(buttonsSelector, $(this));

$lastButtonClicked
.addClass("submitted")
.append($("<span/>", { class: "line-loading" }));
});
$("form").on("click", buttonsSelector, function(e){
$lastButtonClicked = $(this);

if($(this).hasClass("disabled"))
e.preventDefault();
});
})(jQuery);
Loading

0 comments on commit de8e15c

Please sign in to comment.