Skip to content
Draft
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
29 changes: 25 additions & 4 deletions app/assets/stylesheets/_worktimes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ $worktimes-weekcontent-hover-bg: $gray-lighter;
.weeknav-calendar-row,
.weeknav-add-row {
padding: 0 $grid-gutter-width / 2;
line-height: 30px;
line-height: 40px;
vertical-align: middle;
border-width: 0 0 1px 0;
border-style: solid;
Expand All @@ -95,8 +95,28 @@ $worktimes-weekcontent-hover-bg: $gray-lighter;
flex-wrap: wrap;
border-left-width: 1px;
border-right-width: 1px;
padding-left: 0;
margin: auto;

.today-link-blue {
border-radius: 18px;
width: 100px;
font-size: medium;
margin: 6px;
}

.today-link-white {
border-radius: 18px;
width: 100px;
font-size: medium;
margin: 6px;
background-color: white;
color: $gray-dark;
border-color: $gray-dark;
}

> form {
align-items: center;
.input-group-addon {
display: inline-block;
padding: 0;
Expand All @@ -114,9 +134,9 @@ $worktimes-weekcontent-hover-bg: $gray-lighter;
vertical-align: middle;
}
input {
width: 100px;
height: 30px;
padding: 0;
width: 130px;
height: 40px;
padding: 25px;
border: 0;
line-height: 30px;
box-shadow: none;
Expand All @@ -127,6 +147,7 @@ $worktimes-weekcontent-hover-bg: $gray-lighter;

.add-other {
float: right
vertical-a
}
}
.weeknav-add-row {
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/worktimes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ def set_week_days
@week_days = (@selected_date.at_beginning_of_week..@selected_date.at_end_of_week).to_a
@next_week_date = @week_days.last + 1.day
@previous_week_date = @week_days.first - 7.days

@today_week_date = Time.zone.today.at_beginning_of_week
end

def set_selected_date
Expand Down
5 changes: 4 additions & 1 deletion app/views/worktimes/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@

.weeknav-content
.weeknav-calendar-row
- if @selected_date == @today_week_date
= link_to 'Heute', worktimes_url, class: 'btn btn-primary today-link-white'
- else
= link_to 'Heute', worktimes_url, class: 'btn btn-primary today-link-blue'
= plain_form(Worktime.new, method: :get) do |f|

.nowrap
= f.date_field(:work_date,
id: 'week_date',
Expand Down