Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #112 from hicknhack-software/feature/redmine4.0
Feature/redmine4.0
- Loading branch information
Showing
26 changed files
with
162 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ Gemfile.lock | |
|
||
tmp/rubycritic/ | ||
/.bundle | ||
.ruby-version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module Hourglass::TypeParsing | ||
def parse_type(type, attribute) | ||
if Rails::VERSION::MAJOR <= 4 | ||
case type | ||
when :boolean | ||
ActiveRecord::Type::Boolean.new.type_cast_from_user(attribute) | ||
when :integer | ||
ActiveRecord::Type::Integer.new.type_cast_from_user(attribute) | ||
when :float | ||
ActiveRecord::Type::Float.new.type_cast_from_user(attribute) | ||
end | ||
else | ||
case type | ||
when :boolean | ||
ActiveRecord::Type::Boolean.new.cast(attribute) | ||
when :integer | ||
ActiveRecord::Type::Integer.new.cast(attribute) | ||
when :float | ||
ActiveRecord::Type::Float.new.cast(attribute) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
- ids = @records.map(&:id) | ||
ul | ||
li = context_menu_link t(:button_edit), hourglass_ui_bulk_edit_time_bookings_path(ids: ids), class: 'icon-edit js-show-inline-form-multi', title: t(:button_edit), remote: true, data: {type: 'html'}, disabled: !@records.all? { |time_booking| policy(time_booking).change? } | ||
li = context_menu_link t(:button_delete), @records.length == 1 ? hourglass_time_booking_path(@records.first) : bulk_destroy_hourglass_time_bookings_path(time_bookings: ids), class: 'icon-del js-hourglass-remote', title: t(:button_delete), remote: true, method: :delete, data: {confirm: t(:text_are_you_sure)}, disabled: !@records.all? { |time_booking| policy(time_booking).destroy? } | ||
li = context_menu_link t(:button_edit), hourglass_ui_bulk_edit_time_bookings_path(ids: ids), class: 'icon icon-edit js-show-inline-form-multi', title: t(:button_edit), remote: true, data: {type: 'html'}, disabled: !@records.all? { |time_booking| policy(time_booking).change? } | ||
li = context_menu_link t(:button_delete), @records.length == 1 ? hourglass_time_booking_path(@records.first) : bulk_destroy_hourglass_time_bookings_path(time_bookings: ids), class: 'icon icon-del js-hourglass-remote', title: t(:button_delete), remote: true, method: :delete, data: {confirm: t(:text_are_you_sure)}, disabled: !@records.all? { |time_booking| policy(time_booking).destroy? } | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
- ids = @records.map(&:id) | ||
ul | ||
li = context_menu_link t('hourglass.ui.lists.button_book'), hourglass_ui_bulk_book_time_logs_path(ids: ids), class: 'icon-time js-show-inline-form-multi', title: t('hourglass.ui.lists.button_book'), remote: true, data: {type: 'html'}, disabled: !@records.all? { |time_log| policy(time_log).book? } | ||
li = context_menu_link t(:button_edit), hourglass_ui_bulk_edit_time_logs_path(ids: ids), class: 'icon-edit js-show-inline-form-multi', title: t(:button_edit), remote: true, data: {type: 'html'}, disabled: !@records.all? { |time_log| policy(time_log).change? } | ||
li = context_menu_link t(:button_delete), @records.length == 1 ? hourglass_time_log_path(@records.first) : bulk_destroy_hourglass_time_logs_path(time_logs: ids), class: 'icon-del js-hourglass-remote', title: t(:button_delete), remote: true, method: :delete, data: {confirm: t(:text_are_you_sure)}, disabled: !@records.all? { |time_log| policy(time_log).destroy? } | ||
li = context_menu_link t('hourglass.ui.time_logs.button_join'), join_hourglass_time_logs_path(ids: ids), class: 'icon-hourglass-join js-hourglass-remote', title: t('hourglass.ui.time_logs.button_join'), remote: true, data: {method: 'post'}, disabled: ids.length == 1 || !@records.all? { |time_log| policy(time_log).join? } && Hourglass::TimeLog.joinable?(*ids) | ||
li = context_menu_link t('hourglass.ui.lists.button_book'), hourglass_ui_bulk_book_time_logs_path(ids: ids), class: 'icon icon-time js-show-inline-form-multi', title: t('hourglass.ui.lists.button_book'), remote: true, data: {type: 'html'}, disabled: !@records.all? { |time_log| policy(time_log).book? } | ||
li = context_menu_link t(:button_edit), hourglass_ui_bulk_edit_time_logs_path(ids: ids), class: 'icon icon-edit js-show-inline-form-multi', title: t(:button_edit), remote: true, data: {type: 'html'}, disabled: !@records.all? { |time_log| policy(time_log).change? } | ||
li = context_menu_link t(:button_delete), @records.length == 1 ? hourglass_time_log_path(@records.first) : bulk_destroy_hourglass_time_logs_path(time_logs: ids), class: 'icon icon-del js-hourglass-remote', title: t(:button_delete), remote: true, method: :delete, data: {confirm: t(:text_are_you_sure)}, disabled: !@records.all? { |time_log| policy(time_log).destroy? } | ||
li = context_menu_link t('hourglass.ui.time_logs.button_join'), join_hourglass_time_logs_path(ids: ids), class: 'icon icon-hourglass-join js-hourglass-remote', title: t('hourglass.ui.time_logs.button_join'), remote: true, data: {method: 'post'}, disabled: ids.length == 1 || !@records.all? { |time_log| policy(time_log).join? } && Hourglass::TimeLog.joinable?(*ids) | ||
- time_bookings = @records.map(&:time_booking).compact | ||
li = context_menu_link t('hourglass.ui.lists.button_delete_booking'), time_bookings.length == 1 ? hourglass_time_booking_path(time_bookings.first) : bulk_destroy_hourglass_time_bookings_path(time_bookings: time_bookings.map(&:id)), class: 'icon-del js-hourglass-remote', title: t('hourglass.ui.lists.button_delete_booking'), remote: true, method: :delete, data: {confirm: t(:text_are_you_sure)}, disabled: !time_bookings.present? || !time_bookings.all? { |time_booking| policy(time_booking).destroy? } | ||
li = context_menu_link t('hourglass.ui.lists.button_delete_booking'), time_bookings.length == 1 ? hourglass_time_booking_path(time_bookings.first) : bulk_destroy_hourglass_time_bookings_path(time_bookings: time_bookings.map(&:id)), class: 'icon icon-del js-hourglass-remote', title: t('hourglass.ui.lists.button_delete_booking'), remote: true, method: :delete, data: {confirm: t(:text_are_you_sure)}, disabled: !time_bookings.present? || !time_bookings.all? { |time_booking| policy(time_booking).destroy? } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
- ids = @records.map(&:id) | ||
ul | ||
li = context_menu_link t(:button_edit), hourglass_ui_bulk_edit_time_trackers_path(ids: ids), class: 'icon-edit js-show-inline-form-multi', title: t(:button_edit), remote: true, data: {type: 'html'}, disabled: !@records.all? { |time_tracker| policy(time_tracker).change? } | ||
li = context_menu_link t(:button_delete), @records.length == 1 ? hourglass_time_tracker_path(@records.first) : bulk_destroy_hourglass_time_trackers_path(time_trackers: ids), class: 'icon-del js-hourglass-remote', title: t(:button_delete), remote: true, method: :delete, data: {confirm: t(:text_are_you_sure)}, disabled: !@records.all? { |time_tracker| policy(time_tracker).destroy? } | ||
li = context_menu_link t(:button_edit), hourglass_ui_bulk_edit_time_trackers_path(ids: ids), class: 'icon icon-edit js-show-inline-form-multi', title: t(:button_edit), remote: true, data: {type: 'html'}, disabled: !@records.all? { |time_tracker| policy(time_tracker).change? } | ||
li = context_menu_link t(:button_delete), @records.length == 1 ? hourglass_time_tracker_path(@records.first) : bulk_destroy_hourglass_time_trackers_path(time_trackers: ids), class: 'icon icon-del js-hourglass-remote', title: t(:button_delete), remote: true, method: :delete, data: {confirm: t(:text_are_you_sure)}, disabled: !@records.all? { |time_tracker| policy(time_tracker).destroy? } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
[ | ||
%w(app models concerns), | ||
%w(app controllers concerns), | ||
%w(app policies), | ||
%w(app policies concerns) | ||
%w(app models concerns), | ||
%w(app controllers concerns), | ||
%w(app policies), | ||
%w(app policies concerns) | ||
].each do |path| | ||
ActiveSupport::Dependencies.autoload_paths << File.join(Hourglass::PLUGIN_ROOT, *path) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.