Merge branch 'merge-develop' into 'master'

Merge develop

Closes #205 and #190

See merge request framasoft/framadate!222
This commit is contained in:
Thomas Citharel 2018-02-20 19:31:26 +01:00
commit 01dc23125a
36 changed files with 737 additions and 435 deletions

View File

@ -42,12 +42,18 @@ Les tables de l'applications sont décrites plus loin dans ce fichier dans la pa
CREATE USER 'framadate_user'@'localhost' IDENTIFIED BY '<password>'; CREATE USER 'framadate_user'@'localhost' IDENTIFIED BY '<password>';
GRANT ALL PRIVILEGES ON `framadate_db`.* TO 'framadate_user'@'localhost'; GRANT ALL PRIVILEGES ON `framadate_db`.* TO 'framadate_user'@'localhost';
``` ```
## Si vous utilisez la version GIT
Il faut utiliser [Composer](https://getcomposer.org/) avant d'effectuer l'installation
Ensuite ``composer install`` ou ``php composer.phar install``
À noter que pour que l'installation se déroule correctement, MySQL doit être lancé avec le paramètre `[NO_ZERO_DATE](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_no_zero_date)` désactivé. Il vous faudra aller le supprimer du fichier de configuration `my.cnf`. À noter que pour que l'installation se déroule correctement, MySQL doit être lancé avec le paramètre `[NO_ZERO_DATE](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_no_zero_date)` désactivé. Il vous faudra aller le supprimer du fichier de configuration `my.cnf`.
# Installation # Installation
Pour installer l'application Framadate, rendez-vous sur la page http://monsite/admin/install.php et remplissez le formulaire. Pour installer l'application Framadate, rendez-vous sur la page http://monsite/ ; vous serez redirigé vers un outil de vérification de l'état de l'installation qui vous permettra, une fois les prérequis remplis, d'accèder au formulaire de paramètrage.
Le champ `* Chaîne de connexion` contient la variable `<HOST>` qui doit être remplacée par le nom d'hôte de votre base de données, par exemple `localhost`. Il contient également la variable `<SCHEMA>` qui doit être remplacée par le nom de la base de données que vous allez utiliser. Si vous avez suivi les recommandations précédente, ça devrait être `framadate_db`. Le champ `* Chaîne de connexion` contient la variable `<HOST>` qui doit être remplacée par le nom d'hôte de votre base de données, par exemple `localhost`. Il contient également la variable `<SCHEMA>` qui doit être remplacée par le nom de la base de données que vous allez utiliser. Si vous avez suivi les recommandations précédente, ça devrait être `framadate_db`.
@ -57,7 +63,8 @@ La page de migration s'occupe :
- D'installer toute la base de données (tables + données d'exemple) - D'installer toute la base de données (tables + données d'exemple)
- De mettre à jour la base de données lors des mises à jour de l'application. - De mettre à jour la base de données lors des mises à jour de l'application.
! Attention, le chargement de la page de migration peu prendre du temps étant donné qu'elle applique toutes les mises à jours requises ! ! Attention, le chargement de la page de migration peut prendre du temps étant donné qu'elle applique toutes les mises à jours requises !
# Accès à la page administrateur # Accès à la page administrateur

View File

