diff --git a/Gulpfile.js b/Gulpfile.js index c03ec38d8d..3231b43069 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -8,10 +8,16 @@ var paths = { scripts: "assets/js/**", images: "assets/images/**", smileys: "assets/smileys/**", - copy: "assets/misc/**", - stylesheet: "assets/scss/main.scss", - scss: ["assets/scss/**", "!assets/scss/_sprite.scss"], - sass: { + errors_main: "errors/scss/main.scss", + errors_path: "errors/scss/**", + errors: { + sass: "errors/scss", + images: "errors/images", + includePaths: ["errors/scss", "assets/bower_components/modularized-normalize-scss"], + }, + styles_main: "assets/scss/main.scss", + styles_path: ["assets/scss/**", "!assets/scss/_sprite.scss"], + styles: { sass: "assets/scss", images: "assets/images", includePaths: ["assets/scss", "assets/bower_components/modularized-normalize-scss"], @@ -36,12 +42,31 @@ gulp.task("script", ["test"], function() { .pipe($.size({ title: "main.min.js" })); }); +gulp.task("clean-errors", function() { + return gulp.src(["errors/css/*"]) + .pipe($.clean()); +}); + +gulp.task("errors", ["clean-errors"], function() { + return gulp.src(paths.errors_main) + .pipe($.sass({ + sass: paths.errors.sass, + imagePath: paths.errors.images, + includePaths: paths.errors.includePaths + })) + .pipe($.autoprefixer(["last 1 version", "> 1%", "ff >= 20", "ie >= 8", "opera >= 12", "Android >= 2.2"], { cascade: true })) + .pipe(gulp.dest("errors/css")) + .pipe($.rename({ suffix: ".min" })) // génère une version minimifié + .pipe($.minifyCss()) + .pipe(gulp.dest("errors/css")); +}); + gulp.task("stylesheet", ["sprite"], function() { - return gulp.src(paths.stylesheet) + return gulp.src(paths.styles_main) .pipe($.sass({ - sass: paths.sass.sass, - imagePath: paths.sass.images, - includePaths: paths.sass.includePaths + sass: paths.styles.sass, + imagePath: paths.styles.images, + includePaths: paths.styles.includePaths })) .pipe($.autoprefixer(["last 1 version", "> 1%", "ff >= 20", "ie >= 8", "opera >= 12", "Android >= 2.2"], { cascade: true })) .pipe(gulp.dest("dist/css")) @@ -71,7 +96,7 @@ gulp.task("sprite", function() { } })); sprite.img.pipe(gulp.dest("dist/images")); - sprite.css.pipe(gulp.dest(paths.sass.sass)); + sprite.css.pipe(gulp.dest(paths.styles.sass)); return sprite.css; }); @@ -115,17 +140,23 @@ gulp.task("merge-scripts", ["script", "vendors"], function() { gulp.task("watch", function(cb) { gulp.watch(paths.scripts, ["script"]); - gulp.watch(paths.copy, ["copy"]); gulp.watch(paths.smiley, ["smileys"]); gulp.watch(paths.images, ["images"]); - gulp.watch(paths.scss, ["stylesheet"]); + gulp.watch(paths.styles_path, ["stylesheet"]); + gulp.watch(paths.errors_path, ["errors"]); gulp.watch(paths.sprite, ["sprite", "stylesheet"]); gulp.watch("dist/*/**", function(file) { - filePath = path.join("static/", path.relative(path.join(__dirname, "dist/"), file.path)); // Pour que le chemin ressemble à static/.../... + var filePath = path.join("static/", path.relative(path.join(__dirname, "dist/"), file.path)); // Pour que le chemin ressemble à static/.../... $.livereload.changed(filePath); }); + gulp.watch("errors/*/**", function(file) { + setImmediate(function(){ + $.livereload.changed(file.path); + }); + }); + $.livereload.listen(); }); @@ -135,11 +166,6 @@ gulp.task("test", function() { .pipe($.jshint.reporter("jshint-stylish")); }); -gulp.task("copy", function() { - return gulp.src(paths.copy) - .pipe(gulp.dest("dist/")); -}); - gulp.task("pack", ["build"], function() { return gulp.src(["dist/*/**", "!dist/pack.zip"]) .pipe($.zip("pack.zip")) @@ -149,6 +175,6 @@ gulp.task("pack", ["build"], function() { gulp.task("travis", ["test"]); -gulp.task("build", ["smileys", "images", "sprite", "stylesheet", "vendors", "script", "merge-scripts", "copy"]); +gulp.task("build", ["smileys", "images", "sprite", "stylesheet", "vendors", "script", "merge-scripts"]); gulp.task("default", ["build", "watch"]); diff --git a/README.md b/README.md index b8d7eb334f..31e1f0990e 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ pip install --upgrade -r requirements.txt Pour bénéficier de données de test, exécutez les commandes suivantes, dans l'ordre, à la fin des précédentes : ```console -python manage.py loaddata fixtures/users.yaml fixtures/forums.yaml fixtures/topics.yaml fixtures/mps.yaml fixtures/categories.yaml +python manage.py loaddata fixtures/users.yaml fixtures/forums.yaml fixtures/topics.yaml fixtures/mps.yaml fixtures/categories.yaml fixtures/licences.yaml ``` diff --git a/assets/images/favicon.ico b/assets/images/favicon.ico deleted file mode 100644 index 59441cc530..0000000000 Binary files a/assets/images/favicon.ico and /dev/null differ diff --git a/assets/js/mobile-menu.js b/assets/js/mobile-menu.js index 79c492b2e0..86938ffb3c 100644 --- a/assets/js/mobile-menu.js +++ b/assets/js/mobile-menu.js @@ -290,7 +290,11 @@ if(parseInt($("html").css("width")) < 960 && !disableMobileMenu){ var $newBtns = $(".sidebar .new-btn:not(.mobile-btn-imported)"); if($newBtns.length > 0){ - var $prevElem = $("#content > .content-wrapper, #content > .full-content-wrapper").find("h1, h2"); + var $prevElem = $("#content") + .find("> .content-wrapper, > .full-content-wrapper, > .content-col-2") + .first() + .find("h1, h2") + .first(); if($prevElem.next(".license").length > 0) $prevElem = $prevElem.next(".license"); if($prevElem.next(".subtitle").length > 0) diff --git a/assets/js/zen-mode.js b/assets/js/zen-mode.js index 0f358892bf..c83c564f21 100644 --- a/assets/js/zen-mode.js +++ b/assets/js/zen-mode.js @@ -8,7 +8,7 @@ "use strict"; if($(".article-content").length > 0){ - $(".content-container .taglist + .authors").before($(" - + Demander la validation {% else %} + {% if article.sha_validation != version %} +
  • + + Mettre à jour la version en validation + +
  • + {% endif %}
  • - En attente de validation + En attente de validation
  • {% endif %} + {% endif %} @@ -92,13 +105,25 @@

    Validation

    Historique de validation +
  • + + Envoyer un MP + {% if authors.all|length > 1 %} + aux auteurs + {% else %} + à l'auteur + {% endif %} + +
  • {% if not article.sha_validation = None %} {% if validation.is_pending %}
  • {% csrf_token %} -
    @@ -198,7 +223,7 @@

    Supprimer

  • {% else %}
  • - Impossible, car en publié + Impossible, car publié
  • {% endif %} diff --git a/templates/article/member/index.html b/templates/article/member/index.html index 7703d51a02..b58264bdcc 100644 --- a/templates/article/member/index.html +++ b/templates/article/member/index.html @@ -17,6 +17,8 @@ {% block breadcrumb %} {% if request.GET.type == "public" %}
  • Publiés
  • + {% elif request.GET.type == "validate" %} +
  • En validation
  • {% elif request.GET.type == "draft" %}
  • Brouillons
  • {% else %} @@ -30,6 +32,8 @@ Mes Articles {% if request.GET.type == "public" %} / Publiés + {% elif request.GET.type == "validate" %} + / En validation {% elif request.GET.type == "draft" %} / Brouillons {% endif %} @@ -41,6 +45,8 @@ Mes Articles {% if request.GET.type == "public" %} / Publiés + {% elif request.GET.type == "validate" %} + / En validation {% elif request.GET.type == "draft" %} / Brouillons {% endif %} @@ -63,7 +69,12 @@

    Filtres

  • - + + En validation + +
  • +
  • + Brouillons
  • diff --git a/templates/article/member/view.html b/templates/article/member/view.html index fa97abeaae..e6d07e1451 100644 --- a/templates/article/member/view.html +++ b/templates/article/member/view.html @@ -50,7 +50,7 @@

    {% if article.licence %} - Licence {{ article.licence }} + {{ article.licence }} {% endif %} @@ -95,20 +95,46 @@

    - {% if perms.article.change_article and article.sha_validation != None %} -

    - Cet article est en attente de validation -

    - {% if validation.comment_authors %} -
    -

    - Le message suivant a été laissé à destination des validateurs : -

    - -
    - {{ validation.comment_authors }} -
    -
    + {% if user in authors.all or perms.article.change_article %} + {% if article.sha_validation != None %} + {% if validation.version == version %} + {% if validation.validator == None %} +

    + Cet article est en attente d'un validateur +

    + {% else %} +

    + L'article est en cours de validation par + {% include "misc/member_item.part.html" with member=validation.validator %} +

    + {% endif %} + {% if validation.comment_authors %} +
    +

    + Le message suivant a été laissé à destination des validateurs : +

    + +
    + {{ validation.comment_authors }} +
    +
    + {% endif %} + {% else %} + {% if validation.validator == None %} +

    + + Une autre version de cet article + est en attente d'un validateur +

    + {% else %} +

    + + Une autre version de cet article + est en cours de validation par + {% include "misc/member_item.part.html" with member=validation.validator %} +

    + {% endif %} + {% endif %} {% endif %} {% endif %} {% endblock %} diff --git a/templates/article/validation/history.html b/templates/article/validation/history.html index 591b823d7d..32bbfad30b 100644 --- a/templates/article/validation/history.html +++ b/templates/article/validation/history.html @@ -65,6 +65,17 @@ {{ validation.date_proposition|format_date|capfirst }} + {% if validation.comment_authors %} +
    + + Message laissé à la validation + + + {% endif %} {% captureas reservation_url %} diff --git a/templates/article/validation/index.html b/templates/article/validation/index.html index 7d509cfc65..f700dd9598 100644 --- a/templates/article/validation/index.html +++ b/templates/article/validation/index.html @@ -49,18 +49,18 @@

    Filtres

    {% block headline %} Validation des articles + ({{ validations|length }}) {% endblock %}

    {% block content %} {% if validations %} - +
    - - - + + @@ -71,15 +71,19 @@

    {{ validation.article.title }} - -

    TitreCatégorie(s)Auteur(s)ProposéAuteur(s)Proposé Statut
    - {% for tag in validation.article.subcategory.all %} -

    - - {{ tag.title }} - -

    - {% endfor %} +
    + {% if validation.article.subcategory.all %} + Catégories : + {% for subcategory in validation.article.subcategory.all %} + {% if not forloop.first %} + - + {% endif %} + + {{ subcategory.title }} + {% endfor %} + {% else %} + Aucune catégorie + {% endif %}

    {% for author in validation.article.authors.all %} @@ -87,7 +91,7 @@

    {% endfor %}

    - {{ validation.date_proposition|format_date|capfirst }} + {{ validation.date_proposition|format_date:True|capfirst }} {% captureas reservation_url %} diff --git a/templates/base.html b/templates/base.html index d201ef6668..5ae50ae9e7 100644 --- a/templates/base.html +++ b/templates/base.html @@ -55,7 +55,7 @@ {# OpenGraph #} - + @@ -67,7 +67,7 @@ {# Twitter cards #} - + @@ -412,13 +412,13 @@ {% if perms.tutorial.change_tutorial %}
  • - Administration des tutoriels + Validation des tutoriels
  • {% endif %} {% if perms.article.change_article %}
  • - Administration des articles + Validation des articles
  • {% endif %} @@ -489,7 +489,7 @@ {% captureas schema %} {% block schema %}{% endblock %} {% endcaptureas %} -
    +

    {% block headline %}{% endblock %}

    @@ -571,6 +571,6 @@

    {{ headlin messageStyle: "none", }); - + diff --git a/templates/forum/base.html b/templates/forum/base.html index 3ec9fc242d..ba8a157e07 100644 --- a/templates/forum/base.html +++ b/templates/forum/base.html @@ -73,6 +73,7 @@

    {{ period|humane_delta }}

    + {% csrf_token %} @@ -164,4 +165,4 @@

    Flux

    -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/templates/forum/topic/index.html b/templates/forum/topic/index.html index 6769f68690..d5df6cf1d5 100644 --- a/templates/forum/topic/index.html +++ b/templates/forum/topic/index.html @@ -103,9 +103,9 @@ {% endif %} {% if forloop.first and nb = 1 %} - {% set True as answer_schema %} - {% else %} {% set False as answer_schema %} + {% else %} + {% set True as answer_schema %} {% endif %} {% include "misc/message.part.html" with perms_change=perms.forum.change_topic answer_schema=answer_schema %} @@ -140,6 +140,7 @@ + {% csrf_token %} @@ -158,6 +159,7 @@ + {% csrf_token %} @@ -174,6 +176,7 @@ + {% csrf_token %} @@ -199,6 +202,7 @@

    Modération

    + {% csrf_token %} @@ -216,6 +220,7 @@

    Modération

    + {% csrf_token %} diff --git a/templates/gallery/gallery/details.html b/templates/gallery/gallery/details.html index 5a6cbe590b..c335a76b0b 100644 --- a/templates/gallery/gallery/details.html +++ b/templates/gallery/gallery/details.html @@ -46,7 +46,7 @@ {% if u.mode == 'R' %} Lecture {% elif u.mode == 'W' %} - Ecriture + Écriture {% endif %} {% endcaptureas %}
  • @@ -105,4 +105,4 @@ {% csrf_token %}
  • -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/templates/home.html b/templates/home.html index 9e71f19a7e..c7b286a084 100644 --- a/templates/home.html +++ b/templates/home.html @@ -89,10 +89,10 @@