From c99da380cf3d22f023e7526881d78027f8f41acf Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Fri, 17 Jun 2016 10:33:12 +0200 Subject: [PATCH] frio: events - adapt changes to the templates of the other themes --- mod/events.php | 1 + view/templates/event_form.tpl | 20 +- view/templates/event_head.tpl | 17 +- view/theme/frio/js/modal.js | 2 +- view/theme/frio/templates/event.tpl | 2 +- view/theme/frio/templates/event_form.tpl | 259 +++++++++++--------- view/theme/frio/templates/event_head.tpl | 69 +++++- view/theme/frio/templates/events-js.tpl | 2 +- view/theme/frost/js/theme.js | 4 +- view/theme/frost/templates/event_form.tpl | 20 +- view/theme/quattro/templates/event_form.tpl | 20 +- view/theme/vier/templates/event_form.tpl | 20 +- 12 files changed, 247 insertions(+), 189 deletions(-) diff --git a/mod/events.php b/mod/events.php index f6872a616..778613609 100644 --- a/mod/events.php +++ b/mod/events.php @@ -576,6 +576,7 @@ function events_content(&$a) { '$t_orig' => $t_orig, '$summary' => array('summary', t('Title:'), $t_orig, '', '*'), '$sh_text' => t('Share this event'), + '$share' => array('share', t('Share this event'), $sh_checked, ''), '$sh_checked' => $sh_checked, '$nofinish' => array('nofinish', t('Finish date/time is not known or not relevant'), $n_checked), '$adjust' => array('adjust', t('Adjust for viewer timezone'), $a_checked), diff --git a/view/templates/event_form.tpl b/view/templates/event_form.tpl index 1c065477b..de8de44e8 100644 --- a/view/templates/event_form.tpl +++ b/view/templates/event_form.tpl @@ -12,24 +12,15 @@ -
{{$s_text}}
{{$s_dsel}} -
{{$f_text}}
{{$f_dsel}} -
+{{include file="field_checkbox.tpl" field=$nofinish}} -
{{$n_text}}
+{{include file="field_checkbox.tpl" field=$adjust}} -
- -
{{$a_text}}
- -
- -
{{$t_text}}
- +{{include file="field_input.tpl" field=$summary}}
{{$d_text}}
@@ -41,8 +32,9 @@
-
{{$sh_text}}
-
+{{if ! $eid}} +{{include file="field_checkbox.tpl" field=$share}} +{{/if}} {{$acl}} diff --git a/view/templates/event_head.tpl b/view/templates/event_head.tpl index de5ad6070..0c015f4bf 100644 --- a/view/templates/event_head.tpl +++ b/view/templates/event_head.tpl @@ -21,6 +21,14 @@ $('#event-edit-preview').val(0); } + // disable the input for the finish date if it is not available + function enableDisableFinishDate() { + if( $('#id_nofinish').is(':checked')) + $('#id_finish_text').prop("disabled", true); + else + $('#id_finish_text').prop("disabled", false); + } + $(document).ready(function() { $('#events-calendar').fullCalendar({ @@ -152,9 +160,9 @@ $("#comment-edit-text-desc").bbco_autocomplete('bbcode'); {{/if}} - $('#event-share-checkbox').change(function() { + $('#id_share').change(function() { - if ($('#event-share-checkbox').is(':checked')) { + if ($('#id_share').is(':checked')) { $('#acl-wrapper').show(); } else { @@ -175,6 +183,11 @@ }).trigger('change'); + // disable the finish time input if the user disable it + $('body').change("#id_nofinish", function() { + enableDisableFinishDate() + }).trigger('change'); + }); diff --git a/view/theme/frio/js/modal.js b/view/theme/frio/js/modal.js index f99946019..d27048e2d 100644 --- a/view/theme/frio/js/modal.js +++ b/view/theme/frio/js/modal.js @@ -153,7 +153,7 @@ Dialog._load = function(url) { */ function loadModalTitle() { // clear the text of the title - //$("#modal-title").empty(); + $("#modal-title").empty(); // hide the first element with the class "heading" of the modal body $("#modal-body .heading").first().hide(); diff --git a/view/theme/frio/templates/event.tpl b/view/theme/frio/templates/event.tpl index 380bc7cb1..27965bb59 100644 --- a/view/theme/frio/templates/event.tpl +++ b/view/theme/frio/templates/event.tpl @@ -11,7 +11,7 @@
{{if $event.item.plink}}{{/if}} - {{if $event.edit}}{{/if}} + {{if $event.edit}}{{/if}}
diff --git a/view/theme/frio/templates/event_form.tpl b/view/theme/frio/templates/event_form.tpl index 3a6161198..df97e01ff 100644 --- a/view/theme/frio/templates/event_form.tpl +++ b/view/theme/frio/templates/event_form.tpl @@ -1,139 +1,162 @@ -

