OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/app/assets/stylesheets/content/_modal.sass

211 lines
5.2 KiB

//-- copyright
// OpenProject is an open source project management software.
// Copyright (C) 2012-2020 the OpenProject GmbH
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License version 3.
//
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
// Copyright (C) 2006-2017 Jean-Philippe Lang
// Copyright (C) 2010-2013 the ChiliProject Team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See docs/COPYRIGHT.rdoc for more details.
//++
$ng-modal-padding: 3em
$ng-modal-background: $body-background
$ng-modal-close-color: $light-gray
$ng-modal-image-height: 135px
$ng-modal-image-width: $ng-modal-image-height
$modal-header-height: $header-height
$modal-footer-height: $modal-header-height
// The portal element of a modal element
// ( = the outer element should span the entire view )
.op-modal--portal
// overlay
position: fixed
left: 0
top: 0
right: 0
bottom: 0
background: rgba(0, 0, 0, 0.75)
text-align: left
z-index: 9000
// Center modal content vertically and horizontally
display: flex
align-items: center
justify-content: center
[32880] Display scheduling mode in work package view (full, split & table) (#8410) * Show icon next to start date depending on the scheduling mode * Show modal when opening date edit fields which shall be able to change the dates and the scheduling mode * Introduce flatpickr as a datepicker for the modal of the dateEditField * Use new datepicker within opDatePickerComponent * Reuse existing Datepicker class for better code abstraction * Set dates only when Instance is ready * Let augmentedDatePicker use generic DatePicker class, too. * Remove jQuery UI datepicker specific styles as they do not apply any more. * Use localized strings in new datepicker * Close datepicker only on click outside * Allow single and multi selection of dates and save changes * Update schedulingMode button correctly && remove unused method * Show combined field for start and end date within the WP single view * Show normal datepicker for most date fields and the modal with the extended datepicker only for startDate * Add datepicker edit field and component helper * Correctly save start and end date * Show correct default value for dateEditFields && Adapt some tests to new datepicker and combined date field * Fix date editor spec * Fix expecting datepicker for start/due date as milestone * Prevent overflow on body by using modal-portal class && make edit input for combinedDates visible again to show something in a create form * Only output one debounced change event for op datepicker * Show combined datepickerModal for dueDate in table, too && save correct scheduling value * Hide modal if the showing component gets destroyed * Correctly check for closed datepicker * Add spec for toggling scheduling mode * Fix setting dates to modal * Avoid too many (unnecessary) close events and use keydown instead * Fix date setting and add custom field date spec * Change layout of combined date picker modal * Switch from a range date picker to a multiple selection in order to be able to set only start or due date && Highlight date field that is changed next * Highlight range manually * Highlight dueDate initially when the user clicked on the due date field && handle special case that one of the values is not set yet. In this case we don't want to keep both values but only the newly clicked. * Move helper functions to own class && Improve the range selection to be able highlight ranges over multiple months && Prevent that a start date > due date can be chosen by setting minDate and maxDate * Adapt test to new way of changing the scheduling mode * Handle case that the user clicks on a already selected date and thus deselects it Co-authored-by: Oliver Günther <mail@oliverguenther.de>
4 years ago
&.-transparent
background: transparent
// The inner modal element containing header, body, and footer
// This is placed within --portal
.op-modal--modal-container
transition: opacity 0.25s ease
background: $ng-modal-background
position: relative
padding: 5px $ng-modal-padding / 2
min-width: 200px
max-width: 60vw
overflow-y: auto
@include styled-scroll-bar
&.-wide
min-width: 75vw
min-height: 40vh
&.-slim
min-width: 25vw
min-height: 20vh
.op-modal--modal-header
display: flex
align-items: center
height: $modal-header-height
padding: 0 45px 0 0
margin-bottom: 15px
border-bottom: 1px solid $light-gray
*
height: $modal-header-height
line-height: $modal-header-height
h2, h3
border: none
@include text-shortener
margin: 0
.op-modal--modal-body
margin: 1em 0
padding: 0 1.5rem
max-height: calc(100vh - #{$modal-header-height} - #{$modal-footer-height})
overflow: auto
@include styled-scroll-bar
&.-formattable
p:last-of-type
margin-bottom: 0px
.op-modal--modal-footer
padding: 0 1.5rem
button:last-of-type
margin-right: 0
.op-modal--modal-close-button
position: absolute
right: 25px
top: 4px
cursor: pointer
@include varprop(color, body-font-color)
&:hover
text-decoration: none
@include varprop(color, content-link-color)
// Highlighted modal style matching header menu
.op-modal--modal-container.-highlight
padding: 0
// Overridden header styles
.op-modal--modal-header
padding-left: 1.5rem
@include varprop(background-color, header-bg-color)
@include varprop(border-bottom-width, header-border-bottom-width)
@include varprop(border-bottom-color, header-border-bottom-color)
*
@include varprop(color, header-item-font-color)
.op-modal--modal-footer
margin: 1em 0
.op-modal--modal-close-button
top: 0
@include varprop(color, header-item-font-color)
.avatar
margin-right: 0.5rem
&.-danger-zone
.op-modal--modal-header
@include varprop(background-color, content-form-danger-zone-bg-color)
@include varprop(border-bottom-color, content-form-danger-zone-bg-color)
.op-modal--modal-close-button
@include varprop(color, content-form-danger-zone-font-color)
// Specific styles for columns-modal
.columns-modal--content
margin-bottom: 15px
label
display: inline
padding-right: 30px
.ee-relation-columns-upsale
margin-top: -0.7rem
padding-bottom: 1rem
// Specific styles for export-modal
ul.export-options
display: flex
flex-wrap: wrap
margin: 0
padding: 20px 0
list-style-type: none
li
flex: 1 1 calc(33% - 40px) // line break after third element
margin: 20px
text-align: center
a
cursor: pointer
text-decoration: none
color: $body-font-color
font-weight: normal
overflow-wrap: break-word
word-wrap: break-word
&:hover, &:active
text-decoration: none
color: $body-font-color
span.export-label
display: block
padding: 10px 0 0 0
// Legacy styles for jQuery UI modal
.ui-dialog.ui-widget
overflow: visible
// remove iframe border explicitly because Firefox does add it for some reason
#modalIframe
border: 0
// Hide modal content forwarded from rails
// for the dynamic modal
.modal-wrapper--content
display: none
@include breakpoint(680px down)
.wp-table--configuration-modal,
.op-modal--modal-container
width: 90vw
max-width: unset