UI : Add availability to edit poll title

This commit is contained in:
Olivier PEREZ 2014-12-18 12:47:51 +01:00
parent 410d2127ce
commit 94380c6182
2 changed files with 61 additions and 46 deletions

View File

@ -1,14 +1,28 @@
{* TODO Add a form maybe *} {* TODO Add a form maybe *}
<div class="jumbotron{if $admin} bg-danger{/if}"> {$admin = $admin|default:false}
<form action="{$admin_poll_id|poll_url:true}" method="POST" id="title-form">
<div class="jumbotron{if $admin} bg-danger{/if}">
<div class="row"> <div class="row">
<div class="col-md-7"> <div class="col-md-7">
<h3>{$poll->title}</h3> <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">
<label class="sr-only" for="newtitle">{_("Title")}</label>
<div class="input-group">
<input type="text" class="form-control" id="newtitle" name="title" size="40" value="{$poll->title}" />
<span class="input-group-btn">
<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>
</span>
</div>
</div>
{/if}
</div> </div>
<div class="col-md-5"> <div class="col-md-5">
<div class="btn-group pull-right"> <div class="btn-group pull-right">
<button onclick="print(); return false;" class="btn btn-default"><span class="glyphicon glyphicon-print"></span> {_('Print')}</button> <button onclick="print(); return false;" class="btn btn-default"><span class="glyphicon glyphicon-print"></span> {_('Print')}</button>
<a href="{$SERVER_URL}export.php?poll={$poll_id}&mode=csv" class="btn btn-default"><span class="glyphicon glyphicon-download-alt"></span> {_('Export to CSV')}</a> <a href="{$SERVER_URL}export.php?poll={$poll_id}&mode=csv" class="btn btn-default"><span class="glyphicon glyphicon-download-alt"></span> {_('Export to CSV')}</a>
{if $admin|default:false} {if $admin}
<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown">
<span class="glyphicon glyphicon-trash"></span> <span class="sr-only">' . _("Remove") . '</span> <span class="caret"></span> <span class="glyphicon glyphicon-trash"></span> <span class="sr-only">' . _("Remove") . '</span> <span class="caret"></span>
</button> </button>
@ -51,4 +65,5 @@
</div> </div>
{/if} {/if}
</div> </div>
</div> </div>
</form>

View File

@ -8,7 +8,7 @@
{* Global informations about the current poll *} {* Global informations about the current poll *}
{include 'part/poll_info.tpl'} {include 'part/poll_info.tpl' admin=$admin}
{* Information about voting *} {* Information about voting *}