]> git.mxchange.org Git - friendica.git/commitdiff
frio: events - adapt changes to the templates of the other themes
authorrabuzarus <>
Fri, 17 Jun 2016 08:33:12 +0000 (10:33 +0200)
committerrabuzarus <>
Fri, 17 Jun 2016 08:33:12 +0000 (10:33 +0200)
12 files changed:
mod/events.php
view/templates/event_form.tpl
view/templates/event_head.tpl
view/theme/frio/js/modal.js
view/theme/frio/templates/event.tpl
view/theme/frio/templates/event_form.tpl
view/theme/frio/templates/event_head.tpl
view/theme/frio/templates/events-js.tpl
view/theme/frost/js/theme.js
view/theme/frost/templates/event_form.tpl
view/theme/quattro/templates/event_form.tpl
view/theme/vier/templates/event_form.tpl

index f6872a61629fdc9e5a9201ad50097f05e2338da2..7786136097ea6646eedb271300077540e609bfe3 100644 (file)
@@ -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),
index 1c065477b2a7690ac48cbee6ed3b969c8c62111e..de8de44e88ce43341e50ce2454967c5bc5537383 100644 (file)
 <input type="hidden" name="uri" value="{{$uri}}" />
 <input type="hidden" name="preview" id="event-edit-preview" value="0" />
 
-<div id="event-start-text">{{$s_text}}</div>
 {{$s_dsel}}
 
-<div id="event-finish-text">{{$f_text}}</div>
 {{$f_dsel}}
 
-<div id="event-datetime-break"></div>
+{{include file="field_checkbox.tpl" field=$nofinish}}
 
-<input type="checkbox" name="nofinish" value="1" id="event-nofinish-checkbox" {{$n_checked}} /> <div id="event-nofinish-text">{{$n_text}}</div>
+{{include file="field_checkbox.tpl" field=$adjust}}
 
-<div id="event-nofinish-break"></div>
-
-<input type="checkbox" name="adjust" value="1" id="event-adjust-checkbox" {{$a_checked}} /> <div id="event-adjust-text">{{$a_text}}</div>
-
-<div id="event-adjust-break"></div>
-
-<div id="event-summary-text">{{$t_text}}</div>
-<input type="text" id="event-summary" name="summary" value="{{$t_orig|escape:'html'}}" />
+{{include file="field_input.tpl" field=$summary}}
 
 
 <div id="event-desc-text">{{$d_text}}</div>
@@ -41,8 +32,9 @@
 
 <div id="event-location-break"></div>
 
-<input type="checkbox" name="share" value="1" id="event-share-checkbox" {{$sh_checked}} /> <div id="event-share-text">{{$sh_text}}</div>
-<div id="event-share-break"></div>
+{{if ! $eid}}
+{{include file="field_checkbox.tpl" field=$share}}
+{{/if}}
 
 {{$acl}}
 
index de5ad6070cdb97ed99c8454ca8719e93500e1b0f..0c015f4bf832b77f45f802523b85e0e921106f82 100644 (file)
                $('#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({
                $("#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 {
 
                }).trigger('change');
 
+               // disable the finish time input if the user disable it
+               $('body').change("#id_nofinish", function() {
+                       enableDisableFinishDate()
+               }).trigger('change');
+
        });
 
 </script>
index f99946019afaf215ab2bf8d3e901e910a6721527..d27048e2dff57f27dfc3db027f0ba5ab7ba95bef 100644 (file)
@@ -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();
index 380bc7cb1405a506e222f9391c0a735462c7e758..27965bb590899f214ba6806706cb65c9b1a0c716 100644 (file)
@@ -11,7 +11,7 @@
 
                        <div class="event-buttons pull-right">
                                {{if $event.item.plink}}<a href="{{$event.plink.0}}" title="{{$event.plink.1}}" target="_blank" class="btn "><i class="fa fa-external-link" aria-hidden="true"></i></a>{{/if}}
-                               {{if $event.edit}}<a href="{{$event.edit.0}}" title="{{$event.edit.1}}" class="btn"><i class="fa fa-pencil" aria-hidden="true"></i></a>{{/if}}
+                               {{if $event.edit}}<a onclick="eventEdit('{{$event.edit.0}}')" title="{{$event.edit.1}}" class="btn"><i class="fa fa-pencil" aria-hidden="true"></i></a>{{/if}}
                        </div>
                        <div class="clear"></div>
                </div>
