diff options
Diffstat (limited to 'app/helpers')
| -rw-r--r-- | app/helpers/nodes_helper.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/helpers/nodes_helper.rb b/app/helpers/nodes_helper.rb index 1268b63b..5884c8cd 100644 --- a/app/helpers/nodes_helper.rb +++ b/app/helpers/nodes_helper.rb | |||
| @@ -28,6 +28,18 @@ module NodesHelper | |||
| 28 | User.all.map {|u| [u.login, u.id]} | 28 | User.all.map {|u| [u.login, u.id]} |
| 29 | end | 29 | end |
| 30 | 30 | ||
| 31 | def node_last_editor(node) | ||
| 32 | editor = node.draft&.editor || node.head&.editor | ||
| 33 | return nil unless editor | ||
| 34 | editor == current_user ? t("editor_self") : editor.login | ||
| 35 | end | ||
| 36 | |||
| 37 | def node_head_editor(node) | ||
| 38 | editor = node.head&.editor | ||
| 39 | return nil unless editor | ||
| 40 | editor == current_user ? t("publisher_self") : editor.login | ||
| 41 | end | ||
| 42 | |||
| 31 | DEFAULT_EVENT_TAG_BY_PAGE_TAG = { | 43 | DEFAULT_EVENT_TAG_BY_PAGE_TAG = { |
| 32 | 'erfa-detail' => 'open-day', | 44 | 'erfa-detail' => 'open-day', |
| 33 | 'chaostreff-detail' => 'open-day' | 45 | 'chaostreff-detail' => 'open-day' |
