From cb0866f31307680aad80a96d0a9d9962ac193f03 Mon Sep 17 00:00:00 2001
From: Jean-Philippe Lang
Date: Sun, 8 Nov 2015 11:50:36 +0000
Subject: Render issue attributes using divs instead of a table for
responsiveness (#19097).
git-svn-id: http://svn.redmine.org/redmine/trunk@14848 e93f8b46-1217-0410-a6f0-8f06a7374b81
---
app/helpers/issues_helper.rb | 18 +++++++++---------
app/views/issues/show.html.erb | 4 ++--
2 files changed, 11 insertions(+), 11 deletions(-)
(limited to 'app')
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index 9288db5ab..495dcef9e 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -189,18 +189,18 @@ module IssuesHelper
end
def to_html
- html = ''.html_safe
- blank = content_tag('th', '') + content_tag('td', '')
- size.times do |i|
- left = @left[i] || blank
- right = @right[i] || blank
- html << content_tag('tr', left + right)
- end
- html
+ content =
+ content_tag('div', @left.reduce(&:+), :class => 'splitcontentleft') +
+ content_tag('div', @right.reduce(&:+), :class => 'splitcontentleft')
+
+ content_tag('div', content, :class => 'splitcontent')
end
def cells(label, text, options={})
- content_tag('th', label + ":", options) + content_tag('td', text, options)
+ options[:class] = [options[:class] || "", 'attribute'].join(' ')
+ content_tag 'div',
+ content_tag('div', label + ":", :class => 'label') + content_tag('div', text, :class => 'value'),
+ options
end
end
diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb
index 4c60587d2..b6b9ad4c1 100644
--- a/app/views/issues/show.html.erb
+++ b/app/views/issues/show.html.erb
@@ -33,7 +33,7 @@
<% end %>
-
+
<%= issue_fields_rows do |rows|
rows.left l(:field_status), @issue.status.name, :class => 'status'
rows.left l(:field_priority), @issue.priority.name, :class => 'priority'
@@ -70,7 +70,7 @@
end %>
<%= render_custom_fields_rows(@issue) %>
<%= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
-
+
<% if @issue.description? || @issue.attachments.any? -%>
--
cgit v1.2.3