Browse Source

update agenda - refs #2681

Alex Aragón 6 years ago
parent
commit
beb1707546

+ 1 - 1
main/calendar/agenda_js.php

@@ -180,7 +180,7 @@ if ($type == 'course' && !empty($session_id)) {
 
 $agendaColors = array_merge(
     [
-        'platform' => 'red', //red
+        'platform' => '#ff6258', //red
         'course' => '#458B00', //green
         'group' => '#A0522D', //siena
         'session' => '#00496D', // kind of green

+ 2 - 2
main/inc/lib/agenda.lib.php

@@ -112,8 +112,8 @@ class Agenda
         $this->events = [];
         $agendaColors = array_merge(
             [
-                'platform' => 'red', //red
-                'course' => '#458B00', //green
+                'platform' => '#EB4E36', //red
+                'course' => '#43D29E', //green
                 'group' => '#A0522D', //siena
                 'session' => '#00496D', // kind of green
                 'other_session' => '#999', // kind of green

+ 16 - 20
main/template/default/agenda/month.html.twig

@@ -1,9 +1,5 @@
 {% autoescape false %}
-<style>
-.fc-day-grid-event > .fc-content {
-    white-space: normal;
-}
-</style>
+
 <script>
 function checkLength( o, n, min, max ) {
     if ( o.val().length > max || o.val().length < min ) {
@@ -34,11 +30,10 @@ $(document).ready(function() {
     });
 
     function loadColors(calEvent){
-        $('#color_calendar').removeClass();
-        $('#color_calendar').html('{{ type_label | escape('js') }}');
-        $('#color_calendar').addClass('label_tag');
-        $('#color_calendar').addClass(calEvent.type+'_event');
-        $('.type-agenda').show();
+        $("#calendarModal #color_calendar").removeClass();
+        $("#calendarModal #color_calendar").html('{{ type_label | escape('js') }}');
+        $("#calendarModal #color_calendar").addClass('label_tag');
+        $("#calendarModal #color_calendar").addClass(calEvent.type+'_event');
     }
 
 	var title = $("#title"),
@@ -93,8 +88,8 @@ $(document).ready(function() {
         },
 		// Add event
 		select: function(start, end, jsEvent, view) {
-            var start_date = start.format("YYYY-MM-DD h:mm");
-            var end_date = end.format("YYYY-MM-DD h:mm");
+            //var start_date = start.format("YYYY-MM-DD h:mm");
+            //var end_date = end.format("YYYY-MM-DD h:mm");
             var diffDays = moment(end).diff(start, 'days');
 
             var allDay = true;
@@ -183,9 +178,9 @@ $(document).ready(function() {
                                 } else {
                                     var user_id = String(user).substring(5,user_length);
                                 }
-                                var temp = "&user_id="+user_id;
-                                var position = String(window.location).indexOf("&user");
-                                var url = String(window.location).substring(0, position)+temp;
+                                //var temp = "&user_id="+user_id;
+                                //var position = String(window.location).indexOf("&user");
+                                //var url = String(window.location).substring(0, position)+temp;
                                 /*if (position > 0) {
                                     window.location.replace(url);
                                 } else {
@@ -266,7 +261,7 @@ $(document).ready(function() {
 
 				allFields.removeClass( "ui-state-error" );
 
-                $('#modalTitle').html(calEvent.title);
+                $('#calendarModal #modalTitle').html(calEvent.title);
                 $('#calendarModal').modal();
 
 				var url = '{{ web_agenda_ajax_url }}&a=edit_event&id='+calEvent.id+'&view='+view.name;
@@ -283,7 +278,7 @@ $(document).ready(function() {
                 var btnEdit = '<a href="'+urlEdit+'" id="btnEdit" class="btn btn-primary">{{ "Edit" | get_lang }}</a>';
                 var btnDelete = '<button type="button" id="btnDelete" class="btn btn-danger">{{ "Delete" | get_lang }}</button>';
 
-                $('#modalFooter').html(exportCalConfidential+exportCalPrivate+exportCalPublic+btnEdit+btnDelete);
+                $('#calendarModal #modalFooter').html(exportCalConfidential+exportCalPrivate+exportCalPublic+btnEdit+btnDelete);
 
                 {% if type == 'not_available' %}
                 $('#btnEdit').click(function() {
@@ -423,7 +418,7 @@ $(document).ready(function() {
                 var urlThree =  "ical_export.php?id=" + calEvent.id+'&course_id='+calEvent.course_id+"&class=public";
                 var exportCalPublic = '<a href="'+urlThree+'" class="btn btn-light">{{"ExportiCalPrivate"|get_lang}}</a>';
 
-                $('#modalFooter').html(exportCalConfidential+exportCalPrivate+exportCalPublic);
+                $('#calendarModal #modalFooter').html(exportCalConfidential+exportCalPrivate+exportCalPublic);
 
             }
 		},
@@ -474,6 +469,7 @@ $(document).ready(function() {
     <br /><br />
 {% endif %}
 
+
 <div id="loading" style="margin-left:150px;position:absolute;display:none">
     {{ "Loading" | get_lang }}...
 </div>
@@ -525,10 +521,10 @@ $(document).ready(function() {
                     </dd>
                     <!--- type agenda -->
 
-                    <dt class="type-agenda col-sm-2" style="display: none">
+                    <dt class="col-sm-2">
                         {{ "Agenda" |get_lang }}
                     </dt>
-                    <dd class="type-agenda col-sm-10" style="display: none">
+                    <dd class="col-sm-10">
                         <div id="color_calendar"></div>
                     </dd>