diff --git a/resources/assets/javascripts/bootstrap/resources.js b/resources/assets/javascripts/bootstrap/resources.js index 7eb6a68e1172234e1cca9818cce13b73ca9afa70..7d4f75a8b670e862e78b48fd976a50d4fcbea821 100644 --- a/resources/assets/javascripts/bootstrap/resources.js +++ b/resources/assets/javascripts/bootstrap/resources.js @@ -179,7 +179,7 @@ STUDIP.ready(function () { jQuery(document).on( 'dragenter', - '.individual-booking-plan .appointment-booking-plan .schedule_entry', + '.individual-booking-plan .appointment-booking-plan', function (event) { jQuery(event.target).css('opacity', '0.7'); } @@ -187,7 +187,7 @@ STUDIP.ready(function () { jQuery(document).on( 'dragleave', - '.individual-booking-plan .appointment-booking-plan .schedule_entry', + '.individual-booking-plan .appointment-booking-plan', function (event) { jQuery(event.target).css('opacity', '1.0'); } @@ -206,35 +206,6 @@ STUDIP.ready(function () { } ); - jQuery('.schedule_entry').droppable( - { - drop: function (event, ui_element) { - event.preventDefault(); - - var booking_plan_entry = event.target; - var new_background_colour = jQuery( - ui_element.helper - ).css('background-color'); - - jQuery(booking_plan_entry).css( - 'background-color', - new_background_colour - ); - - jQuery(booking_plan_entry).find('dl').css( - { - backgroundColor: new_background_colour, - borderColor: new_background_colour - } - ); - jQuery(booking_plan_entry).find('dt').css( - 'background-color', - new_background_colour - ); - } - } - ); - //For the message functionality of the resource system: jQuery(document).on( diff --git a/resources/assets/javascripts/init.js b/resources/assets/javascripts/init.js index 8fb9257b5b40dac3329d5a8d7b97a4546a8c348a..9db42671dc436137368ea98e50bd7c01c68d1639 100644 --- a/resources/assets/javascripts/init.js +++ b/resources/assets/javascripts/init.js @@ -36,7 +36,6 @@ import Fullscreen from './lib/fullscreen.js'; import GlobalSearch from './lib/global_search.js'; import HeaderMagic from './lib/header_magic.js'; import i18n from './lib/i18n.js'; -import Instschedule from './lib/instschedule.js'; import InlineEditing from './lib/inline-editing.js'; import JSONAPI, { jsonapi } from './lib/jsonapi.ts'; import JSUpdater from './lib/jsupdater.js'; @@ -64,7 +63,6 @@ import register from './lib/register.js'; import Report from './lib/report.ts'; import Resources from './lib/resources.js'; import Responsive from './lib/responsive.js'; -import Schedule from './lib/schedule.js'; import Screenreader from './lib/screenreader.js'; import Scroll from './lib/scroll.js'; import Search from './lib/search.js'; @@ -120,7 +118,6 @@ window.STUDIP = _.assign(window.STUDIP || {}, { GlobalSearch, HeaderMagic, i18n, - Instschedule, InlineEditing, jsonapi, JSONAPI, @@ -149,7 +146,6 @@ window.STUDIP = _.assign(window.STUDIP || {}, { register, Report, Responsive, - Schedule, Scroll, Screenreader, Search, diff --git a/resources/assets/javascripts/lib/instschedule.js b/resources/assets/javascripts/lib/instschedule.js deleted file mode 100644 index d925bfbc0a959713fe7eafa9360f991721727b32..0000000000000000000000000000000000000000 --- a/resources/assets/javascripts/lib/instschedule.js +++ /dev/null @@ -1,19 +0,0 @@ -import { $gettext } from './gettext'; -import Dialog from './dialog.js'; - -const Instschedule = { - /** - * show the details of a grouped-entry in the isntitute-calendar, containing several seminars - * - * @param string the id of the grouped-entry to be displayed - */ - showInstituteDetails: function(id) { - jQuery.get(STUDIP.URLHelper.getURL('dispatch.php/calendar/instschedule/groupedentry/' + id), function(data) { - Dialog.show(data, { - title: $gettext('Detaillierte Veranstaltungsliste') - }); - }); - } -}; - -export default Instschedule; diff --git a/resources/assets/javascripts/lib/schedule.js b/resources/assets/javascripts/lib/schedule.js deleted file mode 100644 index f3e5123fd45cc5d3ba86ba31e9c57dc83f4d254b..0000000000000000000000000000000000000000 --- a/resources/assets/javascripts/lib/schedule.js +++ /dev/null @@ -1,254 +0,0 @@ -import { $gettext } from './gettext'; -import Calendar from './calendar.js'; -import Dialog from './dialog.js'; - -const Schedule = { - inst_changed: false, - - /** - * this function is called, when an entry shall be created in the calendar - * - * @param object the empty entry in the calendar - * @param int the day that has been clicked - * @param int the start-hour that has been clicked - * @param int the end-hour that has been chosen - */ - newEntry: function(entry, day, start_hour, end_hour) { - /* - // do not allow creation of new entry, if one of the following popups is visible! - if (jQuery('#edit_sem_entry').is(':visible') || - jQuery('#edit_entry').is(':visible') || - jQuery('#edit_inst_entry').is(':visible')) { - jQuery(entry).remove(); - return; - } - */ - - // if there is already an entry set, kick him first before showing a new one - if (this.entry) { - jQuery(this.entry).fadeOut('fast'); - jQuery(this.entry).remove(); - } - - this.entry = entry; - - if (!Schedule.new_entry_template) { - jQuery.get(STUDIP.URLHelper.getURL('dispatch.php/calendar/schedule/entry'), function(data) { - Schedule.new_entry_template = data; - Schedule.showEntryDialog(Schedule.new_entry_template, day, start_hour, end_hour); - }); - } else { - Schedule.showEntryDialog(Schedule.new_entry_template, day, start_hour, end_hour); - } - }, - - /** - * this function is called, when an entry shall be created in the calendar - * and the template-data has been loaded - * - * @param string the html for the new-entry dialog - * @param int the day that has been clicked - * @param int the start-hour that has been clicked - * @param int the end-hour that has been chosen - */ - showEntryDialog: function(template, day, start_hour, end_hour) { - // do not open dialog, if no new-entry-marker is present - if ($('#schedule_entry_new').length === 0) return; - - Dialog.show(template, { - title: $gettext('Neuen Termin eintragen'), - origin: this - }); - - $(this).on('dialog-close', function() { - $('#schedule_entry_new').remove(); - }); - - // fill values of overlay - jQuery('input[name=entry_start]').val(start_hour + ':00'); - jQuery('input[name=entry_end]').val(end_hour + ':00'); - jQuery('select[name=entry_day]').val(parseInt(day) + 1); - }, - - /** - * this function morphs from the quick-add box for adding a new entry to the schedule - * to the larger box with more details to edit - * - * @return: void - */ - showDetails: function() { - // set the values for detailed view - jQuery('select[name=entry_day]').val(Number(jQuery('#new_entry_day').val()) + 1); - jQuery('input[name=entry_start_hour]').val(parseInt(jQuery('#new_entry_start_hour').val(), 10)); - jQuery('input[name=entry_start_minute]').val('00'); - jQuery('input[name=entry_end_hour]').val(parseInt(jQuery('#new_entry_end_hour').val(), 10)); - jQuery('input[name=entry_end_minute]').val('00'); - - jQuery('input[name=entry_title]').val(jQuery('#entry_title').val()); - jQuery('textarea[name=entry_content]').val(jQuery('#entry_content').val()); - - jQuery('#edit_entry_drag').html(jQuery('#new_entry_drag').html()); - - // morph to the detailed view - jQuery('#schedule_new_entry').animate( - { - left: Math.floor(jQuery(window).width() / 4), // for safari - width: '50%', - top: '180px' - }, - 500, - function() { - jQuery('#edit_entry').fadeIn(400, function() { - // reset the box - jQuery('#schedule_new_entry').css({ - display: 'none', - left: 0, - width: '400px', - top: 0, - height: '230px', - 'margin-left': 0 - }); - }); - } - ); - }, - - /** - * show a popup conatining the details of the passed seminar - * at the passed cycle - * - * @param string the seminar to be shown - * @param string the cycle-id of the regular time-entry to be shown - * (a seminar can have multiple of these - */ - showSeminarDetails: function(seminar_id, cycle_id) { - jQuery.get( - STUDIP.URLHelper.getURL('dispatch.php/calendar/schedule/entryajax/' + seminar_id + '/' + cycle_id), - function(data) { - Dialog.show(data, { - title: $gettext('Veranstaltungsdetails') - }); - } - ); - - Calendar.click_in_progress = false; - }, - - /** - * show a popup with the details of a regular schedule entry with passed id - * - * @param string the id of the schedule-entry - */ - showScheduleDetails: function(id) { - jQuery.get(STUDIP.URLHelper.getURL('dispatch.php/calendar/schedule/entry/' + id), function(data) { - Dialog.show(data, { - title: $gettext('Termindetails bearbeiten') - }); - }); - - Calendar.click_in_progress = false; - }, - - /** - * show a popup with the details of a group entry, containing several seminars - * - * @param string the id of the grouped entry to be displayed - */ - showInstituteDetails: function(id) { - jQuery.get(STUDIP.URLHelper.getURL('dispatch.php/calendar/schedule/groupedentry/' + id + '/true'), function( - data - ) { - Dialog.show(data, { - title: $gettext('Veranstaltungsdetails') - }); - }); - - Calendar.click_in_progress = false; - }, - - /** - * hide a seminar-entry in the schedule (admin-version) - * - * @param string the seminar to be shown - * @param string the cycle-id of the regular time-entry to be shown - * (a seminar can have multiple of these - */ - instSemUnbind: function(seminar_id, cycle_id) { - Schedule.inst_changed = true; - jQuery.ajax({ - type: 'GET', - url: STUDIP.URLHelper.getURL( - 'dispatch.php/calendar/schedule/adminbind/' + seminar_id + '/' + cycle_id + '/0/true' - ) - }); - - jQuery('#' + seminar_id + '_' + cycle_id + '_hide').fadeOut('fast', function() { - jQuery('#' + seminar_id + '_' + cycle_id + '_show').fadeIn('fast'); - }); - }, - - /** - * make a hidden seminar-entry visible in the schedule again - * - * @param string the seminar to be shown - * @param string the cycle-id of the regular time-entry to be shown - * (a seminar can have multiple of these - */ - instSemBind: function(seminar_id, cycle_id) { - Schedule.inst_changed = true; - jQuery.ajax({ - type: 'GET', - url: STUDIP.URLHelper.getURL( - 'dispatch.php/calendar/schedule/adminbind/' + seminar_id + '/' + cycle_id + '/1/true' - ) - }); - - jQuery('#' + seminar_id + '_' + cycle_id + '_show').fadeOut('fast', function() { - jQuery('#' + seminar_id + '_' + cycle_id + '_hide').fadeIn('fast'); - }); - }, - - /** - * hide the popup of grouped-entry, containing a list of seminars. - * returns true if the visiblity of one of the entries has been changed, - * false otherwise - * - * @param object the element to be hidden - * - * @return bool true if the visibility of one seminar hase changed, false otherwise - */ - hideInstOverlay: function(element) { - if (Schedule.inst_changed) { - return true; - } - jQuery(element).fadeOut('fast'); - - Calendar.click_in_progress = false; - - return false; - }, - - /** - * calls Calendar.checkTimeslot to check that the time is valid - * - * @param bool returns true if the time is valid, false otherwise - */ - checkFormFields: function() { - if ( - !Calendar.checkTimeslot( - jQuery('#schedule_entry_hours > input[name=entry_start_hour]'), - jQuery('#schedule_entry_hours > input[name=entry_start_minute]'), - jQuery('#schedule_entry_hours > input[name=entry_end_hour]'), - jQuery('#schedule_entry_hours > input[name=entry_end_minute]') - ) - ) { - jQuery('#schedule_entry_hours').addClass('invalid'); - jQuery('#schedule_entry_hours > span[class=invalid_message]').show(); - return false; - } - - return true; - } -}; - -export default Schedule; diff --git a/resources/assets/stylesheets/highcontrast.scss b/resources/assets/stylesheets/highcontrast.scss index fc8ec211419c6b067538aec2843fe1b12de4fd69..29b6fd5baaf9b94c57577850d3f0cd0fdd5103bf 100644 --- a/resources/assets/stylesheets/highcontrast.scss +++ b/resources/assets/stylesheets/highcontrast.scss @@ -536,181 +536,6 @@ a .hidden-tiny-down { } } - -/* Calendar categories */ - -div.schedule_entry { - dl { - &.hover:hover { opacity: unset; } - - &.schedule-category1 { - background-color: $white; - border: 1px solid $calendar-category-1; - dt { - background-color: $calendar-category-1; - color: text-contrast($calendar-category-1, $black, $white); - } - dd { - color: $black; - } - } - &.schedule-category2 { - background-color: $white; - border: 1px solid $calendar-category-2; - dt { - background-color: $calendar-category-2; - color: text-contrast($calendar-category-2, $black, $white); - } - dd { - color: $black; - } - } - &.schedule-category3 { - background-color: $white; - border: 1px solid $calendar-category-3; - dt { - background-color: $calendar-category-3; - color: text-contrast($calendar-category-3, $black, $white); - } - dd { - color: $black; - } - } - &.schedule-category4 { - background-color: $white; - border: 1px solid $calendar-category-4; - dt { - background-color: $calendar-category-4; - color: text-contrast($calendar-category-4, $black, $white); - } - dd { - color: $black; - } - } - &.schedule-category5 { - background-color: $white; - border: 1px solid $calendar-category-5; - dt { - background-color: $calendar-category-5; - color: text-contrast($calendar-category-5, $black, $white); - } - dd { - color: $black; - } - } - &.schedule-category6 { - background-color: $white; - border: 1px solid $calendar-category-6; - dt { - background-color: $calendar-category-6; - color: text-contrast($calendar-category-6, $black, $white); - } - dd { - color: $black; - } - } - &.schedule-category7 { - background-color: $white; - border: 1px solid $calendar-category-7; - dt { - background-color: $calendar-category-7; - color: text-contrast($calendar-category-7, $black, $white); - } - dd { - color: $black; - } - } - &.schedule-category8 { - background-color: $white; - border: 1px solid $calendar-category-8; - dt { - background-color: $calendar-category-8; - color: text-contrast($calendar-category-8, $black, $white); - } - dd { - color: $black; - } - } - &.schedule-category9 { - background-color: $white; - border: 1px solid $calendar-category-9; - dt { - background-color: $calendar-category-9; - color: text-contrast($calendar-category-9, $black, $white); - } - dd { - color: $black; - } - } - &.schedule-category10 { - background-color: $white; - border: 1px solid $calendar-category-10; - dt { - background-color: $calendar-category-10; - color: text-contrast($calendar-category-10, $black, $white); - } - dd { - color: $black; - } - } - &.schedule-category11 { - background-color: $white; - border: 1px solid $calendar-category-11; - dt { - background-color: $calendar-category-11; - color: text-contrast($calendar-category-11, $black, $white); - } - dd { - color: $black; - } - } - &.schedule-category12 { - background-color: $white; - border: 1px solid $calendar-category-12; - dt { - background-color: $calendar-category-12; - color: text-contrast($calendar-category-12, $black, $white); - } - dd { - color: $black; - } - } - &.schedule-category13 { - background-color: $white; - border: 1px solid $calendar-category-13; - dt { - background-color: $calendar-category-13; - color: text-contrast($calendar-category-13, $black, $white); - } - dd { - color: $black; - } - } - &.schedule-category14 { - background-color: $white; - border: 1px solid $calendar-category-14; - dt { - background-color: $calendar-category-14; - color: text-contrast($calendar-category-14, $black, $white); - } - dd { - color: $black; - } - } - &.schedule-category15 { - background-color: $white; - border: 1px solid $calendar-category-15; - dt { - background-color: $calendar-category-15; - color: text-contrast($calendar-category-15, $black, $white); - } - dd { - color: $black; - } - } - } -} - /* underlined links only in main content,not in navigation */ a, a:link, @@ -1103,18 +928,6 @@ section.course-statusgroups footer, border-top: 2px solid $black; } -div#schedule_day { - border-right: 2px double $black; -} - -table#schedule_data thead tr td { - border-bottom: 2px solid $darkergray; -} - -table#schedule_data tbody td:first-child { - border-right: 2px solid $darkergray; -} - /* Skiplink box */ button.skiplink { color: $black; diff --git a/resources/assets/stylesheets/print.scss b/resources/assets/stylesheets/print.scss index 72044e0a6ee0e15138410f3c4653fc5e92931649..ee1e8a88b2e645b14c27cb4e97c3e0e4247cfad0 100644 --- a/resources/assets/stylesheets/print.scss +++ b/resources/assets/stylesheets/print.scss @@ -30,8 +30,7 @@ body, input, textarea, td, th, blockquote, p, form, ul, h4 { } #top-bar, #navigation-level-1, #navigation-level-2, -#page-title-container, #responsive-contentbar-container, #sidebar, -#schedule_icons, #edit_inst_entry, +#page-title-container, #responsive-contentbar-container, #sidebar, #edit_inst_entry, .messagebox_buttons a.close, a.button, button.button, #skip_link_navigation, #skiplink_list, .skip_target, .action-menu { display: none !important; diff --git a/resources/assets/stylesheets/scss/schedule.scss b/resources/assets/stylesheets/scss/schedule.scss deleted file mode 100644 index c7491ecbe71e557b16a6d260fc5505a5110e29ea..0000000000000000000000000000000000000000 --- a/resources/assets/stylesheets/scss/schedule.scss +++ /dev/null @@ -1,490 +0,0 @@ -/* --- ablaufplan / dates --------------------------------------------------- */ -.dates_items th, .dates_items td { - border-bottom: 3px solid var(--white); -} - -.dates_opened td { - border-bottom: 3px solid var(--content-color-10); -} - -.dates_content td { - padding: 10px; -} - -#schedule { - width: 100%; - height: 100%; -} - -#schedule_headings { - margin-left: 41px; - background-color: var(--content-color-20); -} - -table.schedule_headings td { - background-color: var(--content-color-20); -} - -div.schedule_day { - border-right: 3px double var(--dark-gray-color-20); - position: relative; -} - -div.schedule_marker { - border-bottom: 1px dotted var(--dark-gray-color-20); - border-top: 1px solid var(--dark-gray-color-20); - padding: 0; -} - -div.schedule_hours { - border-top: 1px solid var(--dark-gray-color-20); - border-right: 1px solid var(--dark-gray-color-20); - color: black; - padding-bottom: 1px; - padding-right: 3px; -} - -div.schedule_entry { - font-size: 10px; - margin: 0; - overflow: hidden; - padding: 0 0 2px; - position: absolute; - - &.clickable { cursor: pointer; } - - dl { - color: white; - height: 100%; - margin: 0; - - &.hover:hover { opacity: 0.7; } - - a { - color: var(--white); - &:hover { text-decoration: underline; } - } - dd { - margin: 0; - overflow: hidden; - padding: 2px; - word-wrap: break-word; - font-weight: 600; - } - } -} - -div.snatch { - bottom: 4px; - cursor: ns-resize; - padding-bottom: 2px; - position: absolute; - text-align: center; - width: 100%; - - div { - border-top: 3px double var(--white); - cursor: ns-resize; - height: 0; - margin-left: auto; - margin-right: auto; - width: 10px; - } -} - -#schedule_new_entry { - background-color: var(--content-color-20); - border: 2px solid var(--dark-gray-color-15); - height: 230px; - position: absolute; - width: 400px; - z-index: 3; -} -#schedule_entry_new { - dl { - border: 1px solid var(--dark-violet); - background-color: var(--dark-violet-80); - } - dt { background-color: var(--dark-violet); } -} - -div.schedule_edit_entry, #schedule_settings { - background-color: var(--content-color-20); - border: 2px solid var(--dark-gray-color-15); - height: auto; - left: 50%; - margin-left: -25%; - max-height: 80em; - min-height: 15em; - min-width: 700px; - padding-bottom: 1em; - position: absolute; - top: 180px; - width: 50%; - z-index: 4; -} - -div.schedule_edit_entry > form { - margin-right: 10px; - padding-left: 10px; - padding-top: 10px; -} - -#schedule_entry_hours { - display: inline; - padding: 2px; -} - -.schedule_icons { - position: absolute; - right: 0; - top: 0; - - img { - width: 16px; - height: 16px; - } -} - -div.invisible_entry { - opacity: 0.8; -} - -span.invisible_entry { - background-color: var(--red); - font-style: italic; -} - -div.schedule_settings { - float: left; - margin-left: 10px; - - div { - font-weight: bold; - } -} - -.schedule-dialog { - display: block; - outline: 0 none; - z-index: 1002; - - position: absolute; - height: 400px; - width: 600px; - top: 50%; - left: 50%; - - margin: -200px 0 0 -300px; -} - -td.schedule-adminbind { - & > span { - margin-right: 10px; - } -} - -#color_picker { - - span { - flex: 0 0 auto; - - padding: 3px; - vertical-align: middle; - } - - input[type="radio"] { - @extend .sr-only; - - &:checked + label { - outline: 1px solid var(--black); - - position: relative; - @include icon(before, accept, info, 24px); - &::before { - position: absolute; - left: 50%; - top: 50%; - transform: translate(-50%, -50%); - filter: drop-shadow(0 0 2px var(--white)); - } - } - } - - label { - border: 1px solid var(--white); - display: inline-block; - height: 32px; - width: 32px; - - &.schedule-category1 { - background-color: $calendar-category-1; - } - &.schedule-category2 { - background-color: $calendar-category-2; - } - &.schedule-category3 { - background-color: $calendar-category-3; - } - &.schedule-category4 { - background-color: $calendar-category-4; - } - &.schedule-category5 { - background-color: $calendar-category-5; - } - &.schedule-category6 { - background-color: $calendar-category-6; - } - &.schedule-category7 { - background-color: $calendar-category-7; - } - &.schedule-category8 { - background-color: $calendar-category-8; - } - &.schedule-category9 { - background-color: $calendar-category-9; - } - &.schedule-category10 { - background-color: $calendar-category-10; - } - &.schedule-category11 { - background-color: $calendar-category-11; - } - &.schedule-category12 { - background-color: $calendar-category-12; - } - &.schedule-category13 { - background-color: $calendar-category-13; - } - &.schedule-category14 { - background-color: $calendar-category-14; - } - &.schedule-category15 { - background-color: $calendar-category-15; - } - &.schedule-category16 { - background-color: $calendar-category-16; - } - &.schedule-category17 { - background-color: $calendar-category-17; - } - &.schedule-category18 { - background-color: $calendar-category-18; - } - &.schedule-category255 { - background-color: $calendar-category-255; - } - } -} - -div.schedule_entry { - - dl { - &.schedule-category1 { - background-color: $calendar-category-1-aux; - border: 1px solid $calendar-category-1; - dt { - background-color: $calendar-category-1; - color: contrast($calendar-category-1, $black, $white); - } - dd { - color: contrast($calendar-category-1-aux, $black, $white); - } - } - &.schedule-category2 { - background-color: $calendar-category-2-aux; - border: 1px solid $calendar-category-2; - dt { - background-color: $calendar-category-2; - color: contrast($calendar-category-2, $black, $white); - } - dd { - color: contrast($calendar-category-2-aux, $black, $white); - } - } - &.schedule-category3 { - background-color: $calendar-category-3-aux; - border: 1px solid $calendar-category-3; - dt { - background-color: $calendar-category-3; - color: contrast($calendar-category-3, $black, $white); - } - dd { - color: contrast($calendar-category-3-aux, $black, $white); - } - } - &.schedule-category4 { - background-color: $calendar-category-4-aux; - border: 1px solid $calendar-category-4; - dt { - background-color: $calendar-category-4; - color: contrast($calendar-category-4, $black, $white); - } - dd { - color: contrast($calendar-category-4-aux, $black, $white); - } - } - &.schedule-category5 { - background-color: $calendar-category-5-aux; - border: 1px solid $calendar-category-5; - dt { - background-color: $calendar-category-5; - color: contrast($calendar-category-5, $black, $white); - } - dd { - color: contrast($calendar-category-5-aux, $black, $white); - } - } - &.schedule-category6 { - background-color: $calendar-category-6-aux; - border: 1px solid $calendar-category-6; - dt { - background-color: $calendar-category-6; - color: contrast($calendar-category-6, $black, $white); - } - dd { - color: contrast($calendar-category-6-aux, $black, $white); - } - } - &.schedule-category7 { - background-color: $calendar-category-7-aux; - border: 1px solid $calendar-category-7; - dt { - background-color: $calendar-category-7; - color: contrast($calendar-category-7, $black, $white); - } - dd { - color: contrast($calendar-category-7-aux, $black, $white); - } - } - &.schedule-category8 { - background-color: $calendar-category-8-aux; - border: 1px solid $calendar-category-8; - dt { - background-color: $calendar-category-8; - color: contrast($calendar-category-8, $black, $white); - } - dd { - color: contrast($calendar-category-8-aux, $black, $white); - } - } - &.schedule-category9 { - background-color: $calendar-category-9-aux; - border: 1px solid $calendar-category-9; - dt { - background-color: $calendar-category-9; - color: contrast($calendar-category-9, $black, $white); - } - dd { - color: contrast($calendar-category-9-aux, $black, $white); - } - } - &.schedule-category10 { - background-color: $calendar-category-10-aux; - border: 1px solid $calendar-category-10; - dt { - background-color: $calendar-category-10; - color: contrast($calendar-category-10, $black, $white); - } - dd { - color: contrast($calendar-category-10-aux, $black, $white); - } - } - &.schedule-category11 { - background-color: $calendar-category-11-aux; - border: 1px solid $calendar-category-11; - dt { - background-color: $calendar-category-11; - color: contrast($calendar-category-11, $black, $white); - } - dd { - color: contrast($calendar-category-11-aux, $black, $white); - } - } - &.schedule-category12 { - background-color: $calendar-category-12-aux; - border: 1px solid $calendar-category-12; - dt { - background-color: $calendar-category-12; - color: contrast($calendar-category-12, $black, $white); - } - dd { - color: contrast($calendar-category-12-aux, $black, $white); - } - } - &.schedule-category13 { - background-color: $calendar-category-13-aux; - border: 1px solid $calendar-category-13; - dt { - background-color: $calendar-category-13; - color: contrast($calendar-category-13, $black, $white); - } - dd { - color: contrast($calendar-category-13-aux, $black, $white); - } - } - &.schedule-category14 { - background-color: $calendar-category-14-aux; - border: 1px solid $calendar-category-14; - dt { - background-color: $calendar-category-14; - color: contrast($calendar-category-14, $black, $white); - } - dd { - color: contrast($calendar-category-14-aux, $black, $white); - } - } - &.schedule-category15 { - background-color: $calendar-category-15-aux; - border: 1px solid $calendar-category-15; - dt { - background-color: $calendar-category-15; - color: contrast($calendar-category-15, $black, $white); - } - dd { - color: contrast($calendar-category-15-aux, $black, $white); - } - } - &.schedule-category16 { - background-color: $calendar-category-16-aux; - border: 1px solid $calendar-category-16; - dt { - background-color: $calendar-category-16; - color: contrast($calendar-category-16, $black, $white); - } - dd { - color: contrast($calendar-category-16-aux, $black, $white); - } - } - &.schedule-category17 { - background-color: $calendar-category-17-aux; - border: 1px solid $calendar-category-17; - dt { - background-color: $calendar-category-17; - color: contrast($calendar-category-17, $black, $white); - } - dd { - color: contrast($calendar-category-17-aux, $black, $white); - } - } - &.schedule-category18 { - background-color: $calendar-category-18-aux; - border: 1px solid $calendar-category-18; - dt { - background-color: $calendar-category-18; - color: contrast($calendar-category-18, $black, $white); - } - dd { - color: contrast($calendar-category-18-aux, $black, $white); - } - } - } -} - - -.studip-widget { - #schedule { - margin: 10px; - width: unset; - } -} \ No newline at end of file diff --git a/resources/assets/stylesheets/scss/tables.scss b/resources/assets/stylesheets/scss/tables.scss index ee551125c1425eef77e2a8fb2e64ce892c46c7be..288c667ef0394e679738a7b46f2811e9b2c2c46a 100644 --- a/resources/assets/stylesheets/scss/tables.scss +++ b/resources/assets/stylesheets/scss/tables.scss @@ -840,42 +840,6 @@ table.withdetails { } } -// Schedule table -table#schedule_data { - width: 100%; - table-layout: fixed; - - thead { - tr { - td { - text-align: center; - vertical-align: top; - background-color: var(--color--table-header); - padding: 0; - - &:first-child { - width: 40px; - } - } - - &:first-child { - td:first-child { - background-color: inherit; - } - } - } - } - - tbody { - td:first-child { - text-align: right; - vertical-align: top; - background-color: var(--color--table-header); - padding: 0px; - } - } -} - // Responsive helper .table-scrollbox-horizontal { @include scrollbox-horizontal(); diff --git a/resources/assets/stylesheets/studip.scss b/resources/assets/stylesheets/studip.scss index 7369a8bb5f80d438a1ec6f7e215badf1d36f2a2c..b166e069e841e39d814e62d12e0db0926f5665ef 100644 --- a/resources/assets/stylesheets/studip.scss +++ b/resources/assets/stylesheets/studip.scss @@ -87,7 +87,6 @@ @import "scss/selects"; @import "scss/search"; @import "scss/skiplinks"; -@import "scss/schedule"; @import "scss/start"; @import "scss/scroll-to-top"; @import "scss/statusgroups"; diff --git a/templates/calendar/calendar_view.php b/templates/calendar/calendar_view.php deleted file mode 100644 index db3cb36b941787473ae0d319ef8d51057fb80e1e..0000000000000000000000000000000000000000 --- a/templates/calendar/calendar_view.php +++ /dev/null @@ -1,188 +0,0 @@ -<?php -# Lifter010: TODO - -if (!$calendar_view || !($calendar_view instanceof CalendarView)) { - throw new Exception('You need to pass a variable named $calendar_view, which holds an instance of CalendarView, to this template ('. __FILE__ .')!'); -} - -list($start_hour, $end_hour) = $calendar_view->getRange(); - -$cell_height = $calendar_view->getHeight() + 2; -$cell_steps = $cell_height / 60; -?> - -<script> - STUDIP.Calendar.cell_height = <?= $cell_height ?>; - STUDIP.Calendar.the_entry_content = '<?= str_replace("\n", '', $this->render_partial('calendar/entries/empty_entry')) ?>'; - STUDIP.Calendar.start_hour = <?= $start_hour ?>; - - <? if ($js_function = $calendar_view->getInsertFunction()) : ?> - jQuery(function() { - - jQuery('[id^=calendar_view_<?= $view_id ?>_column_] div.schedule_entry').bind('mousedown', function(event) { - STUDIP.Calendar.click_in_progress = true; - }); - - jQuery('[id^=calendar_view_<?= $view_id ?>_column_]').bind('mousedown', function(event) { - if (STUDIP.Calendar.click_in_progress) return; - - var column_id = this.id.substr(this.id.lastIndexOf("_")+1); - - STUDIP.Calendar.click_start_hour = Math.floor(((event.pageY - Math.ceil(jQuery(this).offset().top)) - 2) - / STUDIP.Calendar.cell_height) + STUDIP.Calendar.start_hour; - - STUDIP.Calendar.click_entry = jQuery(STUDIP.Calendar.the_entry_content); - jQuery("span.empty_entry_start", STUDIP.Calendar.click_entry).text(STUDIP.Calendar.click_start_hour); - jQuery("span.empty_entry_end", STUDIP.Calendar.click_entry).text(STUDIP.Calendar.click_start_hour + 1); - jQuery(STUDIP.Calendar.click_entry).css("top", Math.floor((STUDIP.Calendar.click_start_hour - STUDIP.Calendar.start_hour) * STUDIP.Calendar.cell_height - 2) + "px") - .css("height", STUDIP.Calendar.cell_height + "px") - .css("display", "none") - .appendTo('#calendar_view_<?= $view_id ?>_column_' + column_id) - .show(); - }); - - jQuery('[id^=calendar_view_<?= $view_id ?>_column_]').bind('mousemove', function(event) { - if (STUDIP.Calendar.click_in_progress) return; - - if (STUDIP.Calendar.click_entry) { - var end_stunde = Math.max(Math.floor(((event.pageY - Math.ceil(jQuery(this).offset().top)) - 2) - / STUDIP.Calendar.cell_height) + STUDIP.Calendar.start_hour, STUDIP.Calendar.click_start_hour); - - jQuery("span.empty_entry_end", STUDIP.Calendar.click_entry).text(end_stunde + 1); - jQuery(STUDIP.Calendar.click_entry).css('height', (STUDIP.Calendar.cell_height * ((end_stunde + 1) - STUDIP.Calendar.click_start_hour) - 2) + 'px'); - window.getSelection().removeAllRanges(); - } - }); - - jQuery('[id^=calendar_view_<?= $view_id ?>_column_]').bind('mouseup', function(event) { - if (STUDIP.Calendar.click_in_progress) return; - - var column_id = this.id.substr(this.id.lastIndexOf("_")+1); - var end_stunde = Math.max(Math.floor(((event.pageY - Math.ceil(jQuery(this).offset().top)) - 2) - / STUDIP.Calendar.cell_height) + STUDIP.Calendar.start_hour, STUDIP.Calendar.click_start_hour); - - var func = <?= $js_function ?>; - - jQuery("span.empty_entry_end", STUDIP.Calendar.click_entry).text(end_stunde + 1); - jQuery(STUDIP.Calendar.click_entry).css('height', (STUDIP.Calendar.cell_height * ((end_stunde + 1) - STUDIP.Calendar.click_start_hour) - 2) + 'px'); - - func(STUDIP.Calendar.click_entry, column_id, STUDIP.Calendar.click_start_hour, end_stunde + 1); - - STUDIP.Calendar.click_entry = null; - STUDIP.Calendar.click_start_hour = null; - }); - }); - <? endif ?> -</script> - -<!-- the view --> -<div id="schedule"> - -<table id="schedule_data" cellspacing="0" cellpadding="0"> - <thead> - <tr> - <td></td> - <? foreach ($calendar_view->getColumns() as $column) : ?> - <td> - <? if ($column->getURL()): ?> - <a href="<?= URLHelper::getLink($column->getURL()) ?>"> - <? endif; ?> - <?= htmlReady($column->getTitle()) ?> - <? if ($column->getURL()): ?> - </a> - <? endif; ?> - </td> - <? endforeach; ?> - </tr> - </thead> - <tbody> - <tr> - <td> - </td> - <td colspan="<?= sizeof($calendar_view->getColumns()) ?>" style="padding: 0px"> - <!-- the lines separating the hours and half-hours --> - <div style="position: relative"> - <div style="position: absolute; width: 100%;"> - <? for ($i = $start_hour; $i <= $end_hour; $i++) : ?> - <div id="marker_<?= $i ?>" class="schedule_marker"></div> - <? endfor; ?> - </div> - </div> - </td> - </tr> - <tr> - <td> - <!-- the hours for the time-table --> - <? for ($i = $start_hour; $i <= $end_hour; $i++) : ?> - <div class="schedule_hours"><?= ($i < 10) ? '0'.$i : $i ?>:00</div> - <? endfor; ?> - </td> - <? foreach ($calendar_view->getColumns() as $column) : ?> - <td style="vertical-align: top"> - <!-- the days with the date for the timetable --> - <div id="calendar_view_<?= $view_id ?>_column_<?= $column->getId() ?>" class="schedule_day" style="overflow: hidden"> - <? $groups = $column->getGroupedEntries(); - if (!empty($groups)) : - $width = round(100 / sizeof($groups), 2); - $col = 0; - foreach ($groups as $grouped_entries) : - - foreach ($grouped_entries as $entry) : - // if we have a grouped entry, use start- and end-time of any entry, the are all the same - $calc_entry = $calendar_view->isGrouped() ? $entry[0] : $entry; - - // move the box up, if the user has set a later start-hour for his schedule - $calc_entry['end'] -= $start_hour * 100; - - // if the start is out of range of the displayed hours, clip the box - if ($calc_entry['start'] < $start_hour * 100) { - $calc_entry['start'] = 0; - } else { - $calc_entry['start'] -= $start_hour * 100; - } - - // calculate the position and height of the entry - $top = floor($cell_height * floor($calc_entry['start'] / 100) - + $cell_steps * floor($calc_entry['start'] % 100)); - $bottom = floor($cell_height * floor($calc_entry['end'] / 100) - + $cell_steps * floor($calc_entry['end'] % 100)) - 1; - - // how many concurring entries has this entry? - $max = 0; - $current_matrix = $column->getMatrix(); - for ($i = ($calc_entry['start'] + 1 + ($start_hour * 100)); $i < $calc_entry['end'] + ($start_hour * 100); $i++) { - if (isset($current_matrix[$i])) { - $max = max($max, $current_matrix[$i]); - } - } - - // set height and width - $height = $bottom - $top; - - $this->top = $top; - $this->width = $width; - $this->height = $height; - $this->entry = $entry; - $this->col = $col; - - // if we have no concurring entries set the maximum useful width - if ($max == 1) $this->width = '100'; - - if ($calendar_view->isGrouped()) { - echo $this->render_partial('calendar/entries/grouped_entry', ['day' => $column->getId()]); - } else { - echo $this->render_partial('calendar/entries/entry'); - } - - endforeach; /* cycle thrugh entries */ - $col++; - - endforeach; /* cycle through columns */ - endif; ?> - </div> - </td> - <? endforeach; /* cycle through days*/ ?> - </tr> - </tbody> -</table> -</div> diff --git a/templates/calendar/entries/empty_entry.php b/templates/calendar/entries/empty_entry.php deleted file mode 100644 index aa6616607cdcdd2dfff4a2479c80172c2c87f41f..0000000000000000000000000000000000000000 --- a/templates/calendar/entries/empty_entry.php +++ /dev/null @@ -1,14 +0,0 @@ -<? -# Lifter010: TODO -?> -<div id="schedule_entry_new" class="schedule_entry" style="width: 98%"> - <dl> - <dt> - <?= sprintf("%s - %s", '<span class="empty_entry_start"></span>:00', '<span class="empty_entry_end"></span>:00') ?> - </dt> - <dd> - <?= _("Neuer Eintrag") ?> - </dd> - </dl> - <div class="snatch" style="display: none"><div> </div></div> -</div> \ No newline at end of file diff --git a/templates/calendar/entries/entry.php b/templates/calendar/entries/entry.php deleted file mode 100644 index 1b4242d7b8eb1cafdba298013ee2b7eaecf83882..0000000000000000000000000000000000000000 --- a/templates/calendar/entries/entry.php +++ /dev/null @@ -1,34 +0,0 @@ -<? - -$element_id = md5(uniqid()); -?> - -<div id="schedule_entry_<?= $element_id ?>_<?= $entry['id'] ?? '' ?>" class="schedule_entry <?= ((isset($entry['visible']) && !$entry['visible']) ? 'invisible_entry' : '') . (!empty($entry['onClick']) ? " clickable" : "") ?>" style="top: <?= $top ?>px; height: <?= $height ?>px; width: <?= str_replace(',', '.', $width) ?>%<?= ($col > 0) ? ';left:'. str_replace(',', '.', $col * $width) .'%' : '' ?>" title="<?= htmlReady($entry['title']) ?>"> - - <a <?= !empty($entry['url']) ? ' href="'.$entry['url'].'"' : '' ?> - <?= !empty($entry['onClick']) ? 'onClick="STUDIP.Calendar.clickEngine('. $entry['onClick'].', this, event); return false;"' : '' ?>> - - <!-- for safari5 we need to set the height for the dl as well --> - <dl class="hidden-medium-up schedule-category<?= $entry['color'] ?? ''?> <?= $calendar_view->getReadOnly() ? '' : 'hover' ?>" style="height: <?= $height ?>px;"> - <dt> - <?= nl2br(htmlReady($entry['content'] ?? '')) ?><br> - </dt> - <dd> - <?= floor($entry['start']/100).":".(($entry['start']%100) < 10 ? "0" : "").($entry['start']%100) ?> - <?= floor($entry['end']/100).":".(($entry['end']%100) < 10 ? "0" : "").($entry['end']%100) ?><?= $entry['title'] ? ', <b>'. htmlReady($entry['title']) .'</b>' : '' ?> - </dd> - </dl> - <dl class="hidden-small-down schedule-category<?= $entry['color']?> <?= $calendar_view->getReadOnly() ? '' : 'hover' ?>" style="height: <?= $height ?>px;"> - <dt> - <?= floor($entry['start']/100).":".(($entry['start']%100) < 10 ? "0" : "").($entry['start']%100) ?> - <?= floor($entry['end']/100).":".(($entry['end']%100) < 10 ? "0" : "").($entry['end']%100) ?><?= $entry['title'] ? ', <b>'. htmlReady($entry['title']) .'</b>' : '' ?> - </dt> - <dd> - <?= nl2br(htmlReady($entry['content'] ?? '')) ?><br> - </dd> - </dl> - - </a> - - <div class="snatch" style="display: none"><div> </div></div> - - <?= $this->render_partial('calendar/entries/icons', compact('element_id')) ?> -</div> diff --git a/templates/calendar/entries/grouped_entry.php b/templates/calendar/entries/grouped_entry.php deleted file mode 100644 index 9e882157653cae0cfb6d06769b3cdb7da31e0d6e..0000000000000000000000000000000000000000 --- a/templates/calendar/entries/grouped_entry.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php -$title = []; -$heading = []; -$ids = []; - -// check, if at least one entry is visible -$show = false; -foreach ($entry as $element) : - $title[] = $element['content']; - if ($element['title']) : - $heading[] = $element['title']; - endif; - $ids[] = $element['id']; - if ($element['visible']) $show = true; -endforeach; -$element_id = md5(uniqid()); -?> - -<? if ($show || $show_hidden) : ?> -<div id="schedule_entry_<?= $element_id ?>_<?= $entry[0]['start'] .'/'. $entry[0]['end'] .'/'. implode(',', $ids) .'/'. $day ?>" class="schedule_entry <?= !$show ? 'invisible_entry' : '' ?>" - style="top: <?= $top ?>px; height: <?= $height ?>px; width: <?= str_replace(',', '.', $width) ?>%<?= ($col > 0) ? ';left:'. str_replace(',', '.', $col * $width) .'%' : '' ?>" - title="<?= htmlReady(implode(', ', $title)) ?>"> - - <a <?= isset($entry['url']) ? ' href="'.$entry['url'].'"' : '' ?> - <?= $entry[0]['onClick'] ? 'onClick="STUDIP.Calendar.clickEngine(' . $entry[0]['onClick'] . ', this, event); return false;"' : '' ?>> - - <!-- for safari5 we need to set the height for the dl as well --> - <dl class="schedule-category<?= $entry[0]['color']?> <?= $calendar_view->getReadOnly() ? '' : 'hover' ?>" style="height: <?= $height ?>px;"> - <dt> - <?= $entry[0]['start_formatted'] ?> - <?= $entry[0]['end_formatted'] ?> - <?= (count($heading) ? ', <strong>' . htmlReady(implode(', ', $heading)) . '</strong>' : '') ?> - </dt> - <dd> - <? foreach ($entry as $element) : - if (!isset($element['visible']) || $element['visible']) : ?> - <?= htmlReady($element['content']) ?><br> - <? elseif ($show_hidden) : ?> - <span class="invisible_entry"><?= htmlReady($element['content']) ?></span><br> - <? endif ?> - <? endforeach; /* the elements for this grouped entry */ ?> - </dd> - </dl> - - </a> - - <div class="snatch" style="display: none"><div> </div></div> - <?= $this->render_partial('calendar/entries/icons', compact('element_id')) ?> - -</div> -<? endif ?> diff --git a/templates/calendar/entries/icons.php b/templates/calendar/entries/icons.php deleted file mode 100644 index 1edb480c546c7935329a1006781befc690c1e1be..0000000000000000000000000000000000000000 --- a/templates/calendar/entries/icons.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php -/** - * @var string $element_id - * @var array $entry - */ -?> -<div id="schedule_icons_<?= $element_id ?>" class="schedule_icons"> - <? if (!empty($entry['icons'])) foreach ($entry['icons'] as $icon) : ?> - <? if (!empty($icon['url'])) : ?> - <a href="<?= $icon['url'] ?>" <?= $icon['onClick'] ? 'onClick="STUDIP.Calendar.clickEngine('. $icon['onClick'].', this, event); return false;"' : '' ?>> - <?= Assets::img($icon['image'], ['title' => $icon['title'], 'alt' => $icon['title']]) ?> - </a> - <? else : ?> - <?= Assets::img($icon['image'], ['title' => $icon['title']]) ?> - <? endif; ?> - <? endforeach ?> -</div>