From 8b4c41671372a074750798080d8e2d262552bee4 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Thu, 16 Jun 2016 20:16:16 +0200 Subject: [PATCH] frio: events - split event form in different sections --- include/datetime.php | 6 +- view/theme/frio/templates/event_form.tpl | 189 +++++++++++++++-------- view/theme/frio/templates/event_head.tpl | 45 +++++- 3 files changed, 168 insertions(+), 72 deletions(-) diff --git a/include/datetime.php b/include/datetime.php index bbb60ba72..4b0bbb576 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -273,7 +273,7 @@ function datetimesel($format, $min, $max, $default, $label, $id = 'datetimepicke $minjs = $min ? ",minDate: new Date({$min->getTimestamp()}*1000), yearStart: " . $min->format('Y') : ''; $maxjs = $max ? ",maxDate: new Date({$max->getTimestamp()}*1000), yearEnd: " . $max->format('Y') : ''; - $input_text = $default ? 'value="' . date($dateformat, $default->getTimestamp()) . '"' : ''; + $input_text = $default ? date($dateformat, $default->getTimestamp()) : ''; $defaultdatejs = $default ? ",defaultDate: new Date({$default->getTimestamp()}*1000)" : ''; $pickers = ''; @@ -283,7 +283,7 @@ function datetimesel($format, $min, $max, $default, $label, $id = 'datetimepicke $extra_js = ''; $pickers .= ",dayOfWeekStart: ".$firstDay.",lang:'".$lang."'"; if($minfrom != '') - $extra_js .= "\$('id_#$minfrom').data('xdsoft_datetimepicker').setOptions({onChangeDateTime: function (currentDateTime) { \$('#id_$id').data('xdsoft_datetimepicker').setOptions({minDate: currentDateTime})}})"; + $extra_js .= "\$('#id_$minfrom').data('xdsoft_datetimepicker').setOptions({onChangeDateTime: function (currentDateTime) { \$('#id_$id').data('xdsoft_datetimepicker').setOptions({minDate: currentDateTime})}})"; if($maxfrom != '') $extra_js .= "\$('#id_$maxfrom').data('xdsoft_datetimepicker').setOptions({onChangeDateTime: function (currentDateTime) { \$('#id_$id').data('xdsoft_datetimepicker').setOptions({maxDate: currentDateTime})}})"; @@ -296,7 +296,7 @@ function datetimesel($format, $min, $max, $default, $label, $id = 'datetimepicke $tpl = get_markup_template('field_input.tpl'); $o .= replace_macros($tpl,array( - '$field' => array($id, $label, $input_text, '', (($required) ? '*' : ''), 'placeholder="' . $readable_format . '" '), + '$field' => array($id, $label, $input_text, '', (($required) ? '*' : ''), 'placeholder="' . $readable_format . '"'), )); // $o .= "
"; // $o .= '
'; diff --git a/view/theme/frio/templates/event_form.tpl b/view/theme/frio/templates/event_form.tpl index ebe4faa35..3a6161198 100644 --- a/view/theme/frio/templates/event_form.tpl +++ b/view/theme/frio/templates/event_form.tpl @@ -1,84 +1,139 @@

{{$title}}

-

-{{$desc}} -

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

+ {{$desc}} +

-{{$f_dsel}} + {{$s_dsel}} -{{include file="field_checkbox.tpl" field=$nofinish}} + {{$f_dsel}} -{{include file="field_checkbox.tpl" field=$adjust}} + {{include file="field_checkbox.tpl" field=$nofinish}} -{{include file="field_input.tpl" field=$summary}} + {{include file="field_checkbox.tpl" field=$adjust}} -
-
{{$d_text}}
- -
+ + -
  • - - - -
  • -
  • - - - -
  • -
  • - - - -
  • -
  • - - - -
  • -
    -
    - -
    {{$l_text}}
    - - -
    - -
    {{$sh_text}}
    -
    - -{{$acl}} - -
    - -
    diff --git a/view/theme/frio/templates/event_head.tpl b/view/theme/frio/templates/event_head.tpl index e11f93ea7..e0cfceec9 100644 --- a/view/theme/frio/templates/event_head.tpl +++ b/view/theme/frio/templates/event_head.tpl @@ -159,13 +159,17 @@ $("#comment-edit-text-desc").bbco_autocomplete('bbcode'); {{/if}} - $('#event-share-checkbox').change(function() { + $('body').change("#event-share-checkbox", function() { - if ($('#event-share-checkbox').is(':checked')) { + if ($('#event-share-checkbox').is(':checked') && !( $('#event-share-checkbox').attr("disabled"))) { $('#acl-wrapper').show(); + $("a#event-perms-lnk").parent("li").show(); + toggleEventNav("a#event-perms-lnk"); + eventAclActive(); } else { $('#acl-wrapper').hide(); + $("a#event-perms-lnk").parent("li").hide(); } }).trigger('change'); @@ -182,7 +186,44 @@ }).trigger('change'); + // Event nav menu. + $("body").on("click", "#event-nav li a", function(e){ + e.preventDefault(); + toggleEventNav(this); + }); + }); +