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/cells/statuses/row_cell.rb

57 lines
966 B

module Statuses
class RowCell < ::RowCell
include ::IconsHelper
include ::ColorsHelper
include ReorderLinksHelper
def status
model
end
def name
link_to status.name, edit_status_path(status)
end
def is_default
checkmark(status.is_default?)
end
def is_closed
checkmark(status.is_closed?)
end
def is_readonly
checkmark(status.is_readonly?)
end
def color
icon_for_color status.color
end
def done_ratio
h(status.default_done_ratio)
end
def sort
reorder_links 'status',
{ action: 'update', id: status },
method: :patch
end
def button_links
[
delete_link
]
end
def delete_link
link_to(
op_icon('icon icon-delete'),
(status_path(status)),
method: :delete,
data: { confirm: I18n.t(:text_are_you_sure) }
)
end
end
end