From bd748e5da7b5150e002890499e9e31e4466120ba Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 25 May 2018 17:37:48 +0200 Subject: [PATCH] Split the create poll (step 1) template into parts Signed-off-by: Thomas Citharel --- js/app/create_poll.js | 4 +- tpl/create_poll.tpl | 353 +----------------- tpl/part/create_poll/customized_url.tpl | 43 +++ tpl/part/create_poll/email_collection.tpl | 44 +++ tpl/part/create_poll/password.tpl | 60 +++ tpl/part/create_poll/permissions.tpl | 45 +++ .../create_poll/receive_notifications.tpl | 24 ++ tpl/part/create_poll/value_max.tpl | 38 ++ tpl/part/create_poll_collapsed.tpl | 18 + tpl/part/create_poll_principal.tpl | 109 ++++++ 10 files changed, 385 insertions(+), 353 deletions(-) create mode 100644 tpl/part/create_poll/customized_url.tpl create mode 100644 tpl/part/create_poll/email_collection.tpl create mode 100644 tpl/part/create_poll/password.tpl create mode 100644 tpl/part/create_poll/permissions.tpl create mode 100644 tpl/part/create_poll/receive_notifications.tpl create mode 100644 tpl/part/create_poll/value_max.tpl create mode 100644 tpl/part/create_poll_collapsed.tpl create mode 100644 tpl/part/create_poll_principal.tpl diff --git a/js/app/create_poll.js b/js/app/create_poll.js index 295ab47..7368112 100644 --- a/js/app/create_poll.js +++ b/js/app/create_poll.js @@ -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"); } }); diff --git a/tpl/create_poll.tpl b/tpl/create_poll.tpl index 05efe44..0ff6990 100644 --- a/tpl/create_poll.tpl +++ b/tpl/create_poll.tpl @@ -6,7 +6,6 @@ - {/block} {block name=main} @@ -14,357 +13,9 @@
-
-

- {__('Step 1', 'You are in the poll creation section.')}
- {__('Step 1', 'Required fields cannot be left blank.')} -

-
- -
- - -
- {if $useRemoteUser} - {$form->admin_name} - {else} - - {/if} -
-
- {if !empty($errors['name']['msg'])} -
-

- {$errors['name']['msg']} -

-
- {/if} - - {if $use_smtp} -
- - -
- {if $useRemoteUser} - {$form->admin_mail} - {else} - - {/if} -
-
- {if !empty($errors['email']['msg'])} -
-

- {$errors['email']['msg']} -

-
- {/if} - - {/if} - -
- - -
- -
-
- {if !empty($errors['title']['msg'])} -
-

- {$errors['title']['msg']} -

-
- {/if} - -
- - -
- {include 'part/description_markdown.tpl'} -
- -
-
-
- {if !empty($errors['description']['msg'])} -
-

- {$errors['description']['msg']} -

-
- {/if} - - {* Optionnal parameters *} - - -
- - -
- {* Poll identifier *} - -
- - {* Value MAX *} -
- -
-
- -
-
-
- -
-
- -
- - -
-
-
- - {if !empty($errors['ValueMax']['msg'])} -
-

- {$errors['ValueMax']['msg']} -

-
- {/if} - - - {* Poll identifier *} -
- - -
-
- -
-
-
-
-
- -
-
- - {$SERVER_URL} - - -
- {__('Step 1', 'Poll id warning')} -
-
- {if !empty($errors['customized_url']['msg'])} -
-

- {$errors['customized_url']['msg']} -

-
- {/if} -
- - {* Password *} - -
- - -
-
- -
-
- - -
- -
- -
-
- - - -
-
-
- - - {if $use_smtp} -
-
-
- -
-
-
-
-
-
- -
-
-
- {/if} - -
-
-
- -
- -
-
- - {* Collect users email *} - -
- -
-
- - - - -
-
-
- - -
- -
{* END div.form-group *} - -
{* END div.collapse *} + {include 'part/create_poll_principal.tpl'} + {include 'part/create_poll_collapsed.tpl'}