index 3a6161198049dd0fae21cd90f6e3eb8614aabe75..df97e01ff20b7353d0580d7b2231948b77656bbe 100644 (file)
 
-<h3 class="heading">{{$title}}</h3>
-
-{{* The event edit navigation menu (text input, permissions, preview, filebrowser) *}}
-<ul id="event-nav" class="nav nav-tabs hidden-xs event-nav" role="menubar" data-tabs="tabs">
-       {{* Mark the first list entry as active because it is the first which is active after opening
-               the modal. Changing of the activity status is done by js in event_head.tpl *}}
-       <li class="active" role="menuitem"><a id="event-edit-lnk" onclick="eventEditActive(); return false;">Text</a></li>
-       {{if $acl}}<li role="menuitem" {{if !$sh_checked}} style="display: none"{{/if}}><a id="event-perms-lnk" onclick="eventAclActive();return false;">Permissions</a></li>{{/if}}
-       {{if $preview}}<li role="menuitem"><a id="event-preview-lnk" onclick="eventPreviewActive();return false;">{{$preview}}</a></li>{{/if}}
-       <li role="menuitem"><a id="event-preview-link" onclick="fbrowserActive(); return false;"> Browser </a></li>
-</ul>
-
-<form id="event-edit-form" action="{{$post}}" method="post" >
-
-       <input type="hidden" name="event_id" value="{{$eid}}" />
-       <input type="hidden" name="cid" value="{{$cid}}" />
-       <input type="hidden" name="uri" value="{{$uri}}" />
-       <input type="hidden" name="preview" id="event-edit-preview" value="0" />
-
-       <div id="event-edit-wrapper">
-               <p>
-               {{$desc}}
-               </p>
-
-               {{$s_dsel}}
-
-               {{$f_dsel}}
-
-               {{include file="field_checkbox.tpl" field=$nofinish}}
-
-               {{include file="field_checkbox.tpl" field=$adjust}}
-
-               {{include file="field_input.tpl" field=$summary}}
-
-
-               <div class="form-group">
-                       <div id="event-desc-text"><b>{{$d_text}}</b></div>
-                       <textarea id="comment-edit-text-desc" class="form-control" name="desc" >{{$d_orig}}</textarea>
-                       <ul id="event-desc-text-edit-bb" class="comment-edit-bb comment-icon-list nav nav-pills hidden-xs pull-left">
-                               <li>
-                                       <a class="icon" style="cursor: pointer;" title="{{$edimg|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="img" data-id="desc">
-                                               <i class="fa fa-picture-o"></i>
-                                       </a>
-                               </li>
-                               <li>
-                                       <a class="icon bb-url" style="cursor: pointer;" title="{{$edurl|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="url" data-id="desc">
-                                               <i class="fa fa-link"></i>
-                                       </a>
-                               </li>
-                               <li>
-                                       <a class="icon bb-video" style="cursor: pointer;" title="{{$edvideo|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="video" data-id="desc">
-                                               <i class="fa fa-video-camera"></i>
-                                       </a>
-                               </li>
-
-                               <li>
-                                       <a class="icon underline" style="cursor: pointer;" title="{{$eduline|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="u" data-id="desc">
-                                               <i class="fa fa-underline"></i>
-                                       </a>
-                               </li>
-                               <li>
-                                       <a class="icon italic" style="cursor: pointer;" title="{{$editalic|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="i" data-id="desc">
-                                               <i class="fa fa-italic"></i>
-                                       </a>
-                               </li>
-                               <li>
-                                       <a class="icon bold" style="cursor: pointer;"  title="{{$edbold|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="b" data-id="desc">
-                                               <i class="fa fa-bold"></i>
-                                       </a>
-                               </li>
-                               <li>
-                                       <a class="icon quote" style="cursor: pointer;" title="{{$edquote|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="quote" data-id="desc">
-                                               <i class="fa fa-quote-left"></i>
-                                       </a>
-                               </li>
-                       </ul>
+<div id="event-form-wrapper">
+       <h3 class="heading">{{$title}}</h3>
+
+       {{* The event edit navigation menu (text input, permissions, preview, filebrowser) *}}
+       <ul id="event-nav" class="nav nav-tabs event-nav" role="menubar" data-tabs="tabs">
+               {{* Mark the first list entry as active because it is the first which is active after opening
+                       the modal. Changing of the activity status is done by js in event_head.tpl *}}
+               <li class="active" role="menuitem"><a id="event-edit-lnk" onclick="eventEditActive(); return false;">Text</a></li>
+               {{if $acl}}<li role="menuitem" {{if !$sh_checked}} style="display: none"{{/if}}><a id="event-perms-lnk" onclick="eventAclActive();return false;">Permissions</a></li>{{/if}}
+               {{if $preview}}<li role="menuitem"><a id="event-preview-lnk" onclick="eventPreviewActive();return false;">{{$preview}}</a></li>{{/if}}
+               {{* commented out because it isn't implemented yet
+               <li role="menuitem"><a id="event-preview-link" onclick="fbrowserActive(); return false;"> Browser </a></li>
+               *}}
+       </ul>
+
+       <div id="event-edit-form-wrapper">
+       <form id="event-edit-form" action="{{$post}}" method="post" >
+
+               <input type="hidden" name="event_id" value="{{$eid}}" />
+               <input type="hidden" name="cid" value="{{$cid}}" />
+               <input type="hidden" name="uri" value="{{$uri}}" />
+               <input type="hidden" name="preview" id="event-edit-preview" value="0" />
+
+               <div id="event-edit-wrapper">
+                       <p>
+                       {{$desc}}
+                       </p>
+
+                       {{$s_dsel}}
+
+                       {{$f_dsel}}
+
+                       {{include file="field_checkbox.tpl" field=$nofinish}}
+
+                       {{include file="field_checkbox.tpl" field=$adjust}}
+
+                       {{include file="field_input.tpl" field=$summary}}
+
+
+                       <div class="form-group">
+                               <div id="event-desc-text"><b>{{$d_text}}</b></div>
+                               <textarea id="comment-edit-text-desc" class="form-control" name="desc" >{{$d_orig}}</textarea>
+                               <ul id="event-desc-text-edit-bb" class="comment-edit-bb comment-icon-list nav nav-pills hidden-xs pull-left">
+                                       {{* commented out because it isn't implemented yet
+                                       <li>
+                                               <a class="icon" style="cursor: pointer;" title="{{$edimg|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="img" data-id="desc">
+                                                       <i class="fa fa-picture-o"></i>
+                                               </a>
+                                       </li>
+                                       *}}
+                                       <li>
+                                               <a class="icon bb-url" style="cursor: pointer;" title="{{$edurl|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="url" data-id="desc">
+                                                       <i class="fa fa-link"></i>
+                                               </a>
+                                       </li>
+                                       <li>
+                                               <a class="icon bb-video" style="cursor: pointer;" title="{{$edvideo|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="video" data-id="desc">
+                                                       <i class="fa fa-video-camera"></i>
+                                               </a>
+                                       </li>
+
+                                       <li>
+                                               <a class="icon underline" style="cursor: pointer;" title="{{$eduline|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="u" data-id="desc">
+                                                       <i class="fa fa-underline"></i>
+                                               </a>
+                                       </li>
+                                       <li>
+                                               <a class="icon italic" style="cursor: pointer;" title="{{$editalic|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="i" data-id="desc">
+                                                       <i class="fa fa-italic"></i>
+                                               </a>
+                                       </li>
+                                       <li>
+                                               <a class="icon bold" style="cursor: pointer;"  title="{{$edbold|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="b" data-id="desc">
+                                                       <i class="fa fa-bold"></i>
+                                               </a>
+                                       </li>
+                                       <li>
+                                               <a class="icon quote" style="cursor: pointer;" title="{{$edquote|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="quote" data-id="desc">
+                                                       <i class="fa fa-quote-left"></i>
+                                               </a>
+                                       </li>
+                               </ul>
+                               <div class="clear"></div>
+                       </div>
+
+                       <div class="form-group">
+                               <div id="event-location-text"><b>{{$l_text}}</b></div>
+                               <textarea id="comment-edit-text-loc" class="form-control" name="location">{{$l_orig}}</textarea>
+                               <ul id="comment-tools-loc" class="comment-edit-bb comment-icon-list nav nav-pills hidden-xs pull-left">
+                                       {{* commented out because it isn't implemented yet
+                                       <li>
+                                               <a class="icon" style="cursor: pointer;" title="{{$edimg|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="img" data-id="loc">
+                                                       <i class="fa fa-picture-o"></i>
+                                               </a>
+                                       </li>
+                                       *}}
+                                       <li>
+                                               <a class="icon bb-url" style="cursor: pointer;" title="{{$edurl|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="url" data-id="loc">
+                                                       <i class="fa fa-link"></i>
+                                               </a>
+                                       </li>
+                                       <li>
+                                               <a class="icon bb-video" style="cursor: pointer;" title="{{$edvideo|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="video" data-id="loc">
+                                                       <i class="fa fa-video-camera"></i>
+                                               </a>
+                                       </li>
+
+                                       <li>
+                                               <a class="icon underline" style="cursor: pointer;" title="{{$eduline|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="u" data-id="loc">
+                                                       <i class="fa fa-underline"></i>
+                                               </a>
+                                       </li>
+                                       <li>
+                                               <a class="icon italic" style="cursor: pointer;" title="{{$editalic|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="i" data-id="loc">
+                                                       <i class="fa fa-italic"></i>
+                                               </a>
+                                       </li>
+                                       <li>
+                                               <a class="icon bold" style="cursor: pointer;"  title="{{$edbold|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="b" data-id="loc">
+                                                       <i class="fa fa-bold"></i>
+                                               </a>
+                                       </li>
+                                       <li>
+                                               <a class="icon quote" style="cursor: pointer;" title="{{$edquote|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="quote" data-id="loc">
+                                                       <i class="fa fa-quote-left"></i>
+                                               </a>
+                                       </li>
+                               </ul>
+                               <div class="clear"></div>
+                       </div>
+
+                       {{if ! $eid}}
+                       {{include file="field_checkbox.tpl" field=$share}}
+                       {{/if}}
+
+                       <div class="pull-right" >
+                               <button id="event-submit" type="submit" name="submit" class="btn btn-primary" value="{{$submit|escape:'html'}}">{{$submit}}</button>
+                       </div>
                        <div class="clear"></div>
                </div>
 
