Redirect anonymous user to sign in on create topic link
This commit is contained in:
@@ -32,4 +32,7 @@ module CommunitiesHelper
|
||||
community.from_proposal? ? t("community.sidebar.description.proposal") : t("community.sidebar.description.investment")
|
||||
end
|
||||
|
||||
def create_topic_link(community)
|
||||
current_user.present? ? new_community_topic_path(community.id) : new_user_session_path
|
||||
end
|
||||
end
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<aside class="small-12 column show-for-small-only">
|
||||
<div class="sidebar-divider"></div>
|
||||
<h2><%= t("community.show.sidebar.participate") %></h2>
|
||||
<%= link_to t("community.show.sidebar.new_topic"), new_community_topic_path(@community.id), class: "button expanded" %>
|
||||
<%= link_to t("community.show.sidebar.new_topic"), create_topic_link(@community) , class: "button expanded" %>
|
||||
</aside>
|
||||
|
||||
<div class="small-12 medium-9 column">
|
||||
@@ -30,7 +30,7 @@
|
||||
<aside class="small-12 medium-3 column hide-for-small-only">
|
||||
<div class="sidebar-divider"></div>
|
||||
<h2><%= t("community.show.sidebar.participate") %></h2>
|
||||
<%= link_to t("community.show.sidebar.new_topic"), new_community_topic_path(@community.id), class: "button expanded" %>
|
||||
<%= link_to t("community.show.sidebar.new_topic"), create_topic_link(@community) , class: "button expanded" %>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user