プロジェクト

全般

プロフィール

Vote #75884

未完了

Issues list : css tags to get sort orders [sort 2 and 3]

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

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

0%

予定工数:
category_id:
10
version_id:
0
issue_org_id:
18735
author_id:
36999
assigned_to_id:
0
comments:
9
status_id:
10
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Needs feedback]

説明

Hi is it possible to have css tags for the sort 2 and 3 ?

Thanks a lot !


journals

An enhancement to #17993
--------------------------------------------------------------------------------
Here is a patch
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Hi, is it possible to examine this patch ?

second and third sort are very useful, and they can not be explicitly showed with css without this patch.
--------------------------------------------------------------------------------
This would define a lot of CSS classes, how would you use them?
Can you provide an example to see what you want to achieve?
--------------------------------------------------------------------------------
This adds the same tag on the second and third sort on the table tag, but in fact it's not the more important part.

I omitted the way to explicit / change the second and third link :
<pre><code class="ruby">
def sort_link(column, caption, default_order)
css, order = nil, default_order

if column.to_s == @sort_criteria.first_key
if @sort_criteria.first_asc?
css = 'sort asc'
order = 'desc'
else
css = 'sort desc'
order = 'asc'
end
end

# Smile specific : #149968 Display sort icons for second and third sort column
# Smile specific : second sort column
if @sort_criteria.size >= 2 && column.to_s == @sort_criteria.second_key
if @sort_criteria.second_asc?
css = 'sort2 asc'
else
css = 'sort2 desc'
end
end

# Smile specific : third sort column
if @sort_criteria.size >= 3 && column.to_s == @sort_criteria.third_key
if @sort_criteria.third_asc?
css = 'sort3 asc'
else
css = 'sort3 desc'
end
end
# END -- Smile specific : #149968 Display sort icons for second and third sort column
caption = column.to_s.humanize unless caption

sort_options = { :sort => @sort_criteria.add(column.to_s, order).to_param }
url_options = params.merge(sort_options)

# Add project_id to url_options
url_options = url_options.merge(:project_id => params[:project_id]) if params.has_key?(:project_id)

# Smile specific : #149968 Display sort icons for second and third sort column
# Smile specific : Sort link on a second line
link_to_content_update(h(caption), url_options) +
'<br/>'.html_safe +
link_to_content_update('&nbsp;&nbsp;&nbsp;&nbsp;'.html_safe, url_options, :class => css)
# END -- Smile specific : #149968 Display sort icons for second and third sort column
end
</code></pre>

--------------------------------------------------------------------------------
Sorry for the Smile specific tags and for the missing tests.

As you can see the sort links are put on a second line of the th cells.

By the way there no mean to remove a sort.

--------------------------------------------------------------------------------
Here is a screen capture of what it gives :

!redmine_3_sorts.png!

here is the css that I have added to get the sort icons :
<pre>
<code class="css">
a.sort2 { padding-right: 16px; background-position: 100% 50%; background-repeat: no-repeat; }
a.sort2.asc { background-image: url(../images/sort2_asc.png); }
a.sort2.desc { background-image: url(../images/sort2_desc.png); }

a.sort3 { padding-right: 16px; background-position: 100% 50%; background-repeat: no-repeat; }
a.sort3.asc { background-image: url(../images/sort3_asc.png); }
a.sort3.desc { background-image: url(../images/sort3_desc.png); }
</code></pre>

I have joined the 4 new icons

--------------------------------------------------------------------------------
Hi,

This issue can be closed, I have developed a plugin for this feature :
http://www.redmine.org/plugins/redmine_smile_three_sortings

--------------------------------------------------------------------------------

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

  • カテゴリUI_10 にセット

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

いいね!0
いいね!0