Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

adapt customized styles for full-calendar

ulferts4477f92e6eca
diff --git a/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.sass b/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.sass
index 7296d65a099..6fff9f52cb9 100644
--- a/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.sass
+++ b/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.sass
@@ -1,12 +1,21 @@
-.fc-view
+full-calendar
overflow-x: auto
.fc-view
min-width: 800px
- .fc-head
+ // Move the days header to the bottom.
+ thead
display: table-footer-group
+ // Remove the borders at the left and of the bottom
+ th.fc-day,
+ th.fc-timegrid-axis
+ border-bottom: none
+
+ table.fc-scrollgrid.fc-scrollgrid-liquid
+ border-left: none
+
.fc-event, .fc-bgevent
border-radius: 0
margin-right: 8px
@@ -31,7 +40,7 @@
.fc-timeGrid-view .fc-day-grid .fc-row .fc-content-skeleton
padding-bottom: 0
- .fc-time-grid .fc-slats .fc-minor td
+ .fc-timegrid-slot.fc-timegrid-slot-minor
border-top: 0
.te-calendar--day-sum
@@ -43,6 +52,7 @@
font-weight: bold
line-height: 22px
opacity: 1
+ cursor: default
.te-calendar--add-entry
text-align: center
@@ -95,8 +105,8 @@
font-weight: bold
.te-calendar--create-button
- float: right
- margin-right: 0
- margin-top: 4px
- height: 34px
+ position: absolute
+ right: 0
+ top: 6px
+ margin-right: 0px
diff --git a/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.ts b/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.ts
index 6770119373d..6ff248cb0d6 100644
--- a/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.ts
+++ b/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.ts
@@ -305,6 +305,7 @@ export class TimeEntryCalendarComponent implements AfterViewInit {
end: date.clone().add(this.maxHour - Math.min(((duration + 0.05) * this.scaleRatio), this.maxHour - 0.5), 'h').format(),
classNames: DAY_SUM_CLASS_NAME,
rendering: 'background' as 'background',
+ startEditable: false,
sum: this.i18n.t('js.units.hour', { count: this.formatNumber(duration) })
};
}
@@ -445,7 +446,7 @@ export class TimeEntryCalendarComponent implements AfterViewInit {
private appendSum(event:CalendarViewEvent) {
if (event.event.extendedProps.sum) {
- event.el.append(event.event.extendedProps.sum);
+ event.el.innerHTML = event.event.extendedProps.sum;
}
}
@@ -469,7 +470,13 @@ export class TimeEntryCalendarComponent implements AfterViewInit {
}
private prependDuration(event:CalendarViewEvent) {
- let formattedDuration = this.timezone.formattedDuration(event.event.extendedProps.entry.hours);
+ let timeEntry = event.event.extendedProps.entry;
+
+ if (this.timezone.toHours(timeEntry.hours) < 0.5) {
+ return;
+ }
+
+ let formattedDuration = this.timezone.formattedDuration(timeEntry.hours);
jQuery(event.el)
.find('.fc-event-title')
diff --git a/frontend/src/global_styles/content/_calendars.sass b/frontend/src/global_styles/content/_calendars.sass
index 139564aa0df..935b6c51e24 100644
--- a/frontend/src/global_styles/content/_calendars.sass
+++ b/frontend/src/global_styles/content/_calendars.sass
@@ -1,7 +1,7 @@
// overrides for full-calendar so that it looks to belong into OpenProject
full-calendar
- .fc-toolbar
+ .fc-header-toolbar.fc-toolbar
.fc-button
@extend .button
height: 34px
@@ -18,13 +18,27 @@ full-calendar
margin-bottom: 0
padding: 0.4em 0.65em
- .fc-button-active
- @extend .button, .-active
+ &.fc-button-active
+ @extend .button, .-active
+ margin-right: 0
- .fc-title
+ // The days in full calendar are anchor elements which we do not
+ // want to like like actual links
+ .fc-col-header-cell a, a.fc-daygrid-day-number
+ color: #000000
+ cursor: default
+
+ &:hover
+ text-decoration: none
+
+ .fc-event-title
max-width: 100%
@include text-shortener(false)
+ .fc-timegrid-event-condensed .fc-event-title-container
+ white-space: nowrap
+ overflow: hidden
+
.fc-header-toolbar
h2
@extend h2