Skip to content

Commit

Permalink
Merge branch 'release-v1.4' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceFox committed Dec 22, 2014
2 parents f618e5e + 80edef9 commit 6988009
Show file tree
Hide file tree
Showing 124 changed files with 3,732 additions and 5,561 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ install:
- sudo apt-get --reinstall install -qq language-pack-fr

# Python dependencies
- travis_retry pip install -r requirements.txt
- travis_retry pip install -r requirements.txt -r requirements-dev.txt
- travis_retry pip install coveralls
- travis_retry pip install MySQL-python

Expand Down
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ Original code base (pdp / fork on 11-02-2013) : Romain Porte (MicroJoe) <microjo
- Ge0 (https://github.com/Ge0)
- geoffreyc (https://github.com/geoffreyc)
- GerardPaligot (https://github.com/GerardPaligot)
- gustavi / Augustin Laville (https://github.com/gustavi)
- pierre-24 (https://github.com/pierre-24)
- poulp (https://github.com/poulp)
- sandhose (https://github.com/sandhose)
- ShigeruM (https://github.com/ShigeruM)
- Situphen (https://github.com/Situphen)
- SpaceFox (https://github.com/SpaceFox)
Expand Down
11 changes: 5 additions & 6 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var gulp = require("gulp"),
$ = require("gulp-load-plugins")(),
path = require("path"),
spritesmith = require("gulp.spritesmith"),
del = require("del"),
mainBowerFiles = require('main-bower-files');

var paths = {
Expand All @@ -27,9 +28,8 @@ var paths = {



gulp.task("clean", function() {
return gulp.src(["dist/*"], { read: false })
.pipe($.rimraf());
gulp.task("clean", function(cb) {
del(["dist/*"], cb);
});

gulp.task("script", ["test"], function() {
Expand All @@ -44,9 +44,8 @@ gulp.task("script", ["test"], function() {
.pipe($.size({ title: "main.min.js" }));
});

gulp.task("clean-errors", function() {
return gulp.src(["errors/css/*"], { read: false })
.pipe($.rimraf());
gulp.task("clean-errors", function(cb) {
del(["errors/css/*"], cb);
});

gulp.task("errors", ["clean-errors"], function() {
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Elles sont reportées essentiellement dans le [bugtraker](https://github.com/zes
Après avoir mis à jour votre dépot, vous devez executer les commandes suivantes (depuis la racine de votre projet) pour mettre à jour les dépendances.

```console
pip install --upgrade -r requirements.txt
pip install --upgrade -r requirements.txt -r requirements-dev.txt
python manage.py migrate
```

Expand All @@ -55,7 +55,7 @@ Pour bénéficier de données de test, exécutez les commandes suivantes, dans l

```console
python manage.py loaddata fixtures/*.yaml

python manage.py load_factory_data fixtures/advanced/aide_tuto_media.yaml
```

Cela va créer plusieurs entitées :
Expand All @@ -72,6 +72,7 @@ Cela va créer plusieurs entitées :
* 3 sujets avec une réponse
* 1 message privé (MP) avec 3 participants
* 3 catégories et 2 sous-catégories
* 4 aides pour l'écriture des tutoriels


### La documentation complète
Expand Down
Binary file added assets/images/beta.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/sprite@2x/unread.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/tutorials.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
153 changes: 153 additions & 0 deletions assets/js/action-ajax.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
/* ===== Zeste de Savoir ====================================================
Manage action button AJAX requests
========================================================================== */

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

$(".sidebar").on("click", ".follow", function(e){
var $act = $(this),
$form = $(this).parents("form:first"),
$email = $(this).parents("li:first").next().find(".email");

var csrfmiddlewaretoken = $form.find("input[name=csrfmiddlewaretoken]").val(),
topic = $form.find("input[name=topic]").val(),
follow = $form.find("input[name=follow]").val(),
page = $form.find("input[name=page]").val();

$.ajax({
url: $form.attr("action"),
type: "POST",
dataType: "json",
data: {
"csrfmiddlewaretoken": csrfmiddlewaretoken,
"topic": topic,
"follow": follow,
"page": page
},
success: function(data){
if(data.follow){
$act.removeClass("blue").addClass("yellow").text("Ne plus suivre ce sujet");
$form.find("input[name=follow]").val(1);
} else {
$act.removeClass("yellow").addClass("blue").text("Suivre ce sujet");
$email.removeClass("blue").text("Être notifié par courriel");
$form.find("input[name=follow]").val(0);
$email.parents("form:first").find("input[name=email]").val(0);
}
}
});

e.stopPropagation();
e.preventDefault();
});
$(".sidebar").on("click", ".email", function(e){
var $act = $(this),
$follow = $(this).parents("li:first").prev().find(".follow"),
$form = $(this).parents("form:first");

var csrfmiddlewaretoken = $form.find("input[name=csrfmiddlewaretoken]").val(),
topic = $form.find("input[name=topic]").val(),
email = $form.find("input[name=email]").val(),
page = $form.find("input[name=page]").val();

$.ajax({
url: $form.attr("action"),
type: "POST",
dataType: "json",
data: {
"csrfmiddlewaretoken": csrfmiddlewaretoken,
"topic": topic,
"email": email,
"page": page
},
success: function(data){
if(data.email){
$act.addClass("blue").text("Ne plus être notifié par courriel");
$follow.removeClass("blue").addClass("yellow").text("Ne plus suivre ce sujet");
$form.find("input[name=email]").val(1);
$follow.parents("form:first").find("input[name=follow]").val(1);
} else {
$act.removeClass("blue").text("Être notifié par courriel");
$form.find("input[name=email]").val(0);
}
}
});
e.stopPropagation();
e.preventDefault();
});
$(".sidebar").on("click", ".solve", function(e){
var $act = $(this),
$form = $(this).parents("form:first");

var csrfmiddlewaretoken = $form.find("input[name=csrfmiddlewaretoken]").val(),
topic = $form.find("input[name=topic]").val(),
solved = $form.find("input[name=solved]").val(),
page = $form.find("input[name=page]").val();

$.ajax({
url: $form.attr("action"),
type: "POST",
dataType: "json",
data: {
"csrfmiddlewaretoken": csrfmiddlewaretoken,
"topic": topic,
"solved": solved,
"page": page
},
success: function(data){
if(data.solved){
$act.removeClass("green").addClass("blue").text("Marquer comme non résolu");
$form.find("input[name=solved]").val(1);
$(".alert-box").removeClass("empty", 1000);
} else {
$act.removeClass("blue").addClass("green").text("Marquer comme résolu");
$form.find("input[name=solved]").val(0);
$(".alert-box").addClass("empty", 1000);
}
}
});
e.stopPropagation();
e.preventDefault();
});

$(".message-actions").on("click", ".cite", function(e){
var $act = $(this),
$editor = $(".md-editor");

$.ajax({
url: $act.attr("href"),
dataType: "json",
success: function(data){
$editor.val($editor.val() + data.text + "\n\n\n");
}
});
e.stopPropagation();
e.preventDefault();
});
$(".message-bottom").on("click", ".btn-grey", function(e){
var $form = $(this).parents("form:first");
var csrfmiddlewaretoken = $form.find("input[name=csrfmiddlewaretoken]").val(),
text = $form.find("textarea[name=text]").val(),
lastPost = $form.find("input[name=last_post]").val();

$.ajax({
url: $form.attr("action"),
type: "POST",
dataType: "json",
data: {
"csrfmiddlewaretoken": csrfmiddlewaretoken,
"text": text,
"last_post": lastPost,
"preview": "Apercu"
},
success: function(data){
$(".previsualisation").remove();
var $prev = $("<div class='previsualisation content-wrapper'> <h3 class='reactions-title'>Prévisualisation de votre message</h3><div class='message-content'>"+data.text+"</div></div>");
$prev.insertAfter($form);
}
});
e.stopPropagation();
e.preventDefault();
});
})(jQuery);
10 changes: 9 additions & 1 deletion assets/js/autocompletion.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@
return false;
},

filterData: function(data, exclude){
return data.filter(function(e){
return exclude.indexOf(e.value) === -1;
});
},

updateDropdown: function(list){
var self = this;
var onClick = function(e){
Expand All @@ -203,6 +209,8 @@
self.handleInput();
};

list = self.filterData(list, self.extractWords(this.$input.val()));

if(list.length > this.options.limit) list = list.slice(0, this.options.limit);

var $list = $("<ul>"), $el, selected = false;
Expand Down Expand Up @@ -296,4 +304,4 @@
$input.autocomplete();
});
});
})(jQuery);
})(jQuery);
Loading

0 comments on commit 6988009

Please sign in to comment.