Feature #27096 » 0002-Add-nwday-class-to-non-working-days-in-calendar.patch
| app/controllers/my_controller.rb | ||
|---|---|---|
|
helper :custom_fields
|
||
|
helper :queries
|
||
|
helper :activities
|
||
|
helper :calendars
|
||
|
def index
|
||
|
page
|
||
| app/helpers/calendars_helper.rb | ||
|---|---|---|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
|
module CalendarsHelper
|
||
|
include Redmine::Utils::DateCalculation
|
||
|
def link_to_previous_month(year, month, options={})
|
||
|
target_year, target_month = if month == 1
|
||
|
[year - 1, 12]
|
||
| ... | ... | |
|
def calendar_day_css_classes(calendar, day)
|
||
|
css = day.month==calendar.month ? 'even' : 'odd'
|
||
|
css << " today" if User.current.today == day
|
||
|
css << " nwday" if non_working_week_days.include?(day.cwday)
|
||
|
css
|
||
|
end
|
||
|
end
|
||
| test/functional/calendars_controller_test.rb | ||
|---|---|---|
|
get :show, :params => {
|
||
|
:query_id => 6
|
||
|
}
|
||
|
|
||
|
assert_response :success
|
||
|
assert_select 'h2', :text => 'Open issues grouped by tracker'
|
||
|
end
|
||
|
def test_show_calendar_day_css_classes
|
||
|
get :show, :params => {
|
||
|
:month => '12',
|
||
|
:year => '2016'
|
||
|
}
|
||
|
assert_response :success
|
||
|
assert_select 'tr:nth-child(2)' do
|
||
|
assert_select 'td.week-number', :text => '49'
|
||
|
# non working days should have "nwday" CSS class
|
||
|
assert_select 'td.nwday', 2
|
||
|
assert_select 'td.nwday', :text => '4'
|
||
|
assert_select 'td.nwday', :text => '10'
|
||
|
end
|
||
|
end
|
||
|
end
|
||
- « Previous
- 1
- 2
- 3
- Next »