-               <div class="form-group">
-                       <div id="event-location-text"><b>{{$l_text}}</b></div>
-                       <textarea id="comment-edit-text-loc" class="form-control" name="location">{{$l_orig}}</textarea>
-                       <ul id="comment-tools-loc" class="comment-edit-bb comment-icon-list nav nav-pills hidden-xs pull-left">
-                               <li>
-                                       <a class="icon" style="cursor: pointer;" title="{{$edimg|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="img" data-id="loc">
-                                               <i class="fa fa-picture-o"></i>
-                                       </a>
-                               </li>
-                               <li>
-                                       <a class="icon bb-url" style="cursor: pointer;" title="{{$edurl|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="url" data-id="loc">
-                                               <i class="fa fa-link"></i>
-                                       </a>
-                               </li>
-                               <li>
-                                       <a class="icon bb-video" style="cursor: pointer;" title="{{$edvideo|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="video" data-id="loc">
-                                               <i class="fa fa-video-camera"></i>
-                                       </a>
-                               </li>
-
-                               <li>
-                                       <a class="icon underline" style="cursor: pointer;" title="{{$eduline|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="u" data-id="loc">
-                                               <i class="fa fa-underline"></i>
-                                       </a>
-                               </li>
-                               <li>
-                                       <a class="icon italic" style="cursor: pointer;" title="{{$editalic|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="i" data-id="loc">
-                                               <i class="fa fa-italic"></i>
-                                       </a>
-                               </li>
-                               <li>
-                                       <a class="icon bold" style="cursor: pointer;"  title="{{$edbold|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="b" data-id="loc">
-                                               <i class="fa fa-bold"></i>
-                                       </a>
-                               </li>
-                               <li>
-                                       <a class="icon quote" style="cursor: pointer;" title="{{$edquote|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="quote" data-id="loc">
-                                               <i class="fa fa-quote-left"></i>
-                                       </a>
-                               </li>
-                       </ul>
-                       <div class="clear"></div>
+               <div id="event-acl-wrapper" style="display: none">
+                       {{$acl}}
                </div>
 
