Skip to content

Commit

Permalink
Merge pull request #1255 from zestedesavoir/master
Browse files Browse the repository at this point in the history
copie sur la branche prod
  • Loading branch information
dralliw committed Jul 22, 2014
2 parents 32ebdd8 + 739798b commit 6da30c1
Show file tree
Hide file tree
Showing 152 changed files with 3,603 additions and 1,358 deletions.
67 changes: 40 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,58 @@
git:
depth: 1

language: python

python:
- "2.7"
- 2.7

notifications:
irc:
channels:
- "irc.smoothirc.net#zds-dev"
- irc.smoothirc.net#zds-dev
skip_join: true

cache:
- apt
- pip

install:
- "sudo apt-get update"
- "sudo echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections"
- "sudo apt-get install ttf-mscorefonts-installer"
- "sudo apt-get install texlive"
- "sudo apt-get install texlive-xetex"
- "sudo apt-get install texlive-lang-french"
- "sudo apt-get install texlive-latex-extra"
- "sudo mkdir -p ~/cabal/bin"
- "sudo mkdir -p ~/.pandoc"
- "sudo wget -P ~/cabal/bin https://dl.dropboxusercontent.com/u/18967337/pandoc"
- "sudo wget -P ~/.pandoc/templates https://dl.dropboxusercontent.com/u/14517385/dev/default.epub"
- "sudo wget -P ~/.pandoc/templates https://dl.dropboxusercontent.com/u/14517385/dev/default.html"
- "sudo touch ~/.pandoc/epub.css"
- "sudo touch ~/.pandoc/templates/epub.css"
- "sudo chmod u+x,g+x,o+x ~/cabal/bin/pandoc"
- "export PATH=$PATH:~/cabal/bin"
- "sudo ~/cabal/bin/pandoc --version"
- "sudo apt-get --reinstall install -qq language-pack-fr"
- "pip install -r requirements.txt"
- "pip install coveralls"
# APT Stuff
- sudo apt-get update
- sudo echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
- sudo apt-get install ttf-mscorefonts-installer
- sudo apt-get install texlive
- sudo apt-get install texlive-xetex
- sudo apt-get install texlive-lang-french
- sudo apt-get install texlive-latex-extra

# Cabal + Pandoc stuff
- sudo mkdir -p ~/cabal/bin
- sudo mkdir -p ~/.pandoc
- sudo wget -P ~/cabal/bin https://dl.dropboxusercontent.com/u/18967337/pandoc
- sudo wget -P ~/.pandoc/templates https://dl.dropboxusercontent.com/u/14517385/dev/default.epub
- sudo wget -P ~/.pandoc/templates https://dl.dropboxusercontent.com/u/14517385/dev/default.html
- sudo touch ~/.pandoc/epub.css
- sudo touch ~/.pandoc/templates/epub.css
- sudo chmod u+x,g+x,o+x ~/cabal/bin/pandoc
- export PATH=$PATH:~/cabal/bin
- sudo ~/cabal/bin/pandoc --version
- sudo apt-get --reinstall install -qq language-pack-fr

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

# NodeJS + NPM stuff
- "sudo add-apt-repository -y ppa:chris-lea/node.js"
- "sudo apt-get -y update"
- "sudo apt-get -y install nodejs"
- "npm install -g bower gulp"
- "npm install"
- sudo add-apt-repository -y ppa:chris-lea/node.js
- sudo apt-get -y update
- sudo apt-get -y install nodejs
- npm install -g bower gulp
- npm install

script:
- npm run-script travis
- coverage run --source='.' manage.py test

after_success:
- coveralls
4 changes: 4 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ Original code base (pdp / fork on 11-02-2013) : Romain Porte (MicroJoe) <microjo
"Zeste de Savoir" code base :

