Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 22 additions & 11 deletions app/assets/stylesheets/_worktimes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// or later. See the COPYING file at the top-level directory or at
// https://github.com/puzzle/puzzletime.


$worktimes-weeknav-active-bg: #fff;
$worktimes-weekcontent-hover-bg: $gray-lighter;

Expand Down Expand Up @@ -75,7 +74,8 @@ $worktimes-weekcontent-hover-bg: $gray-lighter;
align-items: center;
font-size: 30px;

&:hover, &:active {
&:hover,
&:active {
text-decoration: none;
}
}
Expand Down Expand Up @@ -126,7 +126,10 @@ $worktimes-weekcontent-hover-bg: $gray-lighter;
}

.add-other {
float: right
float: right;
&.last-day {
color: $brand-red;
}
}
}
.weeknav-add-row {
Expand Down Expand Up @@ -175,7 +178,8 @@ $worktimes-weekcontent-hover-bg: $gray-lighter;
}

&.today {
background: $brand-blue image-url('day-marker-active.svg') 100% 100% no-repeat;
background: $brand-blue image-url('day-marker-active.svg') 100% 100%
no-repeat;
color: #fff;

&.active {
Expand All @@ -194,15 +198,16 @@ $worktimes-weekcontent-hover-bg: $gray-lighter;
&.holiday {
background: image-url('day-marker-holiday.svg') 100% 100% no-repeat;

.weeknav-label, .weeknav-time {
.weeknav-label,
.weeknav-time {
color: $gray;
}
}

&.active {
background-color: $worktimes-weeknav-active-bg;
}
}
}
}

.weeknav-total {
Expand All @@ -216,7 +221,8 @@ $worktimes-weekcontent-hover-bg: $gray-lighter;
margin-top: 20px;
margin-bottom: 480px;

.date-label, .entry {
.date-label,
.entry {
background-color: none;

transition: background-color 400ms ease-in;
Expand Down Expand Up @@ -273,7 +279,8 @@ $worktimes-weekcontent-hover-bg: $gray-lighter;
border-top: 1px solid $gray-light;
@include clearfix;

&:hover, &:active {
&:hover,
&:active {
transition: none;

background-color: $worktimes-weekcontent-hover-bg;
Expand Down Expand Up @@ -312,7 +319,8 @@ $worktimes-weekcontent-hover-bg: $gray-lighter;
@extend .col-xs-5;
}

.title, .description {
.title,
.description {
@include ellipsis(true);
}

Expand All @@ -324,7 +332,9 @@ $worktimes-weekcontent-hover-bg: $gray-lighter;
clear: both;
}

.time-range, .time-value, .controls {
.time-range,
.time-value,
.controls {
text-align: right;
}

Expand All @@ -348,7 +358,8 @@ $worktimes-weekcontent-hover-bg: $gray-lighter;
font-size: 18px;
}

a:hover, a:active {
a:hover,
a:active {
text-decoration: none;
}
}
Expand Down
1 change: 1 addition & 0 deletions app/controllers/worktimes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class WorktimesController < CrudController
def index
set_week_days
@notifications = UserNotification.list_during(@period, current_user)
@last_day_of_month = Time.zone.today == Time.zone.today.end_of_month
super
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/worktimes/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
.weeknav-actions.nowrap
= link_to('Zeiten freigeben',
edit_employee_worktimes_commit_path(current_user),
class: 'add-other',
class: "add-other #{@last_day_of_month ? 'last-day' : ''}",
data: { modal: '#modal',
title: 'Zeiten freigeben',
remote: true,
Expand Down
10 changes: 8 additions & 2 deletions test/integration/edit_worktimes_as_order_responsible.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
require 'test_helper'

class EditWorktimesAsOrderResponsibleTest < ActionDispatch::IntegrationTest
setup :login

test 'can change own committed worktimes on own order' do
login
click_link 'Zeiten freigeben'
click_button 'Speichern'

Expand All @@ -24,6 +23,13 @@ class EditWorktimesAsOrderResponsibleTest < ActionDispatch::IntegrationTest
assert_selector('.alert.alert-success')
end

test 'label worktimes commit button red if last day of month' do
travel_to Time.zone.today.at_end_of_month
login

assert_selector('.weeknav-calendar-row a.add-other.last-day', text: 'Zeiten freigeben')
end

def login
login_as(:lucien)
visit('/ordertimes')
Expand Down