プロジェクト

全般

プロフィール

Vote #74305

完了

Better block detection on my page

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

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

0%

予定工数:
category_id:
30
version_id:
75
issue_org_id:
14766
author_id:
61731
assigned_to_id:
1
comments:
2
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Hi there,

I'm not sure if this is really better, but in my eyes this looks a little bit better.

I checked this line: source:/trunk/app/controllers/my_controller.rb#L142
Replace:


unless %w(top left right).detect {|f| (@blocks[f] ||= []).include?(k)}
    @block_options << [l("my.blocks.#{v}", :default => [v, v.to_s.humanize]), k.dasherize]
end

with:


unless @blocks.map{ |key, value| value}.flatten.include?(k)
    @block_options << [l("my.blocks.#{v}", :default => [v, v.to_s.humanize]), k.dasherize]
end

This type don't need a list of defined areas (left,right,top) and could handle even more areas.

Best regards,
Daniel


journals

Hi Toshi,

maybe you have some time to take a look at this?

Best regards,
Daniel
--------------------------------------------------------------------------------
Patch committed in r12658, thanks. FYI I've replaced @.map{ |key, value| value}@ with a simple @.values@.
--------------------------------------------------------------------------------

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

  • カテゴリCode cleanup/refactoring_30 にセット
  • 対象バージョン2.5.0_75 にセット

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

いいね!0
いいね!0