@ -7,7 +7,6 @@ If you want to work with us, **fork us on [framagit.org](https://framagit.org)**
![Français](https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Flag_of_France.svg/20px-Flag_of_France.svg.png) **Framasoft utilise GitLab** pour le développement de ses logiciels libres. Nos dépôts Github ne sont que des mirroirs. ![Français](https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Flag_of_France.svg/20px-Flag_of_France.svg.png) **Framasoft utilise GitLab** pour le développement de ses logiciels libres. Nos dépôts Github ne sont que des mirroirs.
Si vous souhaitez travailler avec nous, **forkez-nous sur [framagit.org](https://framagit.org)**. (l'inscription n'est pas nécessaire, vous pouvez vous connecter avec votre compte Github) Si vous souhaitez travailler avec nous, **forkez-nous sur [framagit.org](https://framagit.org)**. (l'inscription n'est pas nécessaire, vous pouvez vous connecter avec votre compte Github)
--- ---
# Installation # Installation
@ -18,13 +17,13 @@ Un fichier est dédié à l'installation de framadate : [INSTALL.md](INSTALL.md)
## De votre côté ## De votre côté
1. Créer un compte sur [https://framagit.org](https://framagit.org) 1. Créer un compte sur [https://git.framasoft.org](https://git.framasoft.org)
1. Créer un fork du projet principal : [Créer le fork](https://framagit.org/framasoft/framadate/forks/new) 1. Créer un fork du projet principal : [Créer le fork](https://git.framasoft.org/framasoft/framadate/fork/new)
1. Créer une branche nommée feature/[Description] 1. Créer une branche nommée feature/[Description] à partir de la branche **develop**
* Où [Description] est une description en anglais très courte de ce qui va être fait * Où [Description] est une description en anglais très courte de ce qui va être fait
1. Faire des commits dans votre branche 1. Faire des commits dans votre branche
1. Pusher la branche sur votre fork 1. Pusher la branche sur votre fork
1. Demander une merge request 1. Demander une merge request vers **develop**
## La suite se passe de notre côté ## La suite se passe de notre côté

View File

@ -444,5 +444,6 @@ $smarty->assign('hidden', false);
$smarty->assign('accessGranted', true); $smarty->assign('accessGranted', true);
$smarty->assign('resultPubliclyVisible', true); $smarty->assign('resultPubliclyVisible', true);
$smarty->assign('editedVoteUniqueId', ''); $smarty->assign('editedVoteUniqueId', '');
$smarty->assign('default_to_marldown_editor', $config['markdown_editor_by_default']);
$smarty->display('studs.tpl'); $smarty->display('studs.tpl');

View File

@ -146,7 +146,7 @@ class PollService {
/** /**
* @param Form $form * @param Form $form
* @return string * @return array
*/ */
function createPoll(Form $form) { function createPoll(Form $form) {
// Generate poll IDs, loop while poll ID already exists // Generate poll IDs, loop while poll ID already exists
@ -289,7 +289,11 @@ class PollService {
* @throws ConcurrentVoteException * @throws ConcurrentVoteException
*/ */
private function checkMaxVotes($user_choice, $poll, $poll_id) { private function checkMaxVotes($user_choice, $poll, $poll_id) {
$best_choices = $this->computeBestChoices($this->allVotesByPollId($poll_id)); $votes = $this->allVotesByPollId($poll_id);
if (count($votes) <= 0) {
return;
}
$best_choices = $this->computeBestChoices($votes);
foreach ($best_choices['y'] as $i => $nb_choice) { foreach ($best_choices['y'] as $i => $nb_choice) {
// if for this option we have reached maximum value and user wants to add itself too // if for this option we have reached maximum value and user wants to add itself too
if ($nb_choice >= $poll->ValueMax && $user_choice[$i] === "2") { if ($nb_choice >= $poll->ValueMax && $user_choice[$i] === "2") {

View File

@ -18,6 +18,8 @@
*/ */
namespace Framadate; namespace Framadate;
use Parsedown;
class Utils { class Utils {
/** /**
* @return string Server name * @return string Server name
@ -138,24 +140,29 @@ class Utils {
return TABLENAME_PREFIX . $tableName; return TABLENAME_PREFIX . $tableName;
} }
public static function markdown($md, $clear) { public static function markdown($md, $clear=false, $line=true) {
preg_match_all('/\[!\[(.*?)\]\((.*?)\)\]\((.*?)\)/', $md, $md_a_img); // Markdown [![alt](src)](href) $parseDown = new Parsedown();
preg_match_all('/!\[(.*?)\]\((.*?)\)/', $md, $md_img); // Markdown ![alt](src)
preg_match_all('/\[(.*?)\]\((.*?)\)/', $md, $md_a); // Markdown [text](href) $parseDown
if (isset($md_a_img[2][0]) && $md_a_img[2][0] !== '' && isset($md_a_img[3][0]) && $md_a_img[3][0] !== '') { // [![alt](src)](href) ->setMarkupEscaped(true)
$text = self::htmlEscape($md_a_img[1][0]); ->setBreaksEnabled(true)
$html = '<a href="' . self::htmlEscape($md_a_img[3][0]) . '"><img src="' . self::htmlEscape($md_a_img[2][0]) . '" class="img-responsive" alt="' . $text . '" title="' . $text . '" /></a>'; ->setUrlsLinked(false);
} elseif (isset($md_img[2][0]) && $md_img[2][0] !== '') { // ![alt](src)
$text = self::htmlEscape($md_img[1][0]); if ($line) {
$html = '<img src="' . self::htmlEscape($md_img[2][0]) . '" class="img-responsive" alt="' . $text . '" title="' . $text . '" />'; $html = $parseDown->line($md);
} elseif (isset($md_a[2][0]) && $md_a[2][0] !== '') { // [text](href) } else {
$text = self::htmlEscape($md_a[1][0]); $md = preg_replace_callback(
$html = '<a href="' . $md_a[2][0] . '">' . $text . '</a>'; '#( ){2,}#',
} else { // text only function ($m) {
$text = self::htmlEscape($md); return str_repeat('&nbsp;', strlen($m[0]));
$html = $text; },
$md
);
$html = $parseDown->text($md);
} }
$text = strip_tags($html);
return $clear ? $text : $html; return $clear ? $text : $html;
} }

View File

@ -56,7 +56,7 @@ $ALLOWED_LANGUAGES = [
'oc' => 'Occitan', 'oc' => 'Occitan',
'es' => 'Español', 'es' => 'Español',
'de' => 'Deutsch', 'de' => 'Deutsch',
'nl' => 'Nederlands', 'nl' => 'Dutch',
'it' => 'Italiano', 'it' => 'Italiano',
'br' => 'Brezhoneg', 'br' => 'Brezhoneg',
]; ];
@ -64,6 +64,9 @@ $ALLOWED_LANGUAGES = [
// Path to image file with the title // Path to image file with the title
const IMAGE_TITRE = 'images/logo-framadate.png'; const IMAGE_TITRE = 'images/logo-framadate.png';
// Relative path to favicon
const FAVICON = 'favicon.ico';
// Clean URLs, boolean // Clean URLs, boolean
const URL_PROPRE = false; const URL_PROPRE = false;
@ -86,6 +89,7 @@ const TIME_EDIT_LINK_EMAIL = 60;
$config = [ $config = [
/* general config */ /* general config */
'use_smtp' => true, // use email for polls creation/modification/responses notification 'use_smtp' => true, // use email for polls creation/modification/responses notification
'tracking_code' => '', // add HTML code to every page, useful for tools like Piwik
/* home */ /* home */
'show_what_is_that' => true, // display "how to use" section 'show_what_is_that' => true, // display "how to use" section
'show_the_software' => true, // display technical information about the software 'show_the_software' => true, // display technical information about the software
@ -94,4 +98,5 @@ $config = [
'default_poll_duration' => 180, // default values for the new poll duration (number of days). 'default_poll_duration' => 180, // default values for the new poll duration (number of days).
/* create_classic_poll.php */ /* create_classic_poll.php */
'user_can_add_img_or_link' => true, // user can add link or URL when creating his poll. 'user_can_add_img_or_link' => true, // user can add link or URL when creating his poll.
'markdown_editor_by_default' => true // The markdown editor for the description is enabled by default
]; ];

View File

@ -33,6 +33,12 @@ $smarty->assign('use_nav_js', strstr($_SERVER['SERVER_NAME'], 'framadate.org'));
$smarty->assign('locale', $locale); $smarty->assign('locale', $locale);
$smarty->assign('langs', $ALLOWED_LANGUAGES); $smarty->assign('langs', $ALLOWED_LANGUAGES);
$smarty->assign('date_format', $date_format); $smarty->assign('date_format', $date_format);
if (isset($config['tracking_code'])) {
$smarty->assign('tracking_code', $config['tracking_code']);
}
if (defined('FAVICON')) {
$smarty->assign('favicon', FAVICON);
}
// Dev Mode // Dev Mode
if (isset($_SERVER['FRAMADATE_DEVMODE']) && $_SERVER['FRAMADATE_DEVMODE']) { if (isset($_SERVER['FRAMADATE_DEVMODE']) && $_SERVER['FRAMADATE_DEVMODE']) {
@ -55,8 +61,8 @@ function smarty_function_poll_url($params, Smarty_Internal_Template $template) {
return Utils::getUrlSondage($poll_id, $admin, $vote_unique_id, $action, $action_value); return Utils::getUrlSondage($poll_id, $admin, $vote_unique_id, $action, $action_value);
} }
function smarty_modifier_markdown($md, $clear = false) { function smarty_modifier_markdown($md, $clear = false, $inline=true) {
return Utils::markdown($md, $clear); return Utils::markdown($md, $clear, $inline);
} }
function smarty_modifier_resource($link) { function smarty_modifier_resource($link) {

View File

@ -60,7 +60,8 @@
"o80/i18n": "dev-develop", "o80/i18n": "dev-develop",
"phpmailer/phpmailer": "^5.2", "phpmailer/phpmailer": "^5.2",
"ircmaxell/password-compat": "dev-master", "ircmaxell/password-compat": "dev-master",
"roave/security-advisories": "dev-master" "roave/security-advisories": "dev-master",
"erusev/parsedown": "1.6.0"
}, },
"require-dev": { "require-dev": {

53
composer.lock generated
View File

@ -4,8 +4,47 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "c9a0740da9fb245e1656578b5ce5d666", "content-hash": "90d0e11c397263c819650490edc8d705",
"packages": [ "packages": [
{
"name": "erusev/parsedown",
"version": "1.6.0",
"source": {
"type": "git",
"url": "https://github.com/erusev/parsedown.git",
"reference": "3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/erusev/parsedown/zipball/3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7",
"reference": "3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7",
"shasum": ""
},
"type": "library",
"autoload": {
"psr-0": {
"Parsedown": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Emanuil Rusev",
"email": "hello@erusev.com",
"homepage": "http://erusev.com"
}
],
"description": "Parser for Markdown.",
"homepage": "http://parsedown.org",
"keywords": [
"markdown",
"parser"
],
"time": "2015-10-04T16:44:32+00:00"
},
{ {
"name": "ircmaxell/password-compat", "name": "ircmaxell/password-compat",
"version": "dev-master", "version": "dev-master",
@ -177,12 +216,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Roave/SecurityAdvisories.git", "url": "https://github.com/Roave/SecurityAdvisories.git",
"reference": "94230db36bded9d164ffccabcb38c67eedd63595" "reference": "b5def2d9e0121c82083f552a90f7b499531a20fb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/94230db36bded9d164ffccabcb38c67eedd63595", "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/b5def2d9e0121c82083f552a90f7b499531a20fb",
"reference": "94230db36bded9d164ffccabcb38c67eedd63595", "reference": "b5def2d9e0121c82083f552a90f7b499531a20fb",
"shasum": "" "shasum": ""
}, },
"conflict": { "conflict": {
@ -236,6 +275,8 @@
"phpmailer/phpmailer": ">=5,<5.2.24", "phpmailer/phpmailer": ">=5,<5.2.24",
"phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3",
"phpxmlrpc/extras": "<0.6.1", "phpxmlrpc/extras": "<0.6.1",
"propel/propel": ">=2.0.0-alpha1,<=2.0.0-alpha7",
"propel/propel1": ">=1,<=1.7.1",
"pusher/pusher-php-server": "<2.2.1", "pusher/pusher-php-server": "<2.2.1",
"sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9",
"shopware/shopware": "<5.3.7", "shopware/shopware": "<5.3.7",
@ -267,7 +308,7 @@
"symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4",
"symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7",
"thelia/backoffice-default-template": ">=2.1,<2.1.2", "thelia/backoffice-default-template": ">=2.1,<2.1.2",
"thelia/thelia": ">=2.1.0-beta1,<2.1.3|>=2.1,<2.1.2", "thelia/thelia": ">=2.1,<2.1.2|>=2.1.0-beta1,<2.1.3",
"twig/twig": "<1.20", "twig/twig": "<1.20",
"typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.22|>=8,<8.7.5", "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.22|>=8,<8.7.5",
"typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5",
@ -316,7 +357,7 @@
} }
], ],
"description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it",
"time": "2018-02-19T09:31:21+00:00" "time": "2018-02-20T15:56:25+00:00"
}, },
{ {
"name": "smarty/smarty", "name": "smarty/smarty",

View File

@ -286,6 +286,7 @@ $smarty->assign('title', $title);
$smarty->assign('useRemoteUser', $useRemoteUser); $smarty->assign('useRemoteUser', $useRemoteUser);
$smarty->assign('errors', $errors); $smarty->assign('errors', $errors);
$smarty->assign('use_smtp', $config['use_smtp']); $smarty->assign('use_smtp', $config['use_smtp']);
$smarty->assign('default_to_marldown_editor', $config['markdown_editor_by_default']);
$smarty->assign('goToStep2', GO_TO_STEP_2); $smarty->assign('goToStep2', GO_TO_STEP_2);
$smarty->assign('poll_type', $poll_type); $smarty->assign('poll_type', $poll_type);
@ -294,7 +295,7 @@ $smarty->assign('customized_url', Utils::fromPostOrDefault('customized_url', $_S
$smarty->assign('use_customized_url', Utils::fromPostOrDefault('use_customized_url', $_SESSION['form']->use_customized_url)); $smarty->assign('use_customized_url', Utils::fromPostOrDefault('use_customized_url', $_SESSION['form']->use_customized_url));
$smarty->assign('ValueMax', Utils::fromPostOrDefault('ValueMax', $_SESSION['form']->ValueMax)); $smarty->assign('ValueMax', Utils::fromPostOrDefault('ValueMax', $_SESSION['form']->ValueMax));
$smarty->assign('use_ValueMax', Utils::fromPostOrDefault('use_ValueMax', $_SESSION['form']->use_ValueMax)); $smarty->assign('use_ValueMax', Utils::fromPostOrDefault('use_ValueMax', $_SESSION['form']->use_ValueMax));
$smarty->assign('poll_description', Utils::fromPostOrDefault('description', $_SESSION['form']->description)); $smarty->assign('poll_description', !empty($_POST['description']) ? $_POST['description'] : $_SESSION['form']->description);
$smarty->assign('poll_name', Utils::fromPostOrDefault('name', $_SESSION['form']->admin_name)); $smarty->assign('poll_name', Utils::fromPostOrDefault('name', $_SESSION['form']->admin_name));
$smarty->assign('poll_mail', Utils::fromPostOrDefault('mail', $_SESSION['form']->admin_mail)); $smarty->assign('poll_mail', Utils::fromPostOrDefault('mail', $_SESSION['form']->admin_mail));
$smarty->assign('poll_editable', Utils::fromPostOrDefault('editable', $_SESSION['form']->editable)); $smarty->assign('poll_editable', Utils::fromPostOrDefault('editable', $_SESSION['form']->editable));

7
css/simplemde.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -150,10 +150,22 @@ header form .input-group .input-group-btn {
.poll-description { .poll-description {
font-family: inherit; font-family: inherit;
white-space: pre-wrap;
word-break: initial; word-break: initial;
} }
/** Description in markdown **/
.form-group .CodeMirror, .form-group .CodeMirror-scroll {
min-height: 200px;
}
#description-form .CodeMirror {
background-color: #f5f5f5;
}
.editor-toolbar {
background-color: #eee;
}
h4.control-label { h4.control-label {
display: inline-block; display: inline-block;
max-width: 100%; max-width: 100%;

143
js/app/adminstuds.js Normal file
View File

@ -0,0 +1,143 @@
$(document).ready(function() {
wrapper = new MDEWrapper($('.js-desc textarea')[0], $('#rich-editor-button'), $('#simple-editor-button'));
var firstOpening = true;
$('#title-form .btn-edit').on('click', function() {
$('#title-form h3').hide();
$('.js-title').removeClass('hidden');
$('.js-title input').focus();
return false;
});
$('#title-form .btn-cancel').on('click', function() {
$('#title-form h3').show();
$('#title-form .js-title').addClass('hidden');
$('#title-form .btn-edit').focus();
return false;
});
$('#name-form .btn-edit').on('click', function() {
$('#name-form p').hide();
$('.js-name').removeClass('hidden');
$('.js-name input').focus();
return false;
});
$('#name-form .btn-cancel').on('click', function() {
$('#name-form p').show();
$('#name-form .js-name').addClass('hidden');
$('#name-form .btn-edit').focus();
return false;
});
$('#email-form .btn-edit').on('click', function() {
$('#email-form p').hide();
$('#email-form .js-email').removeClass('hidden');
$('.js-email input').focus();
return false;
});
$('#email-form .btn-cancel').on('click', function() {
$('#email-form p').show();
$('#email-form .js-email').addClass('hidden');
$('#email-form .btn-edit').focus();
return false;
});
$('#description-form .btn-edit').on('click', function() {
$('#description-form .well').hide();
$('#description-form .control-label .btn-edit').hide();
$('#description-form .js-desc').removeClass('hidden');
$('.js-desc textarea').focus();
if (firstOpening) {
firstOpening = false;
if ($('#rich-editor-button').hasClass('active')) {
wrapper.enable();
}
}
return false;
});
$('#description-form .btn-cancel').on('click', function() {
$('#description-form .well').show();
$('#description-form .control-label .btn-edit').show();
$('#description-form .js-desc').addClass('hidden');
$('.js-desc .btn-edit').focus();
return false;
});
$('#poll-rules-form .btn-edit').on('click', function() {
$('#poll-rules-form p').hide();
$('#poll-rules-form .js-poll-rules').removeClass('hidden');
$('.js-poll-rules select').focus();
return false;
});
$('#poll-rules-form .btn-cancel').on('click', function() {
$('#poll-rules-form p').show();
$('#poll-rules-form .js-poll-rules').addClass('hidden');
$('.js-poll-rules .btn-edit').focus();
return false;
});
$('#poll-hidden-form .btn-edit').on('click', function() {
$('#poll-hidden-form p').hide();
$('#poll-hidden-form .js-poll-hidden').removeClass('hidden');
$('.js-poll-hidden input[type=checkbox]').focus();
return false;
});
$('#poll-hidden-form .btn-cancel').on('click', function() {
$('#poll-hidden-form p').show();
$('#poll-hidden-form .js-poll-hidden').addClass('hidden');
$('.js-poll-hidden .btn-edit').focus();
return false;
});
$('#expiration-form .btn-edit').on('click', function() {
$('#expiration-form p').hide();
$('.js-expiration').removeClass('hidden');
$('.js-expiration input').focus();
return false;
});
$('#expiration-form .btn-cancel').on('click', function() {
$('#expiration-form p').show();
$('#expiration-form .js-expiration').addClass('hidden');
$('#expiration-form .btn-edit').focus();
return false;
});
$('#password-form .btn-edit').on('click', function() {
$('#password-form p').hide();
$('#password-form .js-password').removeClass('hidden');
$('#password').focus();
return false;
});
$('#password-form .btn-cancel').on('click', function() {
$('#password-form p').show();
$('#password-form .js-password').addClass('hidden');
$('.js-password .btn-edit').focus();
return false;
});
// Hiding other field when the admin wants to remove the password protection
var removePassword = $('#removePassword');
removePassword.on('click', function() {
var removeButton = removePassword.siblings('button');
if (removePassword.is(":checked")) {
$('#password_information').addClass('hidden');
removeButton.removeClass('hidden');
} else {
$('#password_information').removeClass('hidden');
removeButton.addClass('hidden');
}
removeButton.focus();
});
});

View File

@ -98,14 +98,19 @@
$('#md-a-imgModalLabel').text($(this).attr('title')); $('#md-a-imgModalLabel').text($(this).attr('title'));
}); });
md_a_imgModal.find('.btn-primary').on('click', function () { md_a_imgModal.find('.btn-primary').on('click', function () {
if (md_img.val() != '' && md_val.val() != '') { var text = md_text.val();
$('#' + $(this).val()).val('[![' + md_text.val() + '](' + md_img.val() + ')](' + md_val.val() + ')'); var img = md_img.val();
} else if (md_img.val() != '') { var link = md_val.val();
$('#' + $(this).val()).val('![' + md_text.val() + '](' + md_img.val() + ')'); var element = $('#' + $(this).val());
} else if (md_val.val() != '') {
$('#' + $(this).val()).val('[' + md_text.val() + '](' + md_val.val() + ')'); if (img != '' && link != '') {
element.val('[![' + text + '](' + img + ')](' + link + ')');
} else if (img != '') {
element.val('![' + text + '](' + img + ')');
} else if (link != '') {
element.val('[' + (text?text:link) + '](' + link + ')');
} else { } else {
$('#' + $(this).val()).val(md_text.val()); element.val(text);
} }
md_a_imgModal.modal('hide'); md_a_imgModal.modal('hide');
md_img.val(''); md_img.val('');

View File

@ -88,4 +88,9 @@ $(document).ready(function () {
document.getElementById("cookie-warning").setAttribute("style", ""); document.getElementById("cookie-warning").setAttribute("style", "");
} }
var wrapper = new MDEWrapper($('#poll_comments')[0], $('#rich-editor-button'), $('#simple-editor-button'));
if ($('#rich-editor-button').hasClass('active')) {
wrapper.enable();
}
}); });

View File

@ -21,28 +21,45 @@ $(document).ready(function () {
// Global variables // Global variables
var $selected_days = $('#selected-days'); var $selected_days = $('#selected-days');
var $removeaday_and_copyhours = $('#remove-a-day, #copyhours'); var $removeaday = $('#remove-a-day');
var $copyhours = $('#copyhours');
var $next = $('button[name="choixheures"]');
var updateButtonState = function () {
$removeaday.toggleClass('disabled', $selected_days.find('fieldset').length <= 1);
$copyhours.toggleClass('disabled', !hasFirstDayFilledHours());
$next.toggleClass('disabled', countFilledDays() < 1)
};
// at least 1 day filled and you can submit // at least 1 day filled and you can submit
var isSubmitDaysAvaillable = function() {
return (countFilledDays() >= 1);
};
var submitDaysAvalaible = function () { var countFilledDays = function () {
var nb_filled_days = 0; var nb_filled_days = 0;
$selected_days.find('fieldset legend input').each(function () { $selected_days.find('fieldset legend input').each(function () {
if ($(this).val() != '') { if ($(this).val() != '') {
nb_filled_days++; nb_filled_days++;
} }
}); });
return nb_filled_days;
if (nb_filled_days >= 1) {
$('button[name="choixheures"]').removeClass('disabled');
return true;
} else {
$('button[name="choixheures"]').addClass('disabled');
return false;
}
}; };
var hasFirstDayFilledHours = function () {
var hasFilledHours = false;
$selected_days.find('fieldset').first().find('.hours').each(function () {
if ($(this).val() != '') {
hasFilledHours = true;
}
});
return hasFilledHours;
};
/** /**
* Parse a string date * Parse a string date
* @param dateStr The string date * @param dateStr The string date
@ -74,8 +91,9 @@ $(document).ready(function () {
}; };
function getLastDayNumber(last_day) { function getLastDayNumber(last_day) {
if (last_day == null) if (last_day == null) {
last_day = $selected_days.find('fieldset').filter(':last'); last_day = $selected_days.find('fieldset').filter(':last');
}
return parseInt(/^d([0-9]+)-h[0-9]+$/.exec($(last_day).find('.hours').filter(':first').attr('id'))[1]) return parseInt(/^d([0-9]+)-h[0-9]+$/.exec($(last_day).find('.hours').filter(':first').attr('id'))[1])
} }
@ -99,7 +117,7 @@ $(document).ready(function () {
.after('<fieldset>' + new_day_html + '</fieldset>') .after('<fieldset>' + new_day_html + '</fieldset>')
.next().find('legend input').val(dateStr); .next().find('legend input').val(dateStr);
$('#day' + (new_day_number)).focus(); $('#day' + (new_day_number)).focus();
$removeaday_and_copyhours.removeClass('disabled'); updateButtonState();
} }
function manageRemoveadayAndCopyhoursButtons() { function manageRemoveadayAndCopyhoursButtons() {
@ -126,7 +144,7 @@ $(document).ready(function () {
// Handle form submission // Handle form submission
$(document.formulaire).on('submit', function (e) { $(document.formulaire).on('submit', function (e) {
if (!submitDaysAvalaible()) { if (!isSubmitDaysAvaillable()) {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
} }
@ -139,14 +157,15 @@ $(document).ready(function () {
$(this).find('.hours:gt(2)').parent().remove(); $(this).find('.hours:gt(2)').parent().remove();
}); });
$('#d0-h0').focus(); $('#d0-h0').focus();
$selected_days.find('fieldset .hours').attr('value', ''); $selected_days.find('fieldset .hours').val('');
}); });
// Button "Remove all days" // Button "Remove all days"
$('#resetdays').on('click', function () { $('#resetdays').on('click', function () {
$selected_days.find('fieldset:gt(0)').remove(); $selected_days.find('fieldset:gt(0)').remove();
$('#day0').focus(); $('#day0').focus();
$removeaday_and_copyhours.addClass('disabled'); updateButtonState();
}); });
// Button "Copy hours of the first day" // Button "Copy hours of the first day"
@ -185,8 +204,7 @@ $(document).ready(function () {
} }
} }
$copyhours.on('click', function () {
$('#copyhours').on('click', function () {
var first_day_hours = $selected_days.find('fieldset:eq(0) .hours').map(function () { var first_day_hours = $selected_days.find('fieldset:eq(0) .hours').map(function () {
return $(this).val(); return $(this).val();
}); });
@ -230,7 +248,7 @@ $(document).ready(function () {
$(this).addClass('disabled'); $(this).addClass('disabled');
} }
} }
submitDaysAvalaible(); updateButtonState();
}); });
// Button "Add a day" // Button "Add a day"
@ -241,11 +259,11 @@ $(document).ready(function () {
// Button "Remove a day" // Button "Remove a day"
$('#remove-a-day').on('click', function () { $removeaday.on('click', function () {
$selected_days.find('fieldset:last').remove(); $selected_days.find('fieldset:last').remove();
$('#day' + (getLastDayNumber() - 1)).focus();
manageRemoveadayAndCopyhoursButtons(); updateButtonState();
submitDaysAvalaible();
}); });
// Button "Remove the current day" // Button "Remove the current day"
@ -254,8 +272,7 @@ $(document).ready(function () {
if ($('#days_container').find('fieldset').length > 1) { if ($('#days_container').find('fieldset').length > 1) {
$(this).parents('fieldset').remove(); $(this).parents('fieldset').remove();
} }
manageRemoveadayAndCopyhoursButtons(); updateButtonState();
submitDaysAvalaible();
}); });
// Add an range of dates // Add an range of dates
@ -287,7 +304,7 @@ $(document).ready(function () {
startDateField.val(''); startDateField.val('');
endDateField.val(''); endDateField.val('');
$('#add_days').modal('hide'); $('#add_days').modal('hide');
submitDaysAvalaible(); updateButtonState();
} else { } else {
setTimeout(function () { setTimeout(function () {
@ -328,14 +345,8 @@ $(document).ready(function () {
}); });
}); });
$(document).on('keyup, change', '.hours, #selected-days fieldset legend input', function () { $(document).on('keyup change', '.hours, #selected-days fieldset legend input', function () {
submitDaysAvalaible(); updateButtonState();
}); });
submitDaysAvalaible(); updateButtonState();
// 2 days and you can remove a day or copy hours
if ($selected_days.find('fieldset').length > 1) {
$removeaday_and_copyhours.removeClass('disabled');
}
}); });

View File

@ -2,137 +2,6 @@ $(document).ready(function() {
window.lang = $('html').attr('lang'); window.lang = $('html').attr('lang');
/**
* adminstuds.php
**/
$('#title-form .btn-edit').on('click', function() {
$('#title-form h3').hide();
$('.js-title').removeClass('hidden');
$('.js-title input').focus();
return false;
});
$('#title-form .btn-cancel').on('click', function() {
$('#title-form h3').show();
$('#title-form .js-title').addClass('hidden');
$('#title-form .btn-edit').focus();
return false;
});
$('#name-form .btn-edit').on('click', function() {
$('#name-form p').hide();
$('.js-name').removeClass('hidden');
$('.js-name input').focus();
return false;
});
$('#name-form .btn-cancel').on('click', function() {
$('#name-form p').show();
$('#name-form .js-name').addClass('hidden');
$('#name-form .btn-edit').focus();
return false;
});
$('#email-form .btn-edit').on('click', function() {
$('#email-form p').hide();
$('#email-form .js-email').removeClass('hidden');
$('.js-email input').focus();
return false;
});
$('#email-form .btn-cancel').on('click', function() {
$('#email-form p').show();
$('#email-form .js-email').addClass('hidden');
$('#email-form .btn-edit').focus();
return false;
});
$('#description-form .btn-edit').on('click', function() {
$('#description-form .well').hide();
$('#description-form .js-desc').removeClass('hidden');
$('.js-desc textarea').focus();
return false;
});
$('#description-form .btn-cancel').on('click', function() {
$('#description-form .well').show();
$('#description-form .js-desc').addClass('hidden');
$('.js-desc .btn-edit').focus();
return false;
});
$('#poll-rules-form .btn-edit').on('click', function() {
$('#poll-rules-form p').hide();
$('#poll-rules-form .js-poll-rules').removeClass('hidden');
$('.js-poll-rules select').focus();
return false;
});
$('#poll-rules-form .btn-cancel').on('click', function() {
$('#poll-rules-form p').show();
$('#poll-rules-form .js-poll-rules').addClass('hidden');
$('.js-poll-rules .btn-edit').focus();
return false;
});
$('#poll-hidden-form .btn-edit').on('click', function() {
$('#poll-hidden-form p').hide();
$('#poll-hidden-form .js-poll-hidden').removeClass('hidden');
$('.js-poll-hidden input[type=checkbox]').focus();
return false;
});
$('#poll-hidden-form .btn-cancel').on('click', function() {
$('#poll-hidden-form p').show();
$('#poll-hidden-form .js-poll-hidden').addClass('hidden');
$('.js-poll-hidden .btn-edit').focus();
return false;
});
$('#expiration-form .btn-edit').on('click', function() {
$('#expiration-form p').hide();
$('.js-expiration').removeClass('hidden');
$('.js-expiration input').focus();
return false;
});
$('#expiration-form .btn-cancel').on('click', function() {
$('#expiration-form p').show();
$('#expiration-form .js-expiration').addClass('hidden');
$('#expiration-form .btn-edit').focus();
return false;
});
$('#password-form .btn-edit').on('click', function() {
$('#password-form p').hide();
$('#password-form .js-password').removeClass('hidden');
$('#password').focus();
return false;
});
$('#password-form .btn-cancel').on('click', function() {
$('#password-form p').show();
$('#password-form .js-password').addClass('hidden');
$('.js-password .btn-edit').focus();
return false;
});
// Hiding other field when the admin wants to remove the password protection
var removePassword = $('#removePassword');
removePassword.on('click', function() {
var removeButton = removePassword.siblings('button');
if (removePassword.is(":checked")) {
$('#password_information').addClass('hidden');
removeButton.removeClass('hidden');
} else {
$('#password_information').removeClass('hidden');
removeButton.addClass('hidden');
}
removeButton.focus();
});
// Horizontal scroll buttons // Horizontal scroll buttons
if($('.results').width() > $('.container').width()) { if($('.results').width() > $('.container').width()) {
$('.scroll-buttons').removeClass('hidden'); $('.scroll-buttons').removeClass('hidden');

62
js/mde-wrapper.js Normal file
View File

@ -0,0 +1,62 @@
function myPreviewRender (text) {
text = text.replace(/[\u00A0-\u9999<>\&]/gim, function(i) {
return '&#'+i.charCodeAt(0)+';';
});
text = SimpleMDE.prototype.markdown(text);
text = text.replace(/ /g, '&nbsp;');
return text;
};
function MDEWrapper(textarea, enableButton, disableButton) {
this.element = textarea;
this.enableButton = enableButton;
this.disableButton = disableButton;
this.simplemde = null;
var wrapper = this;
if (this.enableButton) {
this.enableButton.on('click', function() {wrapper.enable()});
}
if (this.disableButton) {
this.disableButton.on('click', function() {wrapper.disable()});
}
}
MDEWrapper.prototype.enable = function() {
var wrapper = this;
if (this.simplemde == null) {
this.simplemde = new SimpleMDE({
element: wrapper.element,
forceSync: true,
status: true,
previewRender: myPreviewRender,
spellChecker: false,
promptURLs: true
});
if (this.enableButton) {
this.enableButton.addClass('active');
}
if (this.disableButton) {
this.disableButton.removeClass('active');
}
}
}
MDEWrapper.prototype.disable = function() {
if (this.simplemde != null) {
this.simplemde.toTextArea();
this.simplemde = null;
if (this.disableButton) {
this.disableButton.addClass('active');
}
if (this.enableButton) {
this.enableButton.removeClass('active');
}
}
}
MDEWrapper.prototype.isEnabled = function() {
return this.simplemde != null;
}

14
js/simplemde.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -38,6 +38,7 @@
"Search": "Klask", "Search": "Klask",
"Creation date:": "Deiziad krouidigezh:", "Creation date:": "Deiziad krouidigezh:",
"Caption": "Alc'hwez", "Caption": "Alc'hwez",
"Markdown": "Markdown",
"ASTERISK": "*" "ASTERISK": "*"
}, },
"Date": { "Date": {
@ -132,7 +133,9 @@
"Password protected": "Gwarezet gant ur ger-tremen", "Password protected": "Gwarezet gant ur ger-tremen",
"Votes protected by password": "Gwarezet eo ar mouezhioù gant ur ger-tremen", "Votes protected by password": "Gwarezet eo ar mouezhioù gant ur ger-tremen",
"No password": "Ger-tremen ebet", "No password": "Ger-tremen ebet",
"Remove password": "Dilemel ar ger-tremen" "Remove password": "Dilemel ar ger-tremen",
"Rich editor": "Embanner pinvidik",
"Simple editor": "Embanner eeun"
}, },
"Poll results": { "Poll results": {
"Votes of the poll": "Mouezhioù ar sontadeg", "Votes of the poll": "Mouezhioù ar sontadeg",
@ -190,7 +193,7 @@
"Your reminder has been successfully sent!": "Kaset eo bet ho kounadur gant berzh!" "Your reminder has been successfully sent!": "Kaset eo bet ho kounadur gant berzh!"
}, },
"adminstuds": { "adminstuds": {
"As poll administrator, you can change all the lines of this poll with this button": "En ur vezañ merour ar sontadeg e c'hallit kemmañ holl linennoù ar sontadeg gant an afell-mañ", "As poll administrator, you can change all the lines of this poll with this button": "Dre ma'z oc'h merour e c'hallit kemmañ holl linennoù ar sontadeg gant an afell-mañ",
"remove a column or a line with": "dilemel ur bann pe ul linenn gant", "remove a column or a line with": "dilemel ur bann pe ul linenn gant",
"and add a new column with": "ha m'ho peus disoñjet un dibab e c'hallit ouzhpennañ ur bann en ur glikañ war", "and add a new column with": "ha m'ho peus disoñjet un dibab e c'hallit ouzhpennañ ur bann en ur glikañ war",
"Finally, you can change the informations of this poll like the title, the comments or your email address.": "Gallout a rit ivez kemmañ an titouroù a-zivout ar sontadeg evel an titl, an evezhiadennoù pe ho chomlec'h postel.", "Finally, you can change the informations of this poll like the title, the comments or your email address.": "Gallout a rit ivez kemmañ an titouroù a-zivout ar sontadeg evel an titl, an evezhiadennoù pe ho chomlec'h postel.",
@ -243,9 +246,13 @@
"Use a password to restrict access": "Lakaat ur ger-tremen evit bevenniñ an haeziñ", "Use a password to restrict access": "Lakaat ur ger-tremen evit bevenniñ an haeziñ",
"The results are publicly visible": "Gwelus d'an holl eo an disc'hoù", "The results are publicly visible": "Gwelus d'an holl eo an disc'hoù",
"Poll password": "Ger-tremen", "Poll password": "Ger-tremen",
"Confirm password": "Kadarnaat ho ker-tremen", "Password choice": "Dibab",
"Optional parameters": "Arventennoù diret", "Password confirmation": "Kadarnadur",
"Go to step 2": "Mont d'ar bazenn 2" "Permissions": "Aotreoù",
"Go to step 2": "Mont d'ar bazenn 2",
"To make the description more attractive, you can use the Markdown format.": "Evit kinklañ an deskrivadur e c'hallit ober gant ar c'hevradur Markdown.",
"You can enable or disable the editor at will.": "Gallout a rit gweredekaat pe ziweredekaat an embanner diouzh ho tibab.",
"More informations here:": "Titouroù ouzhpenn amañ:"
}, },
"Step 2": { "Step 2": {
"Back to step 1": "Distreiñ d'ar bazenn 1", "Back to step 1": "Distreiñ d'ar bazenn 1",
@ -284,8 +291,8 @@
"Removal date and confirmation (3 on 3)": "Deiziad diamzeriñ ha kadarnadur (3 war 3)", "Removal date and confirmation (3 on 3)": "Deiziad diamzeriñ ha kadarnadur (3 war 3)",
"Confirm the creation of your poll": "Kadarnait krouidigezh ho sontadeg", "Confirm the creation of your poll": "Kadarnait krouidigezh ho sontadeg",
"List of your choices": "Roll ho tibaboù", "List of your choices": "Roll ho tibaboù",
"Once you have confirmed the creation of your poll, you will be automatically redirected on the administration page of your poll.": "Ur wech m'ho po kadarnaet krouidigezh ar sontadeg e viot adheñchet ent emgefreek davet pajenn verañ ar sontadeg.", "Once you have confirmed the creation of your poll, you will be automatically redirected on the administration page of your poll.": "Ur wech kadarnaet krouidigezh ar sontadeg e viot adheñchet ent emgefreek etrezek pajenn verañ ar sontadeg.",
"Then, you will receive quickly two emails: one contening the link of your poll for sending it to the voters, the other contening the link to the administration page of your poll.": "D'ar memes mare e resevot daou bostel: unan oc'h enderc'hel un ere davet ho sontadeg evit e rannañ gant an dud da vezañ sontet hag unan all gant un ere davet pajenn verañ ar sontadeg.", "Then, you will receive quickly two emails: one contening the link of your poll for sending it to the voters, the other contening the link to the administration page of your poll.": "War un dro e resevot daou bostel: unan zo ennañ un ere etrezek ho sontadeg evit e rannañ gant an dud da vezañ sontet hag un eil ennañ un ere etrezek pajenn verañ ar sontadeg.",
"Create the poll": "Krouiñ ar sontadeg", "Create the poll": "Krouiñ ar sontadeg",
"Your poll will be automatically archived in %d days.": "Diellaouet e vo ho sontadeg a-benn %d a zevezhioù ent emgefreek.", "Your poll will be automatically archived in %d days.": "Diellaouet e vo ho sontadeg a-benn %d a zevezhioù ent emgefreek.",
"You can set a closer archiving date for it.": "Gallout a rit dibab un deiziad diellaouiñ tostoc'h.", "You can set a closer archiving date for it.": "Gallout a rit dibab un deiziad diellaouiñ tostoc'h.",
@ -429,5 +436,5 @@
"Consider setting the date.timezone in php.ini.": "Aliañ a reomp da lakaat date.timezone e php.ini.", "Consider setting the date.timezone in php.ini.": "Aliañ a reomp da lakaat date.timezone e php.ini.",
"Check again": "Gwiriañ en-dro", "Check again": "Gwiriañ en-dro",
"Continue the installation": "Kenderc'hel gant ar staliadur" "Continue the installation": "Kenderc'hel gant ar staliadur"
} }
} }

View File

@ -38,6 +38,7 @@
"Search": "Suche", "Search": "Suche",
"Creation date:": "Erstellungsdatum:", "Creation date:": "Erstellungsdatum:",
"Caption": "Bildunterschrift", "Caption": "Bildunterschrift",
"Markdown": "Markdown",
"ASTERISK": "*" "ASTERISK": "*"
}, },
"Date": { "Date": {
@ -132,7 +133,9 @@
"Password protected": "Passwortgeschützt", "Password protected": "Passwortgeschützt",
"Votes protected by password": "Wertungen sind passwortgeschützt", "Votes protected by password": "Wertungen sind passwortgeschützt",
"No password": "Kein Passwort", "No password": "Kein Passwort",
"Remove password": "Passwort entfernen" "Remove password": "Passwort entfernen",
"Rich editor": "DE_Editeur avancé",
"Simple editor": "DE_Editeur simple"
}, },
"Poll results": { "Poll results": {
"Votes of the poll": "Stimmabgaben zur Umfrage", "Votes of the poll": "Stimmabgaben zur Umfrage",
@ -247,7 +250,10 @@
"Password confirmation": "Passwortbestätigung", "Password confirmation": "Passwortbestätigung",
"Permissions": "Berechtigungen", "Permissions": "Berechtigungen",
"Optional parameters": "Optionale Einstellungen", "Optional parameters": "Optionale Einstellungen",
"Go to step 2": "Weiter zum 2. Schritt" "Go to step 2": "Weiter zum 2. Schritt",
"To make the description more attractive, you can use the Markdown format.": "DE_Afin de rendre le descriptif de ce sondage plus attractif, vous pouvez utiliser le formatage Markdown.",
"You can enable or disable the editor at will.": "DE_Vous pouvez activer ou désactiver l'éditeur à votre guise.",
"More informations here:": "DE_Plus d'informations ici :"
}, },
"Step 2": { "Step 2": {
"Back to step 1": "Zurück zum 1. Schritt", "Back to step 1": "Zurück zum 1. Schritt",

View File

@ -132,7 +132,9 @@
"Password protected": "Password protected", "Password protected": "Password protected",
"Votes protected by password": "Votes protected by password", "Votes protected by password": "Votes protected by password",
"No password": "No password", "No password": "No password",
"Remove password": "Remove password" "Remove password": "Remove password",
"Rich editor": "Rich editor",
"Simple editor": "Simple editor"
}, },
"Poll results": { "Poll results": {
"Votes of the poll": "Votes", "Votes of the poll": "Votes",
@ -248,7 +250,10 @@
"Permissions": "Permissions", "Permissions": "Permissions",
"Optional parameters": "Optional parameters", "Optional parameters": "Optional parameters",
"Go to step 2": "Go to step 2", "Go to step 2": "Go to step 2",
"Limit the ammount of voters per option": "Limit the ammount of voters per option", "To make the description more attractive, you can use the Markdown format.": "To make the description more attractive, you can use the Markdown format.",
"You can enable or disable the editor at will.": "You can enable or disable the editor at will.",
"More informations here:": "More informations here:",
"Limit the ammount of voters per option": "Limit the ammount of voters per option",
"ValueMax instructions": "voters per options ", "ValueMax instructions": "voters per options ",
"Value Max" : "Value Max" "Value Max" : "Value Max"
}, },

View File

@ -38,6 +38,7 @@
"Search": "Búsqueda", "Search": "Búsqueda",
"Creation date:": "Fecha de creación:", "Creation date:": "Fecha de creación:",
"Caption": "Leyenda", "Caption": "Leyenda",
"Markdown": "Markdown",
"ASTERISK": "*" "ASTERISK": "*"
}, },
"Date": { "Date": {
@ -132,7 +133,9 @@
"Password protected": "ES_Protégé par mot de passe", "Password protected": "ES_Protégé par mot de passe",
"Votes protected by password": "ES_Votes protégés par mot de passe", "Votes protected by password": "ES_Votes protégés par mot de passe",
"No password": "ES_Pas de mot de passe", "No password": "ES_Pas de mot de passe",
"Remove password": "ES_Supprimer le mot de passe" "Remove password": "ES_Supprimer le mot de passe",
"Rich editor": "ES_Editeur avancé",
"Simple editor": "ES_Editeur simple"
}, },
"Poll results": { "Poll results": {
"Votes of the poll": "Votos de la encuesta", "Votes of the poll": "Votos de la encuesta",
@ -247,7 +250,10 @@
"Password confirmation": "ES_Confirmation", "Password confirmation": "ES_Confirmation",
"Permissions": "ES_Permissions", "Permissions": "ES_Permissions",
"Optional parameters": "ES_Paramètres optionnels", "Optional parameters": "ES_Paramètres optionnels",
"Go to step 2": "Ir al paso número 2" "Go to step 2": "Ir al paso número 2",
"To make the description more attractive, you can use the Markdown format.": "ES_Afin de rendre le descriptif de ce sondage plus attractif, vous pouvez utiliser le formatage Markdown.",
"You can enable or disable the editor at will.": "ES_Vous pouvez activer ou désactiver l'éditeur à votre guise.",
"More informations here:": "ES_Plus d'informations ici :"
}, },
"Step 2": { "Step 2": {
"Back to step 1": "Volver al paso número 1", "Back to step 1": "Volver al paso número 1",

View File

@ -38,7 +38,9 @@
"Search": "Chercher", "Search": "Chercher",
"Creation date:": "Date de création :", "Creation date:": "Date de création :",
"Caption": "Légende", "Caption": "Légende",
"ASTERISK": "*" "Markdown": "Markdown",
"ASTERISK": "*",
"Framadate is an online service for planning an appointment or make a decision quickly and easily.": "Framadate est un service en ligne permettant de planifier un rendez-vous ou prendre des décisions rapidement et simplement."
}, },
"Date": { "Date": {
"dd/mm/yyyy": "jj/mm/aaaa", "dd/mm/yyyy": "jj/mm/aaaa",
@ -132,7 +134,9 @@
"Password protected": "Protégé par mot de passe", "Password protected": "Protégé par mot de passe",
"Votes protected by password": "Votes protégés par mot de passe", "Votes protected by password": "Votes protégés par mot de passe",
"No password": "Pas de mot de passe", "No password": "Pas de mot de passe",
"Remove password": "Supprimer le mot de passe" "Remove password": "Supprimer le mot de passe",
"Rich editor": "Editeur avancé",
"Simple editor": "Editeur simple"
}, },
"Poll results": { "Poll results": {
"Votes of the poll": "Votes du sondage", "Votes of the poll": "Votes du sondage",
@ -248,9 +252,12 @@
"Permissions": "Permissions", "Permissions": "Permissions",
"Optional parameters": "Paramètres facultatifs", "Optional parameters": "Paramètres facultatifs",
"Go to step 2": "Aller à l'étape 2", "Go to step 2": "Aller à l'étape 2",
"Limit the ammount of voters per option":"limiter le nombre de votants par option", "Limit the ammount of voters per option":"limiter le nombre de votants par option",
"Value Max": "Valeur Maximale", "Value Max": "Valeur Maximale",
"ValueMax instructions": "Votants maximum par option" "ValueMax instructions": "Votants maximum par option",
"To make the description more attractive, you can use the Markdown format.": "Afin de rendre le descriptif de ce sondage plus attractif, vous pouvez utiliser le formatage Markdown.",
"You can enable or disable the editor at will.": "Vous pouvez activer ou désactiver l'éditeur à votre guise.",
"More informations here:": "Plus d'informations ici :"
}, },
"Step 2": { "Step 2": {
"Back to step 1": "Revenir à létape 1", "Back to step 1": "Revenir à létape 1",

View File

@ -38,6 +38,7 @@
"Search": "Cercare", "Search": "Cercare",
"Creation date:": "Data di creazione:", "Creation date:": "Data di creazione:",
"Caption": "Titolo", "Caption": "Titolo",
"Markdown": "Markdown",
"ASTERISK": "*" "ASTERISK": "*"
}, },
"Date": { "Date": {
@ -132,7 +133,9 @@
"Password protected": "Protetto da una password", "Password protected": "Protetto da una password",
"Votes protected by password": "Voti protetti da una password", "Votes protected by password": "Voti protetti da una password",
"No password": "Nessuna password", "No password": "Nessuna password",
"Remove password": "Eliminare la password" "Remove password": "Eliminare la password",
"Rich editor": "IT_Editeur avancé",
"Simple editor": "IT_Editeur simple"
}, },
"Poll results": { "Poll results": {
"Votes of the poll": "Voti del sondaggio ", "Votes of the poll": "Voti del sondaggio ",
@ -247,7 +250,10 @@
"Password confirmation": "Conferma della password", "Password confirmation": "Conferma della password",
"Permissions": "Permessi", "Permissions": "Permessi",
"Optional parameters": "Parametri opzionali", "Optional parameters": "Parametri opzionali",
"Go to step 2": "Andare al punto 2" "Go to step 2": "Andare al punto 2",
"To make the description more attractive, you can use the Markdown format.": "IT_Afin de rendre le descriptif de ce sondage plus attractif, vous pouvez utiliser le formatage Markdown.",
"You can enable or disable the editor at will.": "IT_Vous pouvez activer ou désactiver l'éditeur à votre guise.",
"More informations here:": "IT_Plus d'informations ici :"
}, },
"Step 2": { "Step 2": {
"Back to step 1": "Torna al punto 1", "Back to step 1": "Torna al punto 1",

View File

@ -135,8 +135,12 @@
"Remove password": "Wachtwoord verwijderen" "Remove password": "Wachtwoord verwijderen"
}, },
"Poll results": { "Poll results": {
"Votes of the poll": "Stemmen",
"Edit the line: %s": "Bewerk regel: %s", "Edit the line: %s": "Bewerk regel: %s",
"Password protected": "NL_Protégé par mot de passe",
"Votes protected by password": "NL_Votes protégés par mot de passe",
"No password": "NL_Pas de mot de passe",
"Remove password": "NL_Supprimer le mot de passe",
"Votes of the poll": "Stemmen",
"Remove the line:": "Verwijder regel:", "Remove the line:": "Verwijder regel:",
"Vote no for": "Stem nee voor", "Vote no for": "Stem nee voor",
"Vote yes for": "Stem ja voor", "Vote yes for": "Stem ja voor",

View File

@ -38,6 +38,7 @@
"Search": "Cercar", "Search": "Cercar",
"Creation date:": "Data de creacion:", "Creation date:": "Data de creacion:",
"Caption": "Legenda", "Caption": "Legenda",
"Markdown": "Markdown",
"ASTERISK": "*" "ASTERISK": "*"
}, },
"Date": { "Date": {
@ -132,7 +133,9 @@
"Password protected": "Protegit per senhal", "Password protected": "Protegit per senhal",
"Votes protected by password": "Vòtes protegits per senhal", "Votes protected by password": "Vòtes protegits per senhal",
"No password": "Pas cap de senhal", "No password": "Pas cap de senhal",
"Remove password": "Levar lo senhal" "Remove password": "Levar lo senhal",
"Rich editor": "OC_Editeur avancé",
"Simple editor": "OC_Editeur simple"
}, },
"Poll results": { "Poll results": {
"Votes of the poll": "Vòtes del sondatge", "Votes of the poll": "Vòtes del sondatge",
@ -247,7 +250,10 @@
"Password confirmation": "Confirmacion", "Password confirmation": "Confirmacion",
"Permissions": "Permissions", "Permissions": "Permissions",
"Optional parameters": "Paramètres opcionals", "Optional parameters": "Paramètres opcionals",
"Go to step 2": "Anar a letapa 2" "Go to step 2": "Anar a letapa 2",
"To make the description more attractive, you can use the Markdown format.": "OC_Afin de rendre le descriptif de ce sondage plus attractif, vous pouvez utiliser le formatage Markdown.",
"You can enable or disable the editor at will.": "OC_Vous pouvez activer ou désactiver l'éditeur à votre guise.",
"More informations here:": "OC_Plus d'informations ici :"
}, },
"Step 2": { "Step 2": {
"Back to step 1": "Tornar a letapa 1", "Back to step 1": "Tornar a letapa 1",

View File

@ -45,7 +45,7 @@
</div> </div>
{/if} {/if}
<div class="form-group"> <div class="form-group">
<button class="btn btn-default" type="submit" name="back">{__('adminstuds', 'Back to the poll')}</button> <a href="{poll_url id=$admin_poll_id admin=true}" class="btn btn-default" name="back">{__('adminstuds', 'Back to the poll')}</a>
<button type="submit" name="confirm_add_column" class="btn btn-success">{__('adminstuds', 'Add a column')}</button> <button type="submit" name="confirm_add_column" class="btn btn-success">{__('adminstuds', 'Add a column')}</button>
</div> </div>
</div> </div>

View File

@ -94,4 +94,5 @@ $config = [
'default_poll_duration' => 180, // default values for the new poll duration (number of days). 'default_poll_duration' => 180, // default values for the new poll duration (number of days).
/* create_classic_poll.php */ /* create_classic_poll.php */
'user_can_add_img_or_link' => true, // user can add link or URL when creating his poll. 'user_can_add_img_or_link' => true, // user can add link or URL when creating his poll.
'markdown_editor_by_default' => true // The markdown editor for the description is enabled by default
]; ];

View File

@ -1,8 +1,12 @@
{extends file='page.tpl'} {extends file='page.tpl'}
{block name="header"} {block name="header"}
<script src="{"js/simplemde.min.js"|resource}" type="text/javascript"></script>
<script src="{"js/mde-wrapper.js"|resource}" type="text/javascript"></script>
<script src="{"js/app/create_poll.js"|resource}" type="text/javascript"></script> <script src="{"js/app/create_poll.js"|resource}" type="text/javascript"></script>
<link rel="stylesheet" href="{"css/app/create_poll.css"|resource}"> <link rel="stylesheet" href="{"css/app/create_poll.css"|resource}">
<link rel="stylesheet" href="{"css/simplemde.min.css"|resource}">
{/block} {/block}
{block name=main} {block name=main}
@ -37,27 +41,27 @@
{/if} {/if}
{if $use_smtp} {if $use_smtp}
<div class="form-group {$errors['email']['class']}"> <div class="form-group {$errors['email']['class']}">
<label for="email" class="col-sm-4 control-label"> <label for="email" class="col-sm-4 control-label">
{__('Generic', 'Your email address')} *<br/> {__('Generic', 'Your email address')} *<br/>
<span class="small">{__('Generic', '(in the format name@mail.com)')}</span> <span class="small">{__('Generic', '(in the format name@mail.com)')}</span>
</label> </label>
<div class="col-sm-8"> <div class="col-sm-8">
{if $useRemoteUser} {if $useRemoteUser}
<input type="hidden" name="mail" value="{$form->admin_mail}">{$form->admin_mail} <input type="hidden" name="mail" value="{$form->admin_mail}">{$form->admin_mail}
{else} {else}
<input id="email" type="text" name="mail" class="form-control" {$errors['email']['aria']} value="{$poll_mail|html}" /> <input id="email" type="text" name="mail" class="form-control" {$errors['email']['aria']} value="{$poll_mail|html}" />
{/if} {/if}
</div>
</div> </div>
{if !empty($errors['email']['msg'])} </div>
<div class="alert alert-danger"> {if !empty($errors['email']['msg'])}
<p id="poll_title_error"> <div class="alert alert-danger">
{$errors['email']['msg']} <p id="poll_title_error">
</p> {$errors['email']['msg']}
</div> </p>
{/if} </div>
{/if}
{/if} {/if}
@ -81,9 +85,12 @@
<label for="poll_comments" class="col-sm-4 control-label">{__('Generic', 'Description')}</label> <label for="poll_comments" class="col-sm-4 control-label">{__('Generic', 'Description')}</label>
<div class="col-sm-8"> <div class="col-sm-8">
<textarea id="poll_comments" name="description" {include 'part/description_markdown.tpl'}
class="form-control" {$errors['description']['aria']} <div>
rows="5">{$poll_description|html}</textarea> <textarea id="poll_comments" name="description"
class="form-control" {$errors['description']['aria']}
rows="5">{$poll_description|escape}</textarea>
</div>
</div> </div>
</div> </div>
{if !empty($errors['description']['msg'])} {if !empty($errors['description']['msg'])}
@ -115,204 +122,201 @@
<div class="collapse" id="optionnal"> <div class="collapse" id="optionnal">
{* Poll identifier *}
{* Value MAX *}
<div class="form-group">
<label for="use_valueMax" class="col-sm-4 control-label">
{__('Step 1', 'Value Max')}<br/>
</label>
<div class="col-sm-8">
<div class="checkbox">
<label>
<input id="use_ValueMax" name="use_ValueMax" type="checkbox" >
{__('Step 1', "Limit the ammount of voters per option")}
</label>
</div>
</div>
</div>
<div class="form-group">
<div id="ValueMax"{if !$use_ValueMax} class="hidden"{/if}>
<div class="col-sm-offset-4 col-sm-8">
<label >
<input id="ValueMax" type="number" min= "0" name="ValueMax">
{__('Step 1', "ValueMax instructions")}
</label>
</div>
</div>
</div>
{* Poll identifier *}
<div class="form-group {$errors['customized_url']['class']}"> <div class="form-group {$errors['customized_url']['class']}">
<label for="poll_id" class="col-sm-4 control-label">
{__('Step 1', 'Poll id')}<br/>
</label>
<div class="col-sm-8"> {* Value MAX *}
<div class="checkbox"> <div class="form-group">
<label> <label for="use_valueMax" class="col-sm-4 control-label">
<input id="use_customized_url" name="use_customized_url" type="checkbox" {if $use_customized_url}checked{/if}/> {__('Step 1', 'Value Max')}<br/>
{__('Step 1', 'Customize the URL')} </label>
<div class="col-sm-8">
<div class="checkbox">
<label>
<input id="use_ValueMax" name="use_ValueMax" type="checkbox" >
{__('Step 1', "Limit the ammount of voters per option")}
</label> </label>
</div> </div>
</div>
</div> </div>
</div>
<div id="customized_url_options" {if !$use_customized_url}class="hidden"{/if}> <div class="form-group">
<div id="ValueMax"{if !$use_ValueMax} class="hidden"{/if}>
<div class="col-sm-offset-4 col-sm-8">
<label>
<input id="ValueMax" type="number" min= "0" name="ValueMax">
{__('Step 1', "ValueMax instructions")}
</label>
</div>
</div>
</div>
{* Poll identifier *}
<div class="form-group {$errors['customized_url']['class']}"> <div class="form-group {$errors['customized_url']['class']}">
<label for="customized_url" class="col-sm-4 control-label"> <label for="poll_id" class="col-sm-4 control-label">
<span id="pollUrlDesc" class="small">{__('Step 1', 'Poll id rules')}</span> {__('Step 1', 'Poll id')}<br/>
</label> </label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group"> <div class="checkbox">
<span class="input-group-addon"> <label>
{$SERVER_URL} <input id="use_customized_url" name="use_customized_url" type="checkbox" {if $use_customized_url}checked{/if}/>
</span> {__('Step 1', 'Customize the URL')}
<input id="customized_url" type="text" name="customized_url" class="form-control" {$errors['customized_url']['aria']} </label>
value="{$customized_url|html}" aria-describedBy="pollUrlDesc" maxlength="64"
pattern="[A-Za-z0-9-]+"/>
</div> </div>
<span class="help-block text-warning">{__('Step 1', 'Poll id warning')}</span>
</div> </div>
</div> </div>
{if !empty($errors['customized_url']['msg'])} <div id="customized_url_options" {if !$use_customized_url}class="hidden"{/if}>
<div class="alert alert-danger"> <div class="form-group {$errors['customized_url']['class']}">
<p id="poll_customized_url_error"> <label for="customized_url" class="col-sm-4 control-label">
{$errors['customized_url']['msg']} <span id="pollUrlDesc" class="small">{__('Step 1', 'Poll id rules')}</span>
</p> </label>
<div class="col-sm-8">
<div class="input-group">
<span class="input-group-addon">
{$SERVER_URL}
</span>
<input id="customized_url" type="text" name="customized_url" class="form-control" {$errors['customized_url']['aria']}
value="{$customized_url|html}" aria-describedBy="pollUrlDesc" maxlength="64"
pattern="[A-Za-z0-9-]+"/>
</div>
<span class="help-block text-warning">{__('Step 1', 'Poll id warning')}</span>
</div>
</div>
{if !empty($errors['customized_url']['msg'])}
<div class="alert alert-danger">
<p id="poll_customized_url_error">
{$errors['customized_url']['msg']}
</p>
</div>
{/if}
</div>
{* Password *}
<div class="form-group">
<label for="poll_id" class="col-sm-4 control-label">
{__('Step 1', 'Poll password')}
</label>
<div class="col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox" name="use_password" {if $poll_use_password}checked{/if}
id="use_password">
{__('Step 1', "Use a password to restrict access")}
</label>
</div>
</div>
<div id="password_options"{if !$poll_use_password} class="hidden"{/if}>
<div class="col-sm-offset-4 col-sm-8">
<div class="input-group">
<input id="poll_password" type="password" name="password" class="form-control" {$errors['password']['aria']}/>
<label for="poll_password" class="input-group-addon">{__('Step 1', 'Password choice')}</label>
</div>
</div>
{if !empty($errors['password']['msg'])}
<div class="alert alert-danger">
<p id="poll_password_error">
{$errors['password']['msg']}
</p>
</div>
{/if}
<div class="col-sm-offset-4 col-sm-8">
<div class="input-group">
<input id="poll_password_repeat" type="password" name="password_repeat" class="form-control" {$errors['password_repeat']['aria']}/>
<label for="poll_password_repeat" class="input-group-addon">{__('Step 1', 'Password confirmation')}</label>
</div>
</div>
{if !empty($errors['password_repeat']['msg'])}
<div class="alert alert-danger">
<p id="poll_password_repeat_error">
{$errors['password_repeat']['msg']}
</p>
</div>
{/if}
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox" name="results_publicly_visible"
{if $poll_results_publicly_visible}checked{/if} id="results_publicly_visible"/>
{__('Step 1', "The results are publicly visible")}
</label>
</div>
</div>
</div>
</div>
<div class="form-group">
<label for="poll_id" class="col-sm-4 control-label">
{__('Step 1', 'Permissions')}
</label>
<div class="col-sm-8">
<div class="radio">
<label>
<input type="radio" name="editable" id="editableByAll" {if $poll_editable==constant("Framadate\Editable::EDITABLE_BY_ALL")}checked{/if} value="{constant("Framadate\Editable::EDITABLE_BY_ALL")}">
{__('Step 1', 'All voters can modify any vote')}
</label>
<label>
<input type="radio" name="editable" {if $poll_editable==constant("Framadate\Editable::EDITABLE_BY_OWN")}checked{/if} value="{constant("Framadate\Editable::EDITABLE_BY_OWN")}">
{__('Step 1', 'Voters can modify their vote themselves')}
</label>
<label>
<input type="radio" name="editable" {if empty($poll_editable) or $poll_editable==constant("Framadate\Editable::NOT_EDITABLE")}checked{/if} value="{constant("Framadate\Editable::NOT_EDITABLE")}">
{__('Step 1', 'Votes cannot be modified')}
</label>
</div>
</div>
</div>
{if $use_smtp}
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox" name="receiveNewVotes" {if $poll_receiveNewVotes}checked{/if}
id="receiveNewVotes">
{__('Step 1', 'To receive an email for each new vote')}
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox" name="receiveNewComments" {if $poll_receiveNewComments}checked{/if}
id="receiveNewComments">
{__('Step 1', 'To receive an email for each new comment')}
</label>
</div>
</div>
</div> </div>
{/if} {/if}
</div>
{* Password *}
<div class="form-group">
<label for="poll_id" class="col-sm-4 control-label">
{__('Step 1', 'Poll password')}
</label>
<div class="col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox" name="use_password" {if $poll_use_password}checked{/if}
id="use_password">
{__('Step 1', "Use a password to restrict access")}
</label>
</div>
</div>
<div id="password_options"{if !$poll_use_password} class="hidden"{/if}>
<div class="col-sm-offset-4 col-sm-8">
<div class="input-group">
<input id="poll_password" type="password" name="password" class="form-control" {$errors['password']['aria']}/>
<label for="poll_password" class="input-group-addon">{__('Step 1', 'Password choice')}</label>
</div>
</div>
{if !empty($errors['password']['msg'])}
<div class="alert alert-danger">
<p id="poll_password_error">
{$errors['password']['msg']}
</p>
</div>
{/if}
<div class="col-sm-offset-4 col-sm-8">
<div class="input-group">
<input id="poll_password_repeat" type="password" name="password_repeat" class="form-control" {$errors['password_repeat']['aria']}/>
<label for="poll_password_repeat" class="input-group-addon">{__('Step 1', 'Password confirmation')}</label>
</div>
</div>
{if !empty($errors['password_repeat']['msg'])}
<div class="alert alert-danger">
<p id="poll_password_repeat_error">
{$errors['password_repeat']['msg']}
</p>
</div>
{/if}
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox" name="results_publicly_visible"
{if $poll_results_publicly_visible}checked{/if} id="results_publicly_visible"/>
{__('Step 1', "The results are publicly visible")}
</label>
</div>
</div>
</div>
</div>
<div class="form-group">
<label for="poll_id" class="col-sm-4 control-label">
{__('Step 1', 'Permissions')}
</label>
<div class="col-sm-8">
<div class="radio">
<label>
<input type="radio" name="editable" id="editableByAll" {if $poll_editable==constant("Framadate\Editable::EDITABLE_BY_ALL")}checked{/if} value="{constant("Framadate\Editable::EDITABLE_BY_ALL")}">
{__('Step 1', 'All voters can modify any vote')}
</label>
<label>
<input type="radio" name="editable" {if $poll_editable==constant("Framadate\Editable::EDITABLE_BY_OWN")}checked{/if} value="{constant("Framadate\Editable::EDITABLE_BY_OWN")}">
{__('Step 1', 'Voters can modify their vote themselves')}
</label>
<label>
<input type="radio" name="editable" {if empty($poll_editable) or $poll_editable==constant("Framadate\Editable::NOT_EDITABLE")}checked{/if} value="{constant("Framadate\Editable::NOT_EDITABLE")}">
{__('Step 1', 'Votes cannot be modified')}
</label>
</div>
</div>
</div>
{if $use_smtp}
<div class="form-group"> <div class="form-group">
<div class="col-sm-offset-4 col-sm-8"> <div class="col-sm-offset-4 col-sm-8">
<div class="checkbox"> <div class="checkbox">
<label> <label>
<input type="checkbox" name="receiveNewVotes" {if $poll_receiveNewVotes}checked{/if} <input type="checkbox" name="hidden" {if $poll_hidden}checked{/if}
id="receiveNewVotes"> id="hidden">
{__('Step 1', 'To receive an email for each new vote')} {__('Step 1', "Only the poll maker can see the poll's results")}
</label> </label>
</div> </div>
</div> <div id="hiddenWithBadEditionModeError" class="alert alert-danger hidden">
</div> <p>
<div class="form-group"> {__('Error', "You can't create a poll with hidden results with the following edition option:")}"{__('Step 1', 'All voters can modify any vote')}"
<div class="col-sm-offset-4 col-sm-8"> </p>
<div class="checkbox">
<label>
<input type="checkbox" name="receiveNewComments" {if $poll_receiveNewComments}checked{/if}
id="receiveNewComments">
{__('Step 1', 'To receive an email for each new comment')}
</label>
</div> </div>
</div> </div>
</div> </div>
{/if}
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox" name="hidden" {if $poll_hidden}checked{/if}
id="hidden">
{__('Step 1', "Only the poll maker can see the poll's results")}
</label>
</div>
<div id="hiddenWithBadEditionModeError" class="alert alert-danger hidden">
<p>
{__('Error', "You can't create a poll with hidden results with the following edition option:")}"{__('Step 1', 'All voters can modify any vote')}"
</p>
</div>
</div>
</div> </div>
</div> </div>

View File

@ -9,6 +9,11 @@
{else} {else}
<title>{$APPLICATION_NAME|html}</title> <title>{$APPLICATION_NAME|html}</title>
{/if} {/if}
<meta name="description" content="{__('Generic', 'Framadate is an online service for planning an appointment or make a decision quickly and easily.')}" />
{if isset($favicon)}
<link rel="icon" href="{$favicon|resource}">
{/if}
<link rel="stylesheet" href="{'css/bootstrap.min.css'|resource}"> <link rel="stylesheet" href="{'css/bootstrap.min.css'|resource}">
<link rel="stylesheet" href="{'css/datepicker3.css'|resource}"> <link rel="stylesheet" href="{'css/datepicker3.css'|resource}">
@ -38,5 +43,8 @@
</main> </main>
</div> <!-- .container --> </div> <!-- .container -->
{if isset($tracking_code)}
{$tracking_code}
{/if}
</body> </body>
</html> </html>

View File

@ -0,0 +1,34 @@
{* Description buttons for markdown *}
<div class="btn-group" role="group" aria-label="...">
<button type="button" id="rich-editor-button" class="btn btn-default btn-xs{if $default_to_marldown_editor} active{/if}">{__('PollInfo', 'Rich editor')}</button>
<button type="button" id="simple-editor-button" class="btn btn-default btn-xs{if !$default_to_marldown_editor} active{/if}">{__('PollInfo', 'Simple editor')}</button>
</div>
<a href="" data-toggle="modal" data-target="#markdown_modal"><i class="glyphicon glyphicon-info-sign"></i></a><!-- TODO Add accessibility -->
<div id="markdown_modal" class="modal fade">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">{__('Generic', 'Markdown')}</h4>
</div>
<div class="modal-body">
<p>
{__('Step 1', 'To make the description more attractive, you can use the Markdown format.')}
</p>
<p>
{__('Step 1', 'You can enable or disable the editor at will.')}
</p>
<p>
{__('Step 1', 'More informations here:')}
<a href="http://{$locale}.wikipedia.org/wiki/Markdown">http://{$locale}.wikipedia.org/wiki/Markdown</a>
</p>
</div>
</div>
</div>
</div>

View File

@ -88,10 +88,11 @@
{if $admin || preg_match('/[^ \r\n]/', $poll->description)} {if $admin || preg_match('/[^ \r\n]/', $poll->description)}
<div class="form-group col-md-8" id="description-form"> <div class="form-group col-md-8" id="description-form">
<label class="control-label">{__('Generic', 'Description')}{if $admin && !$expired} <button class="btn btn-link btn-sm btn-edit" title="{__('PollInfo', 'Edit the description')}"><span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic', 'Edit')}</span></button>{/if}</label> <label class="control-label">{__('Generic', 'Description')}{if $admin && !$expired} <button class="btn btn-link btn-sm btn-edit" title="{__('PollInfo', 'Edit the description')}"><span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic', 'Edit')}</span></button>{/if}</label>
<pre class="form-control-static well poll-description">{$poll->description|html}</pre> <div class="form-control-static well poll-description">{$poll->description|markdown:false:false}</div>
{if $admin && !$expired} {if $admin && !$expired}
<div class="hidden js-desc text-right"> <div class="hidden js-desc">
<label class="sr-only" for="newdescription">{__('Generic', 'Description')}</label> <label class="sr-only" for="newdescription">{__('Generic', 'Description')}</label>
{include 'part/description_markdown.tpl'}
<textarea class="form-control" id="newdescription" name="description" rows="2" cols="40">{$poll->description|html}</textarea> <textarea class="form-control" id="newdescription" name="description" rows="2" cols="40">{$poll->description|html}</textarea>
<button type="submit" id="btn-new-desc" name="update_poll_info" value="description" class="btn btn-sm btn-success" title="{__('PollInfo', 'Save the description')}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic', 'Save')}</span></button> <button type="submit" id="btn-new-desc" name="update_poll_info" value="description" class="btn btn-sm btn-success" title="{__('PollInfo', 'Save the description')}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic', 'Save')}</span></button>
<button class="btn btn-default btn-sm btn-cancel" title="{__('PollInfo', 'Cancel the description edit')}"><span class="glyphicon glyphicon-remove"></span><span class="sr-only">{__('Generic', 'Cancel')}</span></button> <button class="btn btn-default btn-sm btn-cancel" title="{__('PollInfo', 'Cancel the description edit')}"><span class="glyphicon glyphicon-remove"></span><span class="sr-only">{__('Generic', 'Cancel')}</span></button>

View File

@ -7,6 +7,13 @@
<script src="{"js/app/studs.js"|resource}" type="text/javascript"></script> <script src="{"js/app/studs.js"|resource}" type="text/javascript"></script>
<link rel="stylesheet" href="{'css/jquery-ui.min.css'|resource}"> <link rel="stylesheet" href="{'css/jquery-ui.min.css'|resource}">
{if $admin}
<script src="{"js/simplemde.min.js"|resource}" type="text/javascript"></script>
<script src="{"js/mde-wrapper.js"|resource}" type="text/javascript"></script>
<script src="{"js/app/adminstuds.js"|resource}" type="text/javascript"></script>
<link rel="stylesheet" href="{'css/simplemde.min.css'|resource}">
{/if}
{/block} {/block}
{block name=main} {block name=main}