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")
|
community.from_proposal? ? t("community.sidebar.description.proposal") : t("community.sidebar.description.investment")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def create_topic_link(community)
|
||||||
|
current_user.present? ? new_community_topic_path(community.id) : new_user_session_path
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<aside class="small-12 column show-for-small-only">
|
<aside class="small-12 column show-for-small-only">
|
||||||
<div class="sidebar-divider"></div>
|
<div class="sidebar-divider"></div>
|
||||||
<h2><%= t("community.show.sidebar.participate") %></h2>
|
<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>
|
</aside>
|
||||||
|
|
||||||
<div class="small-12 medium-9 column">
|
<div class="small-12 medium-9 column">
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<aside class="small-12 medium-3 column hide-for-small-only">
|
<aside class="small-12 medium-3 column hide-for-small-only">
|
||||||
<div class="sidebar-divider"></div>
|
<div class="sidebar-divider"></div>
|
||||||
<h2><%= t("community.show.sidebar.participate") %></h2>
|
<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>
|
</aside>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user