2014-12-18 12:47:51 +01:00
{ $admin = $admin | default : false }
2014-12-18 13:08:30 +01:00
2015-04-02 16:52:46 +02:00
{ if $admin } <form action=" { poll_url id = $admin_poll_id admin = true } " method="POST"> { /if }
2014-12-18 12:47:51 +01:00
<div class="jumbotron { if $admin } bg-danger { /if } ">
2015-04-11 18:08:18 +02:00
<div class="row"> { * Title | buttons* }
2014-12-18 13:08:30 +01:00
<div id="title-form" class="col-md-7">
2015-03-30 15:19:56 +02:00
<h3> { $poll - > title | html } { if $admin & & ! $expired } <button class="btn btn-link btn-sm btn-edit" title=" { __ ( 'PollInfo' , 'Edit the title' ) } "><span class="glyphicon glyphicon-pencil"></span><span class="sr-only"> { __ ( 'Generic' , 'Edit' ) } </span></button> { /if } </h3>
2015-02-28 19:18:59 +01:00
{ if $admin & & ! $expired }
2014-12-18 12:47:51 +01:00
<div class="hidden js-title">
2015-03-30 15:19:56 +02:00
<label class="sr-only" for="newtitle"> { __ ( 'PollInfo' , 'Title' ) } </label>
2014-12-18 12:47:51 +01:00
<div class="input-group">
2015-01-11 14:59:25 +01:00
<input type="text" class="form-control" id="newtitle" name="title" size="40" value=" { $poll - > title | html } " />
2014-12-18 12:47:51 +01:00
<span class="input-group-btn">
2015-03-30 15:19:56 +02:00
<button type="submit" class="btn btn-success" name="update_poll_info" value="title" title=" { __ ( 'PollInfo' , 'Save the new title' ) } "><span class="glyphicon glyphicon-ok"></span><span class="sr-only"> { __ ( 'Generic' , 'Save' ) } </span></button>
<button class="btn btn-link btn-cancel" title=" { __ ( 'PollInfo' , 'Cancel the title edit' ) } "><span class="glyphicon glyphicon-remove"></span><span class="sr-only"> { __ ( 'Generic' , 'Cancel' ) } </span></button>
2014-12-18 12:47:51 +01:00
</span>
</div>
</div>
2014-12-17 23:43:06 +01:00
{ /if }
2014-12-17 23:12:05 +01:00
</div>
2015-01-04 02:00:02 +01:00
<div class="col-md-5 hidden-print">
2014-12-18 12:47:51 +01:00
<div class="btn-group pull-right">
2015-03-30 15:19:56 +02:00
<button onclick="print(); return false;" class="btn btn-default"><span class="glyphicon glyphicon-print"></span> { __ ( 'PollInfo' , 'Print' ) } </button>
2016-10-06 21:13:01 +02:00
{ if $admin }
<a href=" { $SERVER_URL | html } exportcsv.php?admin= { $admin_poll_id | html } " class="btn btn-default"><span class="glyphicon glyphicon-download-alt"></span> { __ ( 'PollInfo' , 'Export to CSV' ) } </a>
{ else }
{ if ! $hidden }
<a href=" { $SERVER_URL | html } exportcsv.php?poll= { $poll_id | html } " class="btn btn-default"><span class="glyphicon glyphicon-download-alt"></span> { __ ( 'PollInfo' , 'Export to CSV' ) } </a>
{ /if }
{ /if }
2016-05-04 01:51:49 +02:00
{ if $admin }
{ if ! $expired }
2014-12-18 12:47:51 +01:00
<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown">
2015-03-30 15:19:56 +02:00
<span class="glyphicon glyphicon-trash"></span> <span class="sr-only"> { __ ( 'Generic' , 'Remove' ) } </span> <span class="caret"></span>
2014-12-18 12:47:51 +01:00
</button>
<ul class="dropdown-menu" role="menu">
2015-03-30 15:19:56 +02:00
<li><button class="btn btn-link" type="submit" name="remove_all_votes"> { __ ( 'PollInfo' , 'Remove all the votes' ) } </button></li>
<li><button class="btn btn-link" type="submit" name="remove_all_comments"> { __ ( 'PollInfo' , 'Remove all the comments' ) } </button></li>
2014-12-18 12:47:51 +01:00
<li class="divider" role="presentation"></li>
2015-03-30 15:19:56 +02:00
<li><button class="btn btn-link" type="submit" name="delete_poll"> { __ ( 'PollInfo' , 'Remove the poll' ) } </button></li>
2014-12-18 12:47:51 +01:00
</ul>
2016-05-04 01:51:49 +02:00
{ else }
<button class="btn btn-danger" type="submit" name="delete_poll" title=" { __ ( 'PollInfo' , 'Remove the poll' ) } ">
<span class="glyphicon glyphicon-trash"></span>
<span class="sr-only"> { __ ( 'PollInfo' , 'Remove the poll' ) } </span>
</button>
{ /if }
2014-12-18 12:47:51 +01:00
{ /if }
</div>
2014-12-17 23:12:05 +01:00
</div>
2014-12-17 23:43:06 +01:00
</div>
2015-04-11 18:08:18 +02:00
<div class="row"> { * Admin name + email | Description * }
2015-04-14 22:43:04 +02:00
<div class="form-group col-md-4">
2015-04-11 18:08:18 +02:00
<div id="name-form">
2015-04-14 22:43:04 +02:00
<label class="control-label"> { __ ( 'PollInfo' , 'Initiator of the poll' ) } </label>
2015-04-11 18:08:18 +02:00
<p class="form-control-static"> { $poll - > admin_name | html } { if $admin & & ! $expired } <button class="btn btn-link btn-sm btn-edit" title=" { __ ( 'PollInfo' , 'Edit the name' ) } "><span class="glyphicon glyphicon-pencil"></span><span class="sr-only"> { __ ( 'Generic' , 'Edit' ) } </span></button> { /if } </p>
{ if $admin & & ! $expired }
<div class="hidden js-name">
<label class="sr-only" for="newname"> { __ ( 'PollInfo' , 'Initiator of the poll' ) } </label>
<div class="input-group">
<input type="text" class="form-control" id="newname" name="name" size="40" value=" { $poll - > admin_name | html } " />
<span class="input-group-btn">
<button type="submit" class="btn btn-success" name="update_poll_info" value="name" title=" { __ ( 'PollInfo' , 'Save the new name' ) } "><span class="glyphicon glyphicon-ok"></span><span class="sr-only"> { __ ( 'Generic' , 'Save' ) } </span></button>
<button class="btn btn-link btn-cancel" title=" { __ ( 'PollInfo' , 'Cancel the name edit' ) } "><span class="glyphicon glyphicon-remove"></span><span class="sr-only"> { __ ( 'Generic' , 'Cancel' ) } </span></button>
</span>
</div>
2015-01-08 22:03:44 +01:00
</div>
2015-04-11 18:08:18 +02:00
{ /if }
2015-01-08 22:03:44 +01:00
</div>
2015-04-11 18:08:18 +02:00
{ if $admin }
2015-01-11 14:59:25 +01:00
<div id="email-form">
2015-03-30 15:19:56 +02:00
<p> { $poll - > admin_mail | html } { if ! $expired } <button class="btn btn-link btn-sm btn-edit" title=" { __ ( 'PollInfo' , 'Edit the email adress' ) } "><span class="glyphicon glyphicon-pencil"></span><span class="sr-only"> { __ ( 'Generic' , 'Edit' ) } </span></button> { /if } </p>
2015-02-28 19:18:59 +01:00
{ if ! $expired }
2015-04-11 18:08:18 +02:00
<div class="hidden js-email">
<label class="sr-only" for="admin_mail"> { __ ( 'PollInfo' , 'Email' ) } </label>
<div class="input-group">
<input type="text" class="form-control" id="admin_mail" name="admin_mail" size="40" value=" { $poll - > admin_mail | html } " />
2015-01-11 14:59:25 +01:00
<span class="input-group-btn">
2015-03-30 15:19:56 +02:00
<button type="submit" name="update_poll_info" value="admin_mail" class="btn btn-success" title=" { __ ( 'PollInfo' , 'Save the email address' ) } "><span class="glyphicon glyphicon-ok"></span><span class="sr-only"> { __ ( 'Generic' , 'Save' ) } </span></button>
<button class="btn btn-link btn-cancel" title=" { __ ( 'PollInfo' , 'Cancel the email address edit' ) } "><span class="glyphicon glyphicon-remove"></span><span class="sr-only"> { __ ( 'Generic' , 'Cancel' ) } </span></button>
2015-01-11 14:59:25 +01:00
</span>
2015-04-11 18:08:18 +02:00
</div>
2014-12-18 13:08:30 +01:00
</div>
2015-02-28 19:18:59 +01:00
{ /if }
2015-01-11 14:59:25 +01:00
</div>
2015-04-11 18:08:18 +02:00
{ /if }
2014-12-17 23:43:06 +01:00
</div>
2015-04-15 13:23:19 +02:00
{ if $admin | | preg_match ( '/[^ \r\n]/' , $poll - > description ) }
2015-04-15 13:16:55 +02:00
<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>
2016-05-11 17:38:34 +02:00
<div class="form-control-static well poll-description"> { $poll - > description | markdown : false : false } </div>
2015-04-15 13:16:55 +02:00
{ if $admin & & ! $expired }
2016-05-11 17:38:34 +02:00
<div class="hidden js-desc">
2015-04-15 13:16:55 +02:00
<label class="sr-only" for="newdescription"> { __ ( 'Generic' , 'Description' ) } </label>
2016-05-12 17:41:27 +02:00
{ include 'part/description_markdown.tpl' }
2015-04-15 13:16:55 +02:00
<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>
</div>
{ /if }
</div>
{ /if }
2014-12-18 12:47:51 +01:00
</div>
2015-04-11 18:08:18 +02:00
<div class="row">
</div>
2014-12-18 12:47:51 +01:00
<div class="row">
2015-01-08 00:27:40 +01:00
<div class="form-group form-group { if $admin } col-md-4 { else } col-md-6 { /if } ">
2015-04-02 16:52:46 +02:00
<label for="public-link"><a class="public-link" href=" { poll_url id = $poll_id } "> { __ ( 'PollInfo' , 'Public link of the poll' ) } <span class="btn-link glyphicon glyphicon-link"></span></a></label>
2016-03-05 16:35:13 +01:00
<input class="form-control" id="public-link" type="text" readonly="readonly" value=" { poll_url id = $poll_id } " onclick="select();"/>
2014-12-17 23:43:06 +01:00
</div>
2014-12-18 12:47:51 +01:00
{ if $admin }
2015-01-08 00:27:40 +01:00
<div class="form-group col-md-4">
2015-04-02 16:52:46 +02:00
<label for="admin-link"><a class="admin-link" href=" { poll_url id = $admin_poll_id admin = true } "> { __ ( 'PollInfo' , 'Admin link of the poll' ) } <span class="btn-link glyphicon glyphicon-link"></span></a></label>
2016-03-05 16:35:13 +01:00
<input class="form-control" id="admin-link" type="text" readonly="readonly" value=" { poll_url id = $admin_poll_id admin = true } " onclick="select();"/>
2014-12-18 12:47:51 +01:00
</div>
2015-01-08 00:27:40 +01:00
<div id="expiration-form" class="form-group col-md-4">
2015-04-14 22:43:04 +02:00
<label class="control-label"> { __ ( 'PollInfo' , 'Expiration date' ) } </label>
2016-05-04 01:36:42 +02:00
<p> { $poll - > end_date | date_format : $date_format [ 'txt_date' ] | html } <button class="btn btn-link btn-sm btn-edit" title=" { __ ( 'PollInfo' , 'Edit the expiration date' ) } "><span class="glyphicon glyphicon-pencil"></span><span class="sr-only"> { __ ( 'Generic' , 'Edit' ) } </span></button></p>
2015-01-08 00:27:40 +01:00
<div class="hidden js-expiration">
2015-03-30 15:19:56 +02:00
<label class="sr-only" for="newexpirationdate"> { __ ( 'PollInfo' , 'Expiration date' ) } </label>
2015-01-08 00:27:40 +01:00
<div class="input-group">
2015-01-11 14:59:25 +01:00
<input type="text" class="form-control" id="newexpirationdate" name="expiration_date" size="40" value=" { $poll - > end_date | date_format : $date_format [ 'txt_date' ] | html } " />
2015-01-08 00:27:40 +01:00
<span class="input-group-btn">
2015-03-30 15:19:56 +02:00
<button type="submit" class="btn btn-success" name="update_poll_info" value="expiration_date" title=" { __ ( 'PollInfo' , 'Save the new expiration date' ) } "><span class="glyphicon glyphicon-ok"></span><span class="sr-only"> { __ ( 'Generic' , 'Save' ) } </span></button>
<button class="btn btn-link btn-cancel" title=" { __ ( 'PollInfo' , 'Cancel the expiration date edit' ) } "><span class="glyphicon glyphicon-remove"></span><span class="sr-only"> { __ ( 'Generic' , 'Cancel' ) } </span></button>
2015-01-08 00:27:40 +01:00
</span>
</div>
</div>
2016-05-04 01:36:42 +02:00
2014-12-18 12:47:51 +01:00
</div>
{ /if }
</div>
2014-12-18 23:57:00 +01:00
{ if $admin }
2014-12-18 13:23:47 +01:00
<div class="row">
2015-10-30 20:45:18 +01:00
<div class="col-md-4">
<div id="password-form">
{ if ! empty ( $poll - > password_hash ) & & ! $poll - > results_publicly_visible }
2016-03-14 23:37:58 +01:00
{ $password_text = __ ( 'PollInfo' , 'Password protected' ) }
2015-10-30 20:45:18 +01:00
{ elseif ! empty ( $poll - > password_hash ) & & $poll - > results_publicly_visible }
2016-03-14 23:37:58 +01:00
{ $password_text = __ ( 'PollInfo' , 'Votes protected by password' ) }
2015-10-30 20:45:18 +01:00
{ else }
2016-03-14 23:37:58 +01:00
{ $password_text = __ ( 'PollInfo' , 'No password' ) }
2015-10-30 20:45:18 +01:00
{ /if }
<p class=""><span class="glyphicon glyphicon-lock"> </span> { $password_text } <button class="btn btn-link btn-sm btn-edit" title=" { __ ( 'PollInfo' , 'Edit the poll rules' ) } "><span class="glyphicon glyphicon-pencil"></span><span class="sr-only"> { __ ( 'Generic' , 'Edit' ) } </span></button></p>
<div class="hidden js-password">
<button class="btn btn-link btn-cancel" title=" { __ ( 'PollInfo' , 'Cancel the rules edit' ) } "><span class="glyphicon glyphicon-remove"></span><span class="sr-only"> { __ ( 'Generic' , 'Cancel' ) } </span></button>
{ if ! empty ( $poll - > password_hash ) }
<div class="input-group">
<input type="checkbox" id="removePassword" name="removePassword"/>
2016-03-14 23:37:58 +01:00
<label for="removePassword"> { __ ( 'PollInfo' , 'Remove password' ) } </label>
2015-10-30 20:45:18 +01:00
<button type="submit" name="update_poll_info" value="removePassword" class="btn btn-success hidden" title=" { __ ( 'PollInfo' , 'Save the new rules' ) } "><span class="glyphicon glyphicon-ok"></span><span class="sr-only"> { __ ( 'Generic' , 'Remove password.' ) } </span></button>
</div>
{ /if }
<div id="password_information">
<div class="input-group">
2017-11-20 10:54:34 +01:00
<input type="checkbox" id="resultsPubliclyVisible" name="resultsPubliclyVisible" { if $poll - > results_publicly_visible & & $poll - > hidden = = false & & ( ! empty ( $poll - > password_hash ) ) } checked="checked" { elseif ( $poll - > hidden = = true | | empty ( $poll - > password_hash ) ) } disabled="disabled" { /if } />
<label for="resultsPubliclyVisible"> { __ ( 'PollInfo' , 'Only votes are protected' ) } </label>
2015-10-30 20:45:18 +01:00
</div>
<div class="input-group">
<input type="text" class="form-control" id="password" name="password"/>
<span class="input-group-btn">
<button type="submit" name="update_poll_info" value="password" class="btn btn-success" title=" { __ ( 'PollInfo' , 'Save the new rules' ) } "><span class="glyphicon glyphicon-ok"></span><span class="sr-only"> { __ ( 'Generic' , 'Save' ) } </span></button>
</span>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4 ">
2015-04-06 12:39:58 +02:00
<div id="poll-hidden-form">
{ if $poll - > hidden }
{ $hidden_icon = "glyphicon-eye-close" }
2016-03-14 23:37:58 +01:00
{ $hidden_text = __ ( 'PollInfo' , 'Results are hidden' ) }
2015-04-06 12:39:58 +02:00
{ else }
{ $hidden_icon = "glyphicon-eye-open" }
2016-03-14 23:37:58 +01:00
{ $hidden_text = __ ( 'PollInfo' , 'Results are visible' ) }
2015-04-06 12:39:58 +02:00
{ /if }
<p class=""><span class="glyphicon { $hidden_icon } "> </span> { $hidden_text } <button class="btn btn-link btn-sm btn-edit" title=" { __ ( 'PollInfo' , 'Edit the poll rules' ) } "><span class="glyphicon glyphicon-pencil"></span><span class="sr-only"> { __ ( 'Generic' , 'Edit' ) } </span></button></p>
<div class="hidden js-poll-hidden">
<div class="input-group">
<input type="checkbox" id="hidden" name="hidden" { if $poll - > hidden } checked="checked" { /if } />
2016-03-14 23:37:58 +01:00
<label for="hidden"> { __ ( 'PollInfo' , 'Results are hidden' ) } </label>
2015-04-06 12:39:58 +02:00
<span class="input-group-btn">
<button type="submit" name="update_poll_info" value="hidden" class="btn btn-success" title=" { __ ( 'PollInfo' , 'Save the new rules' ) } "><span class="glyphicon glyphicon-ok"></span><span class="sr-only"> { __ ( 'Generic' , 'Save' ) } </span></button>
<button class="btn btn-link btn-cancel" title=" { __ ( 'PollInfo' , 'Cancel the rules edit' ) } "><span class="glyphicon glyphicon-remove"></span><span class="sr-only"> { __ ( 'Generic' , 'Cancel' ) } </span></button>
</span>
</div>
</div>
</div>
</div>
<div class="col-md-4" >
2014-12-18 13:23:47 +01:00
<div id="poll-rules-form">
{ if $poll - > active }
{ if $poll - > editable }
2015-04-06 12:39:58 +02:00
{ if $poll - > editable = = constant ( "Framadate\Editable::EDITABLE_BY_ALL" ) }
{ $rule_id = 2 }
2016-03-05 18:02:22 +01:00
{ $rule_txt = __ ( 'Step 1' , 'All voters can modify any vote' ) }
2015-04-06 12:39:58 +02:00
{ else }
{ $rule_id = 3 }
2016-03-05 18:02:22 +01:00
{ $rule_txt = __ ( 'Step 1' , 'Voters can modify their vote themselves' ) }
2015-04-06 12:39:58 +02:00
{ /if }
2014-12-18 13:23:47 +01:00
{ $rule_icon = '<span class="glyphicon glyphicon-edit"></span>' }
2016-03-05 18:02:22 +01:00
{ else }
2014-12-18 13:23:47 +01:00
{ $rule_id = 1 }
{ $rule_icon = '<span class="glyphicon glyphicon-check"></span>' }
2016-03-05 18:24:07 +01:00
{ $rule_txt = __ ( 'Step 1' , 'Votes cannot be modified' ) }
2014-12-18 13:23:47 +01:00
{ /if }
{ else }
{ $rule_id = 0 }
{ $rule_icon = '<span class="glyphicon glyphicon-lock"></span>' }
2015-03-30 15:19:56 +02:00
{ $rule_txt = __ ( 'PollInfo' , 'Votes and comments are locked' ) }
2014-12-18 13:23:47 +01:00
{ /if }
2016-05-04 01:36:42 +02:00
<p class=""> { $rule_icon } { $rule_txt | html } <button class="btn btn-link btn-sm btn-edit" title=" { __ ( 'PollInfo' , 'Edit the poll rules' ) } "><span class="glyphicon glyphicon-pencil"></span><span class="sr-only"> { __ ( 'Generic' , 'Edit' ) } </span></button></p>
2014-12-18 13:23:47 +01:00
<div class="hidden js-poll-rules">
2015-03-30 15:19:56 +02:00
<label class="sr-only" for="rules"> { __ ( 'PollInfo' , 'Poll rules' ) } </label>
2014-12-18 13:23:47 +01:00
<div class="input-group">
<select class="form-control" id="rules" name="rules">
2015-03-30 15:19:56 +02:00
<option value="0" { if $rule_id = = 0 } selected="selected" { /if } > { __ ( 'PollInfo' , 'Votes and comments are locked' ) } </option>
2016-03-05 18:24:07 +01:00
<option value="1" { if $rule_id = = 1 } selected="selected" { /if } > { __ ( 'Step 1' , 'Votes cannot be modified' ) } </option>
2016-03-05 18:02:22 +01:00
<option value="3" { if $rule_id = = 3 } selected="selected" { /if } > { __ ( 'Step 1' , 'Voters can modify their vote themselves' ) } </option>
<option value="2" { if $rule_id = = 2 } selected="selected" { /if } > { __ ( 'Step 1' , 'All voters can modify any vote' ) } </option>
2014-12-18 13:23:47 +01:00
</select>
<span class="input-group-btn">
2015-03-30 15:19:56 +02:00
<button type="submit" name="update_poll_info" value="rules" class="btn btn-success" title=" { __ ( 'PollInfo' , 'Save the new rules' ) } "><span class="glyphicon glyphicon-ok"></span><span class="sr-only"> { __ ( 'Generic' , 'Save' ) } </span></button>
<button class="btn btn-link btn-cancel" title=" { __ ( 'PollInfo' , 'Cancel the rules edit' ) } "><span class="glyphicon glyphicon-remove"></span><span class="sr-only"> { __ ( 'Generic' , 'Cancel' ) } </span></button>
2014-12-18 13:23:47 +01:00
</span>
</div>
</div>
</div>
</div>
</div>
{ /if }
2014-12-17 23:43:06 +01:00
</div>
2014-12-18 13:08:30 +01:00
{ if $admin } </form> { /if }