-               <input type="checkbox" name="share" value="1" id="event-share-checkbox" {{$sh_checked}} /> <div id="event-share-text">{{$sh_text}}</div>
-               <div id="event-share-break"></div>
+               <div id="event-preview" style="display: none"></div>
 
-               <input id="event-edit-preview" type="submit" name="preview" value="{{$preview|escape:'html'}}" onclick="doEventPreview(); return false;" />
-               <input id="event-submit" type="submit" name="submit" value="{{$submit|escape:'html'}}" />
-       </div>
+               <div class="clear"></div>
 
-       <div id="event-acl-wrapper" style="display: none">
-               {{$acl}}
+       </form>
        </div>
-
-       <div class="clear"></div>
-
-</form>
-
+</div>
+
+<script>
+       $(document).ready( function() {
+               // disable finish date input if it isn't available
+               enableDisableFinishDate();
+               // load bbcode autocomplete for the description textarea
+               $('#comment-edit-text-desc, #comment-edit-text-loc').bbco_autocomplete('bbcode');
+       });
+</script>
\ No newline at end of file
index e0cfceec96912af6a050857abd6bc70bee3641b1..dc1457a87d1e63f0012f92abce0974abd6433f30 100644 (file)
@@ -5,16 +5,18 @@
 
 <script>
 
