2014-12-17 23:43:06 +01:00
{ * TODO Add a form maybe * }
2014-12-18 12:47:51 +01:00
{ $admin = $admin | default : false }
2014-12-18 13:08:30 +01:00
{ if $admin } <form action=" { $admin_poll_id | poll_url : true } " method="POST"> { /if }
2014-12-18 12:47:51 +01:00
<div class="jumbotron { if $admin } bg-danger { /if } ">
<div class="row">
2014-12-18 13:08:30 +01:00
<div id="title-form" class="col-md-7">
2014-12-18 12:47:51 +01:00
<h3> { $poll - > title } { if $admin } <button class="btn btn-link btn-sm btn-edit" title=" { _ ( 'Edit the title' ) } "><span class="glyphicon glyphicon-pencil"></span><span class="sr-only"> { _ ( 'Edit' ) } </span></button> { /if } </h3>
{ if $admin }
<div class="hidden js-title">
2015-01-08 22:03:44 +01:00
<label class="sr-only" for="newtitle"> { _ ( 'Title' ) } </label>
2014-12-18 12:47:51 +01:00
<div class="input-group">
<input type="text" class="form-control" id="newtitle" name="title" size="40" value=" { $poll - > title } " />
<span class="input-group-btn">
2015-01-08 00:27:40 +01:00
<button type="submit" class="btn btn-success" name="update_poll_info" value="title" title=" { _ ( 'Save the new title' ) } "><span class="glyphicon glyphicon-ok"></span><span class="sr-only"> { _ ( 'Save' ) } </span></button>
<button class="btn btn-link btn-cancel" title=" { _ ( 'Cancel the title edit' ) } "><span class="glyphicon glyphicon-remove"></span><span class="sr-only"> { _ ( '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">
<button onclick="print(); return false;" class="btn btn-default"><span class="glyphicon glyphicon-print"></span> { _ ( 'Print' ) } </button>
2015-01-03 17:24:39 +01:00
<a href=" { $SERVER_URL } exportcsv.php?poll= { $poll_id } " class="btn btn-default"><span class="glyphicon glyphicon-download-alt"></span> { _ ( 'Export to CSV' ) } </a>
2014-12-18 12:47:51 +01:00
{ if $admin }
<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown">
2014-12-18 13:08:30 +01:00
<span class="glyphicon glyphicon-trash"></span> <span class="sr-only"> { _ ( "Remove" ) } </span> <span class="caret"></span>
2014-12-18 12:47:51 +01:00
</button>
<ul class="dropdown-menu" role="menu">
<li><button class="btn btn-link" type="submit" name="remove_all_votes"> { _ ( 'Remove all the votes' ) } </button></li>
<li><button class="btn btn-link" type="submit" name="remove_all_comments"> { _ ( 'Remove all the comments' ) } </button></li>
<li class="divider" role="presentation"></li>
2015-01-08 00:27:40 +01:00
<li><button class="btn btn-link" type="submit" name="delete_poll"> { _ ( 'Remove the poll' ) } </button></li>
2014-12-18 12:47:51 +01:00
</ul>
{ /if }
</div>
2014-12-17 23:12:05 +01:00
</div>
2014-12-17 23:43:06 +01:00
</div>
2015-01-08 22:03:44 +01:00
<div class="row">
<div id="name-form" class="form-group col-md-5">
<h4 class="control-label"> { _ ( 'Initiator of the poll' ) } </h4>
<p class="form-control-static"> { $poll - > admin_name } { if $admin } <button class="btn btn-link btn-sm btn-edit" title=" { _ ( 'Edit the initiator' ) } "><span class="glyphicon glyphicon-pencil"></span><span class="sr-only"> { _ ( 'Edit' ) } </span></button> { /if } </p>
{ if $admin }
<div class="hidden js-name">
<label class="sr-only" for="newname"> { _ ( '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 } " />
<span class="input-group-btn">
<button type="submit" class="btn btn-success" name="update_poll_info" value="name" title=" { _ ( 'Save the new name' ) } "><span class="glyphicon glyphicon-ok"></span><span class="sr-only"> { _ ( 'Save' ) } </span></button>
<button class="btn btn-link btn-cancel" title=" { _ ( 'Cancel the name edit' ) } "><span class="glyphicon glyphicon-remove"></span><span class="sr-only"> { _ ( 'Cancel' ) } </span></button>
</span>
</div>
</div>
</div>
</div>
2014-12-18 12:47:51 +01:00
<div class="row">
2014-12-17 23:43:06 +01:00
<div class="form-group col-md-5">
2015-01-08 22:03:44 +01:00
{ /if }
2014-12-18 13:08:30 +01:00
{ if $admin }
<div id="email-form">
<p> { $poll - > admin_mail } <button class="btn btn-link btn-sm btn-edit" title=" { _ ( 'Edit the email adress' ) } "><span class="glyphicon glyphicon-pencil"></span><span class="sr-only"> { _ ( 'Edit' ) } </span></button></p>
<div class="hidden js-email">
2015-01-08 22:03:44 +01:00
<label class="sr-only" for="admin_mail"> { _ ( 'Email adress' ) } </label>
2014-12-18 13:08:30 +01:00
<div class="input-group">
2015-01-07 23:30:55 +01:00
<input type="text" class="form-control" id="admin_mail" name="admin_mail" size="40" value=" { $poll - > admin_mail } " />
2014-12-18 13:08:30 +01:00
<span class="input-group-btn">
<button type="submit" name="update_poll_info" value="admin_mail" class="btn btn-success" title=" { _ ( 'Save the email address ' ) } "><span class="glyphicon glyphicon-ok"></span><span class="sr-only"> { _ ( 'Save' ) } </span></button>
<button class="btn btn-link btn-cancel" title=" { _ ( 'Cancel the email address edit' ) } "><span class="glyphicon glyphicon-remove"></span><span class="sr-only"> { _ ( 'Cancel' ) } </span></button>
</span>
</div>
</div>
</div>
{ /if }
2014-12-17 23:43:06 +01:00
</div>
2014-12-18 12:47:51 +01:00
{ if ! empty ( $poll - > comment ) }
2014-12-18 13:08:30 +01:00
<div class="form-group col-md-7" id="description-form">
<h4 class="control-label"> { _ ( "Description" ) } { if $admin } <button class="btn btn-link btn-sm btn-edit" title=" { _ ( 'Edit the description' ) } "><span class="glyphicon glyphicon-pencil"></span><span class="sr-only"> { _ ( 'Edit' ) } </span></button> { /if } </h4>
2014-12-18 12:47:51 +01:00
<p class="form-control-static well"> { $poll - > comment } </p>
2014-12-18 13:08:30 +01:00
<div class="hidden js-desc text-right">
2015-01-08 22:03:44 +01:00
<label class="sr-only" for="newdescription"> { _ ( 'Description' ) } </label>
2014-12-18 13:08:30 +01:00
<textarea class="form-control" id="newdescription" name="comment" rows="2" cols="40"> { $poll - > comment } </textarea>
<button type="submit" id="btn-new-desc" name="update_poll_info" value="comment" class="btn btn-sm btn-success" title=" { _ ( "Save the description" ) } "><span class="glyphicon glyphicon-ok"></span><span class="sr-only"> { _ ( 'Save' ) } </span></button>
<button class="btn btn-default btn-sm btn-cancel" title=" { _ ( 'Cancel the description edit' ) } "><span class="glyphicon glyphicon-remove"></span><span class="sr-only"> { _ ( 'Cancel' ) } </span></button>
</div>
2014-12-18 12:47:51 +01:00
</div>
{ /if }
</div>
<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-01-08 22:03:44 +01:00
<label for="public-link"><a class="public-link" href=" { $poll_id | poll_url } "> { _ ( 'Public link of the poll' ) } <span class="btn-link glyphicon glyphicon-link"></span></a></label>
2014-12-18 12:47:51 +01:00
<input class="form-control" id="public-link" type="text" readonly="readonly" value=" { $poll_id | poll_url } " />
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-01-08 22:03:44 +01:00
<label for="admin-link"><a class="admin-link" href=" { $admin_poll_id | poll_url : true } "> { _ ( 'Admin link of the poll' ) } <span class="btn-link glyphicon glyphicon-link"></span></a></label>
2014-12-18 12:47:51 +01:00
<input class="form-control" id="admin-link" type="text" readonly="readonly" value=" { $admin_poll_id | poll_url : true } " />
</div>
2015-01-08 00:27:40 +01:00
<div id="expiration-form" class="form-group col-md-4">
2015-01-08 22:03:44 +01:00
<h4 class="control-label"> { _ ( 'Expiration\'s date' ) } </h4>
2015-01-08 22:15:52 +01:00
<p> { $poll - > end_date | date_format : $date_format [ 'txt_date' ] } { if $admin } <button class="btn btn-link btn-sm btn-edit" title=" { _ ( 'Edit the expiration\'s date' ) } "><span class="glyphicon glyphicon-pencil"></span><span class="sr-only"> { _ ( 'Edit' ) } </span></button> { /if } </p>
2015-01-08 00:27:40 +01:00
{ if $admin }
<div class="hidden js-expiration">
2015-01-08 22:15:52 +01:00
<label class="sr-only" for="newexpirationdate"> { _ ( 'Expiration\'s date' ) } </label>
2015-01-08 00:27:40 +01:00
<div class="input-group">
2015-01-08 22:03:44 +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' ] } " />
2015-01-08 00:27:40 +01:00
<span class="input-group-btn">
<button type="submit" class="btn btn-success" name="update_poll_info" value="expiration_date" title=" { _ ( 'Save the new expiration date' ) } "><span class="glyphicon glyphicon-ok"></span><span class="sr-only"> { _ ( 'Save' ) } </span></button>
<button class="btn btn-link btn-cancel" title=" { _ ( 'Cancel the expiration date edit' ) } "><span class="glyphicon glyphicon-remove"></span><span class="sr-only"> { _ ( 'Cancel' ) } </span></button>
</span>
</div>
</div>
{ /if }
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-01-08 00:27:40 +01:00
<div class="col-md-4 col-md-offset-8" >
2014-12-18 13:23:47 +01:00
<div id="poll-rules-form">
{ if $poll - > active }
{ if $poll - > editable }
{ $rule_id = 2 }
{ $rule_icon = '<span class="glyphicon glyphicon-edit"></span>' }
{ $rule_txt = _ ( 'Votes are editable' ) }
{ else }
{ $rule_id = 1 }
{ $rule_icon = '<span class="glyphicon glyphicon-check"></span>' }
{ $rule_txt = _ ( 'Votes and comments are open' ) }
{ /if }
{ else }
{ $rule_id = 0 }
{ $rule_icon = '<span class="glyphicon glyphicon-lock"></span>' }
{ $rule_txt = _ ( 'Votes and comments are locked' ) }
{ /if }
2015-01-08 00:27:40 +01:00
<p class=""> { $rule_icon } { $rule_txt } <button class="btn btn-link btn-sm btn-edit" title=" { _ ( 'Edit the poll rules' ) } "><span class="glyphicon glyphicon-pencil"></span><span class="sr-only"> { _ ( 'Edit' ) } </span></button></p>
2014-12-18 13:23:47 +01:00
<div class="hidden js-poll-rules">
2015-01-07 23:30:55 +01:00
<label class="sr-only" for="rules"> { _ ( "Poll rules" ) } </label>
2014-12-18 13:23:47 +01:00
<div class="input-group">
<select class="form-control" id="rules" name="rules">
<option value="0" { if $rule_id = = 0 } selected="selected" { /if } > { _ ( "Votes and comments are locked" ) } </option>
<option value="1" { if $rule_id = = 1 } selected="selected" { /if } > { _ ( "Votes and comments are open" ) } </option>
<option value="2" { if $rule_id = = 2 } selected="selected" { /if } > { _ ( "Votes are editable" ) } </option>
</select>
<span class="input-group-btn">
<button type="submit" name="update_poll_info" value="rules" class="btn btn-success" title=" { _ ( 'Save the new rules' ) } "><span class="glyphicon glyphicon-ok"></span><span class="sr-only"> { _ ( 'Save' ) } </span></button>
<button class="btn btn-link btn-cancel" title=" { _ ( 'Cancel the rules edit' ) } "><span class="glyphicon glyphicon-remove"></span><span class="sr-only"> { _ ( 'Cancel' ) } </span></button>
</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 }