- Alex-D (https://github.com/Alex-D)
- AlexandreBroudin (https://github.com/AlexandreBroudin)
- artragis (https://github.com/artragis)
- cgabard (https://github.com/cgabard)
- coma94 (https://github.com/coma94)
- Coy0te (https://github.com/Coy0te)
- delphiki (https://github.com/delphiki)
- Eskimon (https://github.com/Eskimon)
- firm1 (https://github.com/firm1)
- Florian BOUX (https://github.com/Florianboux)
- Ge0 (https://github.com/Ge0)
- geoffreyc (https://github.com/geoffreyc)
- GerardPaligot (https://github.com/GerardPaligot)
Expand All @@ -20,3 +23,4 @@ Original code base (pdp / fork on 11-02-2013) : Romain Porte (MicroJoe) <microjo
- Taluu (https://github.com/Taluu)
- Thunderseb (https://github.com/Thunderseb)
- vhf / victor felder (https://github.com/vhf)
- Vulser (https://github.com/Vulser)
5 changes: 3 additions & 2 deletions Gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
var gulp = require("gulp"),
$ = require("gulp-load-plugins")(),
path = require("path"),
spritesmith = require("gulp.spritesmith");
spritesmith = require("gulp.spritesmith"),
mainBowerFiles = require('main-bower-files');

var paths = {
scripts: "assets/js/**",
Expand Down Expand Up @@ -91,7 +92,7 @@ gulp.task("smileys", function() {
});

gulp.task("vendors", function() {
return $.bowerFiles()
return gulp.src(mainBowerFiles())
.pipe($.newer("dist/js/vendors.js"))
.pipe($.flatten()) // remove folder structure
.pipe($.size({ title: "vendors", showFiles: true }))
Expand Down
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
Zeste de Savoir
===============

Site internet communautaire codé à l'aide du framework Django 1.6.
Site internet communautaire codé à l'aide du framework [Django](https://www.djangoproject.com/) 1.6 et de [Python](https://www.djangoproject.com/) 2.7.

* Lien du site : [zestedesavoir](http://www.zestedesavoir.com)
* Lien de teasing : [Teasing](http://zestedesavoir.com/teasing/)



Expand All @@ -36,7 +35,7 @@ Fonctionnalités implementées
Fonctionnalités à venir
-----------------------

Elles sont reportées essentiellement dans le [bugtraker](https://github.com/zestedesavoir/zds-site/issues)
Elles sont reportées essentiellement dans le [bugtraker](https://github.com/zestedesavoir/zds-site/issues).



Expand Down Expand Up @@ -71,20 +70,20 @@ python manage.py loaddata fixtures/users.yaml fixtures/forums.yaml fixtures/topi

Cela va créer plusieurs entitées :

* 3 utilisateurs (username/password) :
* 3 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
* 3 categories
* 3 catégories
* 11 forums
* 3 topics with one answer
* 1 mp with 3 participants
* 3 sujets avec une réponse
* 1 message privé (MP) avec 3 participants
* 3 catégories et 2 sous-catégories


### Conseil de developpement
### Conseils de developpement

Avant de faire une PR, vérifiez que votre code passe tous les tests unitaires et qu'il est compatible PEP-8 (sous peine de refus de Pull Request) en exécutant les commandes suivantes, pour le back :
Avant de faire une Pull Request (PR), vérifiez que votre code passe tous les tests unitaires et qu'il est compatible [PEP-8](http://legacy.python.org/dev/peps/pep-0008/) en exécutant les commandes suivantes, pour le back :

```console
python manage.py test
Expand Down Expand Up @@ -115,9 +114,11 @@ En savoir plus
--------------

- [Comment déployer ZDS sur un serveur de production ?](doc/deploy.md)
- [Contribuer](CONTRIBUTING.md)
- [Comment contribuer : comprendre comment suivre le workflow (sur zds)](http://zestedesavoir.com/forums/sujet/324/comment-contribuer-comprendre-comment-suivre-le-workflow/)





Zeste de Savoir est basé sur un fork de [Progdupeu.pl](http://progdupeu.pl) ([Dépôt Bitbucket](https://bitbucket.org/MicroJoe/progdupeupl/))
Zeste de Savoir est basé sur un fork de [Progdupeu.pl](http://progdupeu.pl) ([Dépôt Bitbucket](https://bitbucket.org/MicroJoe/progdupeupl/)).
Binary file added assets/images/clem-home-quote.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/clem-home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions assets/js/accessibility-links.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* ===== Zeste de Savoir ====================================================
Author: Alex-D / Alexandre Demode
---------------------------------
Managment of accessibility links
---------------------------------
Author: Alex-D / Alexandre Demode
========================================================================== */

(function($){
Expand Down
8 changes: 4 additions & 4 deletions assets/js/accordeon.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* ===== Zeste de Savoir ====================================================
Author: Alex-D
---------------------------------
Accordeon for sidebar
---------------------------------
Author: Alex-D
========================================================================== */

(function($){
Expand All @@ -10,13 +10,13 @@
$(".main .sidebar.accordeon, .main .sidebar .accordeon").each(function(){
var $that = this;

$("h4 + ul", $that).each(function(){
$("h4 + ul, h4 + ol", $that).each(function(){
if($(".current", $(this)).length === 0)
$(this).hide();
});

$("h4", $that).click(function(e){
$("+ ul", $(this)).slideToggle(100);
$("+ ul, + ol", $(this)).slideToggle(100);

e.preventDefault();
e.stopPropagation();
Expand Down
23 changes: 16 additions & 7 deletions assets/js/autocompletion.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* ===== Zeste de Savoir ====================================================
Author: Sandhose / Quentin Gliech
---------------------------------
Add autocomplete for members names
---------------------------------
Author: Sandhose / Quentin Gliech
========================================================================== */

(function($) {
Expand All @@ -13,8 +13,8 @@
this.$dropdown = this.$wrapper.find(".autocomplete-dropdown");

this.$dropdown.css({
top: "-" + this.$input.css("margin-bottom"),
left: this.$input.css("margin-left")
"marginTop": "-" + this.$input.css("margin-bottom"),
"left": this.$input.css("margin-left")
});

this.$input.on("keyup", this.handleInput.bind(this));
Expand Down Expand Up @@ -59,6 +59,7 @@
case 13: // Enter
e.preventDefault();
e.stopPropagation();

this.enter();
break;
}
Expand Down Expand Up @@ -89,7 +90,7 @@
self.updateDropdown(self.sortList(data, search));
})
.fail(function(){
console.log("something went wrong...");
console.error("[Autocompletition] Something went wrong...");
})
;
this.updateDropdown(this.sortList(this.searchCache(search), search));
Expand All @@ -98,6 +99,8 @@
},

showDropdown: function(){
if(this.$input.is("input"))
this.$dropdown.css("width", this.$input.outerWidth());
this.$dropdown.show();
},

Expand Down Expand Up @@ -256,10 +259,16 @@

function buildDom(input) {
var $input = $(input),
$wrapper = $("<span>", { class: "autocomplete-wrapper" }),
$dropdown = $("<div>", { class: "autocomplete-dropdown" });
$wrapper = $("<div/>", {
"class": "autocomplete-wrapper"
}),
$dropdown = $("<div/>", {
"class": "autocomplete-dropdown"
})
;

return $input.addClass("autocomplete-input")
.attr("autocomplete", "off")
.wrap($wrapper)
.parent()
.append($dropdown)
Expand Down
4 changes: 2 additions & 2 deletions assets/js/close-alert-box.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* ===== Zeste de Savoir ====================================================
Author: Alex-D / Alexandre Demode
---------------------------------
Close alert-boxes
---------------------------------
Author: Alex-D / Alexandre Demode
========================================================================== */

(function($){
Expand Down
51 changes: 34 additions & 17 deletions assets/js/cookies-banner.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,47 @@
(function(window, document, undefined) {
// Google Analytics ID
var gaProperty = "UA-27730868-1";
/* ===== Zeste de Savoir ====================================================
Manage tracking cookies message
---------------------------------
Authors: Sandhose
Alex-D / Alexandre Demode
========================================================================== */

(function(document, undefined) {
var $banner = $("#cookies-banner");

// Disable tracking if the opt-out cookie exists.
var disableStr = "ga-disable-" + gaProperty;
if(document.cookie.indexOf("hasconsent=true") > -1){
window[disableStr] = false;
} else if(document.cookie.indexOf("hasconsent=false") > -1){
window[disableStr] = true;
} else {
$banner.show();
function checkHasConsent(){
if(document.cookie.indexOf("hasconsent=true") > -1){
$("#gtm").after(
"<script>" +
"dataLayer = [{'gaTrackingId': 'UA-27730868-1'}];" +
"(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':" +
"new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0]," +
"j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=" +
"'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);" +
"})(window,document,'script','dataLayer','GTM-WH7642');" +
"</script>"
);
} else if(document.cookie.indexOf("hasconsent=false") === -1){
// Accept for the next page
setHasConsent(true);

// Show the banner
$banner.show();
}
}
checkHasConsent();

function sethasconsent(hasconsent){

function setHasConsent(hasconsent){
document.cookie = "hasconsent="+hasconsent+"; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/";
window[disableStr] = !hasconsent;
$banner.slideUp(200);
}

$("#reject-cookies").on("click", function(){
sethasconsent(false);
setHasConsent(false);
$banner.slideUp(200);
});

$("#accept-cookies").on("click", function(){
sethasconsent(true);
checkHasConsent();
$banner.slideUp(200);
});
})(window, document);
})(document);
18 changes: 15 additions & 3 deletions assets/js/data-click.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
/* ===== Zeste de Savoir ====================================================
Author: Alex-D / Alexandre Demode
---------------------------------
Simulate click on element from another
---------------------------------
Author: Alex-D / Alexandre Demode
========================================================================== */

(function($){
"use strict";

$("[data-click]").on("click focus", function(e){
var dropdownMouseDown = false;

$("[data-click]")
.on("mousedown", function(){
dropdownMouseDown = true;
})
.on("mouseup", function(){
dropdownMouseDown = false;
})
.on("click focus", function(e){
if(e.type === "focus" && dropdownMouseDown)
return false;

if(!($(this).hasClass("dont-click-if-sidebar") && $(".header-container .mobile-menu-btn").is(":visible"))){
e.preventDefault();
e.stopPropagation();
Expand Down
Loading

0 comments on commit 6da30c1

Please sign in to comment.