diff --git a/.travis.yml b/.travis.yml index 92291b12ec..cf7b58f12b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ env: - secure: "azmDZZQZzf88zpbkYpLpxI66vpEVyv+kniW0QdWAt4qlys8P5OcO3VJBR5YT85vlvnjN9b6raWQAL1ymee0WmVdTmzXed8XjZv7t9QXVw7pfezxMKlEftVp/4Cu4wtvbew0ViZXNWV2hNXHzEqlhgnoIOq94i0UzZ7grMrI0xm0=" matrix: - TEST_APP="-e back_mysql -- zds.member zds.mp zds.utils zds.forum zds.gallery zds.pages zds.search zds.featured" - - TEST_APP="-e back_mysql -- zds.article zds.tutorial zds.tutorialv2" + - TEST_APP="-e back_mysql -- zds.tutorialv2" - TEST_APP="-e front" diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000..5d07a0c5d4 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,51 @@ +# Code de Conduite Contributeurs + +En tant que contributeurs et responsables de ce projet, et dans l'intérêt +de favoriser une communauté ouverte et accueillante, nous nous engageons à +respecter toutes les personnes qui contribuent en rapportant des erreurs, +en postant des demandes de fonctionnalités nouvelles, en mettant à jour la +documentation, en soumettant des pull requests ou des correctifs, ainsi que +toutes autres activités. + +Nous sommes déterminés à rendre toute participation à ce projet une +expérience exempte de harcèlement pour tout le monde, quel que soit le niveau +d'expérience, le sexe, l'identité ou l'expression de genre, l'orientation +sexuelle, le handicap, l'apparence personnelle, la taille physique, la race, +l'origine ethnique, l'âge, la religion ou la nationalité. + +De tels comportements ne sont pas acceptables, par exemple : + +* l'utilisation de langage ou d'imagerie sexualisé ; +* les attaques personnelles ; +* les trolls ou commentaires insultants ou désobligeants ; +* le harcèlement en public ou en privé ; +* la publication d'autres informations privées, telles que les adresses + physiques ou électroniques, sans permission explicite ; +* toute autre conduite contraire à l'éthique ou non professionnelle. + +Les mainteneurs du projet ont le droit et la responsabilité de supprimer, +modifier ou rejeter les commentaires, commits, code, modifications du wiki, +questions et autres contributions qui ne respectent pas ce Code de Conduite, +ou de bannir temporairement ou définitivement tout contributeur à la suite +d'autres comportements qu'ils jugent inappropriés, menaçants, injurieux, +ou nuisibles. + +En adoptant ce Code de Conduite, les mainteneurs du projet s'engagent à +appliquer équitablement et uniformément ces principes à tous les aspects de +la gestion de ce projet. Les mainteneurs de projets qui ne suivent pas ou ne +font pas respecter le Code de Conduite peuvent être retirés de façon permanente +de l'équipe de projet. + +Ce Code de Conduite s'applique à la fois au sein des espaces de projet +ainsi que dans les espaces publics quand un individu représente le projet +ou sa communauté. + +Les instances de comportement abusif, harcelant ou autrement inacceptable +peuvent être signalés en contactant un responsable de projet à +zestedesavoir at gmail.com. Toutes les plaintes seront examinées et étudiées +et se traduiront par une réponse jugée nécessaire et appropriée aux +circonstances. Les mainteneurs s'obligent à garder confidentielles les +informations de la personne qui remonte un incident. + +Ce Code de Conduite est adaptée du [Contributor Covenant](http://contributor-covenant.org), +version 1.3.0, [disponible ici](http://contributor-covenant.org/version/1/3/0/fr). \ No newline at end of file diff --git a/Gulpfile.js b/Gulpfile.js index 04890ba2d4..045474c05a 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -4,6 +4,14 @@ var gulp = require("gulp"), path = require("path"), del = require("del"); +var autoprefixer = require("autoprefixer"), + cssnano = require("cssnano"); + +var postcssProcessors = [ + require("autoprefixer")({ browsers: ["last 1 version", "> 1%", "ff >= 20", "ie >= 8", "opera >= 12", "Android >= 2.2"] }), + require("cssnano")() +]; + var sourceDir = "assets", destDir = "dist", errorsDir = "errors", @@ -15,26 +23,25 @@ var sourceDir = "assets", stylesFiles = ["main.scss"], vendorsCSS = ["node_modules/normalize.css/normalize.css"], vendorsJS = ["node_modules/jquery/dist/jquery.js", "node_modules/cookies-eu-banner/dist/cookies-eu-banner.js"], - autoprefixerConfig = ["last 1 version", "> 1%", "ff >= 20", "ie >= 8", "opera >= 12", "Android >= 2.2"], imageminConfig = { optimizationLevel: 3, progressive: true, interlaced: true }; /** * Cleans up the workspace, deletes the build */ -gulp.task("clean", function(cb) { - del([ +gulp.task("clean", function() { + return del([ destDir, path.join(sourceDir, "{" + scriptsDir + "," + sassDir + "}", vendorsDir), path.join(sourceDir, "bower_components/"), path.join(sourceDir, sassDir, "_sprite.scss") - ], cb); + ]); }); /** * Clean error-pages files */ -gulp.task("clean-errors", function(cb) { - del(["errors/css/*"], cb); +gulp.task("clean-errors", function() { + return del(["errors/css/*"]); }); /** @@ -59,15 +66,14 @@ gulp.task("vendors-js", function() { */ gulp.task("vendors", ["vendors-js", "vendors-css"], function() { return gulp.src(path.join(sourceDir, scriptsDir, vendorsDir, "*.js")) - .pipe($.concat("vendors.js")) + .pipe($.sourcemaps.init()) + .pipe($.concat("vendors.js")) + .pipe($.uglify().on('error', $.notify.onError({ + title: "Javascript error", + message: "<%= error.message %>" + }))) + .pipe($.sourcemaps.write(".", { includeContent: true, sourceRoot: path.join("../../", vendorsDir) })) .pipe($.size({ title: "Scripts (vendors)" })) - .pipe(gulp.dest(path.join(destDir, scriptsDir))) - .pipe($.rename({ suffix: ".min" })) - .pipe($.size({ title: "Scripts (vendors, minified)" })) - .pipe($.uglify().on('error', $.notify.onError({ - title: "Javascript error", - message: "<%= error.message %>" - }))) .pipe(gulp.dest(path.join(destDir, scriptsDir))); }); @@ -78,19 +84,18 @@ gulp.task("stylesheet", ["sprite", "vendors"], function() { var files = stylesFiles.map(function(filename) { return path.join(sourceDir, sassDir, filename); }); + return gulp.src(files) - .pipe($.sass()) - .on("error", $.notify.onError({ - title: "SASS Error", - message: "<%= error.message %>" - })) + .pipe($.sourcemaps.init()) + .pipe($.sass({ sourceMapContents: true })) + .on("error", $.notify.onError({ + title: "SASS Error", + message: "<%= error.message %>" + })) + .pipe($.postcss(postcssProcessors)) + .pipe($.sourcemaps.write(".", { includeContent: true, sourceRoot: path.join("../../", sourceDir, sassDir) })) .on("error", function() { this.emit("end"); }) - .pipe($.autoprefixer(autoprefixerConfig, { cascade: true })) .pipe($.size({ title: "Stylesheet" })) - .pipe(gulp.dest(path.join(destDir, "css/"))) - .pipe($.rename({ suffix: ".min" })) - .pipe($.minifyCss()) - .pipe($.size({ title: "Stylesheet (minified)" })) .pipe(gulp.dest(path.join(destDir, "css/"))); }); @@ -99,13 +104,12 @@ gulp.task("stylesheet", ["sprite", "vendors"], function() { */ gulp.task("errors", ["clean-errors"], function() { return gulp.src(path.join(errorsDir, sassDir, "main.scss")) - .pipe($.sass({ - includePaths: [path.join(sourceDir, sassDir)] - })) - .pipe($.autoprefixer(autoprefixerConfig, { cascade: true })) - .pipe(gulp.dest(path.join(errorsDir, "css/"))) - .pipe($.rename({ suffix: ".min" })) - .pipe($.minifyCss()) + .pipe($.sourcemaps.init()) + .pipe($.sass({ + includePaths: [path.join(sourceDir, sassDir)] + })) + .pipe($.postcss(postcssProcessors)) + .pipe($.sourcemaps.write(".", { includeContent: true })) .pipe(gulp.dest(path.join(errorsDir, "css/"))); }); @@ -141,15 +145,14 @@ gulp.task("images", ["stylesheet"], function() { */ gulp.task("scripts", function() { return gulp.src(path.join(sourceDir, scriptsDir, "*.js")) - .pipe($.concat("main.js", { newLine: "\r\n\r\n" })) + .pipe($.sourcemaps.init()) + .pipe($.concat("main.js", { newLine: "\r\n\r\n" })) + .pipe($.uglify().on('error', $.notify.onError({ + title: "Javascript error", + message: "<%= error.message %>" + }))) + .pipe($.sourcemaps.write(".", { includeContent: true, sourceRoot: path.join("../../", sourceDir, scriptsDir) })) .pipe($.size({ title: "Scripts" })) - .pipe(gulp.dest(path.join(destDir, scriptsDir))) - .pipe($.rename({ suffix: ".min" })) - .pipe($.uglify().on('error', $.notify.onError({ - title: "Javascript error", - message: "<%= error.message %>" - }))) - .pipe($.size({ title: "Scripts (minified)" })) .pipe(gulp.dest(path.join(destDir, scriptsDir))); }); @@ -166,16 +169,11 @@ gulp.task("jshint", function() { * Merge vendors and app scripts */ gulp.task("merge-scripts", ["vendors", "scripts"], function() { - return gulp.src(path.join(destDir, scriptsDir, "{vendors,main}.js")) - .pipe($.concat("all.js")) + return gulp.src([path.join(destDir, scriptsDir, "vendors.js"), path.join(destDir, scriptsDir, "main.js")]) + .pipe($.sourcemaps.init({ loadMaps: true })) + .pipe($.concat("all.js")) + .pipe($.sourcemaps.write(".", { includeContent: true, sourceRoot: path.join("../../", sourceDir, scriptsDir) })) .pipe($.size({ title: "Scripts (all)" })) - .pipe(gulp.dest(path.join(destDir, scriptsDir))) - .pipe($.rename({ suffix: ".min" })) - .pipe($.uglify().on('error', $.notify.onError({ - title: "Javascript error", - message: "<%= error.message %>" - }))) - .pipe($.size({ title: "Scripts (all, minified)" })) .pipe(gulp.dest(path.join(destDir, scriptsDir))); }); diff --git a/README.md b/README.md index 175b29a193..29b20d7a7a 100644 --- a/README.md +++ b/README.md @@ -63,13 +63,15 @@ python manage.py load_factory_data fixtures/advanced/aide_tuto_media.yaml Cela va créer plusieurs entitées : -* 6 utilisateurs (utilisateur/mot de passe) : +* 7 utilisateurs (utilisateur/mot de passe) : * user/user : Utilisateur normal * staff/staff : Utilisateur avec les droits d'un staff * admin/admin : Utilisateur avec les droits d'un staff et d'un admin * anonymous/anonymous : Utilisateur qui permet l'anonymisation des messages sur les forums * Auteur externe/external : Utilisateur qui permet de récupérer les tutoriels d'anciens membres et/ou de publier des tutoriels externes. * ïtrema/ïtrema : Utilisateur de test supplémentaire sans droit + * decal/decal: le compte qui possède un identifiant ``Profile`` différent de l'identifiant ``user`` pour permettre de tester des cas ou ces id sont différents + * 3 catégories * 11 forums * 3 sujets avec une réponse @@ -93,6 +95,10 @@ Pour générer la documentation en local, rendez-vous dans le répertoire `zds-s Vous trouverez tout sur [la page dédiée de la documentation](CONTRIBUTING.md) +### Code de Conduite Contributeurs + +En contribuant, vous vous engagez à respecter le [Code de Conduite Contributeurs](CODE_OF_CONDUCT.md). + ## En savoir plus @@ -101,4 +107,4 @@ Vous trouverez tout sur [la page dédiée de la documentation](CONTRIBUTING.md) - [Comment contribuer : comprendre comment suivre le workflow (sur zds)](http://zestedesavoir.com/forums/sujet/324/comment-contribuer-comprendre-comment-suivre-le-workflow/) - [Les détails du workflow utilisé sur Zeste de Savoir](http://zds-site.readthedocs.org/fr/latest/workflow.html) -Zeste de Savoir est basé sur un fork de [Progdupeupl](https://pdp.microjoe.org) ([voir le dépôt Git](http://git.microjoe.org/progdupeupl/)). +Zeste de Savoir est basé sur un fork de [Progdupeupl](https://pdp.microjoe.org) ([voir le dépôt Git](https://github.com/progdupeupl/pdp_website)). diff --git a/assets/images/sprite/zform-abbr.png b/assets/images/sprite/zform-abbr.png new file mode 100644 index 0000000000..67624efaea Binary files /dev/null and b/assets/images/sprite/zform-abbr.png differ diff --git a/assets/images/sprite/zform-attention.png b/assets/images/sprite/zform-attention.png new file mode 100644 index 0000000000..e501aac193 Binary files /dev/null and b/assets/images/sprite/zform-attention.png differ diff --git a/assets/images/sprite/zform-blockcode.png b/assets/images/sprite/zform-blockcode.png new file mode 100644 index 0000000000..da4ec91f21 Binary files /dev/null and b/assets/images/sprite/zform-blockcode.png differ diff --git a/assets/images/sprite/zform-bold.png b/assets/images/sprite/zform-bold.png new file mode 100644 index 0000000000..342d1ab522 Binary files /dev/null and b/assets/images/sprite/zform-bold.png differ diff --git a/assets/images/sprite/zform-center.png b/assets/images/sprite/zform-center.png new file mode 100644 index 0000000000..5e9b278f35 Binary files /dev/null and b/assets/images/sprite/zform-center.png differ diff --git a/assets/images/sprite/zform-error.png b/assets/images/sprite/zform-error.png new file mode 100644 index 0000000000..3a060f7e31 Binary files /dev/null and b/assets/images/sprite/zform-error.png differ diff --git a/assets/images/sprite/zform-footnote.png b/assets/images/sprite/zform-footnote.png new file mode 100644 index 0000000000..0aa6355084 Binary files /dev/null and b/assets/images/sprite/zform-footnote.png differ diff --git a/assets/images/sprite/zform-image.png b/assets/images/sprite/zform-image.png new file mode 100644 index 0000000000..a10d3a3b5e Binary files /dev/null and b/assets/images/sprite/zform-image.png differ diff --git a/assets/images/sprite/zform-information.png b/assets/images/sprite/zform-information.png new file mode 100644 index 0000000000..6ae555d268 Binary files /dev/null and b/assets/images/sprite/zform-information.png differ diff --git a/assets/images/sprite/zform-italic.png b/assets/images/sprite/zform-italic.png new file mode 100644 index 0000000000..2fea87c45e Binary files /dev/null and b/assets/images/sprite/zform-italic.png differ diff --git a/assets/images/sprite/zform-key.png b/assets/images/sprite/zform-key.png new file mode 100644 index 0000000000..ec2db271d0 Binary files /dev/null and b/assets/images/sprite/zform-key.png differ diff --git a/assets/images/sprite/zform-link.png b/assets/images/sprite/zform-link.png new file mode 100644 index 0000000000..5d08206aa4 Binary files /dev/null and b/assets/images/sprite/zform-link.png differ diff --git a/assets/images/sprite/zform-math.png b/assets/images/sprite/zform-math.png new file mode 100644 index 0000000000..d74df9744d Binary files /dev/null and b/assets/images/sprite/zform-math.png differ diff --git a/assets/images/sprite/zform-ol.png b/assets/images/sprite/zform-ol.png new file mode 100644 index 0000000000..346b527b61 Binary files /dev/null and b/assets/images/sprite/zform-ol.png differ diff --git a/assets/images/sprite/zform-question.png b/assets/images/sprite/zform-question.png new file mode 100644 index 0000000000..ba51b97a7b Binary files /dev/null and b/assets/images/sprite/zform-question.png differ diff --git a/assets/images/sprite/zform-quote.png b/assets/images/sprite/zform-quote.png new file mode 100644 index 0000000000..235ed59ee8 Binary files /dev/null and b/assets/images/sprite/zform-quote.png differ diff --git a/assets/images/sprite/zform-right.png b/assets/images/sprite/zform-right.png new file mode 100644 index 0000000000..2fa35a0b3e Binary files /dev/null and b/assets/images/sprite/zform-right.png differ diff --git a/assets/images/sprite/zform-secret.png b/assets/images/sprite/zform-secret.png new file mode 100644 index 0000000000..b469c1696d Binary files /dev/null and b/assets/images/sprite/zform-secret.png differ diff --git a/assets/images/sprite/zform-strike.png b/assets/images/sprite/zform-strike.png new file mode 100644 index 0000000000..58f9402c00 Binary files /dev/null and b/assets/images/sprite/zform-strike.png differ diff --git a/assets/images/sprite/zform-sub.png b/assets/images/sprite/zform-sub.png new file mode 100644 index 0000000000..fb615c509e Binary files /dev/null and b/assets/images/sprite/zform-sub.png differ diff --git a/assets/images/sprite/zform-sup.png b/assets/images/sprite/zform-sup.png new file mode 100644 index 0000000000..157e50004c Binary files /dev/null and b/assets/images/sprite/zform-sup.png differ diff --git a/assets/images/sprite/zform-table.png b/assets/images/sprite/zform-table.png new file mode 100644 index 0000000000..6cb3341b1d Binary files /dev/null and b/assets/images/sprite/zform-table.png differ diff --git a/assets/images/sprite/zform-title1.png b/assets/images/sprite/zform-title1.png new file mode 100644 index 0000000000..86ba912bf6 Binary files /dev/null and b/assets/images/sprite/zform-title1.png differ diff --git a/assets/images/sprite/zform-title2.png b/assets/images/sprite/zform-title2.png new file mode 100644 index 0000000000..30d29d7295 Binary files /dev/null and b/assets/images/sprite/zform-title2.png differ diff --git a/assets/images/sprite/zform-title3.png b/assets/images/sprite/zform-title3.png new file mode 100644 index 0000000000..42f7c4114e Binary files /dev/null and b/assets/images/sprite/zform-title3.png differ diff --git a/assets/images/sprite/zform-title4.png b/assets/images/sprite/zform-title4.png new file mode 100644 index 0000000000..46804ab837 Binary files /dev/null and b/assets/images/sprite/zform-title4.png differ diff --git a/assets/images/sprite/zform-titles.png b/assets/images/sprite/zform-titles.png new file mode 100644 index 0000000000..86ba912bf6 Binary files /dev/null and b/assets/images/sprite/zform-titles.png differ diff --git a/assets/images/sprite/zform-ul.png b/assets/images/sprite/zform-ul.png new file mode 100644 index 0000000000..164b49d5b5 Binary files /dev/null and b/assets/images/sprite/zform-ul.png differ diff --git a/assets/js/ajax-actions.js b/assets/js/ajax-actions.js index 4788a6c515..3ade43b304 100644 --- a/assets/js/ajax-actions.js +++ b/assets/js/ajax-actions.js @@ -303,7 +303,7 @@ $(data).insertAfter($form); /* global MathJax */ - if ($(data).find("mathjax").length > 0) + if ($(data).find("$").length > 0) MathJax.Hub.Queue(["Typeset", MathJax.Hub]); } }); diff --git a/assets/js/editor.js b/assets/js/editor.js index 52dddb274e..58b84cc741 100644 --- a/assets/js/editor.js +++ b/assets/js/editor.js @@ -93,11 +93,12 @@ titles: { "link" : "Lien hypertexte", "abbr" : "Abréviation", - "image": "Image" + "image": "Image", }, init: function() { - var listTexta = document.getElementsByTagName("textarea"); + var self = this, + listTexta = document.getElementsByTagName("textarea"); for (var i=0, c=listTexta.length; i" + - "
" + - - "
" + - "
" + - "" + - "" + - "
" + - - "
" + - "" + - "" + - "
" + - "
" + - - "
" + - "
" + - "" + - "" + - "
" + - - "
" + - "" + - "" + - "
" + - "
" + - - "
" + - "
" + - "" + - "" + - "
" + - - "
" + - "" + - "" + - "
" + - "
" + - - "
" + - "
" + - "" + - "" + - "
" + - - "
" + - "" + - "
" + - - "
" + - "" + - "
" + - "
" + - - "" + - ""; - - this.addEvent(document.getElementById("zform-modal-validate"), "click", (function(_this) { - return function() { - _this.validatePopup(); - }; - }) (this)); + var validateButton = document.createElement("a"); + validateButton.className = "btn btn-submit"; + validateButton.innerHTML = "Valider"; + validateButton.href = "#"; - this.addEvent(document.getElementById("zform-modal-cancel"), "click", (function(_this) { - return function() { - _this.closePopup(); - }; - }) (this)); + function buildButton(type) { + var btn = validateButton.cloneNode(true); + btn.addEventListener("click", self.validatePopup.bind(self, type)); + return btn; + } + + this.modals = {}; + this.modals.link = new window.Modal({ + "title": this.titles.link, + "body": "
" + + "" + + "" + + "
" + + "" + + "" + + "
", + "footer": buildButton("link") + }); + + this.modals.image = new window.Modal({ + "title": this.titles.image, + "body": "
" + + "" + + "" + + "
" + + "" + + "" + + "
", + "footer": buildButton("image") + }); + + this.modals.abbr = new window.Modal({ + "title": this.titles.abbr, + "body": "
" + + "" + + "" + + "
" + + "" + + "" + + "
", + "footer": buildButton("abbr") + }); }, setup: function(textareaId) { @@ -278,36 +251,21 @@ }, openPopup: function(popupGuid) { - this.closePopup(); - - document.getElementById("zform-modal-overlay").style.display = "block"; - document.getElementById("zform-modal-wrapper").style.display = "block"; - - document.getElementById("zform-modal-header").innerHTML = this.titles[popupGuid] || "Markdown"; - - document.getElementById("zform-modal-" + popupGuid).style.display = "block"; + this.modals[popupGuid].open(); return false; }, closePopup: function() { - var modals = document.getElementsByTagName("section"); - - for (var i=0, c=modals.length; i button[name=answer]").click(); } }); -})(jQuery); \ No newline at end of file +})(jQuery); diff --git a/assets/js/modal.js b/assets/js/modal.js index 126d4d3b6e..efe3087629 100644 --- a/assets/js/modal.js +++ b/assets/js/modal.js @@ -1,72 +1,217 @@ /* ===== Zeste de Savoir ==================================================== Manage modals boxes - --------------------------------- - Author: Alex-D / Alexandre Demode ========================================================================== */ -(function(document, $, undefined){ +(function(document, $, undefined) { "use strict"; - - var $overlay = $("
", { - "id": "modals-overlay" - }).on("click", function(e){ - closeModal(); - e.preventDefault(); - e.stopPropagation(); - }); - var $modals = $("
", { "id": "modals" }); - $("body").append($modals); - $modals.append($overlay); + /** + * Create a new Modal + * + * @constructor + * @param {Object} options + * @param {string} options.title + * @param {(Node|jQuery)} options.body + * @param {(Node|jQuery)} options.footer + * @param {string} [options.titleIcon=""] - Icon to add to the title + * @param {string} [options.closeText="Annuler"] - The text of the close button + * @param {(Node|jQuery)} [options.modal] - The modal element to wrap the content + */ + var Modal = function(options) { + this.options = $.extend({ + titleIcon: "", + closeText: "Annuler" + }, options); + if(!Modal._initialized) this.firstRun(); + this.init(); + }; - function buildModals($elems){ - $elems.each(function(){ - $modals.append($(this).addClass("tab-modalize")); - $(this).append($("", { - class: "btn btn-cancel " + ($(this).is("[data-modal-close]") ? "btn-modal-fullwidth" : ""), + /** + * Close the current modal + * + * @static + */ + Modal.closeCurrent = function() { + Modal.current.modal.removeClass("open"); + Modal.container.removeClass("open"); + $("html").removeClass("dropdown-active"); + Modal.current = null; + }; + + /** + * Open a modal + * + * @static + * @param {string} id - The id of the modal to open + */ + Modal.openModal = function(id) { + if(Modal.list[id]) { + Modal.list[id].open(); + } + }; + + Modal.prototype = { + /** + * To be run on first modal creation + * + * @access private + */ + firstRun: function() { + /** + * The Node that contains all the modals and the overlay + * @type {jQuery} + */ + Modal.container = $("
", { class: "modals-container" }); + /** + * The Node that wrap all the modals + * @type {jQuery} + */ + Modal.wrapper = $("
", { class: "modals-wrapper" }); + /** + * The overlay + * @type {jQuery} + */ + Modal.overlay = $("
", { class: "modals-overlay" }); + Modal.container.append(Modal.wrapper).append(Modal.overlay).appendTo($("body")); + /** + * The list of all the modals + * @type {Modal[]} + */ + Modal.list = []; + Modal._initialized = true; + Modal.nextId = 0; + + Modal.overlay.on("click", Modal.closeCurrent); + + $("body").on("click", ".open-modal", function(e) { + Modal.openModal($(this).attr("href").substring(1)); + + e.preventDefault(); + e.stopPropagation(); + }).on("keydown", function(e) { + // Escape close modal + if(Modal.current && e.which === 27){ + Modal.closeCurrent(); + e.stopPropagation(); + } else if(Modal.current && e.which === 13) { + if(document.activeElement.tagName !== "TEXTAREA" || e.ctrlKey) { + var elem = Modal.current.footer.find(".btn-submit").get(0); + if(elem) elem.click(); + } + } + }); + }, + + /** + * Initialize a Modal + * + * @access private + */ + init: function() { + /** + * The modal DOM Node + * @member {jQuery} + */ + this.modal = this.options.modal || $("
", { class: "modal modal-flex" }); + /** + * The ID of the modal + * @member {string} + */ + this.id = this.modal.attr("id") || "noid-" + (Modal.nextId++); + /** + * The title of the modal + * @member {jQuery} + */ + this.title = $("
", { + class: "modal-title", + text: this.options.title + }); + + if(this.options.titleIcon) { + this.title.addClass(this.options.titleIcon + " ico-after"); + } + + /** + * The body of the modal + * @member {jQuery} + */ + this.body = $("
", { + class: "modal-body" + }).append(this.options.body); + + /** + * The footer of the modal (contains the buttons) + * @member {jQuery} + */ + this.footer = $("
", { + class: "modal-footer" + }).append(this.options.footer).append($("", { + class: "btn btn-cancel", href: "#close-modal", - text: $(this).is("[data-modal-close]") ? $(this).attr("data-modal-close") : "Annuler", + text: this.options.closeText, click: function(e){ - closeModal(); + Modal.closeCurrent(); e.preventDefault(); e.stopPropagation(); } })); - var $link = $("[href=#"+$(this).attr("id")+"]:first"); - var linkIco = $link.hasClass("ico-after") ? " light " + $link.attr("class").replace(/btn[a-z-]*/g, "") : ""; - $(this).prepend($("", { - class: "modal-title" + linkIco, - text: $link.text() - })); - }); - } - $("body").on("click", ".open-modal", function(e){ - $overlay.show(); - $($(this).attr("href")).show(0, function(){ - $(this).find("input:visible, select, textarea").first().focus(); - }); - if(!$("html").hasClass("enable-mobile-menu")) - $("html").addClass("dropdown-active"); + this.modal.addClass("tab-modalize").append(this.title, this.body, this.footer).appendTo(Modal.wrapper); - e.preventDefault(); - e.stopPropagation(); - }); + Modal.list[this.id] = this; + }, + + /** + * Open the Modal + */ + open: function() { + if(Modal.current) Modal.closeCurrent(); + this.modal.addClass("open"); + Modal.container.addClass("open"); + + Modal.current = this; + + this.body.find("input:visible, select, textarea").first().focus(); + if(!$("html").hasClass("enable-mobile-menu")) + $("html").addClass("dropdown-active"); + }, - $("body").on("keydown", function(e){ - // Escape close modal - if($(".modal:visible", $modals).length > 0 && e.which === 27){ - closeModal(); - e.stopPropagation(); + /** + * Close the Modal + */ + close: function() { + Modal.closeCurrent(); } - }); + }; - function closeModal(){ - $(".modal:visible", $modals).fadeOut(150); - $overlay.fadeOut(150); - $("html").removeClass("dropdown-active"); + /** + * Build the modal from the given elements + * + * @param {jQuery} $elems + */ + function buildModals($elems){ + $elems.each(function(){ + var $link = $("[href=#"+$(this).attr("id")+"]:first"); + + var linkIco = ""; + if($link.hasClass("ico-after")) { + linkIco = $link.attr("class").split(" ").concat(["light"]).filter(function(c) { + return ["", "ico-after", "open-modal", "blue"].indexOf(c) === -1 && c.indexOf("btn-") === -1; + }).join(" "); + } + + new Modal({ + title: $link.text(), + footer: $(this).find(".btn, [type=submit]").filter(":not(.modal-inner)").detach(), + body: $(this).children(), + modal: $(this), + closeText: $(this).is("[data-modal-close]") ? $(this).attr("data-modal-close") : "Annuler", + titleIcon: linkIco + }); + }); } + window.Modal = Modal; $(document).ready(function(){ buildModals($(".modal")); @@ -74,4 +219,4 @@ buildModals($(e.target)); }); }); -})(document, jQuery); \ No newline at end of file +})(document, jQuery); diff --git a/assets/scss/base/_forms.scss b/assets/scss/base/_forms.scss index fe3741c70f..200978e491 100644 --- a/assets/scss/base/_forms.scss +++ b/assets/scss/base/_forms.scss @@ -1,5 +1,5 @@ .content-container, -#modals { +.modals-container { form { width: 100%; @@ -238,7 +238,9 @@ margin: 0 auto; text-align: center; } +} +.content-container { .btn-holder, .buttonHolder /* specifix for crispy */ { margin-top: 25px; @@ -248,7 +250,7 @@ .wf-active { .content-container, - #modals { + .modals-container { textarea { font-family: $font-monospace-active; } @@ -256,7 +258,7 @@ } .main-container, -#modals { +.modals-container { input[type=radio], input[type=checkbox] { float: left; @@ -266,18 +268,31 @@ border: 1px solid #BBB; background: #FCFCFC; transition: none; + position: relative; - &:checked { + &:after { + display: block; + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + opacity: 0; @include sprite(); } + + &:checked:after { + opacity: 1; + } } input[type=radio] { border-radius: 50%; } - input[type=radio]:checked { + input[type=radio]:after { @include sprite-position($radio); } - input[type=checkbox]:checked { + input[type=checkbox]:after { @include sprite-position($check); } @@ -299,7 +314,7 @@ @media only screen and #{$media-wide} { .content-container, - #modals { + .modals-container { form.content-wrapper { margin: 0; width: 100%; diff --git a/assets/scss/base/_high-pixel-ratio.scss b/assets/scss/base/_high-pixel-ratio.scss index 292706a42d..ff75ab560f 100644 --- a/assets/scss/base/_high-pixel-ratio.scss +++ b/assets/scss/base/_high-pixel-ratio.scss @@ -10,11 +10,17 @@ } .ico, .ico-after:after, - .breadcrumb ol li:not(:last-child):after, - input[type=radio]:checked, - input[type=checkbox]:checked { + .breadcrumb ol li:not(:last-child):after { @include sprite-2x(); } + + .main-container, + .modals-container { + input[type=radio]:after, + input[type=checkbox]:after { + @include sprite-2x(); + } + } } @media only screen and (-webkit-min-device-pixel-ratio: 1.3) and #{$media-mobile-tablet}, diff --git a/assets/scss/base/_icons.scss b/assets/scss/base/_icons.scss index 62c63be0ee..c48ce237cc 100644 --- a/assets/scss/base/_icons.scss +++ b/assets/scss/base/_icons.scss @@ -17,8 +17,16 @@ @include sprite(); } - &.alert:after { - @include sprite-position($alert); + &.alert { + &:after { + @include sprite-position($alert); + } + &.blue:after { + @include sprite-position($alert-blue); + } + &.light:after { + @include sprite-position($alert-light); + } } &.arrow-left { diff --git a/assets/scss/components/_autocomplete.scss b/assets/scss/components/_autocomplete.scss index ec6a0109f9..bc35d5b3fd 100644 --- a/assets/scss/components/_autocomplete.scss +++ b/assets/scss/components/_autocomplete.scss @@ -30,6 +30,5 @@ } .modal .autocomplete-dropdown { - margin-top: -10px; - margin-left: 15px; -} \ No newline at end of file + margin-top: -15px; +} diff --git a/assets/scss/components/_breadcrumb.scss b/assets/scss/components/_breadcrumb.scss index ce4b90a740..aca03ed28b 100644 --- a/assets/scss/components/_breadcrumb.scss +++ b/assets/scss/components/_breadcrumb.scss @@ -18,7 +18,7 @@ right: 0; width: 50px; height: 100%; - background-image:linear-gradient(left, rgba(231, 235, 236, 0), rgba(231, 235, 236, .75)); + background-image:linear-gradient(to right, rgba(231, 235, 236, 0), rgba(231, 235, 236, .75)); } ol { diff --git a/assets/scss/components/_editor.scss b/assets/scss/components/_editor.scss index b70eacdf78..b7e9b47558 100644 --- a/assets/scss/components/_editor.scss +++ b/assets/scss/components/_editor.scss @@ -33,8 +33,8 @@ top: 7px; left: 12px; // TODO : remake icons - display: none; - } + //display: none; + } } button { padding: 0 15px; @@ -42,7 +42,7 @@ border-top: none; border-right: none; border-left: none; - + &[type=submit] { background: #084561; border-bottom-color: #084561; @@ -74,34 +74,34 @@ /* Icons */ -.zform-button-bold { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAwklEQVQoz2P4z4AfMlBLQXlC+fmS/wXvs+tT1ye8j5wfLIBhQnF95v+s/SBWxPyQ/17nMRTk1qf+TwYr8K/3++/4H0NBen38/2igAl8Bt/tu/y3mYyhIqI/8H3zfp971vMt/s/1YfBFRH/zfCyxhMt/iv9p5eQE0Bf71vv8dwQq0BdT+6/4XL0BT4FYPtBlqtMx/zf8C9WgKbOsd/uuDPSddoPKf/z2XAooCmwST9br71fbL90v2C+/n7edUoHpc4IYASlr8ehOQ9V8AAAAASUVORK5CYII="); } -.zform-button-italic { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAcUlEQVQoz2P4z4AfMlBbQXZD6oeE/5Efgg/gNCHuQeT/wAScJsQYhP/3/4DHipAJQf/dFuBR4PPA879tAE4FXgau/20+4PGF4wSX/0YL8CiweGDxXysApwIzB9P/Gv9xBpRJg+4BtQPyByQ30DguMCEAC2D/O2OrpxIAAAAASUVORK5CYII="); } -.zform-button-strike { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAn0lEQVQoz2P4z4AfMlBTQYlgwczstNTyhJmRu7EqyHuXVQ6iI8oD/2NRkJuW9j+5A8L2wGZCukvC/+j/ITN9jf8z2LtgtSJyd+j/wP8e/23PmKEqKC8t/w+D8f9t/ksguRvJBH9BCG2Upn3X6L/cGQwr3NLsy2Fsmf9idzEU2KaZ/9eHmiLyjr8cQ4FJmu47tTPy5ZJpwuW8HTSKC+wQAFs6/D/QOXeIAAAAAElFTkSuQmCC"); } -.zform-button-abbr { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACTUlEQVR42pWR4UtTYRTGB/0FgyBckZREI8SyElEEEyW0RJoxbaK2raYmaVMnt6ZYzpbTudqW091arqZoKYEVjWgFFRhCg77Ymt7J3d6522rh9yJ6eufHcOXOt3Nenuf8nveIRH9V10wY7dMEre4wNM7gN1G61TYtPB6aJ7g8F0cDG21J20DDrkDp5D3NngTkjlhhWmK1i6DB+vldLZvYXjsaQ5WZ6LYsVk7ER1rGA5AbPw7LeheLFaME5YPhyS2JG1zxgyp7ENX9/pJkr32jedD4cAilA6uL/xXXOWNjcjuBzPgJJy3CDu3b827rBxPM7wcgu9OPalfFtnKbIlZqJ8wxK/EVWYiv0ExmCwYjTZsatr48azEtXIM3NI/eF904brv588TYGlSTcRSZCeonBFx69BU17BoOGfjNTepmZMN6bwesC17I7wrQTMVRMERMybe867xJ5RZwxhnDgZ5VJmW0ClvJj86nr9B4P458w+vfeUZenJzn9PGsilJU2SPYx3BNqcSxYmMB8vW5OKy/ipwrjl8U15fdx+OUPYobzxKQMiFkdnLilAT5gxExxfXVUNTTjg1c/36Gmz13T0AbjbRbu+z/53VyDbxfwQqQj69B2sNtZN2j45jKkQgqzBHsvBhMnZ/ilpVZCEzPvyNbH0KWjhNT3L1062rHlICjdCZpDpalNKC4TZW3Ihh4kkCVLYqsrhVIdSsoN4Wh9XxB/e0ojnRzkKgDm5vQ3xVTXDZTu4xd7ctJXL/kQpChWxmJJrBOhesZ6iU2Q7kk/gOYnkYcn8opfQAAAABJRU5ErkJggg=="); } -.zform-button-key { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABe0lEQVR42pWSQW5TQQyGv/GMX1KVsmJLeggEO+ACCHEJWOQKBSo19ADZpoIFN0CIY9BK0G1DuyebIlGSzNgsXt5LiKia/tJItmR/M7894dPnLy/NbGTmgHOzAkECEsKrF8+fHaWc8+jRwwfc3dnB3W5uD8Llr0uOT76NgKNkZpydjXn65DGb6uvxCXe2twFIZsbWVgeAfr9Pp9NBRDAzZrMZe6/fkHMGwN3Z7d2nqpTfV39qQClGShUABwcDut0u+/tvGQzeMZ1OyTkjqgDUc4KUFLOrBlDQpsCtPmZtLFHap4s3gISbNRYK1QIQYyTGiLu38ap8AahUKVZWLcR/AOvxOkA1Lu2sWogxIiLM53NE5FpAPQNbbkE11UmMYMZwOMRKqfP/AVSx1oIZKWk7nKYwiBCv+QeaEt5YsDULm0hVKcWWMyCEek0imwEqXdpxd0QC309PgbBBu9Pr9ZhMJjXgx3h8+P7Dxz1uqYvz80MWV94Ddrm9LoCffwHdG70wvg5ZlgAAAABJRU5ErkJggg=="); } -.zform-button-sup { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABLElEQVR42mNgGDkgZMoDhdJVzy+0bH75wbfrbgPJBiTPe7wBqFHBq+1WQ8P65//JdknirIcXUuY9eoAhUV5efqC4uPhAbm7ugbS0tAPx8fEK4eHhB/z8/A64uroeAKmxr7jWEDbp3gXznEsGGAYANQcANX9ISUn5D9Q8ASQG1NwA1LzAxsZGwbroSoBT9bUFJhkXBAyTLzjoxZ9VwDAEaLMDUPP/yMjI/0DNBTCbQcC79eaB9LkP/yfPevA/bOLdDzj9CHT2hMDAwP9ubm7/gTYLkBxIQJsFQJpdXFz+GxkZTSDZAJCzgTYXWFtb/zcwMPivoKDgQLTN0AArAPE1NTUnAF3wX0JC4oOgoKABsTYfADkbqNkAaPMBoOYDQM0HuLi4DrCwsBgMzjwCAMHEeHCN9BV5AAAAAElFTkSuQmCC"); } -.zform-button-sub { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABLElEQVR42mNgGD6gvLz8QHFx8YHc3NwDaWlpB+Lj4xXCw8MP+Pn5HXB1dT1A0ACg5gCg5g8pKSn/gZongMSAmhuAmhfY2NgoEOUKoM0OQM3/IyMj/wM1FxBlMzoAOntCYGDgfzc3t/9AmwVINgBoswBIs4uLy38jI6MJJBsAcjbQ5gJra+v/BgYG/xUUFBxA4iFTHiiUrnp+oWXzyw++XXcbsNoMDbACEF9TU3MC0AX/JSQkPggKChokz3u8AahRwavtVkPD+uf/cdl8AORsoGYDoM0HgJoPADUf4OLiOsDCwmIAUpc46+GFlHmPHpCVVuwrrjWETbp3wTznkgHJmq2LrgQ4VV9bYJJxQcAw+YKDXvxZBZIM8G69eSB97sP/ybMe/A+bePfD4MlDAC7MeHCrEeunAAAAAElFTkSuQmCC"); } -.zform-button-center { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAfElEQVR42mP8z4AfMDFQqoAFRJT//8fwBwx/g+EvMP7FsJeRgYHxPzEmMDDkZP+eAtMNhTnHpoJkiDMh9T+yzQh4iwQ3BGf/moKsF2hWziMS3OD9H9Xu31D4mRg3MPwHQ9Ns/f+a/1X+y/2X/C/yn/8/93/2bIgMI8WxCQClCFYAGIFCIgAAAABJRU5ErkJggg=="); } -.zform-button-right { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAY0lEQVR42mP8z4AfMDFQqoAFRJT//8fwBwx/g+EvMP7FsJeRgYHxPzEmQEDS/99QnTB4hmgTUv8j24yAt0h0g/t/hF6Iec+JNsH7P6rdv6HwM4lu0Pr/G64bEq5/iDGBYGQBABNITB8iVnJIAAAAAElFTkSuQmCC"); } -.zform-button-ul { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA1UlEQVR42mNgGBQgZ/7jgqm7Xj8A0aTqZQERmtIcBQqibPJAJsiACeXl5dlAesrfv38Z/vz5w/D792+GX79+gemfP3+C2WvXrmWkigsGCUiZ+aigc9PLByE9d8kLRCUx1gIZIRb5N5Ic4ECMi4vLBgbUFFCAIeMfP37A2bdu3UIEYkDHrYKSxY8fuFZeG6qBaJt/qSB+2r0H1nmXyAxEdZ4CAwVucEo8CgxEIyOjbGBATYGlOhCNnBpBqROYShnhBty58WUCSDOUZjh37txUIDWVLt4HAP/ViGJIIAyXAAAAAElFTkSuQmCC"); } -.zform-button-ol { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA70lEQVR42mNgoAbImf9YZdHhd//JNgCkmSIDYIbA2OXl5dlA/L+kpOR/QUHB/+zs7P+pqan/ExIS/kdGRv4PDg7+j9UFiw5S6Aqywdz9b//P2vP6f8TEeypkGxLae0+ld8tL8rwQ1HVHpXPTc7jmuLi47IiIiP+BgYH/vby8/js7O/+3sbH5b2Ji8l9XV/e/mpoaqkVt65//b1zz9H/NqqcDFIjlyx7/L136+H/x4sfkuwCk2TrvEvmxANIMc4GRkVG2trb2fxUVlf9ycnL/xcXF/wsJCf3n4eH5z87O/p+Zmfk/hu0gbFd0pYPu4QcAKY588QFUIAIAAAAASUVORK5CYII="); } -.zform-button-quote { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABH0lEQVR42mNgGDQgon2HEBAvBeKfQPwfD94FxCrYDNi48uCt/7///P2PD2w5eR9kyG0gZkPWzAPEf/7++/f/w7d//19++vf/2cd//5+8//f/4bt//++9+ff/9qu//++8ghheveA4yBAzZAPkcqYeAEu+AGp89uHf/8dAzQ/e/vt/F6r5+ou//68+gxjQueosyABvrAY8BWp+9A6q+fW//7deQjRfAWq++AS3AXAvgJx/H2jrndd//98Ear72/O//y0DNF56ADPgDNqB20QmQAZZYAxFkCDIAuebC479gg9ECkRNXNP6BRdncHVfhBr3//APMB4pfxhqNONLGnefvvsI0fgfiWlISVu/MbVdAGr8AcSGpqVIJiO8BcQrD8AcAGopyopBVAH0AAAAASUVORK5CYII="); } -.zform-button-link { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAA6UlEQVQoz2P4z4AfMtBJgR13Vmnru3n/ax7mmOdI1Nyd97/1XVapHTdUgRGbT9fE/y/+3/1/8H/jvepDN3/c/X/k/8T/Pl1GbGAFhn7FH66+i9jm/Sf1/6T/lf9T/3v/idi24mHxB0M/iAldTd8np/tz2X/e+//c/0P/1/63/+zPNTm96btRF1iBbmb6+2klQTsdf7n9DwRCt/+Ov4J2TitJf6+bCVagqel7vff9qrfr/k//X/i/Akiu+7/qbe973+uammAFasz2Bl73U75kf8/+GR4X7pz9Kft7yhev+/YGasz0C0mKFAAASj0PpKVVf4oAAAAASUVORK5CYII="); } -.zform-button-image { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB8ElEQVQ4y6WTPWtUQRSGnzP33r33Jgu7kI1hI1GSgGARxFRG/4CFhY1VUlhI+oCNP8LfIKaz0MpCLEz+QUCwCIQVQc0X+dhsNtm5O3PGImbJboIIGaabmeec9533SAiB66wYYPnj2mtVmT8pNLPuilsDNZIYsoQ3L57OLsUAGmThyaOJ0SzLRCT6Z8WOgnddPnzZeA6cAU6spmmayfLqAR32aMk6k2M75EkTF5T9o5xvGxWGwl1iRnj5bBKvIj0JhQNjIoxAYbaYrO2Qln7QtC2cd8RpytREne+NYaqlGqoDHgAoYIxgwy6l5IDD0ybWdyicw4U2aZrStjkjuSEQesb0A0QITrG+S8dZTruWQh1eAekS1BMb4eLPmZ7R4QyQMUqrPUwgwarHOo9IiXarTLk0ThQZCHJZQghnEsrRTX5tbVPJNhkaNqTiON4fYnurTr0yRWzkcg7CRUByg/H8Pj/XVqiWfyPek3RGuTW9QDmr41X7YtHXwfreIl4Vr8odu8vcxG0UaGxu8+n4FXqkqCrweaCDEBDg8exS7yCaOeSkvUe2+ZXaw0Xmo6Qvmec+xgByRV59XsXnVWxt+oo8DpiYJdJEu5V7Yw9A5C8qnO9Lj50riCMJPUAplnfvVxpzhQ8z/zOccQSJ4S2AXHec/wAGb9qTrxXEvwAAAABJRU5ErkJggg=="); } -.zform-button-attention { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACJklEQVR42qVTTUiUYRB+vh93dX903bKUYMNlMWHJBC1WW8GjZVCnfpa6Fp1i6dilQwcJglgrDEKiQqhDRYWVCEsSFJ0Ksh8zKjJZ3V0WU3G/73tnpoNrFGkZzmHmMDPPPM8wA6zRtJUSuXSHISSvhLnALJ21Xc9ouTp9JQAhSblqd0VdG7viQnz0v2hlh+PBqaH272TPiF0Ylcl72/MTd1qCq2bAxNcqQgm/puswvUF46hNBIT6zqulTj9ubMw9jJGSJNXVB7Gy/sJ2TLze3qc8DW5v/yUCYb/gakzqrOXwcuoXxR1fBTgaBppMGE/f+FSAzGEuUVbdFvZv3YeFrEiKACFCc6IE/0g13bUf8w5WGxLIAmcGYj5lTnvABsMoDXOoWAbMDLo6hqvEgmPjsu0th3x8ATNzvCe1f564Ow8ndBiAoD3iWhMHKXERFTQiVWw5tUkXn1G+HNHl/R0SY39btTpu08BLO9GUwA3pZOeZzs3B7GYYhMCo7Yfj3YrS31SZLRVtO58f1xaPhAV/DcVN4DjT7HBAGIPg08h7TbyYBCCAMVRiGps+jJpZ0Kcs5DwDat7ut3UZV04MNHSmo2SdwstcXJbFARAME0A2BJjZECLqxHuX1PXjdl8DM2Mgek4n6ApHDAADT1w7T11YSpy3JLzn5uQ9oLtTtPIbCaPqcKcTp7NMTR4QYTIxfIzkEshwoywFZDshSIFuBHAIrAit6sdZvxg9QwSUHEnNo0gAAAABJRU5ErkJggg=="); } -.zform-button-error { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACU0lEQVR42q2T7U9SYRjG/VvgQys313pbc81WW80EBT1EICDiIdMjNlojTcdhptlWzoY0PzS11F618kumMWPlS7bUXpmWx0ohTsGK0HNAIN0V0oK51E9e2/Xt+f2ePffuJyVls+MqLxfOUWXmT1QJM6MnuWm9jvtIaphJUmV2FimEG8JuQznxhaLYn7ZGhIcciLwfR2RsGPzDLriMxXhbQLCvNFJiXXi2lOIX7ndheeYDovYHiHZaEW29hN93W7A0aoe32ohxlZh/qchcLZkzGAQx2MPd7sQy40T06gUErBbMN1YhfMWCSBONcMMZhB/dgfskidFjhzwj8gOChCAG075aM5acE/EbF200/BdNCNUZVpU7SyLccwNvJBkYlGXQCcFn6gQT7LmJaHcrAg0V+KGVrdmFChJ8Yw28lko8JdKZhIAp1Ycij3sQtVkQOG/EevEqs+GnCjDf2gyHZE8oIZgmtaHF7naE640InSvZUOArVmO+pRkD0h1JwVSRmvE31GDRSoM7rYkfXLMqCQK11XBVm2AXpSWf4CxU0IxchFB3BwJ6OfzFef/BrEIMNj8Pwc5rGJbuQn/WtuQQ32llgtc6wuMu0yF4rz0+MJ9a+hdU5oCVx2C5FHxHGyYLZSuwp1e0VbBqFybys4kx5RF+9rgawVvt+FVPw0uq8E2jhL/ODP56G6Y0uejLSuVj8Nrb+EJxmHh+9CA7nrcP36tM8Dddjvdr5Sk8y965ArPrwv8yJNsvHJSmmx3EXuZJ7m5uQLSd689JY/rEqebezC3CTf+9fwCiP9Om7nIiOAAAAABJRU5ErkJggg=="); } -.zform-button-question { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACZUlEQVR42r2SXUiTURjH34K6CbryIgi62FXQVezOZLM2isLSQbFljVpOvOgmRelmQUblkD7VssFGgRSrtQyKUvrYLEdI5XQfVtIWS833Zeac22xra/+e854FE7vppgN/zsPz/P7Ped7zHkEoW6mLxnXpzvqelNWwlOrQI3W+JBZTTq4RI/xtLVrrry12HkbO04vizBBQ/Az8Kolilst5roMxjF1mTpzVOzN3LEDaD/wYA+YfA5IDiN/kEh08tzQmM4xlHtk8d0Z/LmlvBvJBggaBqW7gy2WIV00IG9QIH1Qjbm8CvvUAX7s4QyzzMK8gWnRZfB8Gki+AGRsw60DG14HQ/iqaxoms/xJGddvI2EdN7MC0jbPkEU/psoJ0Wk/fGQDm3DQqQdJtKjoJctHI/ciHehE1aYAFF68xhrHkEU/WQpi1HKBLogaJR1S4z4vzD1AUXYi01NEklUD2CTV4SI3dnEnQfSCA6da9EGLNNTks+GjcNwQRmCAlB+j05wS95mJx8imvMUZmfYi11OQET4PWLnYdJ/ADkBsBUl66aS8y/lsI1ikRrFVSnpqkPXIeP0dklnk8Zq2d/YiNbxu1g5KtlUD6Tflx2t8DBRLGuQqjJKphgvYgJFsbmId5/zwFxctDqr5I+zGCYiR6PIiWYq5CfBiJgW5ET+zDqyM77jHPssdkVW2pllwXCE4j+c6NgL4Sn0zbMdmgwaRZg4+N2qzXWH13c8X6KsI3rXjKE22GG8ViBFL/FYSMauxWbNhJaWWZtpaMq1eYw0171obNuxA6qsGQQfWsZFgj/MNaVXaSQvif6zcxVDmUf47DnQAAAABJRU5ErkJggg=="); } -.zform-button-information, .zform-button-infoblocks { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACl0lEQVR42q2T7U9SURzH/VvgT+je3rQ2fdFcmw2StBeZNUwTtZWuwmywSjERnwAFbAiGmg+UT1CSIiRwJSPkITT15sAM2trqDWQty29H2jA35yvP9nl3v5/f+Z57TlbWUa983Qr3jCYiyVOF2VMt/mSOwpfMViyw2Qqv5ORDhntomKddFpxWhhIVvUH0OmMYZTbTGO1RCLWvQUtmE7TULjgwTKYKclsDqZbJVdj8CfRMxyAzv8eD4WUoLaswuzbQOBoBXTmRoq9P7JfkqcOc3LbF+G7Y8iYBCQndGQhhyPMRQ+4N3DYFIe4PwTS7DtnTIOgyc5wuHeZkBLnKRWm53g+r7zPqBiIQkwo3DQF8/7mdptrgQ3WPD+LHfgy8iuJC80tQRf3SjCCnzcca7TGoLSxu9QZQY/CjWu9Dn3MdJkJlN/MPnYfUCkE7vQK60MBmBCdkzNb4wifU9QXJpLeoeuQlHzPYXTsEkcaN8s45ggvXdG6YmSgoQddWRkBLnVtj3s10191JFVoPCXkQiX1D6sc2yjqcKG134ApBpHJgZJ4I+Kr/BXZWb2chf7aEKp0Xoi43rqrn8C76lQh+oUQxgxLSW9hsQ20PA7UtDPpsx14FutYmLVY6MeSKoUrDQKR0webbwO8/O+kKwQ9fUCyzEizofh5B4d1RImjfO0T6xhiHFpnj90cCMNnXUKZ0QNgyjUvyKRQ3WHCxfgJF9eNoHfGT3ztPti+P03w5Z99doISDgmMFxpRk0AfjzArEejfZ8gtcbrSiRuOA1hKCuI8BzWtIkfDBt5EqNAqogu7E+XuTUE8t4YmbJayhwxpGfp0ZFK8xQfObBIe+B/qclksJOiVUvoql+M1JiteUJBNZguQ4v4F75K/3L7zz0NlKPuwgAAAAAElFTkSuQmCC"); } -.zform-button-secret { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACfUlEQVR42m1Sz2sTQRh9u9nml02M2hoapaZNtaIg4q0eBMEeRPGg3jyJhyK00EvpsZBr/wqhAfHQs3fBglRa0EYTm5YYFEqKSRvTJDs7s77ZbdpYHfiYmW++7817b8bAiZHL5fqVUnNSygnGWQYYvxgrjuMszs7O/u6tN3o3S0tLN9m8nEqlRuLxOEzTBPdot9uoVqvY5iDQ4/n5+fV/ANjcz8O1TCYzZts2KpUKms2mvh2WZSGZTHp1+Xx+k7kbCwsLLb03uwBMvhwaGhoTQqBYLG41Go0010Edel0oFH5qYLIbo5Tpbp/VXTA5EY1GUSqVwKaHMzMz5R515Ww2e69cLufT6bRX+z+AQa2Zt+n19klzdU6z0zVkO/iXB+V3z92V0jh29iKe5kfXVxFwBVzpwHX8EELi1fotz9RkuIYHF1ZxdWrN8Bm4Lp4+uUs0E0Ygwvk+oIhthfUhDRKQTgPZySbzwmvZfP3+WIK+SRc6u29ghQZgGP0s7AMiCaYVcLAHuf8NdusHlHOAyMg0XLvTA0CKUPomG/WNj9R5Colrt1F5u8j+8xi+M4n61w0C1BBLnyFhCVfYvQDCk+GSamL8CszgAN1RkB2JT7sRDMNGIjOCdjPE2gOPVRfA+wcu3dWoWmvt8zpZfOCJA9VW6LRI1SWzwhfUi999uUp5PccM9EajUkLichqB6DkC2Bh9NoVRwYb9HZzOpBDc7/MZUO4JANtDVY72YIMAMSBMI60g8xqgjlatCtFsIDYcp93Kl90LoCWELr5A5FIARjDkP6HJl1CUZrcQazWosEOi0vdLG38EwCfZWp7zvfA+jjgM52jmD/M/lpT+WgNx/AHLKabZiPgg0gAAAABJRU5ErkJggg=="); } -.zform-button-blockcode, .zform-button-monospace { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABD0lEQVR42mNgGAVYgWHPQ36yNRt0PuD3nPf0WMSq5x9gYnGbX3/wXvz8GEgOr2b9tntCHrOfHiva9vq//9yn92DiIate3ivb/eY/SE679o4QVs16Lfciole//F649dV/v1lP76kX3JBGkpMOWPTsHkguYunz70C5CBTNug132cKXP/9YueMNUMGz36o514zRLdAsv2UMkivd9PJ/4MzHHxWSrrChKFAvvhkROv/p96xVL/579D24Jx93SRpJTtp76qN7ILmgmY++A+UisHpDMeWKkG3DnWOpi5/+d225Cw8Dr0mP7mWseP4fJCcXfVEIb0DKRFzgtyy/ecy78x48FvynPPxgU3vnGEhuNJFjAgDXGIoQBpiXVgAAAABJRU5ErkJggg=="); } -.zform-button-titles { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAApklEQVQoz73QsQ2EMAwFUEsUNDRUVJeKLh1VdE2qSIiGAikZxBNkAja4Cf4iLOI1uCjkdKkokSvrP9lO6KT7okeAjx4eWzhpCQ4WJp6k53GvJnjZcLUplhS/RyipwCZrAQZTDhQPNVhlORxbNjwdOgcD9zVYxJUJGmMOeu5q4MQW8NvdcVsDK6YAhWt3y80f2JhOg07PVGFAjy62ofkQaKfXU199X1/TU/Qkt2QxeAAAAABJRU5ErkJggg=="); } -.zform-button-title1 { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAApklEQVQoz73QsQ2EMAwFUEsUNDRUVJeKLh1VdE2qSIiGAikZxBNkAja4Cf4iLOI1uCjkdKkokSvrP9lO6KT7okeAjx4eWzhpCQ4WJp6k53GvJnjZcLUplhS/RyipwCZrAQZTDhQPNVhlORxbNjwdOgcD9zVYxJUJGmMOeu5q4MQW8NvdcVsDK6YAhWt3y80f2JhOg07PVGFAjy62ofkQaKfXU199X1/TU/Qkt2QxeAAAAABJRU5ErkJggg=="); } -.zform-button-title2 { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAwklEQVQoz73QsQ2DMBAF0JMoaBARiiIqXER07lxZNK4sIRoKJHuCTMAETJANmOBvkAnYIBPcGsQCh5ISXfmfvs9HK50PXQLc5OAw+JU6b2GgJyXlXEO0R4PjAbs3UKwqudST+Dy4qCIYuI9A48nS1yEomxtnTQQ9d4sdzahHtUjeaYHsm+YRdGxjg0S9geKdIZXHDpZNBGE13uLXSklO/x0M6wgE7lw0oRwJaKF2A2bSUJDhm8KXCG/PWwyarzv1+fwAYArrjnYCa/AAAAAASUVORK5CYII="); } -.zform-button-title3 { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAxElEQVQoz73QsanDMBSF4cPzAxdx4KkSBKxKnTpXIo0qg3GTwmBPkAk0gSbIBpngbuAJsshZ46Z4wmXK8LcfpzhQfA5fAWtZZZVlU8zbKEliGUJ4enHTsbBykX+fJFIRdl/cbnmAhbcKogxU+F5h72Y/wI3za8wpxzy8AhWut3Jmlw8wc6wLQTwVCtN3e8tmqmBkqsDLhTaYu6Ltf4lcQWKswMkfTT6xvTbhh7gqoEglyiBhU7jNipHu0ZbmiQem7139uTdX8exNUqtqywAAAABJRU5ErkJggg=="); } -.zform-button-title4 { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAt0lEQVQoz73QsQ2DMBAFUEsUNAiJiipXRNfRUSE3rty4oYhkBmGCmyAbZILbgAnYgAluDXIBJ6SiRNdY+k/fPpvVnI+5BESKrDOsph8Ce3b0CZob0q8hSuTdayxbXOIE/AceCTjuNoAvmOsDPKSfw+hHN3ZzqwCfYGuuDtBLSA0t3wUtLBovxZJTAkF8Ao0CKGtb2WLKp6xJwItLABlkP+Wcfa/wpE/jVtfEAVjLt/UyMnTdV5/PG1Cu8REDzPeUAAAAAElFTkSuQmCC"); } -.zform-button-table { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAByElEQVR42q2TzytEURTHv/Pe85sFGVPIRpHflKYRC8rCilCKspKlvZVY8H/IQhQldiyEyUSKUhKxUH7MTH7LNO/+cO6b8d4bWRCn3jvv3nfO53zvufcCfzSPes1tPUxIiVEuRakQAlwATHmuviUYeefh4EzSvNifGa7wGwogpBzr9+cV/qby5MJ5vfIWgGhW8srFLFVmVIXBJG9y0/E09/lvvGUapskzXABpUYeqR35U/S1GUMbhANSiyeZ3wj8CdDcXIO4GsCRA2WBbERaDdxho9dlzS6E79AeccfQ5lqrAJAA1EoZOwbth6LqG5VAYHg3Qkkkre6SOYtIoo6okG3HzyxJUFwzdg16/l4Ij6PEXpShwj8+vn8GYSFUgaWxQubWDCClIeCtAcyAGnRqVVl2cSQXdAKJJJY8Su5q82DiKorPBORbrhxEEKvORl2WF4/TqCTkZhquJIkHTNY+VrOzT0xSdBWD75MEGlnvT7Z1LABhL9IDkdtQVYvM4ivZaR8FyKIK+gNceKwV6cmlOD2gJtWW5uLl/R7kvC5e3r/ZdqClJt5LcJoQUrl2Qwan5s8Y4Fzlqf9XDqS+mdXnYt4fp8SW2iv+wD9RSCSl9jwFVAAAAAElFTkSuQmCC"); } -.zform-button-math { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAs0lEQVQoz2P4z4AfMhCpoNGh8X/d/+oz5UeLz+T/yPqfchTDhLrz+/6XnSnqye3JmJzcEzsfQ0GlQff/Cf9zHCC8sP1Y3FBQP/9/2v0EATyOTDk/+39kAR4FsQkR74Nm4VQQIxB2P/A2nnAIXe9/xrMHwjb5j6EgOMHvvMdpEMsC6Ez992gKggx83ru/cay3qTfvN7qv918L3ZveCa77HfZb7Tfdb7hfd7/mfrV+UuOCAgUAOHoB5MLjQikAAAAASUVORK5CYII="); } -.zform-button-footnote { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABlUlEQVR42qWTx05CURCGeQCfwBIX+gY+i23v3qCIEevCaMB7uY0LF9SoxF5iiSshlmCjG2kixRghajQRrjuJ+T3XFRukOMkkM2dyvjP/nIxKVWSL9uWC6j82v7AE+/IqZucXGmoCSLY55PIy1je3YbHOdVUNEMwSvgoFyJ+f2NrZhVmyrVUF4AQzZFnGbShMIDIczmMIoiVTMYDhRby9vePiyg1fIIjnl1dcu71geRNEi7X8XBhOQCabhc8f+PVA8Abph0eEozEFQLqR/p4LzXBIpdMIEQmKjFA4gmgsRs4ecBdPYNG+At5k2S0JoIwcuRDHfSIJt8eDRDIFhhNhoBjQjECkiAoAJQEGmkU4EsPpmQtGRc5T9neQfRqtRMptRV4CQF5ye/2gWeF7QDu04Tq/xBOBUEY2X9EvzNAMTGYr2js6e0jaxJNvzX3kcORwYlpPdZcFGCgWupHxPRLWKXmvut/q8fiQz+UxOaVHJU0o+pqL8npelLB/cAjd6MRJTfuh1gyu6IbHXCRsqXVJG4m3lir+AKcgCFAzJG3uAAAAAElFTkSuQmCC"); } +.zform-button-bold:after { @include sprite-position($zform-bold); } +.zform-button-italic:after { @include sprite-position($zform-italic); } +.zform-button-strike:after { @include sprite-position($zform-strike); } +.zform-button-abbr:after { @include sprite-position($zform-abbr); } +.zform-button-key:after { @include sprite-position($zform-key); } +.zform-button-sup:after { @include sprite-position($zform-sup); } +.zform-button-sub:after { @include sprite-position($zform-sub); } +.zform-button-center:after { @include sprite-position($zform-center); } +.zform-button-right:after { @include sprite-position($zform-right); } +.zform-button-ul:after { @include sprite-position($zform-ul); } +.zform-button-ol:after { @include sprite-position($zform-ol); } +.zform-button-quote:after { @include sprite-position($zform-quote); } +.zform-button-link:after { @include sprite-position($zform-link); } +.zform-button-image:after { @include sprite-position($zform-image); } +.zform-button-attention:after { @include sprite-position($zform-attention); } +.zform-button-error:after { @include sprite-position($zform-error); } +.zform-button-question:after { @include sprite-position($zform-question); } +.zform-button-information:after, .zform-button-infoblocks:after { @include sprite-position($zform-information); } +.zform-button-secret:after { @include sprite-position($zform-secret); } +.zform-button-blockcode:after, .zform-button-monospace:after { @include sprite-position($zform-blockcode); } +.zform-button-titles:after { @include sprite-position($zform-titles); } +.zform-button-title1:after { @include sprite-position($zform-title1); } +.zform-button-title2:after { @include sprite-position($zform-title2); } +.zform-button-title3:after { @include sprite-position($zform-title3); } +.zform-button-title4:after { @include sprite-position($zform-title4); } +.zform-button-table:after { @include sprite-position($zform-table); } +.zform-button-math:after { @include sprite-position($zform-math); } +.zform-button-footnote:after { @include sprite-position($zform-footnote); } @@ -109,9 +109,9 @@ div.zform-popup { top: 18px; z-index: 100; - background: transparent; + background: transparent; background-color: #fff; - background-image: linear-gradient(center bottom , #EBEBE5 8%, #F9F9F6 75%); + background-image: linear-gradient(center to top, #EBEBE5 8%, #F9F9F6 75%); border: 1px solid #CCCCCC; border-radius: 3px; padding: 2px; @@ -142,148 +142,3 @@ div.zform-popup { } } } - - - -/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Modal box - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -/* Overlay gris clair */ -#zform-modal-overlay { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: #000; - opacity: 0.5; - filter: alpha(opacity=50); - display: none; - z-index: 99; -} - -/* HTML Structure -==================================================================================== - -==================================================================================== */ - -/* Modal box container */ -#zform-modal-wrapper { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - display: none; - margin-top: 10%; - text-align: center; - z-index: 100; - - & > div { - position: relative; - display: inline-block; - text-align: left; - background: #f4f6f6; - border: 1px solid #555; - border-radius: 2px; - box-shadow: 0 2px 26px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.1); - min-height: 220px; - min-width: 400px; - - & > header { - color: #fff; - padding-left: 6px; - padding-right: 6px; - white-space: nowrap; - border-bottom: 3px solid #f8ad32; - line-height: 53px; - height: 50px; - text-indent: 15px; - margin-bottom: 20px; - background: #084561; - font-size: 1.6rem; - font-size: 16px; - text-shadow: rgba(0,0,0,.75)0 0 3px; - } - } - - section { - display: block; - margin: 8px; - min-width: 200px; - min-height: 50px; - div { - input { - min-width: 260px; - margin: 7px 15px; - } - } - } - - .btn, - [type=submit] { - position: absolute; - width: 50%; - height: 50px; - line-height: 50px; - bottom: 0; - right: 0; - margin: 0 !important; - padding: 0 !important; - text-align: center; - background: none !important; - border-top: 1px solid #CCC; - color: #333; - cursor: pointer; - - &:hover, - &:focus { - background: #DDD !important; - } - } - .btn-submit, - [type=submit] { - color: $color-primary; - font-weight: bold; - } - .btn-cancel { - right: auto; - left: 0; - border-right: 1px solid #CCC; - color: #555; - } -} - -.zform-modal { - label { - display: inline-block; - width: 70px; - text-align: left; - } -} \ No newline at end of file diff --git a/assets/scss/components/_header-search.scss b/assets/scss/components/_header-search.scss index 4cd343f056..3fd96f1673 100644 --- a/assets/scss/components/_header-search.scss +++ b/assets/scss/components/_header-search.scss @@ -88,7 +88,7 @@ left: -20px; height: 30px; width: 20px; - background: linear-gradient(right, rgba(0, 0, 0, .03), rgba(0, 0, 0, 0)); + background: linear-gradient(to left, rgba(0, 0, 0, .03), rgba(0, 0, 0, 0)); } form { input { diff --git a/assets/scss/components/_modals.scss b/assets/scss/components/_modals.scss index 0a72db74f6..e8ec7466e7 100644 --- a/assets/scss/components/_modals.scss +++ b/assets/scss/components/_modals.scss @@ -1,16 +1,51 @@ .modal { display: none; } -#modals .modal { + +.modals-container { + display: none; position: fixed; - z-index: 50; - width: auto !important; top: 0; - right: 0; - bottom: 0; left: 0; + height: 100vh; + width: 100vw; + overflow-y: auto; + z-index: 50; + + &.open { + display: block; + } + + .modals-wrapper { + display: flex; + width: 100vw; + min-height: 100vh; + align-items: center; + justify-content: space-around; + flex-direction: column; + } + + .modals-overlay { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 1; + background-color: rgba(0, 0, 0, 0.7); + } +} + +.modals-container .modal { + position: relative; + z-index: 2; background: #EEE; - min-height: 220px; + flex: 0; + flex-direction: column; + + &.open { + display: flex; + } .modal-title { display: block; @@ -18,7 +53,6 @@ line-height: 53px; height: 50px; text-indent: 15px; - margin-bottom: 20px; background: $color-primary; color: #FFF; font-size: 16px; @@ -34,102 +68,73 @@ } } - p, - input, - select, - textarea { - margin: 10px 15px; - resize: none; + .modal-body { + padding: 20px 15px 5px; + flex: 1; - &:not([type=checkbox]):not([type=radio]) { - width: calc(98% - 32px) !important; + p { + width: 370px; + } + + table { + margin-top: 0; + } + + p, + input:not([type=checkbox]):not([type=radio]), + select, + textarea { + margin: 0 0 15px; } - } - label { - margin: 0 15px; - } - textarea { - margin-top: 0; } - .btn:not(.modal-inner), - [type=submit]:not(.modal-inner) { - position: absolute; - width: 50%; - height: 50px; - line-height: 50px; - bottom: 0; - right: 0; - margin: 0 !important; - padding: 0 !important; - text-align: center; - background: none !important; + .modal-footer { + display: flex; border-top: 1px solid #CCC; - color: #333; - } - .btn-submit:not(.modal-inner), - [type=submit]:not(.modal-inner) { - height: 51px; - color: $color-primary; - font-weight: bold; - } - .btn-cancel { - right: auto; - left: 0; - border-right: 1px solid #CCC; - color: #555; - } - .btn.btn-modal-fullwidth { - width: 100%; - border-right: none; - font-weight: bold; - } -} -.enable-mobile-menu #modals .modal { - top: $modal-margin; - right: $modal-margin; - bottom: $modal-margin; - left: $modal-margin; - box-shadow: 0 0 5px #000; + flex-direction: row-reverse; - &.modal-small, - &.modal-medium, - &.modal-big { - top: 50%; - bottom: auto; - max-width: 400px; - } + & > * { + flex: 1; + height: 50px; + line-height: 50px; + margin: 0; + padding: 0; + text-align: center; + background: none!important; + color: #333; - &.modal-small { - height: 220px; - margin: -110px auto 0; - } - &.modal-medium { - height: 250px; - margin: -125px auto 0; + &:not(:first-child) { + border-right: 1px solid #CCC; + } - textarea { - height: 80px; + &:only-child { + font-weight: bold; + } + } + + .btn-submit, [type=submit] { + color: $color-primary; + font-weight: bold; + } + + .btn-cancel { + color: #555; } - } - &.modal-big { - height: 320px; - margin: -160px auto 0; } } -.enable-mobile-menu #modals-overlay { - position: fixed; - display: none; - z-index: 49; - top: 0; - right: 0; - bottom: 0; - left: 0; - background: rgba(0, 0, 0, .7); + +.enable-mobile-menu .modals-container .modal { + margin: $modal-margin; + box-shadow: 0 0 5px #000; + max-width: 100%; + + &.modal-flex { + width: 400px; + } } @media only screen and #{$media-wide} { - .enable-mobile-menu #modals .modal { + .enable-mobile-menu .modals-container .modal { box-shadow: 0 2px 7px rgba(0, 0, 0, .7); .modal-title { @@ -153,4 +158,4 @@ } } } -} \ No newline at end of file +} diff --git a/assets/scss/layout/_content.scss b/assets/scss/layout/_content.scss index 147a74ed4e..c180a524b7 100644 --- a/assets/scss/layout/_content.scss +++ b/assets/scss/layout/_content.scss @@ -132,7 +132,7 @@ line-height: 30px; margin-left: 3px; opacity: .7; - + z-index: 1; &.ico-after:after { margin-top: 7px; } diff --git a/assets/scss/layout/_header.scss b/assets/scss/layout/_header.scss index 14684967c0..59e0b560f1 100644 --- a/assets/scss/layout/_header.scss +++ b/assets/scss/layout/_header.scss @@ -397,7 +397,7 @@ box-shadow: 0 0 4px rgba(0, 0, 0, .3); header { - background-image: linear-gradient(left,transparent 20%,rgba(255,255,255,.07) 40%,rgba(255,255,255,.07) 60%,transparent 80%); + background-image: linear-gradient(to right,transparent 20%,rgba(255,255,255,.07) 40%,rgba(255,255,255,.07) 60%,transparent 80%); } } diff --git a/assets/scss/layout/_main.scss b/assets/scss/layout/_main.scss index aa8f409a88..f5cb2fdb27 100644 --- a/assets/scss/layout/_main.scss +++ b/assets/scss/layout/_main.scss @@ -242,7 +242,7 @@ ol { margin-left: calc(-11% - 10px); width: calc(111% + 10px); - background: linear-gradient(top, rgba(0, 0, 0, .07), transparent 3px); + background: linear-gradient(to bottom, rgba(0, 0, 0, .07), transparent 3px); a { padding-left: calc(11% + 30px); diff --git a/assets/scss/layout/_sidebar.scss b/assets/scss/layout/_sidebar.scss index 01db76e691..8724b95e11 100644 --- a/assets/scss/layout/_sidebar.scss +++ b/assets/scss/layout/_sidebar.scss @@ -351,7 +351,7 @@ padding-bottom: 5px; margin-left: -42px; width: calc(105% + 25px); - background: linear-gradient(top, rgba(0, 0, 0, .07), #F7F7F7 3px); + background: linear-gradient(to bottom, rgba(0, 0, 0, .07), #F7F7F7 3px); a { padding-left: 50px; diff --git a/doc/source/back-end-code/article.rst b/doc/source/back-end-code/article.rst deleted file mode 100644 index f9ab8e8f3a..0000000000 --- a/doc/source/back-end-code/article.rst +++ /dev/null @@ -1,19 +0,0 @@ -=========================== -Les articles (``article/``) -=========================== - -Module situé dans ``zds/article/``. - -.. contents:: Fichiers documentés : - -Modèles (``models.py``) -======================= - -.. automodule:: zds.article.models - :members: - -Vues (``views.py``) -=================== - -.. automodule:: zds.article.views - :members: diff --git a/doc/source/back-end-code/tutorial.rst b/doc/source/back-end-code/tutorial.rst deleted file mode 100644 index 505775e4f8..0000000000 --- a/doc/source/back-end-code/tutorial.rst +++ /dev/null @@ -1,19 +0,0 @@ -============================= -Les tutoriels (``tutorial/``) -============================= - -Module situé dans ``zds/tutorial/``. - -.. contents:: Fichiers documentés : - -Modèles (``models.py``) -======================= - -.. automodule:: zds.tutorial.models - :members: - -Vues (``views.py``) -=================== - -.. automodule:: zds.tutorial.views - :members: \ No newline at end of file diff --git a/doc/source/back-end-code/tutorialv2.rst b/doc/source/back-end-code/tutorialv2.rst index 9595c8bb15..e53dc952a8 100644 --- a/doc/source/back-end-code/tutorialv2.rst +++ b/doc/source/back-end-code/tutorialv2.rst @@ -62,3 +62,8 @@ Les utilitaires (``utils.py``) .. automodule:: zds.tutorialv2.utils :members: +Les utilitaires de publication (``publication_utils.py``) +========================================================= + +.. automodule:: zds.tutorialv2.publication_utils.py + :members: \ No newline at end of file diff --git a/doc/source/back-end-code/utils.rst b/doc/source/back-end-code/utils.rst index d65ccc4744..62362a1dc5 100644 --- a/doc/source/back-end-code/utils.rst +++ b/doc/source/back-end-code/utils.rst @@ -12,12 +12,6 @@ Modèles (``models.py``) .. automodule:: zds.utils.models :members: -Articles (``articles.py``) -========================== - -.. automodule:: zds.utils.articles - :members: - Forums (``forums.py``) ====================== diff --git a/doc/source/back-end/contents.rst b/doc/source/back-end/contents.rst index 3398d69226..86f43d633d 100644 --- a/doc/source/back-end/contents.rst +++ b/doc/source/back-end/contents.rst @@ -239,6 +239,8 @@ peuvent donc continuer à travailler chacun de leur côté. La publication -------------- +**Le cas général** + Une fois que le contenu est passé en validation et a satisfait les critères éditoriaux, il est publié. Il faut bien préciser que le processus de validation peut être assez long. De plus, un historique de validation est @@ -264,6 +266,29 @@ Enfin, signalons qu'il est possible à tout moment pour un membre de l'équipe de dépublier un contenu. Le cas échéant, un message sera envoyé aux auteurs, indiquant les raisons de la dépublication. +**Les politiques de génération** + +La manière dont l'application réagira à une publication dans le but de générer -- ou non -- des documents téléchargeables +est configurable selon trois niveaux à affecter au paramètre ``ZDS_APP['content']['extra_content_generation_policy']``: + +- NOTHING : ne génère aucun document téléchargeable autre que le fichier markdown et l'archive zip des sources +- SYNC : génère tous les documents téléchargeables que le système peut générer de manière synchrone à la publication. C'est à dire que la génération est élevée au rang de tâche bloquante +- WATCHDOG : seul un "marqueur de publication" est généré lors de la publication, c'est un observateur externe qui viendra publier le nouveau contenu. Le site fourni un observateur externe : ``python mangage.py publication_watchdog``. + +.. attention:: + + Le mode ``WATCHDOG`` est soumis à l'utilisation d'un autre paramètre : ``ZDS_APP['content']['extra_content_watchdog_dir']`` qui, par défaut, créera un dossier watchdog-build à la racine de l'application + + +**Ajouter un nouveau format d'export** + +Les fichiers téléchargeables générés le sont à partir d'un registre de créateur. +Par défaut le registre contient les 3 formats pandoc HTML, PDF et EPUB. + +Vous pouvez définir votre propre formatteur qui devra alors hériter de la classe ``zds.tutorialv2.publication_utils.Publicator`` et implémenter la méthode ``publish``. +Si vous désirez vous passer de pandoc, il vous suffira d'appeler ``map(PublicatorRegistry.unregister, ["pdf", "epub", "html"])``. +Vous pouvez aussi simplement surcharger chacun des ``Publicator`` par défaut en en enregistrant un nouveau sous le même nom. + L'entraide ---------- @@ -554,3 +579,25 @@ Migrer la base de données Si vous faites tourner une instance du code de Zeste de Savoir sous la version 1.X et que vous passez à la v2.X, vous allez devoir migrer les différents tutoriels. Pour cela, il faudra simplement exécuter la commande ``python manage.py migrate_to_zep12.py``. + +Récapitulatif des paramètres du module +====================================== + +Ces paramètres sont à surcharger dans le dictionnaire ZDS_APP['content'] + +- ``repo_private_path`` : chemin vers le dossier qui contiend les contenus durant leur rédaction, par défaut le dossier sera contents-private à la racine de l'application +- ``repo_public_path``: chemin vers le dossier qui contient les fichiers permettant l'affichage des contenus publiés ainsi que les fichiers téléchargeables, par défaut contents-public +- ``extra_contents_dirname``: nom du sous-dosssier qui contient les fichiers téléchargeables (pdf, epub...), par défaut extra_contents +- ``extra_content_generation_policy``: Contient la politique de génération des fichiers téléchargeable, 'SYNC', 'WATCHDOG' ou 'NOTHING' +- ``extra_content_watchdog_dir``: dossier qui permet à l'observateur (si ``extra_content_generation_policy`` vaut ``"WATCHDOG"``) de savoir qu'un contenu a été publié +- ``max_tree_depth``: Profondeur maximal de la hiérarchie des tutoriels : par défaut ``3`` pour partie/chapitre/extrait +- ``default_licence_pk``: Clef primaire de la licence par défaut (TOUS DROITS RESERVES en français), 7 si vous utilisez les fixtures +- ``content_per_page``: Nombre de contenus dans les listing (article, tutoriels) +- ``notes_per_page``: Nombre de réaction nouvelles par page (donc sans compter la répétition de la dernière note de la page précédente) +- ``helps_per_page`` : Nombre de contenus ayant besoin d'aide dans la page ZEP03 +- ``feed_length``: Nombre de contenus affiché dans un flux RSS ou ATOM, +- ``user_page_number``: Nombre de contenu de chaque type qu'on affiche sur le profil d'un utilisateur par défaut 5, +- ``default_image``: chemin vers l'image utilisée par défaut dans les icônes de contenu, +- ``import_image_prefix``: préfixe mnémonique permettant d'indiquer que l'image se trouve dans l'archive jointe lors de l'import de contenu +- ``build_pdf_when_published``: indique que la publication génèrera un PDF (quelque soit la politique, si ``False`` les PDF ne seront pas générés, sauf à appeler la commande adéquate, +- ``maximum_slug_size``: taille maximale du slug d'un contenu diff --git a/doc/source/back-end/forum.rst b/doc/source/back-end/forum.rst index 9ca0877c3f..1e7f0f09c9 100644 --- a/doc/source/back-end/forum.rst +++ b/doc/source/back-end/forum.rst @@ -83,7 +83,7 @@ Suivre un sujet Nous permettons à nos membres de "suivre" un sujet directement sur le site. "Suivre un sujet", cela signifie que, lorsqu'un nouveau message est posté sur ce sujet, l'icône de notification nous en informe. -Dès lors vous pourrez par un simple clic allé au dernier message non lu. +Dès lors vous pourrez par un simple clic vous rendre au dernier message non lu. Pour repérer qu'un message est lu ou pas, nous utilisons côté backend la classe ``zds.forum.models.TopicRead`` qui retient la date de dernière lecture du topic. De la même manière nous utilisons la classe ``zds.forum.models.TopicFollowed`` pour retenir le fait que vous suivez ou non un sujet. @@ -98,4 +98,4 @@ Pour cesser de suivre un sujet, et ne plus être notifier de son activité, vous - Vous rendre sur le topic et cliquer sur "Ne plus suivre" en haut de la sidebar. - Vous rendre sur n'importe quelle page du forum, survoler le titre du sujet et cliquer sur la croix qui apparaît alors. -En effectuant ces actions vous cessez de suivre le sujet, l'instance de TopicFollowed qui était associée à votre suivi est supprimée définitivement. Cela a pour effet que vous pourrez à nouveau suivre le sujet dans le future si vous le désirez. \ No newline at end of file +En effectuant ces actions vous cessez de suivre le sujet, l'instance de TopicFollowed qui était associée à votre suivi est supprimée définitivement. Cela a pour effet que vous pourrez à nouveau suivre le sujet dans le futur si vous le désirez. diff --git a/doc/source/front-end/elements-specifiques-au-site.rst b/doc/source/front-end/elements-specifiques-au-site.rst index 06b5fb3477..2af5d3017b 100644 --- a/doc/source/front-end/elements-specifiques-au-site.rst +++ b/doc/source/front-end/elements-specifiques-au-site.rst @@ -26,7 +26,7 @@ Il arrive souvent d'avoir donc ceci : .. sourcecode:: html - {% endif %} @@ -186,7 +184,7 @@

{% trans "Anciens tutoriels SdZ" %}

{{ titre }} {% trans "Supprimer" %} -