Merge pull request #66 from finnlabs/fix/accessibility_work_package_attribute_list_2258

[FIX] Accessibility work package attribute list 2258
pull/6827/head
Till Breuer 11 years ago
commit 545aab1200
  1. 1
      doc/CHANGELOG.md
  2. 24
      lib/open_project/backlogs/hooks.rb

@ -39,6 +39,7 @@ See doc/COPYRIGHT.rdoc for more details.
## 3.0.5.pre2
* `#2167` [Accessibility] Link form elements to their label - backlogs - new task
* `#2258` [Accessibility] linearisation of issue show form
* `#2607` [Agile] Display Storypoints in Taskboard view
## 3.0.5.pre1

@ -36,6 +36,7 @@
module OpenProject::Backlogs::Hooks
class LayoutHook < Redmine::Hook::ViewListener
include RbCommonHelper
include AccessibilityHelper
# This ought to be view_work_packages_sidebar_queries_bottom, but the entire
# queries toolbar is disabled if you don't have custom queries
@ -68,6 +69,7 @@ module OpenProject::Backlogs::Hooks
end
def view_work_packages_show_details_bottom(context = {})
attributes = []
work_package = context[:issue]
return '' unless work_package.backlogs_enabled?
@ -77,21 +79,21 @@ module OpenProject::Backlogs::Hooks
snippet = ''
if work_package.is_story?
snippet += %Q{
<tr>
<th class="story-points">#{WorkPackage.human_attribute_name(:story_points)}:</th>
<td class="story-points">#{work_package.story_points || '-'}</td>
</tr>
snippet = %Q{
<th class="story-points">#{WorkPackage.human_attribute_name(:story_points)}:</th>
<td class="story-points">#{work_package.story_points || empty_element_tag}</td>
}
attributes << WorkPackagesHelper::WorkPackageAttribute.new(:story_points, snippet)
end
snippet += %Q{
<tr>
<th class="remaining_hours">#{WorkPackage.human_attribute_name(:remaining_hours)}:</th>
<td class="remaining_hours">#{l_hours(work_package.remaining_hours)}</td>
</tr>
snippet = %Q{
<th class="remaining_hours">#{WorkPackage.human_attribute_name(:remaining_hours)}:</th>
<td class="remaining_hours">#{work_package.remaining_hours ? l_hours(work_package.remaining_hours) : empty_element_tag}</td>
}
snippet
attributes << WorkPackagesHelper::WorkPackageAttribute.new(:remaining_hours, snippet)
YAML::dump(attributes)
end
def view_work_packages_form_details_bottom(context = {})

Loading…
Cancel
Save