Commit 1d3efeb7 authored by Alex Kalderimis's avatar Alex Kalderimis

Support display of wiki events

This updates templates and views to support wiki events
parent 0c342a8c
......@@ -70,6 +70,8 @@ module EventsHelper
def event_preposition(event)
if event.push_action? || event.commented_action? || event.target
"at"
elsif event.wiki_page?
_("Events|in the wiki for")
elsif event.milestone?
"in"
end
......@@ -172,6 +174,19 @@ module EventsHelper
end
end
def event_wiki_title_html(event)
capture do
concat content_tag(:span, _('wiki page'), class: "event-target-type append-right-4")
concat link_to(event.wiki_page_title, event_wiki_page_target_url(event),
title: event.target_title,
class: 'has-tooltip event-target-link append-right-4')
end
end
def event_wiki_page_target_url(event)
project_wiki_url(event.project, event.wiki_page_title)
end
def event_note_title_html(event)
if event.note_target
capture do
......
......@@ -5,7 +5,9 @@
.event-item-timestamp
#{time_ago_with_tooltip(event.created_at)}
- if event.created_project_action?
- if event.wiki_page?
= render "events/event/wiki", event: event
- elsif event.created_project_action?
= render "events/event/created_project", event: event
- elsif event.push_action?
= render "events/event/push", event: event
......
= icon_for_profile_event(event)
= event_user_info(event)
.event-title.d-flex.flex-wrap
= inline_event_icon(event)
%span.event-type.d-inline-block.append-right-4{ class: event.action_name }
= event.action_name
= event_wiki_title_html(event)
= render "events/event_scope", event: event
......@@ -15,4 +15,6 @@
= render_if_exists 'events/epics_filter'
- if comments_visible?
= event_filter_link EventFilter::COMMENTS, _('Comments'), s_('EventFilterBy|Filter by comments')
- if @project.nil? || @project.has_wiki?
= event_filter_link EventFilter::WIKI, _('Wiki'), s_('EventFilterBy|Filter by wiki')
= event_filter_link EventFilter::TEAM, _('Team'), s_('EventFilterBy|Filter by team')
---
title: Support wiki events in activity streams
merge_request: 23869
author:
type: changed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment