2015-03-29 22:13:22 +02:00
{ extends file = 'page.tpl' }
2015-04-05 18:36:43 +02:00
{ block name = "header" }
2016-05-11 17:38:34 +02:00
<script src=" { "js/simplemde.min.js" | resource } " type="text/javascript"></script>
2016-05-12 16:20:47 +02:00
<script src=" { "js/mde-wrapper.js" | resource } " type="text/javascript"></script>
2015-04-05 18:36:43 +02:00
<script src=" { "js/app/create_poll.js" | resource } " type="text/javascript"></script>
2015-04-13 11:18:09 +02:00
<link rel="stylesheet" href=" { "css/app/create_poll.css" | resource } ">
2016-05-11 17:38:34 +02:00
<link rel="stylesheet" href=" { "css/simplemde.min.css" | resource } ">
2016-05-12 16:20:47 +02:00
2015-04-05 18:36:43 +02:00
{ /block }
2015-03-29 22:13:22 +02:00
{ block name = main }
<div class="row" style="display:none" id="form-block">
<div class="col-md-8 col-md-offset-2">
<form name="formulaire" id="formulaire" action="" method="POST" class="form-horizontal" role="form">
<div class="alert alert-info">
<p>
{ __ ( 'Step 1' , 'You are in the poll creation section.' ) } <br/>
{ __ ( 'Step 1' , 'Required fields cannot be left blank.' ) }
</p>
</div>
2015-12-05 16:03:01 +01:00
2016-07-29 16:22:12 +02:00
<div class="form-group { $errors [ 'name' ] [ 'class' ] } ">
<label for="yourname" class="col-sm-4 control-label"> { __ ( 'Generic' , 'Your name' ) } *</label>
2015-03-29 22:13:22 +02:00
<div class="col-sm-8">
2016-07-29 16:22:12 +02:00
{ if $useRemoteUser }
<input type="hidden" name="name" value=" { $form - > admin_name } " /> { $form - > admin_name }
{ else }
2018-03-29 12:54:48 +02:00
<input id="yourname" type="text" required name="name" class="form-control" { $errors [ 'name' ] [ 'aria' ] } value=" { $poll_name | html } " />
2016-07-29 16:22:12 +02:00
{ /if }
2015-03-29 22:13:22 +02:00
</div>
</div>
2016-07-29 16:22:12 +02:00
{ if ! empty ( $errors [ 'name' ] [ 'msg' ] ) }
2015-03-29 22:13:22 +02:00
<div class="alert alert-danger">
<p id="poll_title_error">
2016-07-29 16:22:12 +02:00
{ $errors [ 'name' ] [ 'msg' ] }
2015-03-29 22:13:22 +02:00
</p>
</div>
{ /if }
2016-07-29 16:22:12 +02:00
{ if $use_smtp }
2018-02-20 19:29:40 +01:00
<div class="form-group { $errors [ 'email' ] [ 'class' ] } ">
<label for="email" class="col-sm-4 control-label">
{ __ ( 'Generic' , 'Your email address' ) } *<br/>
<span class="small"> { __ ( 'Generic' , '(in the format name@mail.com)' ) } </span>
</label>
<div class="col-sm-8">
{ if $useRemoteUser }
<input type="hidden" name="mail" value=" { $form - > admin_mail } "> { $form - > admin_mail }
{ else }
2018-03-29 12:54:48 +02:00
<input id="email" required type="email" name="mail" class="form-control" { $errors [ 'email' ] [ 'aria' ] } value=" { $poll_mail | html } " />
2018-02-20 19:29:40 +01:00
{ /if }
2016-07-29 16:22:12 +02:00
</div>
2018-02-20 19:29:40 +01:00
</div>
{ if ! empty ( $errors [ 'email' ] [ 'msg' ] ) }
<div class="alert alert-danger">
<p id="poll_title_error">
{ $errors [ 'email' ] [ 'msg' ] }
</p>
</div>
{ /if }
2016-07-29 16:22:12 +02:00
{ /if }
<div class="form-group { $errors [ 'title' ] [ 'class' ] } ">
<label for="poll_title" class="col-sm-4 control-label"> { __ ( 'Step 1' , 'Poll title' ) } *</label>
<div class="col-sm-8">
2018-03-29 12:54:48 +02:00
<input id="poll_title" type="text" name="title" class="form-control" required { $errors [ 'title' ] [ 'aria' ] }
2016-07-29 16:22:12 +02:00
value=" { $poll_title | html } "/>
2015-12-05 16:03:01 +01:00
</div>
</div>
2016-07-29 16:22:12 +02:00
{ if ! empty ( $errors [ 'title' ] [ 'msg' ] ) }
2015-12-05 16:03:01 +01:00
<div class="alert alert-danger">
<p id="poll_title_error">
2016-07-29 16:22:12 +02:00
{ $errors [ 'title' ] [ 'msg' ] }
2015-12-05 16:03:01 +01:00
</p>
</div>
{ /if }
2015-12-05 14:38:24 +01:00
<div class="form-group { $errors [ 'description' ] [ 'class' ] } ">
2015-03-29 22:13:22 +02:00
<label for="poll_comments" class="col-sm-4 control-label"> { __ ( 'Generic' , 'Description' ) } </label>
<div class="col-sm-8">
2016-05-12 17:41:27 +02:00
{ include 'part/description_markdown.tpl' }
2016-05-12 16:20:47 +02:00
<div>
<textarea id="poll_comments" name="description"
class="form-control" { $errors [ 'description' ] [ 'aria' ] }
rows="5"> { $poll_description | escape } </textarea>
</div>
2015-03-29 22:13:22 +02:00
</div>
</div>
{ if ! empty ( $errors [ 'description' ] [ 'msg' ] ) }
<div class="alert alert-danger">
<p id="poll_title_error">
{ $errors [ 'description' ] [ 'msg' ] }
</p>
</div>
{ /if }
2016-08-09 01:23:30 +02:00
{ * Optionnal parameters * }
<div class="col-sm-offset-3 col-sm-1 hidden-xs">
<p class="lead">
<i class="glyphicon glyphicon-cog" aria-hidden="true"></i>
</p>
</div>
<div class="col-sm-8 col-xs-12">
<span class="lead visible-xs-inline">
<i class="glyphicon glyphicon-cog" aria-hidden="true"></i>
</span>
2018-03-29 12:54:48 +02:00
<a class="optionnal-parameters { if ! $advanced_errors } collapsed { /if } lead" role="button" data-toggle="collapse" href="#optionnal" aria-expanded=" { if $advanced_errors } false { else } true { /if } " aria-controls="optionnal">
2016-10-06 22:39:13 +02:00
{ __ ( 'Step 1' , "Optional parameters" ) }
2016-08-09 01:23:30 +02:00
<i class="caret" aria-hidden="true"></i>
<i class="caret caret-up" aria-hidden="true"></i>
</a>
2015-03-29 22:13:22 +02:00
</div>
2016-08-09 01:23:30 +02:00
<div class="clearfix"></div>
2018-03-29 12:54:48 +02:00
<div class="collapse { if $advanced_errors } in { /if } " id="optionnal" { if $advanced_errors } aria-expanded="true" { /if } >
2018-02-20 19:29:40 +01:00
{ * Poll identifier * }
2018-02-20 19:05:24 +01:00
<div class="form-group { $errors [ 'customized_url' ] [ 'class' ] } ">
2018-02-20 19:29:40 +01:00
{ * Value MAX * }
2018-03-29 12:54:48 +02:00
<div class="form-group { $errors [ 'ValueMax' ] [ 'class' ] } ">
2018-02-20 19:29:40 +01:00
<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>
2018-03-29 12:54:48 +02:00
<input id="use_ValueMax" name="use_ValueMax" type="checkbox" { if $use_ValueMax } checked { /if } >
{ __ ( 'Step 1' , "Limit the amount of voters per option" ) }
2018-02-20 19:29:40 +01:00
</label>
</div>
</div>
2018-02-20 13:06:58 +01:00
</div>
2018-03-29 12:54:48 +02:00
<div class="form-group { $errors [ 'ValueMax' ] [ 'class' ] } ">
<div id="ValueMax" { if ! $use_ValueMax } class="hidden" { /if } >
2018-02-20 19:05:24 +01:00
2018-02-20 19:29:40 +01:00
<div class="col-sm-offset-4 col-sm-8">
<label>
2018-03-29 12:54:48 +02:00
<input id="ValueMax" type="number" min="0" name="ValueMax" value=" { $ValueMax | html } " { $errors [ 'ValueMax' ] [ 'aria' ] } >
2018-02-20 19:05:24 +01:00
2018-02-20 19:29:40 +01:00
{ __ ( 'Step 1' , "ValueMax instructions" ) }
2018-02-20 13:06:58 +01:00
</label>
2018-02-20 19:05:24 +01:00
2018-02-20 19:29:40 +01:00
</div>
</div>
</div>
2018-02-20 13:06:58 +01:00
2018-03-29 12:54:48 +02:00
{ if ! empty ( $errors [ 'ValueMax' ] [ 'msg' ] ) }
<div class="alert alert-danger">
<p id="poll_customized_url_error">
{ $errors [ 'ValueMax' ] [ 'msg' ] }
</p>
</div>
{ /if }
2016-08-09 01:23:30 +02:00
2018-02-20 19:29:40 +01:00
{ * Poll identifier * }
2016-08-09 01:23:30 +02:00
<div class="form-group { $errors [ 'customized_url' ] [ 'class' ] } ">
2018-02-20 19:29:40 +01:00
<label for="poll_id" class="col-sm-4 control-label">
{ __ ( 'Step 1' , 'Poll id' ) } <br/>
2016-07-29 16:22:12 +02:00
</label>
2018-02-20 19:29:40 +01:00
2016-08-09 01:23:30 +02:00
<div class="col-sm-8">
2018-02-20 19:29:40 +01:00
<div class="checkbox">
<label>
<input id="use_customized_url" name="use_customized_url" type="checkbox" { if $use_customized_url } checked { /if } />
{ __ ( 'Step 1' , 'Customize the URL' ) }
</label>
2016-08-09 01:23:30 +02:00
</div>
2016-07-29 14:08:41 +02:00
</div>
2016-07-29 16:22:12 +02:00
</div>
2018-02-20 19:29:40 +01:00
<div id="customized_url_options" { if ! $use_customized_url } class="hidden" { /if } >
<div class="form-group { $errors [ 'customized_url' ] [ 'class' ] } ">
<label for="customized_url" class="col-sm-4 control-label">
<span id="pollUrlDesc" class="small"> { __ ( 'Step 1' , 'Poll id rules' ) } </span>
2016-07-29 16:22:12 +02:00
</label>
2018-02-20 19:29:40 +01:00
<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>
2016-08-09 01:23:30 +02:00
</div>
</div>
2018-02-20 19:29:40 +01:00
{ if ! empty ( $errors [ 'customized_url' ] [ 'msg' ] ) }
2016-08-09 01:23:30 +02:00
<div class="alert alert-danger">
2018-02-20 19:29:40 +01:00
<p id="poll_customized_url_error">
{ $errors [ 'customized_url' ] [ 'msg' ] }
2016-08-09 01:23:30 +02:00
</p>
</div>
{ /if }
2018-02-20 19:29:40 +01:00
</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">
2016-08-09 01:23:30 +02:00
<div class="checkbox">
<label>
2018-02-20 19:29:40 +01:00
<input type="checkbox" name="use_password" { if $poll_use_password } checked { /if }
id="use_password">
{ __ ( 'Step 1' , "Use a password to restrict access" ) }
2016-08-09 01:23:30 +02:00
</label>
</div>
</div>
2015-03-29 22:13:22 +02:00
2018-02-20 19:29:40 +01:00
<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>
2015-03-29 22:13:22 +02:00
</div>
</div>
2016-08-09 01:23:30 +02:00
<div class="form-group">
2018-02-20 19:29:40 +01:00
<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>
2016-08-09 01:23:30 +02:00
<label>
2018-02-20 19:29:40 +01:00
<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' ) }
2016-08-09 01:23:30 +02:00
</label>
</div>
</div>
</div>
2018-02-20 19:29:40 +01:00
{ 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>
{ /if }
2016-08-09 01:23:30 +02:00
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox">
<label>
2018-02-20 19:29:40 +01:00
<input type="checkbox" name="hidden" { if $poll_hidden } checked { /if }
id="hidden">
{ __ ( 'Step 1' , "Only the poll maker can see the poll's results" ) }
2016-08-09 01:23:30 +02:00
</label>
</div>
2018-02-20 19:29:40 +01:00
<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>
2016-08-09 01:23:30 +02:00
</div>
2015-04-05 18:36:43 +02:00
</div>
2018-04-20 20:11:10 +02:00
{ * Collect users email * }
2018-03-18 10:40:38 +01:00
<div class="form-group">
<label for="collect_mail" class="col-sm-4 control-label">
{ __ ( 'Step 1' , 'Collect users email' ) }
</label>
<div class="col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox" name="collect_users_mail"
id="collect_users_mail">
{ __ ( 'Step 1' , "Collect the polled users email addresses" ) }
</label>
</div>
</div>
2018-04-20 20:11:10 +02:00
<div id="collect_warning" class="hidden">
<div class="col-sm-offset-4 col-sm-8">
<label class="bg-danger"><i class="glyphicon glyphicon-alert"> </i> { __ ( 'Step 1' , 'Warning: anyone can access the polled users email addresses since all voters can modify any vote. You should restrict permission rules.' ) } </label>
</div>
</div>
</div>
</div> { * END div.form-group * }
</div> { * END div.collapse * }
2015-03-29 22:13:22 +02:00
<p class="text-right">
<button name=" { $goToStep2 } " value=" { $poll_type } " type="submit"
class="btn btn-success"> { __ ( 'Step 1' , 'Go to step 2' ) } </button>
</p>
<script type="text/javascript">document.formulaire.title.focus();</script>
</form>
</div>
</div>
<noscript>
<div class="alert alert-danger">
{ __ ( 'Step 1' , 'Javascript is disabled on your browser. Its activation is required to create a poll.' ) }
</div>
</noscript>
<div id="cookie-warning" class="alert alert-danger" style="display:none">
{ __ ( 'Step 1' , 'Cookies are disabled on your browser. Theirs activation is required to create a poll.' ) }
</div>
2016-07-29 16:22:12 +02:00
{ /block }