Merge branch 'develop'

This commit is contained in:
Thomas Citharel 2018-02-20 19:05:24 +01:00
commit 801bc08a81
35 changed files with 560 additions and 253 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>';
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`.
# 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`.
@ -57,7 +63,8 @@ La page de migration s'occupe :
- 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.
! 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

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.
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
@ -18,13 +17,13 @@ Un fichier est dédié à l'installation de framadate : [INSTALL.md](INSTALL.md)
## De votre côté
1. Créer un compte sur [https://framagit.org](https://framagit.org)
1. Créer un fork du projet principal : [Créer le fork](https://framagit.org/framasoft/framadate/forks/new)
1. Créer une branche nommée feature/[Description]
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://git.framasoft.org/framasoft/framadate/fork/new)
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
1. Faire des commits dans votre branche
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é

View File

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

View File

@ -83,4 +83,4 @@ class NotificationService {
{
return $type >= self::UPDATE_POLL;
}
}
}

View File

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

View File

@ -56,7 +56,7 @@ $ALLOWED_LANGUAGES = [
'oc' => 'Occitan',
'es' => 'Español',
'de' => 'Deutsch',
'nl' => 'Nederlands',
'nl' => 'Dutch',
'it' => 'Italiano',
'br' => 'Brezhoneg',
];
@ -64,6 +64,9 @@ $ALLOWED_LANGUAGES = [
// Path to image file with the title
const IMAGE_TITRE = 'images/logo-framadate.png';
// Relative path to favicon
const FAVICON = 'favicon.ico';
// Clean URLs, boolean
const URL_PROPRE = false;
@ -86,6 +89,7 @@ const TIME_EDIT_LINK_EMAIL = 60;
$config = [
/* general config */
'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 */
'show_what_is_that' => true, // display "how to use" section
'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).
/* create_classic_poll.php */
'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('langs', $ALLOWED_LANGUAGES);
$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
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);
}
function smarty_modifier_markdown($md, $clear = false) {
return Utils::markdown($md, $clear);
function smarty_modifier_markdown($md, $clear = false, $inline=true) {
return Utils::markdown($md, $clear, $inline);
}
function smarty_modifier_resource($link) {
@ -68,4 +74,4 @@ function smarty_modifier_addslashes_single_quote($string) {
function smarty_modifier_html($html) {
return Utils::htmlEscape($html);
}
}

View File

@ -60,7 +60,8 @@
"o80/i18n": "dev-develop",
"phpmailer/phpmailer": "^5.2",
"ircmaxell/password-compat": "dev-master",
"roave/security-advisories": "dev-master"
"roave/security-advisories": "dev-master",
"erusev/parsedown": "1.6.0"
},
"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",
"This file is @generated automatically"
],
"content-hash": "c9a0740da9fb245e1656578b5ce5d666",
"content-hash": "90d0e11c397263c819650490edc8d705",
"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",
"version": "dev-master",
@ -177,12 +216,12 @@
"source": {
"type": "git",
"url": "https://github.com/Roave/SecurityAdvisories.git",
"reference": "94230db36bded9d164ffccabcb38c67eedd63595"
"reference": "b5def2d9e0121c82083f552a90f7b499531a20fb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/94230db36bded9d164ffccabcb38c67eedd63595",
"reference": "94230db36bded9d164ffccabcb38c67eedd63595",
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/b5def2d9e0121c82083f552a90f7b499531a20fb",
"reference": "b5def2d9e0121c82083f552a90f7b499531a20fb",
"shasum": ""
},
"conflict": {
@ -236,6 +275,8 @@
"phpmailer/phpmailer": ">=5,<5.2.24",
"phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3",
"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",
"sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9",
"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/yaml": ">=2,<2.0.22|>=2.1,<2.1.7",
"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",
"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",
@ -316,7 +357,7 @@
}
],
"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",

View File

@ -286,6 +286,7 @@ $smarty->assign('title', $title);
$smarty->assign('useRemoteUser', $useRemoteUser);
$smarty->assign('errors', $errors);
$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('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('ValueMax', Utils::fromPostOrDefault('ValueMax', $_SESSION['form']->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_mail', Utils::fromPostOrDefault('mail', $_SESSION['form']->admin_mail));
$smarty->assign('poll_editable', Utils::fromPostOrDefault('editable', $_SESSION['form']->editable));

View File