+       // loads the event into a modal
        function showEvent(eventid) {
-               
                        addToModal('{{$baseurl}}/events/?id='+eventid);
        
        }
 
+       // Load the html of the actual event and incect the output to the
+       // event-edit section
        function doEventPreview() {
                $('#event-edit-preview').val(1);
                $.post('events',$('#event-edit-form').serialize(), function(data) {
-                       $.colorbox({ html: data });
+                       $("#event-preview").append(data);
                });
                $('#event-edit-preview').val(0);
        }
        function changeView(action, viewName) {
                $('#events-calendar').fullCalendar(action, viewName);
                var view = $('#events-calendar').fullCalendar('getView');
-               $('#title').text(view.title);
+               $('#fc-title').text(view.title);
        }
 
        $(document).ready(function() {
+               // start the fullCalendar
                $('#events-calendar').fullCalendar({
                        firstDay: {{$i18n.firstDay}},
                        monthNames: ['{{$i18n.January}}','{{$i18n.February}}','{{$i18n.March}}','{{$i18n.April}}','{{$i18n.May}}','{{$i18n.June}}','{{$i18n.July}}','{{$i18n.August}}','{{$i18n.September}}','{{$i18n.October}}','{{$i18n.November}}','{{$i18n.December}}'],
                $("#comment-edit-text-desc").bbco_autocomplete('bbcode');
                {{/if}}
 
-               $('body').change("#event-share-checkbox", function() {
+               // go to the permissions tab if the checkbox is checked
+               $('body').change("#id_share", function() {
 
-                       if ($('#event-share-checkbox').is(':checked')  && !( $('#event-share-checkbox').attr("disabled"))) { 
+                       if ($('#id_share').is(':checked') && !( $('#id_share').attr("disabled"))) { 
                                $('#acl-wrapper').show();
                                $("a#event-perms-lnk").parent("li").show();
                                toggleEventNav("a#event-perms-lnk");
                        }
                }).trigger('change');
 
+               // disable the finish time input if the user disable it
+               $('body').change("#id_nofinish", function() {
+                       enableDisableFinishDate()
+               }).trigger('change');
 
+               // js for the permission sextion
                $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
                        var selstr;
                        $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
 
                }).trigger('change');
 
-               // Event nav menu.
-               $("body").on("click", "#event-nav li a", function(e){
+               // Change the event nav menu.tabs on click
+               $("body").on("click", "#event-nav > li > a", function(e){
                        e.preventDefault();
                        toggleEventNav(this);
                });
 
+               // this is experimental. We maybe can make use of it to inject
+               // some js code while the event modal opens
+               //$('body').on('show.bs.modal', function () {
+               //      enableDisableFinishDate();
+               //});
+
+               // clear some elements (e.g. the event-preview container) when
+               // selecting a event nav link so it don't appear more than once
+               $('body').on("click", "#event-nav a", function(e) {
+                       $("#event-preview").empty();
+                       e.preventDefault();
+               });
+
+
        });
 
 </script>
        // 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
                // 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);
+       }
 </script>
index 93c131b36bd539f245f8cce668f1ac41a348e0ea..dcd522c5869547b50d89c4ec97a9e3cdf7a4647a 100644 (file)
@@ -1,7 +1,7 @@
 <div class="generic-page-wrapper">
        {{$tabs}}
        {{include file="section_title.tpl" title=$title}}
-<div id="new-event-link"><a href="{{$new_event.0}}" >{{$new_event.1}}</a></div>
+
        <div id="new-event-link"><a onclick="addToModal('{{$new_event.0}}')" >{{$new_event.1}}</a></div>
 
        <div id="fc-header">
index fc1bb643c00e26ecd1f7899de2666d2ba1fda9bd..038f83e0e5316b773206f702fc3962438bfb84bc 100644 (file)
@@ -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 {
index 43f2a782fa57c8e636f08d4d0ad25e1d3d09ab09..27631d9f772baedaf90c0a6d92cf0e1a5e82d63d 100644 (file)
 <input type="hidden" name="uri" value="{{$uri}}" />
 <input type="hidden" name="preview" id="event-edit-preview" value="0" />
 
-<div id="event-start-text">{{$s_text}}</div>
 {{$s_dsel}}
 
-<div id="event-finish-text">{{$f_text}}</div>
 {{$f_dsel}}
 
-<div id="event-datetime-break"></div>
+{{include file="field_checkbox.tpl" field=$nofinish}}
 
-<input type="checkbox" name="nofinish" value="1" id="event-nofinish-checkbox" {{$n_checked}} /> <div id="event-nofinish-text">{{$n_text}}</div>
+{{include file="field_checkbox.tpl" field=$adjust}}
 
-<div id="event-nofinish-break"></div>
-
-<input type="checkbox" name="adjust" value="1" id="event-adjust-checkbox" {{$a_checked}} /> <div id="event-adjust-text">{{$a_text}}</div>
-
-<div id="event-adjust-break"></div>
-
-<div id="event-summary-text">{{$t_text}}</div>
-<input type="text" id="event-summary" name="summary" value="{{$t_orig}}" />
+{{include file="field_input.tpl" field=$summary}}
 
 
 <div id="event-desc-text">{{$d_text}}</div>
@@ -40,8 +31,9 @@
 <textarea id="event-location-textarea" rows="10" cols="70" name="location">{{$l_orig}}</textarea>
 <br />
 
-<input type="checkbox" name="share" value="1" id="event-share-checkbox" {{$sh_checked}} /> <div id="event-share-text">{{$sh_text}}</div>
-<div id="event-share-break"></div>
+{{if ! $eid}}
+{{include file="field_checkbox.tpl" field=$share}}
+{{/if}}
 
 {{$acl}}
 
index 098b57850efd720c51ca9bb9d82040266af8a3ca..484fe6744b09a27d651a357cbfa827d3504f38d4 100644 (file)
        <input type="hidden" name="uri" value="{{$uri}}" />
        <input type="hidden" name="preview" id="event-edit-preview" value="0" />
 
-       {{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}}
        <hr>
-       {{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, "")}}
        <hr>
 
-       <div class='field checkbox' id='div_id_share'>
-               <label for='id_share'>{{$sh_text}}</label>
-               <input type="checkbox" name='share' id='id_share' aria-describedby='share_tip' value="1" {{$sh_checked}}>
-               
-       </div>
+       {{if ! $eid}}
+       {{include file="field_checkbox.tpl" field=$share}}
+       {{/if}}
 
        {{$acl}}
 
index 4f3240de8ef853c99c3cf0b1da4178a6c095c746..0507c36aa19e17429c99f8f8aa4c16da027c36dc 100644 (file)
 <input type="hidden" name="uri" value="{{$uri}}" />
 <input type="hidden" name="preview" id="event-edit-preview" value="0" />
 
-<div id="event-start-text">{{$s_text}}</div>
 {{$s_dsel}}
 
-<div id="event-finish-text">{{$f_text}}</div>
 {{$f_dsel}}
 
-<div id="event-datetime-break"></div>
+{{include file="field_checkbox.tpl" field=$nofinish}}
 
-<input type="checkbox" name="nofinish" value="1" id="event-nofinish-checkbox" {{$n_checked}} /> <div id="event-nofinish-text">{{$n_text}}</div>
+{{include file="field_checkbox.tpl" field=$adjust}}
 
-<div id="event-nofinish-break"></div>
-
-<input type="checkbox" name="adjust" value="1" id="event-adjust-checkbox" {{$a_checked}} /> <div id="event-adjust-text">{{$a_text}}</div>
-
-<div id="event-adjust-break"></div>
-
-<div id="event-summary-text">{{$t_text}}</div>
-<input type="text" size="65" id="event-summary" name="summary" value="{{$t_orig|escape:'html'}}" />
+{{include file="field_input.tpl" field=$summary}}
 
 
 <div id="event-desc-text">{{$d_text}}</div>
@@ -61,8 +52,9 @@
 
 <div id="event-location-break"></div>
 
-<input type="checkbox" name="share" value="1" id="event-share-checkbox" {{$sh_checked}} /> <div id="event-share-text">{{$sh_text}}</div>
-<div id="event-share-break"></div>
+{{if ! $eid}}
+{{include file="field_checkbox.tpl" field=$share}}
+{{/if}}
 
 {{$acl}}