diff options
Diffstat (limited to 'app/helpers')
| -rw-r--r-- | app/helpers/node_actions_helper.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/helpers/node_actions_helper.rb b/app/helpers/node_actions_helper.rb index 672dda36..7dd55bdb 100644 --- a/app/helpers/node_actions_helper.rb +++ b/app/helpers/node_actions_helper.rb | |||
| @@ -106,12 +106,18 @@ module NodeActionsHelper | |||
| 106 | :from => c.dig("title", "from"), :to => c.dig("title", "to")) | 106 | :from => c.dig("title", "from"), :to => c.dig("title", "to")) |
| 107 | end | 107 | end |
| 108 | 108 | ||
| 109 | if %w[rrule start_time end_time].any? { |field| c.key?(field) } | 109 | if %w[rrule start_time].any? { |field| c.key?(field) } |
| 110 | items << t("node_actions.detail_event_schedule", | 110 | items << t("node_actions.detail_event_schedule", |
| 111 | :from => event_schedule_side(m, c, "from"), | 111 | :from => event_schedule_side(m, c, "from"), |
| 112 | :to => event_schedule_side(m, c, "to")) | 112 | :to => event_schedule_side(m, c, "to")) |
| 113 | end | 113 | end |
| 114 | 114 | ||
| 115 | if c["end_time"] | ||
| 116 | items << t("node_actions.detail_event_end", | ||
| 117 | :from => event_time_ref(c.dig("end_time", "from")), | ||
| 118 | :to => event_time_ref(c.dig("end_time", "to"))) | ||
| 119 | end | ||
| 120 | |||
| 115 | if c["allday"] | 121 | if c["allday"] |
| 116 | items << t("node_actions.detail_event_allday", | 122 | items << t("node_actions.detail_event_allday", |
| 117 | :from => t("admin.common.#{c.dig("allday", "from") ? "yes" : "no"}"), | 123 | :from => t("admin.common.#{c.dig("allday", "from") ? "yes" : "no"}"), |
| @@ -149,6 +155,11 @@ module NodeActionsHelper | |||
| 149 | event_schedule_text(Event.new(attributes)).presence || t("node_actions.event_none") | 155 | event_schedule_text(Event.new(attributes)).presence || t("node_actions.event_none") |
| 150 | end | 156 | end |
| 151 | 157 | ||
| 158 | def event_time_ref iso | ||
| 159 | return t("node_actions.event_none") if iso.blank? | ||
| 160 | I18n.l(Time.zone.parse(iso), :format => :ccc) | ||
| 161 | end | ||
| 162 | |||
| 152 | def translation_changes diff | 163 | def translation_changes diff |
| 153 | case diff["status"] | 164 | case diff["status"] |
| 154 | when "added" then [t("node_actions.locale_added", :title => diff.dig("title", "to"))] | 165 | when "added" then [t("node_actions.locale_added", :title => diff.dig("title", "to"))] |