@ -22,4 +22,4 @@
border-bottom: 4px dashed;
border-top: 0 none;
content: "";
}
}

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 {
font-family: inherit;
white-space: pre-wrap;
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 {
display: inline-block;
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_imgModal.find('.btn-primary').on('click', function () {
if (md_img.val() != '' && md_val.val() != '') {
$('#' + $(this).val()).val('[![' + md_text.val() + '](' + md_img.val() + ')](' + md_val.val() + ')');
} else if (md_img.val() != '') {
$('#' + $(this).val()).val('![' + md_text.val() + '](' + md_img.val() + ')');
} else if (md_val.val() != '') {
$('#' + $(this).val()).val('[' + md_text.val() + '](' + md_val.val() + ')');
var text = md_text.val();
var img = md_img.val();
var link = md_val.val();
var element = $('#' + $(this).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 {
$('#' + $(this).val()).val(md_text.val());
element.val(text);
}
md_a_imgModal.modal('hide');
md_img.val('');

View File

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

View File

@ -2,137 +2,6 @@ $(document).ready(function() {
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
if($('.results').width() > $('.container').width()) {
$('.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",
"Creation date:": "Deiziad krouidigezh:",
"Caption": "Alc'hwez",
"Markdown": "Markdown",
"ASTERISK": "*"
},
"Date": {
@ -132,7 +133,9 @@
"Password protected": "Gwarezet gant ur ger-tremen",
"Votes protected by password": "Gwarezet eo ar mouezhioù gant ur ger-tremen",
"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": {
"Votes of the poll": "Mouezhioù ar sontadeg",
@ -190,7 +193,7 @@
"Your reminder has been successfully sent!": "Kaset eo bet ho kounadur gant berzh!"
},
"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",
"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.",
@ -243,9 +246,13 @@
"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ù",
"Poll password": "Ger-tremen",
"Confirm password": "Kadarnaat ho ker-tremen",
"Optional parameters": "Arventennoù diret",
"Go to step 2": "Mont d'ar bazenn 2"
"Password choice": "Dibab",
"Password confirmation": "Kadarnadur",
"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": {
"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)",
"Confirm the creation of your poll": "Kadarnait krouidigezh ho sontadeg",
"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.",
"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.",
"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.": "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",
"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.",
@ -429,5 +436,5 @@
"Consider setting the date.timezone in php.ini.": "Aliañ a reomp da lakaat date.timezone e php.ini.",
"Check again": "Gwiriañ en-dro",
"Continue the installation": "Kenderc'hel gant ar staliadur"
}
}
}

View File

@ -38,6 +38,7 @@
"Search": "Suche",
"Creation date:": "Erstellungsdatum:",
"Caption": "Bildunterschrift",
"Markdown": "Markdown",
"ASTERISK": "*"
},
"Date": {
@ -132,7 +133,9 @@
"Password protected": "Passwortgeschützt",
"Votes protected by password": "Wertungen sind passwortgeschützt",
"No password": "Kein Passwort",
"Remove password": "Passwort entfernen"
"Remove password": "Passwort entfernen",
"Rich editor": "DE_Editeur avancé",
"Simple editor": "DE_Editeur simple"
},
"Poll results": {
"Votes of the poll": "Stimmabgaben zur Umfrage",
@ -247,7 +250,10 @@
"Password confirmation": "Passwortbestätigung",
"Permissions": "Berechtigungen",
"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": {
"Back to step 1": "Zurück zum 1. Schritt",

View File

@ -132,7 +132,9 @@
"Password protected": "Password protected",
"Votes protected by password": "Votes protected by password",
"No password": "No password",
"Remove password": "Remove password"
"Remove password": "Remove password",
"Rich editor": "Rich editor",
"Simple editor": "Simple editor"
},
"Poll results": {
"Votes of the poll": "Votes",
@ -248,7 +250,10 @@
"Permissions": "Permissions",
"Optional parameters": "Optional parameters",
"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 ",
"Value Max" : "Value Max"
},

View File

@ -38,6 +38,7 @@
"Search": "Búsqueda",
"Creation date:": "Fecha de creación:",
"Caption": "Leyenda",
"Markdown": "Markdown",
"ASTERISK": "*"
},
"Date": {
@ -132,7 +133,9 @@
"Password protected": "ES_Protégé 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",
"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": {
"Votes of the poll": "Votos de la encuesta",
@ -247,7 +250,10 @@
"Password confirmation": "ES_Confirmation",
"Permissions": "ES_Permissions",
"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": {
"Back to step 1": "Volver al paso número 1",

View File

@ -38,7 +38,9 @@
"Search": "Chercher",
"Creation date:": "Date de création :",
"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": {
"dd/mm/yyyy": "jj/mm/aaaa",
@ -132,7 +134,9 @@
"Password protected": "Protégé par mot de passe",
"Votes protected by password": "Votes protégés par 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": {
"Votes of the poll": "Votes du sondage",
@ -248,9 +252,12 @@
"Permissions": "Permissions",
"Optional parameters": "Paramètres facultatifs",
"Go to step 2": "Aller à l'étape 2",
"Limit the ammount of voters per option":"limiter le nombre de votants par option",
"Value Max": "Valeur Maximale",
"ValueMax instructions": "Votants maximum par option"
"Limit the ammount of voters per option":"limiter le nombre de votants par option",
"Value Max": "Valeur Maximale",
"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": {
"Back to step 1": "Revenir à létape 1",

View File

@ -38,6 +38,7 @@
"Search": "Cercare",
"Creation date:": "Data di creazione:",
"Caption": "Titolo",
"Markdown": "Markdown",
"ASTERISK": "*"
},
"Date": {
@ -132,7 +133,9 @@
"Password protected": "Protetto da una password",
"Votes protected by password": "Voti protetti da una 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": {
"Votes of the poll": "Voti del sondaggio ",
@ -247,7 +250,10 @@
"Password confirmation": "Conferma della password",
"Permissions": "Permessi",
"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": {
"Back to step 1": "Torna al punto 1",

View File

@ -135,8 +135,12 @@
"Remove password": "Wachtwoord verwijderen"
},
"Poll results": {
"Votes of the poll": "Stemmen",
"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:",
"Vote no for": "Stem nee voor",
"Vote yes for": "Stem ja voor",

View File

@ -38,6 +38,7 @@
"Search": "Cercar",
"Creation date:": "Data de creacion:",
"Caption": "Legenda",
"Markdown": "Markdown",
"ASTERISK": "*"
},
"Date": {
@ -132,7 +133,9 @@
"Password protected": "Protegit per senhal",
"Votes protected by password": "Vòtes protegits per 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": {
"Votes of the poll": "Vòtes del sondatge",
@ -247,7 +250,10 @@
"Password confirmation": "Confirmacion",
"Permissions": "Permissions",
"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": {
"Back to step 1": "Tornar a letapa 1",

View File

@ -45,7 +45,7 @@
</div>
{/if}
<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>
</div>
</div>

View File

@ -94,4 +94,5 @@ $config = [
'default_poll_duration' => 180, // default values for the new poll duration (number of days).
/* create_classic_poll.php */
'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'}
{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>
<link rel="stylesheet" href="{"css/app/create_poll.css"|resource}">
<link rel="stylesheet" href="{"css/simplemde.min.css"|resource}">
{/block}
{block name=main}
@ -81,9 +85,12 @@
<label for="poll_comments" class="col-sm-4 control-label">{__('Generic', 'Description')}</label>
<div class="col-sm-8">
<textarea id="poll_comments" name="description"
class="form-control" {$errors['description']['aria']}
rows="5">{$poll_description|html}</textarea>
{include 'part/description_markdown.tpl'}
<div>
<textarea id="poll_comments" name="description"
class="form-control" {$errors['description']['aria']}
rows="5">{$poll_description|escape}</textarea>
</div>
</div>
</div>
{if !empty($errors['description']['msg'])}
@ -116,11 +123,18 @@
<div class="collapse" id="optionnal">
{* Poll identifier *}
<div class="form-group {$errors['customized_url']['class']}">
<label for="poll_id" class="col-sm-4 control-label">
{__('Step 1', 'Poll id')}<br/>
</label>
{* Value MAX *}
<div class="form-group">
<label for="use_valueMax" class="col-sm-4 control-label">
{__('Step 1', 'Value Max')}<br/>
@ -128,8 +142,8 @@
<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")}
<input id="use_ValueMax" name="use_ValueMax" type="checkbox" >
{__('Step 1', "Limit the ammount of voters per option")}
</label>
</div>
</div>
@ -137,19 +151,19 @@
<div class="form-group">
<div id="ValueMax"{if !$use_ValueMax} class="hidden"{/if}>
<div class="col-sm-offset-4 col-sm-8">
<label >
<label >
<input id="ValueMax" type="number" min= "0" name="ValueMax">
{__('Step 1', "ValueMax instructions")}
</label>
</div>
</div>
</div>
{* Poll identifier *}
@ -172,7 +186,6 @@
<label for="customized_url" class="col-sm-4 control-label">
<span id="pollUrlDesc" class="small">{__('Step 1', 'Poll id rules')}</span>
</label>
<div class="col-sm-8">
<div class="input-group">
<span class="input-group-addon">

View File

@ -9,6 +9,11 @@
{else}
<title>{$APPLICATION_NAME|html}</title>
{/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/datepicker3.css'|resource}">
@ -38,5 +43,8 @@
</main>
</div> <!-- .container -->
{if isset($tracking_code)}
{$tracking_code}
{/if}
</body>
</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)}
<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>
<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}
<div class="hidden js-desc text-right">
<div class="hidden js-desc">
<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>
<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>

View File

@ -7,6 +7,13 @@
<script src="{"js/app/studs.js"|resource}" type="text/javascript"></script>
<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 name=main}