Split the create poll (step 1) template into parts
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
e793a77b2a
commit
bd748e5da7
@ -60,9 +60,9 @@ $(document).ready(function () {
|
||||
*/
|
||||
$("#use_ValueMax").change(function () {
|
||||
if ($(this).prop("checked")) {
|
||||
$("#ValueMax").removeClass("hidden");
|
||||
$("#valueMaxWrapper").removeClass("hidden");
|
||||
} else {
|
||||
$("#ValueMax").addClass("hidden");
|
||||
$("#valueMaxWrapper").addClass("hidden");
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
<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}
|
||||
@ -14,357 +13,9 @@
|
||||
<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>
|
||||
|
||||
<div class="form-group {$errors['name']['class']}">
|
||||
<label for="yourname" class="col-sm-4 control-label">{__('Generic', 'Your name')} *</label>
|
||||
|
||||
<div class="col-sm-8">
|
||||
{if $useRemoteUser}
|
||||
<input type="hidden" name="name" value="{$form->admin_name}" />{$form->admin_name}
|
||||
{else}
|
||||
<input id="yourname" type="text" required name="name" class="form-control" {$errors['name']['aria']} value="{$poll_name|html}" />
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{if !empty($errors['name']['msg'])}
|
||||
<div class="alert alert-danger">
|
||||
<p id="poll_title_error">
|
||||
{$errors['name']['msg']}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if $use_smtp}
|
||||
<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}
|
||||
<input id="email" required type="email" name="mail" class="form-control" {$errors['email']['aria']} value="{$poll_mail|html}" />
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{if !empty($errors['email']['msg'])}
|
||||
<div class="alert alert-danger">
|
||||
<p id="poll_title_error">
|
||||
{$errors['email']['msg']}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{/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">
|
||||
<input id="poll_title" type="text" name="title" class="form-control" required {$errors['title']['aria']}
|
||||
value="{$poll_title|html}"/>
|
||||
</div>
|
||||
</div>
|
||||
{if !empty($errors['title']['msg'])}
|
||||
<div class="alert alert-danger">
|
||||
<p id="poll_title_error">
|
||||
{$errors['title']['msg']}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="form-group {$errors['description']['class']}">
|
||||
<label for="poll_comments" class="col-sm-4 control-label">{__('Generic', 'Description')}</label>
|
||||
|
||||
<div class="col-sm-8">
|
||||
{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'])}
|
||||
<div class="alert alert-danger">
|
||||
<p id="poll_title_error">
|
||||
{$errors['description']['msg']}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{* 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>
|
||||
<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">
|
||||
{__('Step 1', "Optional parameters")}
|
||||
<i class="caret" aria-hidden="true"></i>
|
||||
<i class="caret caret-up" aria-hidden="true"></i>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
|
||||
<div class="collapse{if $advanced_errors} in{/if}" id="optionnal" {if $advanced_errors}aria-expanded="true"{/if}>
|
||||
{* Poll identifier *}
|
||||
|
||||
<div class="form-group {$errors['customized_url']['class']}">
|
||||
|
||||
{* Value MAX *}
|
||||
<div class="form-group {$errors['ValueMax']['class']}">
|
||||
<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>
|
||||
<input id="use_ValueMax" name="use_ValueMax" type="checkbox" {if $use_ValueMax}checked{/if}>
|
||||
{__('Step 1', "Limit the amount of voters per option")}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group {$errors['ValueMax']['class']}">
|
||||
<div id="ValueMax" {if !$use_ValueMax}class="hidden"{/if}>
|
||||
|
||||
<div class="col-sm-offset-4 col-sm-8">
|
||||
<label>
|
||||
<input id="ValueMax" type="number" min="0" name="ValueMax" value="{$ValueMax|html}" {$errors['ValueMax']['aria']}>
|
||||
|
||||
{__('Step 1', "ValueMax instructions")}
|
||||
</label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{if !empty($errors['ValueMax']['msg'])}
|
||||
<div class="alert alert-danger">
|
||||
<p id="poll_customized_url_error">
|
||||
{$errors['ValueMax']['msg']}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
{* 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>
|
||||
|
||||
<div class="col-sm-8">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
{if !empty($errors['customized_url']['msg'])}
|
||||
<div class="alert alert-danger">
|
||||
<p id="poll_customized_url_error">
|
||||
{$errors['customized_url']['msg']}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
</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">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="use_password" {if $poll_use_password}checked{/if}
|
||||
id="use_password">
|
||||
{__('Step 1', "Use a password to restrict access")}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<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>
|
||||
<label>
|
||||
<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')}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{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}
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-4 col-sm-8">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="hidden" {if $poll_hidden}checked{/if}
|
||||
id="hidden">
|
||||
{__('Step 1', "Only the poll maker can see the poll's results")}
|
||||
</label>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* Collect users email *}
|
||||
|
||||
<div class="form-group">
|
||||
<label for="poll_id" class="col-sm-4 control-label">
|
||||
{__('Step 1', 'Collect voters email')}
|
||||
</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio">
|
||||
<label>
|
||||
<input type="radio" name="collect_users_mail" id="no_collect" {if $collect_users_mail==constant("Framadate\CollectMail::NO_COLLECT")}checked{/if} value="{constant("Framadate\CollectMail::NO_COLLECT")}">
|
||||
{__('Step 1', 'Email addresses are not collected')}
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="collect_users_mail" {if $collect_users_mail==constant("Framadate\CollectMail::COLLECT")}checked{/if} value="{constant("Framadate\CollectMail::COLLECT")}">
|
||||
{__('Step 1', 'Email addresses are collected but not required')}
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="collect_users_mail" {if $collect_users_mail==constant("Framadate\CollectMail::COLLECT_REQUIRED")}checked{/if} value="{constant("Framadate\CollectMail::COLLECT_REQUIRED")}">
|
||||
{__('Step 1', 'Email addresses are required')}
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" disabled name="collect_users_mail" {if $collect_users_mail==constant("Framadate\CollectMail::COLLECT_REQUIRED_VERIFIED")}checked{/if} value="{constant("Framadate\CollectMail::COLLECT_REQUIRED_VERIFIED")}">
|
||||
{__('Step 1', 'Email addresses are required and verified')}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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 *}
|
||||
|
||||
{include 'part/create_poll_principal.tpl'}
|
||||
{include 'part/create_poll_collapsed.tpl'}
|
||||
|
||||
<p class="text-right">
|
||||
<button name="{$goToStep2}" value="{$poll_type}" type="submit"
|
||||
|
43
tpl/part/create_poll/customized_url.tpl
Normal file
43
tpl/part/create_poll/customized_url.tpl
Normal file
@ -0,0 +1,43 @@
|
||||
{* Poll identifier *}
|
||||
<div class="form-group {$errors['customized_url']['class']}">
|
||||
<label for="customized_url_options" class="col-sm-4 control-label">
|
||||
{__('Step 1', 'Poll id')}<br/>
|
||||
</label>
|
||||
|
||||
<div class="col-sm-8">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
{if !empty($errors['customized_url']['msg'])}
|
||||
<div class="alert alert-danger">
|
||||
<p id="poll_customized_url_error">
|
||||
{$errors['customized_url']['msg']}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
44
tpl/part/create_poll/email_collection.tpl
Normal file
44
tpl/part/create_poll/email_collection.tpl
Normal file
@ -0,0 +1,44 @@
|
||||
{* Collect users email *}
|
||||
|
||||
<div class="form-group">
|
||||
<label for="collect_voters_email" class="col-sm-4 control-label">
|
||||
{__('Step 1', 'Collect voters email')}
|
||||
</label>
|
||||
<div class="col-sm-8" id="collect_voters_email">
|
||||
<div class="radio">
|
||||
<label>
|
||||
<input type="radio" name="collect_users_mail" id="no_collect"
|
||||
{if $collect_users_mail==constant("Framadate\CollectMail::NO_COLLECT")}checked{/if}
|
||||
value="{constant("Framadate\CollectMail::NO_COLLECT")}">
|
||||
{__('Step 1', 'Email addresses are not collected')}
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="collect_users_mail"
|
||||
{if $collect_users_mail==constant("Framadate\CollectMail::COLLECT")}checked{/if}
|
||||
value="{constant("Framadate\CollectMail::COLLECT")}">
|
||||
{__('Step 1', 'Email addresses are collected but not required')}
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="collect_users_mail"
|
||||
{if $collect_users_mail==constant("Framadate\CollectMail::COLLECT_REQUIRED")}checked{/if}
|
||||
value="{constant("Framadate\CollectMail::COLLECT_REQUIRED")}">
|
||||
{__('Step 1', 'Email addresses are required')}
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" disabled name="collect_users_mail"
|
||||
{if $collect_users_mail==constant("Framadate\CollectMail::COLLECT_REQUIRED_VERIFIED")}checked{/if}
|
||||
value="{constant("Framadate\CollectMail::COLLECT_REQUIRED_VERIFIED")}">
|
||||
{__('Step 1', 'Email addresses are required and verified')}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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> {* END div.form-group *}
|
60
tpl/part/create_poll/password.tpl
Normal file
60
tpl/part/create_poll/password.tpl
Normal file
@ -0,0 +1,60 @@
|
||||
{* 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">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="use_password" {if $poll_use_password}checked{/if}
|
||||
id="use_password">
|
||||
{__('Step 1', "Use a password to restrict access")}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
45
tpl/part/create_poll/permissions.tpl
Normal file
45
tpl/part/create_poll/permissions.tpl
Normal file
@ -0,0 +1,45 @@
|
||||
<div class="form-group">
|
||||
<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>
|
||||
<label>
|
||||
<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')}
|
||||
</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="hidden" {if $poll_hidden}checked{/if}
|
||||
id="hidden">
|
||||
{__('Step 1', "Only the poll maker can see the poll's results")}
|
||||
</label>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
24
tpl/part/create_poll/receive_notifications.tpl
Normal file
24
tpl/part/create_poll/receive_notifications.tpl
Normal file
@ -0,0 +1,24 @@
|
||||
<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>
|
38
tpl/part/create_poll/value_max.tpl
Normal file
38
tpl/part/create_poll/value_max.tpl
Normal file
@ -0,0 +1,38 @@
|
||||
{* Value MAX *}
|
||||
<div class="form-group {$errors['ValueMax']['class']}">
|
||||
<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>
|
||||
<input id="use_ValueMax" name="use_ValueMax" type="checkbox"
|
||||
{if $use_ValueMax}checked{/if}>
|
||||
{__('Step 1', "Limit the amount of voters per option")}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group {$errors['ValueMax']['class']}">
|
||||
<div {if !$use_ValueMax}class="hidden"{/if} id="valueMaxWrapper">
|
||||
|
||||
<div class="col-sm-offset-4 col-sm-8">
|
||||
<label>
|
||||
<input id="ValueMax" type="number" min="1" name="ValueMax"
|
||||
value="{$ValueMax|html}" {$errors['ValueMax']['aria']}>
|
||||
|
||||
{__('Step 1', "ValueMax instructions")}
|
||||
</label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{if !empty($errors['ValueMax']['msg'])}
|
||||
<div class="alert alert-danger">
|
||||
<p id="poll_customized_url_error">
|
||||
{$errors['ValueMax']['msg']}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
18
tpl/part/create_poll_collapsed.tpl
Normal file
18
tpl/part/create_poll_collapsed.tpl
Normal file
@ -0,0 +1,18 @@
|
||||
<div class="collapse{if $advanced_errors} in{/if}" id="optionnal" {if $advanced_errors}aria-expanded="true"{/if}>
|
||||
|
||||
{include 'part/create_poll/value_max.tpl'}
|
||||
|
||||
{include 'part/create_poll/customized_url.tpl'}
|
||||
|
||||
{include 'part/create_poll/password.tpl'}
|
||||
|
||||
{include 'part/create_poll/permissions.tpl'}
|
||||
|
||||
|
||||
{if $use_smtp}
|
||||
{include 'part/create_poll/receive_notifications.tpl'}
|
||||
{/if}
|
||||
|
||||
{include 'part/create_poll/email_collection.tpl'}
|
||||
|
||||
</div> {* END div.collapse *}
|
109
tpl/part/create_poll_principal.tpl
Normal file
109
tpl/part/create_poll_principal.tpl
Normal file
@ -0,0 +1,109 @@
|
||||
<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>
|
||||
|
||||
<div class="form-group {$errors['name']['class']}">
|
||||
<label for="yourname" class="col-sm-4 control-label">{__('Generic', 'Your name')} *</label>
|
||||
|
||||
<div class="col-sm-8">
|
||||
{if $useRemoteUser}
|
||||
<input type="hidden" name="name" value="{$form->admin_name}" />
|
||||
{$form->admin_name}
|
||||
{else}
|
||||
<input id="yourname" type="text" required name="name"
|
||||
class="form-control" {$errors['name']['aria']} value="{$poll_name|html}"/>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{if !empty($errors['name']['msg'])}
|
||||
<div class="alert alert-danger">
|
||||
<p id="poll_title_error">
|
||||
{$errors['name']['msg']}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if $use_smtp}
|
||||
<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}
|
||||
<input id="email" required type="email" name="mail"
|
||||
class="form-control" {$errors['email']['aria']} value="{$poll_mail|html}"/>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{if !empty($errors['email']['msg'])}
|
||||
<div class="alert alert-danger">
|
||||
<p id="poll_title_error">
|
||||
{$errors['email']['msg']}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{/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">
|
||||
<input id="poll_title" type="text" name="title" class="form-control"
|
||||
required {$errors['title']['aria']}
|
||||
value="{$poll_title|html}"/>
|
||||
</div>
|
||||
</div>
|
||||
{if !empty($errors['title']['msg'])}
|
||||
<div class="alert alert-danger">
|
||||
<p id="poll_title_error">
|
||||
{$errors['title']['msg']}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="form-group {$errors['description']['class']}">
|
||||
<label for="poll_comments" class="col-sm-4 control-label">{__('Generic', 'Description')}</label>
|
||||
|
||||
<div class="col-sm-8">
|
||||
{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'])}
|
||||
<div class="alert alert-danger">
|
||||
<p id="poll_title_error">
|
||||
{$errors['description']['msg']}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{* 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>
|
||||
<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">
|
||||
{__('Step 1', "Optional parameters")}
|
||||
<i class="caret" aria-hidden="true"></i>
|
||||
<i class="caret caret-up" aria-hidden="true"></i>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
Loading…
Reference in New Issue
Block a user