From 70551b3b97680397f462f7c23a3e649dd7ead3f0 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Willms Date: Fri, 19 Jan 2024 12:08:40 +0000 Subject: rename permission checks and make parameter user_id optional, re #1354 Merge request studip/studip!2530 --- app/controllers/calendar/calendar.php | 23 +- app/controllers/calendar/date.php | 8 +- app/views/calendar/calendar/publish.php | 2 +- lib/classes/IcalExport.php | 17 +- lib/classes/calendar/ICalendarExport.class.php | 10 +- lib/classes/calendar/Owner.interface.php | 10 +- lib/models/Course.class.php | 12 +- lib/models/User.class.php | 12 +- lib/models/calendar/CalendarDate.class.php | 4 +- lib/navigation/StartNavigation.php | 2 +- lib/seminar_open.php | 2 +- .../javascripts/bootstrap/calendar_dialog.js | 11 - resources/assets/javascripts/entry-base.js | 1 - resources/assets/javascripts/init.js | 2 - .../assets/javascripts/lib/calendar_dialog.js | 64 ----- resources/assets/stylesheets/highcontrast.scss | 292 --------------------- resources/assets/stylesheets/less/calendar.less | 292 --------------------- resources/assets/stylesheets/studip.less | 1 - resources/vue/base-components.js | 2 - resources/vue/components/ItemList.vue | 120 --------- 20 files changed, 65 insertions(+), 822 deletions(-) delete mode 100644 resources/assets/javascripts/bootstrap/calendar_dialog.js delete mode 100644 resources/assets/javascripts/lib/calendar_dialog.js delete mode 100644 resources/assets/stylesheets/less/calendar.less delete mode 100644 resources/vue/components/ItemList.vue diff --git a/app/controllers/calendar/calendar.php b/app/controllers/calendar/calendar.php index 6eb7821..6b51a75 100644 --- a/app/controllers/calendar/calendar.php +++ b/app/controllers/calendar/calendar.php @@ -155,16 +155,16 @@ class Calendar_CalendarController extends AuthenticatedController $read_permissions = false; $write_permissions = false; if ($calendar_owner) { - $read_permissions = $calendar_owner->calendarReadable(User::findCurrent()->id); - $write_permissions = $calendar_owner->calendarWritable(User::findCurrent()->id); + $read_permissions = $calendar_owner->isCalendarReadable(); + $write_permissions = $calendar_owner->isCalendarWritable(); } elseif ($selected_group) { //Count on how many group member calendars the current user has read or write permissions: foreach ($selected_group->items as $item) { if ($item->user) { - if ($item->user->calendarReadable(User::findCurrent()->id)) { + if ($item->user->isCalendarReadable()) { $read_permissions = true; } - if ($item->user->calendarWritable(User::findCurrent()->id)) { + if ($item->user->isCalendarWritable()) { $write_permissions = true; } } @@ -210,7 +210,7 @@ class Calendar_CalendarController extends AuthenticatedController //Check if the user has at least read permissions for the calendar of one user of one group: foreach ($groups as $group) { foreach ($group->items as $item) { - if ($item->user && $item->user->calendarReadable(User::findCurrent()->id)) { + if ($item->user && $item->user->isCalendarReadable()) { $available_groups[] = $group; break 1; } @@ -279,7 +279,7 @@ class Calendar_CalendarController extends AuthenticatedController if ($group_view && $selected_group) { //All users in the selected group that have granted read permissions to the user can be shown. foreach ($selected_group->items as $item) { - if ($item->user && $item->user->calendarReadable(User::findCurrent()->id)) { + if ($item->user && $item->user->isCalendarReadable()) { $calendar_resources[] = [ 'id' => $item->user_id, 'title' => $item->user ? $item->user->getFullName() : '', @@ -412,7 +412,7 @@ class Calendar_CalendarController extends AuthenticatedController throw new AccessDeniedException(_('Sie dürfen diesen Kalender nicht sehen!')); } - if (!$course->isVisibleForUser(User::findCurrent()->id) || !$course->calendarReadable(User::findCurrent()->id)) { + if (!$course->isVisibleForUser() || !$course->isCalendarReadable()) { throw new AccessDeniedException(_('Sie dürfen diesen Kalender nicht sehen!')); } @@ -448,7 +448,7 @@ class Calendar_CalendarController extends AuthenticatedController //Create the fullcalendar object: - $calendar_writable = $course->calendarWritable(User::findCurrent()->id); + $calendar_writable = $course->isCalendarWritable(); $calendar_settings = User::findCurrent()->getConfiguration()->CALENDAR_SETTINGS ?? []; $slot_settings = $this->getUserCalendarSlotSettings(); @@ -524,7 +524,7 @@ class Calendar_CalendarController extends AuthenticatedController $owner = Course::getCalendarOwner($range_id); } - if (!$owner || !$owner->calendarReadable(User::findCurrent()->id)) { + if (!$owner || !$owner->isCalendarReadable()) { throw new AccessDeniedException(_('Sie dürfen diesen Kalender nicht sehen!')); } @@ -600,7 +600,7 @@ class Calendar_CalendarController extends AuthenticatedController throw new AccessDeniedException(); } foreach ($group->items as $item) { - if ($item->user->calendarReadable(User::findCurrent()->id)) { + if ($item->user->isCalendarReadable()) { $users[] = $item->user; } } @@ -661,6 +661,9 @@ class Calendar_CalendarController extends AuthenticatedController $this->selected_semester_id = $semester->id; } else { $this->selected_semester_id = $selected_semester_pseudo_id ?? ''; + if (!Semester::exists($this->selected_semesters_id)) { + $this->selected_semester_id = ''; + } } $this->selected_course_ids = SimpleCollection::createFromArray( diff --git a/app/controllers/calendar/date.php b/app/controllers/calendar/date.php index 189ed4f..8b8435e 100644 --- a/app/controllers/calendar/date.php +++ b/app/controllers/calendar/date.php @@ -44,7 +44,7 @@ class Calendar_DateController extends AuthenticatedController } } - if (!$owner || !$owner->calendarReadable($GLOBALS['user']->id)) { + if (!$owner || !$owner->isCalendarReadable()) { throw new AccessDeniedException(_('Sie dürfen diesen Kalender nicht sehen!')); } return $owner; @@ -76,21 +76,21 @@ class Calendar_DateController extends AuthenticatedController $group = ContactGroup::find($group_id); if ($group) { foreach ($group->items as $item) { - if ($item->user && $item->user->calendarWritable($GLOBALS['user']->id)) { + if ($item->user && $item->user->isCalendarWritable()) { $result[$item->user_id] = $item->user; } } } } elseif ($user_id = Request::get('user_id', $GLOBALS['user']->id)) { $user = User::find($user_id); - if ($user && $user->calendarWritable($GLOBALS['user']->id)) { + if ($user && $user->isCalendarWritable()) { $result[$user->id] = $user; } } if ($other_calendar_ids = Request::getArray('other_calendar_ids')) { foreach ($other_calendar_ids as $other_calendar_id) { $user = User::find($other_calendar_id); - if ($user && $user->calendarWritable($GLOBALS['user']->id)) { + if ($user && $user->isCalendarWritable()) { $result[$user->id] = $user; } } diff --git a/app/views/calendar/calendar/publish.php b/app/views/calendar/calendar/publish.php index 13a7c7c..71901b5 100644 --- a/app/views/calendar/calendar/publish.php +++ b/app/views/calendar/calendar/publish.php @@ -49,7 +49,7 @@ - url_for('calendar/single/' . $last_view)) ?> + url_for('calendar/calendar')) ?> diff --git a/lib/classes/IcalExport.php b/lib/classes/IcalExport.php index f011c5e..2bb16d5 100644 --- a/lib/classes/IcalExport.php +++ b/lib/classes/IcalExport.php @@ -50,18 +50,25 @@ class IcalExport while ($length--) { while (1) { $rnd = rand(48, 122); - if ($rnd < 48) + if ($rnd < 48) { continue; - if ($rnd > 57 && $rnd < 65) + } + if ($rnd > 57 && $rnd < 65) { continue; - if ($rnd > 90 && $rnd < 97) + } + if ($rnd > 90 && $rnd < 97) { continue; - if ($rnd > 122) + } + if ($rnd > 122) { continue; + } $char = chr($rnd); - if ($rejected[$char] > 1) { + if (isset($rejected[$char]) && $rejected[$char] > 1) { continue; } + if (!isset($rejected[$char])) { + $rejected[$char] = 0; + } $rejected[$char]++; $ret .= $char; break; diff --git a/lib/classes/calendar/ICalendarExport.class.php b/lib/classes/calendar/ICalendarExport.class.php index c9c82d9..fba0974 100644 --- a/lib/classes/calendar/ICalendarExport.class.php +++ b/lib/classes/calendar/ICalendarExport.class.php @@ -183,10 +183,12 @@ class ICalendarExport // Default values $header = "BEGIN:VCALENDAR" . self::NEWLINE; $header .= "VERSION:2.0" . self::NEWLINE; - if ($this->client_identifier) { + if (isset($this->client_identifier)) { $header .= "PRODID:" . $this->client_identifier . self::NEWLINE; } else { - $header .= "PRODID:-//Stud.IP@{$_SERVER['SERVER_NAME']}//Stud.IP_iCalendar Library"; + $server_name = $_SERVER['SERVER_NAME'] ?? 'unknown'; + + $header .= "PRODID:-//Stud.IP@{$server_name}//Stud.IP_iCalendar Library"; $header .= " //EN" . self::NEWLINE; } $header .= "METHOD:PUBLISH" . self::NEWLINE; @@ -232,8 +234,6 @@ class ICalendarExport */ public function writeICalEvent(array $properties): string { - $exdate_time = 0; - $result = "BEGIN:VEVENT" . self::NEWLINE; foreach ($properties as $name => $value) { @@ -338,7 +338,7 @@ class ICalendarExport case "UID": $value = "$value"; } - if ($name) { + if ($name && !is_array($value)) { $attr_string = $name . $params_str . ':' . $value; $result .= $this->foldLine($attr_string) . self::NEWLINE; } diff --git a/lib/classes/calendar/Owner.interface.php b/lib/classes/calendar/Owner.interface.php index 0a2a13b..a7c2519 100644 --- a/lib/classes/calendar/Owner.interface.php +++ b/lib/classes/calendar/Owner.interface.php @@ -21,18 +21,20 @@ interface Owner /** * Determines whether the specified user has read permissions to the calendar. * - * @param string $user_id The user for which to determine read permissions. + * @param string|null $user_id The ID of the user for which to determine write permissions. + * Defaults to the current user if no user-ID is provided. * * @return bool True, if the user has read permissions, false otherwise. */ - public function calendarReadable(string $user_id) : bool; + public function isCalendarReadable(?string $user_id = null) : bool; /** * Determines whether the specified user has write permissions to the calendar. * - * @param string $user_id The user for which to determine write permissions. + * @param string|null $user_id The ID of the user for which to determine write permissions. + * Defaults to the current user if no user-ID is provided. * * @return bool True, if the user has write permissions, false otherwise. */ - public function calendarWritable(string $user_id) : bool; + public function isCalendarWritable(?string $user_id = null) : bool; } diff --git a/lib/models/Course.class.php b/lib/models/Course.class.php index 3f2621e..75dad33 100644 --- a/lib/models/Course.class.php +++ b/lib/models/Course.class.php @@ -1093,8 +1093,12 @@ class Course extends SimpleORMap implements Range, PrivacyObject, StudipItem, Fe /** * @inheritDoc */ - public function calendarReadable(string $user_id): bool + public function isCalendarReadable(?string $user_id = null): bool { + if ($user_id === null) { + $user_id = self::findCurrent()->id; + } + //Calendar read permissions are granted for all participants //that have at least user permissions. return $GLOBALS['perm']->have_studip_perm('user', $this->id, $user_id); @@ -1103,8 +1107,12 @@ class Course extends SimpleORMap implements Range, PrivacyObject, StudipItem, Fe /** * @inheritDoc */ - public function calendarWritable(string $user_id): bool + public function isCalendarWritable(string $user_id = null): bool { + if ($user_id === null) { + $user_id = self::findCurrent()->id; + } + //Calendar write permissions are granted for all participants //that have autor permissions or higher. return $GLOBALS['perm']->have_studip_perm('autor', $this->id, $user_id); diff --git a/lib/models/User.class.php b/lib/models/User.class.php index 276d8a4..5f1d6a0 100644 --- a/lib/models/User.class.php +++ b/lib/models/User.class.php @@ -1553,8 +1553,12 @@ class User extends AuthUserMd5 implements Range, PrivacyObject, Studip\Calendar\ /** * @inheritDoc */ - public function calendarReadable(string $user_id): bool + public function isCalendarReadable(?string $user_id = null): bool { + if ($user_id === null) { + $user_id = self::findCurrent()->id; + } + if ($this->id === $user_id) { //The owner can always read their own calendar. return true; @@ -1569,8 +1573,12 @@ class User extends AuthUserMd5 implements Range, PrivacyObject, Studip\Calendar\ /** * @inheritDoc */ - public function calendarWritable(string $user_id): bool + public function isCalendarWritable(string $user_id = null): bool { + if ($user_id === null) { + $user_id = self::findCurrent()->id; + } + if ($this->id === $user_id) { //The owner can always write their own calendar. return true; diff --git a/lib/models/calendar/CalendarDate.class.php b/lib/models/calendar/CalendarDate.class.php index 44a63d5..23ea8af 100644 --- a/lib/models/calendar/CalendarDate.class.php +++ b/lib/models/calendar/CalendarDate.class.php @@ -186,11 +186,11 @@ class CalendarDate extends SimpleORMap implements PrivacyObject $assignments = CalendarDateAssignment::findByCalendar_date_id($this->id); foreach ($assignments as $assignment) { if ($assignment->course instanceof Course) { - if ($assignment->course->calendarReadable($range_id)) { + if ($assignment->course->isCalendarReadable($range_id)) { return true; } } elseif ($assignment->user instanceof User) { - if ($assignment->user->calendarReadable($range_id)) { + if ($assignment->user->isCalendarReadable($range_id)) { return true; } } diff --git a/lib/navigation/StartNavigation.php b/lib/navigation/StartNavigation.php index ea7807f..913f3fa 100644 --- a/lib/navigation/StartNavigation.php +++ b/lib/navigation/StartNavigation.php @@ -284,7 +284,7 @@ class StartNavigation extends Navigation $navigation = new Navigation(_('Kalender')); if (Config::get()->CALENDAR_ENABLE) { - $navigation->addSubNavigation('calendar', new Navigation(_('Kalender'), 'dispatch.php/calendar/single')); + $navigation->addSubNavigation('calendar', new Navigation(_('Kalender'), 'dispatch.php/calendar/calendar')); } if (Config::get()->SCHEDULE_ENABLE) { diff --git a/lib/seminar_open.php b/lib/seminar_open.php index 0ca9991..45c4df3 100644 --- a/lib/seminar_open.php +++ b/lib/seminar_open.php @@ -44,7 +44,7 @@ function startpage_redirect($page_code) { $jump_page = "dispatch.php/contact"; break; case 5: - $jump_page = "dispatch.php/calendar/single"; + $jump_page = "dispatch.php/calendar"; break; case 6: // redirect to global blubberstream diff --git a/resources/assets/javascripts/bootstrap/calendar_dialog.js b/resources/assets/javascripts/bootstrap/calendar_dialog.js deleted file mode 100644 index ee5ab4c..0000000 --- a/resources/assets/javascripts/bootstrap/calendar_dialog.js +++ /dev/null @@ -1,11 +0,0 @@ -jQuery(document).on('click', 'td.calendar-day-edit, td.calendar-day-event', function(event) { - var elem = jQuery(this) - .find('a') - .first(); - if (_.isString(elem.attr('href'))) { - STUDIP.Dialog.fromURL(elem.attr('href'), { title: elem.attr('title') }); - event.preventDefault(); - } else { - return false; - } -}); diff --git a/resources/assets/javascripts/entry-base.js b/resources/assets/javascripts/entry-base.js index 37bec89..bb03231 100644 --- a/resources/assets/javascripts/entry-base.js +++ b/resources/assets/javascripts/entry-base.js @@ -37,7 +37,6 @@ import "./bootstrap/multi_person_search.js" import "./bootstrap/skip_links.js" import "./bootstrap/i18n_input.js" import "./bootstrap/forms.js" -import "./bootstrap/calendar_dialog.js" import "./bootstrap/drag_and_drop_upload.js" import "./bootstrap/admin_sem_classes.js" import "./bootstrap/cronjobs.js" diff --git a/resources/assets/javascripts/init.js b/resources/assets/javascripts/init.js index 569a89e..8fe092a 100644 --- a/resources/assets/javascripts/init.js +++ b/resources/assets/javascripts/init.js @@ -14,7 +14,6 @@ import Blubber from './lib/blubber.js'; import Browse from './lib/browse.js'; import Cache from './lib/cache.js'; import Calendar from './lib/calendar.js'; -import CalendarDialog from './lib/calendar_dialog.js'; import Clipboard from './lib/clipboard.js'; import Cookie from './lib/cookie.js'; import CourseWizard from './lib/course_wizard.js'; @@ -103,7 +102,6 @@ window.STUDIP = _.assign(window.STUDIP || {}, { Browse, Cache, Calendar, - CalendarDialog, Cookie, CourseWizard, CSS, diff --git a/resources/assets/javascripts/lib/calendar_dialog.js b/resources/assets/javascripts/lib/calendar_dialog.js deleted file mode 100644 index e42a149..0000000 --- a/resources/assets/javascripts/lib/calendar_dialog.js +++ /dev/null @@ -1,64 +0,0 @@ -import Dialog from './dialog.js'; - -const CalendarDialog = { - closeMps: function(form) { - var added_users = []; - jQuery('#calendar-manage_access_selectbox option:selected').each(function() { - added_users[added_users.length] = jQuery(this).attr('value'); - }); - jQuery.ajax({ - url: STUDIP.ABSOLUTE_URI_STUDIP + 'dispatch.php/calendar/single/add_users/', - data: { - added_users: added_users - }, - type: 'post' - }); - jQuery(form) - .closest('.ui-dialog-content') - .dialog('close'); - Dialog.fromURL(jQuery('#calendar-open-manageaccess').attr('href')); - return false; - }, - - removeUser: function(element) { - var url = jQuery(element).attr('href'); - jQuery(element).removeAttr('href'); - jQuery.ajax({ - url: url, - type: 'get', - success: function() { - var head_tr = jQuery(element) - .closest('tr') - .prev('.calendar-user-head'); - jQuery(element) - .closest('tr') - .remove(); - if (head_tr.nextUntil('.calendar-user-head').length === 0) { - head_tr.remove(); - } - } - }); - return false; - }, - - addException: function() { - var exc_date = jQuery('#exc-date').val(); - var exists = jQuery('#exc-dates input').is("input[value='" + exc_date + "']"); - if (!exists) { - var compiled = _.template( - '
  • ' + - '' + - '
  • ' - ); - jQuery('#exc-dates').append(compiled({ excdate: exc_date, link: '' })); - } - return false; - } -}; - -export default CalendarDialog; diff --git a/resources/assets/stylesheets/highcontrast.scss b/resources/assets/stylesheets/highcontrast.scss index 6c822b1..47bfbf2 100644 --- a/resources/assets/stylesheets/highcontrast.scss +++ b/resources/assets/stylesheets/highcontrast.scss @@ -515,26 +515,6 @@ form.default fieldset.collapsable.collapsed legend { } /* Stundenplan / Terminkalender */ -.celltoday { - background-color: $white; - border: 1px solid $black; - - > a { - color: $black; - font-size: 1.5em; - } -} -a:link.calhead { - color: $contrast-blue; -} - -.calhead label { - color: $contrast-blue !important; - - &:hover { - text-decoration: underline; - } -} a .hidden-tiny-down { color: $contrast-blue !important; @@ -566,40 +546,6 @@ a .hidden-tiny-down { /* Calendar categories */ -span li.calendar-category1, -ul li.calendar-category1, -span li.calendar-category2, -ul li.calendar-category2, -span li.calendar-category3, -ul li.calendar-category3, -span li.calendar-category4, -ul li.calendar-category4, -span li.calendar-category5, -ul li.calendar-category5, -span li.calendar-category6, -ul li.calendar-category6, -span li.calendar-category7, -ul li.calendar-category7, -span li.calendar-category8, -ul li.calendar-category8, -span li.calendar-category9, -ul li.calendar-category9, -span li.calendar-category10, -ul li.calendar-category10, -span li.calendar-category11, -ul li.calendar-category11, -span li.calendar-category12, -ul li.calendar-category12, -span li.calendar-category13, -ul li.calendar-category13, -span li.calendar-category14, -ul li.calendar-category14, -span li.calendar-category15, -ul li.calendar-category15 { - color: $black; - -} - div.schedule_entry { dl { &.hover:hover { opacity: unset; } @@ -772,244 +718,6 @@ div.schedule_entry { } } -table.calendar-week, -table.calendar-day { - tbody tr td { - &.calendar-day-event { - a { - color: $contrast-blue !important; - } - div:first-child { - background-color: $calendar-day-event; - overflow: hidden; - } - background: $white; - border: solid 1px $calendar-day-event; - } - &.calendar-category1, - &.calendar-course-category5 { - a { - color: $contrast-blue !important; - } - div:first-child { - background-color: $calendar-category-1; - overflow: hidden; - } - background: $white; - border: solid 1px $calendar-category-1; - } - &.calendar-category2, - &.calendar-course-category1 { - a { - color: $contrast-blue !important; - } - div:first-child { - background-color: $calendar-category-2; - overflow: hidden; - } - background: $white; - border: solid 1px $calendar-category-2; - } - &.calendar-category3, - &.calendar-course-category2 { - a { - color: $contrast-blue !important; - } - div:first-child { - background-color: $calendar-category-3; - overflow: hidden; - } - background: $white; - border: solid 1px $calendar-category-3; - } - &.calendar-category4, - &.calendar-course-category3 { - a { - color: $contrast-blue !important; - } - div:first-child { - background-color: $calendar-category-4; - overflow: hidden; - color: $black; - } - background: $white; - border: solid 1px $calendar-category-4; - } - &.calendar-category5, - &.calendar-course-category4 { - a { - color: $contrast-blue !important; - } - div:first-child { - background-color: $calendar-category-5; - overflow: hidden; - color: $black; - } - background: $white; - border: solid 1px $calendar-category-5; - } - &.calendar-category6, - &.calendar-course-category6 { - a { - color: $contrast-blue !important; - } - div:first-child { - background-color: $calendar-category-6; - overflow: hidden; - color: $black; - } - background: $white; - border: solid 1px $calendar-category-6; - } - &.calendar-category7, - &.calendar-course-category8 { - a { - color: $contrast-blue !important; - } - div:first-child { - background-color: $calendar-category-7; - overflow: hidden; - } - background: $white; - border: solid 1px $calendar-category-7; - } - &.calendar-category8, - &.calendar-course-category9 { - a { - color: $contrast-blue !important; - } - div:first-child { - background-color: $calendar-category-8; - overflow: hidden; - } - background: $white; - border: solid 1px $calendar-category-8; - } - &.calendar-category9, - &.calendar-course-category10 { - a { - color: $contrast-blue !important; - } - div:first-child { - background-color: $calendar-category-9; - overflow: hidden; - } - background: $white; - border: solid 1px $calendar-category-9; - } - &.calendar-category10, - &.calendar-course-category11 { - a { - color: $contrast-blue !important; - } - div:first-child { - background-color: $calendar-category-10; - overflow: hidden; - } - background: $white; - border: solid 1px $calendar-category-10; - } - &.calendar-category11, - &.calendar-course-category12 { - a { - color: $contrast-blue !important; - } - div:first-child { - background-color: $calendar-category-11; - overflow: hidden; - } - background: $white; - border: solid 1px $calendar-category-11; - } - &.calendar-category12, - &.calendar-course-category13 { - a { - color: $contrast-blue !important; - } - div:first-child { - background-color: $calendar-category-12; - overflow: hidden; - color: $black; - } - background: $white; - border: solid 1px $calendar-category-12; - } - &.calendar-category13, - &.calendar-course-category14 { - a { - color: $contrast-blue !important; - } - div:first-child { - background-color: $calendar-category-13; - overflow: hidden; - color: $black; - } - background: $white; - border: solid 1px $calendar-category-13; - } - &.calendar-category14, - &.calendar-course-category15 { - a { - color: $contrast-blue !important; - } - div:first-child { - background-color: $calendar-category-14; - overflow: hidden; - color: $black; - } - background: $white; - border: solid 1px $calendar-category-14; - } - &.calendar-category15, - &.calendar-course-category7 { - a { - color: $contrast-blue !important; - } - div:first-child { - background-color: $calendar-category-15; - overflow: hidden; - color: $black; - } - background: $white; - border: solid 1px $calendar-category-15; - } - &.calendar-category255, - &.calendar-course-category255 { - a { - color: $contrast-blue !important; - } - div:first-child { - background-color: $calendar-category-255; - overflow: hidden; - } - background: $white; - border: solid 1px $calendar-category-255; - } - /* Termin von im Stundenplan vorgemerkter Kurs */ - &.calendar-course-category256 { - a { - color: $contrast-blue !important; - } - div:first-child { - background-color: $contrast-blue-medium; - overflow: hidden; - } - background: $white; - border: solid 1px $contrast-blue-medium; - } - } -} - - -/* links */ -div.index_container div.index_main nav div.login_link a { - text-decoration: underline; - - p { - color: $black !important; - } -} - /* underlined links only in main content,not in navigation */ a, a:link, diff --git a/resources/assets/stylesheets/less/calendar.less b/resources/assets/stylesheets/less/calendar.less deleted file mode 100644 index 1cc9092..0000000 --- a/resources/assets/stylesheets/less/calendar.less +++ /dev/null @@ -1,292 +0,0 @@ -// TODO: LESSify - -/* --- Styles fuer Terminkalender ------------------------------------------- */ -a.day { - font-weight: bold; -} - -a.sday { - color: var(--red); - font-weight: bold; -} - -a.hday { - color: var(--red-80); - font-weight: bold; -} - -span.kwmin { - color: var(--dark-gray-color-80); - font-weight: bold; -} - -a.lightday { - color: var(--base-color-40); - font-weight: bold; -} - -a.lightsday { - color: var(--red-40); - font-weight: bold; -} - -.inday { - font-size: 8pt; -} - -.precol1w { - font-size: 12pt; - font-weight: bold; - color: var(--light-gray-color); - text-align: center; - vertical-align: top; -} - -.precol2w { - font-size: 8pt; - font-weight: bold; - color: var(--light-gray-color); - text-align: center; -} - -td.calhead, div.calhead { - font-size: 18pt; - font-weight: bold; - color: var(--light-gray-color); - text-align: center; -} - -a:link.calhead { - color: var(--base-color-60); - white-space: nowrap; - font-weight: bold; -} - -a:hover.calhead { - color: var(--red-60); -} - -.calhead label { - cursor: pointer; - &:hover { - color: var(--base-color-40); - } - - .media-breakpoint-small-down({ - .button(); - - img { - padding-left: 0.5em; - vertical-align: middle; - } - }) -} - -.celltoday { - background-color: var(--red-20); -} - -td.weekend { - background-color: var(--dark-gray-color-15); -} - -td.weekday { - background-color: var(--dark-gray-color-5); -} - -td.current { - padding: 2px; - border: 2px solid var(--red); -} - -table.calendar-week, table.calendar-day { - border-spacing: 0; - table-layout: fixed; - td { - padding: 0; - } -} - -table.calendar-month { - width: 100%; - tr td { - max-width: 90px; - min-width: 90px; - vertical-align: top; - } -} - -td.month { - background-color: fadeout(darken(@dark-gray-color-15, 5), 30); - padding: 3px; - div { - width: 90%; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } -} - -td.lightmonth { - background-color: fadeout(darken(@dark-gray-color-5, 5), 30); - padding: 3px; - div { - width: 90%; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } -} - -table.calendar-month td.calendar-month-week { - text-align: center; - vertical-align: middle; - height: 80px; - width: 80px; -} - -td.weekdayevents { - width: 90px; -} - -nav.calendar-nav { - display: flex; - align-items: center; - padding-bottom: 1em; - - > div { - flex: 1 1 auto; - } - - .calhead { - color: var(--base-color); - } -} - -.calendar-day-edit { - text-align: right; - font-size: 0.8em; -} - -.calendar-week tbody tr, .calendar-day tbody tr { - transition: background-color 0.3s; - &:hover { - background-color: fadeout(@dark-gray-color-5, 40%); - } - & td { - padding: 3px; - border-bottom: 1px solid var(--dark-gray-color-5); - } -} - -.calendar-day-event-title { - overflow: hidden; - text-overflow: ellipsis; - a { - color: var(--dark-gray-color); - } -} - -.calendar-category-mixin(@color-bg) { - vertical-align: top; - font-size: 11px; - color: var(--white); - padding: 0; - /* necessary for All-day Events */ - a { - color: contrast(@color-bg, black, white, 60%); - font-weight: 600; - } -} - -.calendar-single-year { - .calendar-single-year--table { - - > thead th { - min-width: 5em; - text-align: left; - } - - .yday { - white-space: nowrap; - } - } -} - - -.calendar-tooltip { - display: none; - font-size: 0.8em; -} - - -#exc-dates { - padding: 2px; - list-style-type: none; - width: 7.5em; - min-height: 5em; - max-height: 10em; - overflow: auto; - border: 1px solid var(--dark-gray-color-60); - - img { - vertical-align: text-top; - } - input:checked ~ span { - text-decoration: line-through; - opacity: 0.6; - } -} - -/* --- Styles fuer TerminZeile ---------------------------------------------- */ -table.tabdaterow { - background-color: white; -} - -td.tddaterowp { - border: 1px solid var(--white); - background-color: var(--dark-gray-color-10); - font-weight: bold; - color: var(--dark-green); - font-size: 8pt; -} - -td.tddaterowpx { - border: 1px solid var(--active-color); - background-color: var(--dark-gray-color-10); - font-weight: bold; - color: var(--dark-green); - font-size: 8pt; -} - - -.recurrences { - width: 100%; - float: none; - list-style: none; - text-align: left; - position: relative; - padding: 0; - margin: 0; - li { - display: block; - width: 100%; - } - input.rec-select { - } - .rec-label { - cursor: pointer; - } - .rec-label:hover { - } - .rec-content { - display: none; - position: relative; - padding-left: 3em; - } - [id^="rec"]:checked + label.rec-label { - } - [id^="rec"]:checked ~ [id^="rec-content"] { - display: block; - } -} diff --git a/resources/assets/stylesheets/studip.less b/resources/assets/stylesheets/studip.less index 1a2c794..aee6779 100644 --- a/resources/assets/stylesheets/studip.less +++ b/resources/assets/stylesheets/studip.less @@ -12,7 +12,6 @@ @import "less/tables.less"; @import "less/buttons.less"; @import "less/messagebox.less"; -@import "less/calendar.less"; @import "less/schedule.less"; @import "less/files.less"; diff --git a/resources/vue/base-components.js b/resources/vue/base-components.js index d0cc2a5..2390bb9 100644 --- a/resources/vue/base-components.js +++ b/resources/vue/base-components.js @@ -4,7 +4,6 @@ import DateListInput from './components/form_inputs/DateListInput.vue'; import Multiselect from './components/Multiselect.vue'; import MyCoursesColouredTable from './components/form_inputs/MyCoursesColouredTable.vue'; import EditableList from "./components/EditableList.vue"; -import ItemList from "./components/ItemList.vue"; import Quicksearch from './components/Quicksearch.vue'; import RepetitionInput from "./components/form_inputs/RepetitionInput.vue"; import SidebarWidget from './components/SidebarWidget.vue'; @@ -36,7 +35,6 @@ const BaseComponents = { Multiselect, MyCoursesColouredTable, EditableList, - ItemList, Quicksearch, RangeInput, RepetitionInput, diff --git a/resources/vue/components/ItemList.vue b/resources/vue/components/ItemList.vue deleted file mode 100644 index 05c056f..0000000 --- a/resources/vue/components/ItemList.vue +++ /dev/null @@ -1,120 +0,0 @@ - - - -- cgit v1.0