{{$title}}

+
+

{{$title}}

-{{* The event edit navigation menu (text input, permissions, preview, filebrowser) *}} - + {{* The event edit navigation menu (text input, permissions, preview, filebrowser) *}} + -
+
+ - - - - + + + + -
-

- {{$desc}} -

+
+

+ {{$desc}} +

- {{$s_dsel}} + {{$s_dsel}} - {{$f_dsel}} + {{$f_dsel}} - {{include file="field_checkbox.tpl" field=$nofinish}} + {{include file="field_checkbox.tpl" field=$nofinish}} - {{include file="field_checkbox.tpl" field=$adjust}} + {{include file="field_checkbox.tpl" field=$adjust}} - {{include file="field_input.tpl" field=$summary}} + {{include file="field_input.tpl" field=$summary}} -
-
{{$d_text}}
- - +
+
+ +
+
{{$l_text}}
+ + +
+
+ + {{if ! $eid}} + {{include file="field_checkbox.tpl" field=$share}} + {{/if}} + +
+ +
-
-
{{$l_text}}
- - -
+ -
{{$sh_text}}
-
+ - - +
+ +
+
- - -
- - - + \ No newline at end of file diff --git a/view/theme/frio/templates/event_head.tpl b/view/theme/frio/templates/event_head.tpl index e0cfceec9..dc1457a87 100644 --- a/view/theme/frio/templates/event_head.tpl +++ b/view/theme/frio/templates/event_head.tpl @@ -5,16 +5,18 @@ @@ -200,18 +223,19 @@ // the following functions show/hide the specific event-edit content // in dependence of the selected nav function eventAclActive() { - $("#event-edit-wrapper, .modal-body #jot-preview-content, .modal-body #jot-fbrowser-wrapper").hide(); + $("#event-edit-wrapper, #event-preview").hide(); $("#event-acl-wrapper").show(); } - function previewActive() { - $(".modal-body #profile-jot-wrapper, .modal-body #profile-jot-acl-wrapper,.modal-body #jot-fbrowser-wrapper").hide(); - preview_post(); + function eventPreviewActive() { + $("#event-acl-wrapper, #event-edit-wrapper").hide(); + $("#event-preview").show(); + doEventPreview(); } function eventEditActive() { - $("#event-acl-wrapper, .modal-body #jot-preview-content, .modal-body #jot-fbrowser-wrapper").hide(); + $("#event-acl-wrapper, #event-preview").hide(); $("#event-edit-wrapper").show(); //make sure jot text does have really the active class (we do this because there are some @@ -226,4 +250,25 @@ // add the active class to the parent of the link which was selected $(elm).parent("li").addClass("active"); } + + // this function load the content of the edit url into a modal + function eventEdit(url) { + var char = qOrAmp(url); + url = url + char + 'mode=none'; + + $.get(url, function(data) { + $("#modal-body").empty(); + $("#modal-body").append(data); + }).done(function() { + loadModalTitle(); + }); + } + + // disable the input for the finish date if it is not available + function enableDisableFinishDate() { + if( $('#id_nofinish').is(':checked')) + $('#id_finish_text').prop("disabled", true); + else + $('#id_finish_text').prop("disabled", false); + } diff --git a/view/theme/frio/templates/events-js.tpl b/view/theme/frio/templates/events-js.tpl index 93c131b36..dcd522c58 100644 --- a/view/theme/frio/templates/events-js.tpl +++ b/view/theme/frio/templates/events-js.tpl @@ -1,7 +1,7 @@
{{$tabs}} {{include file="section_title.tpl" title=$title}} - +
diff --git a/view/theme/frost/js/theme.js b/view/theme/frost/js/theme.js index fc1bb643c..038f83e0e 100644 --- a/view/theme/frost/js/theme.js +++ b/view/theme/frost/js/theme.js @@ -70,9 +70,9 @@ $(document).ready(function() { return false; });*/ - $('#event-share-checkbox').change(function() { + $('#id_share').change(function() { - if ($('#event-share-checkbox').is(':checked')) { + if ($('#id_share').is(':checked')) { $('#acl-wrapper').show(); } else { diff --git a/view/theme/frost/templates/event_form.tpl b/view/theme/frost/templates/event_form.tpl index 43f2a782f..27631d9f7 100644 --- a/view/theme/frost/templates/event_form.tpl +++ b/view/theme/frost/templates/event_form.tpl @@ -12,24 +12,15 @@ -
{{$s_text}}
{{$s_dsel}} -
{{$f_text}}
{{$f_dsel}} -
+{{include file="field_checkbox.tpl" field=$nofinish}} -
{{$n_text}}
+{{include file="field_checkbox.tpl" field=$adjust}} -
- -
{{$a_text}}
- -
- -
{{$t_text}}
- +{{include file="field_input.tpl" field=$summary}}
{{$d_text}}
@@ -40,8 +31,9 @@
-
{{$sh_text}}
-
+{{if ! $eid}} +{{include file="field_checkbox.tpl" field=$share}} +{{/if}} {{$acl}} diff --git a/view/theme/quattro/templates/event_form.tpl b/view/theme/quattro/templates/event_form.tpl index 098b57850..484fe6744 100644 --- a/view/theme/quattro/templates/event_form.tpl +++ b/view/theme/quattro/templates/event_form.tpl @@ -10,23 +10,23 @@ - {{include file="field_custom.tpl" field=array('start_text', $s_text, $s_dsel, "")}} - {{include file="field_custom.tpl" field=array('finish_text', $f_text, $f_dsel, "")}} + {{$s_dsel}} - {{include file="field_checkbox.tpl" field=array('nofinish', $n_text, $n_checked, "")}} - {{include file="field_checkbox.tpl" field=array('adjust', $a_text, $a_checked, "")}} + {{$f_dsel}} + + {{include file="field_checkbox.tpl" field=$nofinish}} + + {{include file="field_checkbox.tpl" field=$adjust}}
- {{include file="field_input.tpl" field=array('summary', $t_text, $t_orig, "")}} + {{include file="field_input.tpl" field=$summary}} {{include file="field_textarea.tpl" field=array('desc', $d_text, $d_orig, "")}} {{include file="field_textarea.tpl" field=array('location', $l_text, $l_orig, "")}}
-
- - - -
+ {{if ! $eid}} + {{include file="field_checkbox.tpl" field=$share}} + {{/if}} {{$acl}} diff --git a/view/theme/vier/templates/event_form.tpl b/view/theme/vier/templates/event_form.tpl index 4f3240de8..0507c36aa 100644 --- a/view/theme/vier/templates/event_form.tpl +++ b/view/theme/vier/templates/event_form.tpl @@ -13,24 +13,15 @@ -
{{$s_text}}
{{$s_dsel}} -
{{$f_text}}
{{$f_dsel}} -
+{{include file="field_checkbox.tpl" field=$nofinish}} -
{{$n_text}}
+{{include file="field_checkbox.tpl" field=$adjust}} -
- -
{{$a_text}}
- -
- -
{{$t_text}}
- +{{include file="field_input.tpl" field=$summary}}
{{$d_text}}
@@ -61,8 +52,9 @@
-
{{$sh_text}}
-
+{{if ! $eid}} +{{include file="field_checkbox.tpl" field=$share}} +{{/if}} {{$acl}}