##// END OF EJS Templates
Render issue attributes using divs instead of a table for responsiveness (#19097)....
Jean-Philippe Lang -
r14466:cb0866f31307
parent child
Show More
@@ -189,18 +189,18 module IssuesHelper
189 end
189 end
190
190
191 def to_html
191 def to_html
192 html = ''.html_safe
192 content =
193 blank = content_tag('th', '') + content_tag('td', '')
193 content_tag('div', @left.reduce(&:+), :class => 'splitcontentleft') +
194 size.times do |i|
194 content_tag('div', @right.reduce(&:+), :class => 'splitcontentleft')
195 left = @left[i] || blank
195
196 right = @right[i] || blank
196 content_tag('div', content, :class => 'splitcontent')
197 html << content_tag('tr', left + right)
198 end
199 html
200 end
197 end
201
198
202 def cells(label, text, options={})
199 def cells(label, text, options={})
203 content_tag('th', label + ":", options) + content_tag('td', text, options)
200 options[:class] = [options[:class] || "", 'attribute'].join(' ')
201 content_tag 'div',
202 content_tag('div', label + ":", :class => 'label') + content_tag('div', text, :class => 'value'),
203 options
204 end
204 end
205 end
205 end
206
206
@@ -33,7 +33,7
33 <% end %>
33 <% end %>
34 </p>
34 </p>
35
35
36 <table class="attributes">
36 <div class="attributes">
37 <%= issue_fields_rows do |rows|
37 <%= issue_fields_rows do |rows|
38 rows.left l(:field_status), @issue.status.name, :class => 'status'
38 rows.left l(:field_status), @issue.status.name, :class => 'status'
39 rows.left l(:field_priority), @issue.priority.name, :class => 'priority'
39 rows.left l(:field_priority), @issue.priority.name, :class => 'priority'
@@ -70,7 +70,7
70 end %>
70 end %>
71 <%= render_custom_fields_rows(@issue) %>
71 <%= render_custom_fields_rows(@issue) %>
72 <%= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
72 <%= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
73 </table>
73 </div>
74
74
75 <% if @issue.description? || @issue.attachments.any? -%>
75 <% if @issue.description? || @issue.attachments.any? -%>
76 <hr />
76 <hr />
@@ -253,10 +253,6 a.sort { padding-right: 16px; background-position: 100% 50%; background-repeat:
253 a.sort.asc { background-image: url(../images/sort_asc.png); }
253 a.sort.asc { background-image: url(../images/sort_asc.png); }
254 a.sort.desc { background-image: url(../images/sort_desc.png); }
254 a.sort.desc { background-image: url(../images/sort_desc.png); }
255
255
256 table.attributes { width: 100% }
257 table.attributes th { vertical-align: top; text-align: left; }
258 table.attributes td { vertical-align: top; }
259
260 table.boards a.board, h3.comments { background: url(../images/comment.png) no-repeat 0% 50%; padding-left: 20px; }
256 table.boards a.board, h3.comments { background: url(../images/comment.png) no-repeat 0% 50%; padding-left: 20px; }
261 table.boards td.last-message {text-align:left;font-size:80%;}
257 table.boards td.last-message {text-align:left;font-size:80%;}
262
258
@@ -356,9 +352,10 div.issue div.subject>div>p { margin-top: 0.5em; }
356 div.issue div.subject h3 {margin: 0; margin-bottom: 0.1em;}
352 div.issue div.subject h3 {margin: 0; margin-bottom: 0.1em;}
357 div.issue span.private, div.journal span.private { position:relative; bottom: 2px; text-transform: uppercase; background: #d22; color: #fff; font-weight:bold; padding: 0px 2px 0px 2px; font-size: 60%; margin-right: 2px; border-radius: 2px;}
353 div.issue span.private, div.journal span.private { position:relative; bottom: 2px; text-transform: uppercase; background: #d22; color: #fff; font-weight:bold; padding: 0px 2px 0px 2px; font-size: 60%; margin-right: 2px; border-radius: 2px;}
358 div.issue .next-prev-links {color:#999;}
354 div.issue .next-prev-links {color:#999;}
359 div.issue table.attributes th {width:22%;}
355 div.issue .attributes {margin-top: 2em;}
360 div.issue table.attributes td {width:28%;}
356 div.issue .attribute {padding-left:180px; clear:left; min-height: 1.8em;}
361 div.issue.issue.overdue td.due-date { color: #c22; }
357 div.issue .attribute .label {width: 170px; margin-left:-180px; font-weight:bold; float:left;}
358 div.issue.overdue .due-date .value { color: #c22; }
362
359
363 #issue_tree table.issues, #relations table.issues { border: 0; }
360 #issue_tree table.issues, #relations table.issues { border: 0; }
364 #issue_tree td.checkbox, #relations td.checkbox {display:none;}
361 #issue_tree td.checkbox, #relations td.checkbox {display:none;}
@@ -796,7 +793,7 table.progress td { height: 1em; }
796 table.progress td.closed { background: #BAE0BA none repeat scroll 0%; }
793 table.progress td.closed { background: #BAE0BA none repeat scroll 0%; }
797 table.progress td.done { background: #D3EDD3 none repeat scroll 0%; }
794 table.progress td.done { background: #D3EDD3 none repeat scroll 0%; }
798 table.progress td.todo { background: #eee none repeat scroll 0%; }
795 table.progress td.todo { background: #eee none repeat scroll 0%; }
799 p.percent {font-size: 80%;}
796 p.percent {font-size: 80%; margin:0;}
800 p.progress-info {clear: left; font-size: 80%; margin-top:-4px; color:#777;}
797 p.progress-info {clear: left; font-size: 80%; margin-top:-4px; color:#777;}
801
798
802 #roadmap table.progress td { height: 1.2em; }
799 #roadmap table.progress td { height: 1.2em; }
@@ -1382,7 +1382,7 class IssuesControllerTest < ActionController::TestCase
1382
1382
1383 get :show, :id => 1
1383 get :show, :id => 1
1384 assert_response :success
1384 assert_response :success
1385 assert_select 'table.attributes .category'
1385 assert_select '.attributes .category'
1386 end
1386 end
1387
1387
1388 def test_show_should_not_display_category_field_if_no_categories_are_defined
1388 def test_show_should_not_display_category_field_if_no_categories_are_defined
@@ -1482,7 +1482,7 class IssuesControllerTest < ActionController::TestCase
1482 get :show, :id => 1
1482 get :show, :id => 1
1483 assert_response :success
1483 assert_response :success
1484
1484
1485 assert_select 'td', :text => 'MySQL, Oracle'
1485 assert_select ".cf_1 .value", :text => 'MySQL, Oracle'
1486 end
1486 end
1487
1487
1488 def test_show_with_multi_user_custom_field
1488 def test_show_with_multi_user_custom_field
@@ -1495,7 +1495,7 class IssuesControllerTest < ActionController::TestCase
1495 get :show, :id => 1
1495 get :show, :id => 1
1496 assert_response :success
1496 assert_response :success
1497
1497
1498 assert_select "td.cf_#{field.id}", :text => 'Dave Lopper, John Smith' do
1498 assert_select ".cf_#{field.id} .value", :text => 'Dave Lopper, John Smith' do
1499 assert_select 'a', :text => 'Dave Lopper'
1499 assert_select 'a', :text => 'Dave Lopper'
1500 assert_select 'a', :text => 'John Smith'
1500 assert_select 'a', :text => 'John Smith'
1501 end
1501 end
@@ -68,9 +68,9 class IssuesCustomFieldsVisibilityTest < ActionController::TestCase
68 get :show, :id => @issue.id
68 get :show, :id => @issue.id
69 @fields.each_with_index do |field, i|
69 @fields.each_with_index do |field, i|
70 if fields.include?(field)
70 if fields.include?(field)
71 assert_select 'td', {:text => "Value#{i}", :count => 1}, "User #{user.id} was not able to view #{field.name}"
71 assert_select '.value', {:text => "Value#{i}", :count => 1}, "User #{user.id} was not able to view #{field.name}"
72 else
72 else
73 assert_select 'td', {:text => "Value#{i}", :count => 0}, "User #{user.id} was able to view #{field.name}"
73 assert_select '.value', {:text => "Value#{i}", :count => 0}, "User #{user.id} was able to view #{field.name}"
74 end
74 end
75 end
75 end
76 end
76 end
@@ -171,7 +171,10 class IssuesTest < Redmine::IntegrationTest
171
171
172 # Issue view
172 # Issue view
173 follow_redirect!
173 follow_redirect!
174 assert_select 'th:contains("Tester:") + td', :text => tester.name
174 assert_select ".cf_#{@field.id}" do
175 assert_select '.label', :text => 'Tester:'
176 assert_select '.value', :text => tester.name
177 end
175 assert_select 'select[name=?]', "issue[custom_field_values][#{@field.id}]" do
178 assert_select 'select[name=?]', "issue[custom_field_values][#{@field.id}]" do
176 assert_select 'option', users.size + 1 # +1 for blank value
179 assert_select 'option', users.size + 1 # +1 for blank value
177 assert_select 'option[value=?][selected=selected]', tester.id.to_s, :text => tester.name
180 assert_select 'option[value=?][selected=selected]', tester.id.to_s, :text => tester.name
General Comments 0
You need to be logged in to leave comments. Login now