プロジェクト

全般

プロフィール

Vote #81523

未完了

Fix css class assignment in issue custom field rendering in show view

Admin Redmine さんが約2年前に追加. 約2年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Issues_2
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
2
version_id:
0
issue_org_id:
35545
author_id:
361769
assigned_to_id:
0
comments:
4
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
165
ステータス-->[New]

説明

Rendering the issue custom fields in the show view is done by the
class IssueFieldsRow, which can be found in issues_helper.rb.

The method IssueFieldRow#to_html has an error because the
class 'splitcontentright' will never be assigned.

This patch fixes this error by modifying the class in the respective
content_tag of the helper method. Thus, it is a one liner.


journals

This is the content of the patch file:

<pre>
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index 756d7ed4c..d43a7db8b 100755
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -332,7 +332,7 @@ module IssuesHelper
def to_html
content =
content_tag('div', @left.reduce(&:+), :class => 'splitcontentleft') +
- content_tag('div', @right.reduce(&:+), :class => 'splitcontentleft')
+ content_tag('div', @right.reduce(&:+), :class => 'splitcontentright')

content_tag('div', content, :class => 'splitcontent')
end
</pre>
--------------------------------------------------------------------------------
The suggested change causes a layout issue. See the screenshot below.

!{border: 1px solid grey; width: 762px;}.35545-layout-issue.png!
--------------------------------------------------------------------------------
Hi Go MAEDA,

Thank you for this important information.

I have fixed it with some more css:

<pre>
Old styles:
.splitcontent {overflow: auto; display: flex; flex-wrap: wrap}
.splitcontentleft {flex: 1; margin-right: 5px;}
.splitcontentright {flex: 1; margin-left: 5px;}

New styles:
.splitcontent {overflow: auto; display: flex; flex-wrap: wrap;justify-content: space-between}
.splitcontentleft, .splitcontentright {width: 49.5%}
</pre>

This is how it looks like now:

!35545-layout-issue-flex-css.png!

It also looks nice on the project overview page where the same css classes are used.

Best Regards
Liane
--------------------------------------------------------------------------------
Here is the patch file for the css changes.
--------------------------------------------------------------------------------

Admin Redmine さんが約2年前に更新

  • カテゴリIssues_2 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0