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/helpers/backlogs_helper.rb

35 lines
767 B

module BacklogsHelper
include Redmine::I18n
def backlog_html_class(backlog)
is_sprint?(backlog) ? "sprint backlog" : "product backlog"
end
def backlog_html_id(backlog)
is_sprint?(backlog) ? "sprint_#{backlog.id}" : "product_backlog"
end
def backlog_id_or_empty(backlog)
is_sprint?(backlog) ? backlog.id : ""
end
def date_or_nil(date)
date.nil? ? '' : date.strftime('%Y-%m-%d')
end
def editable_if_sprint(backlog)
"editable" if is_sprint?(backlog)
end
def is_sprint?(backlog)
backlog.class.to_s.downcase=='sprint'
end
def name_or_default(backlog)
is_sprint?(backlog) ? backlog.name : l(:label_Product_backlog)
end
def stories(backlog)
backlog[:stories] || backlog.stories
end
end