Skip to content

Commit

Permalink
Ask for login or signup in comment section
Browse files Browse the repository at this point in the history
Users might wonder why commenting isn't available

Fixes #4775
  • Loading branch information
krauselukas committed Sep 18, 2018
1 parent b4d2a7a commit 0968458
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/api/app/views/webui/comment/_new.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
- unless User.current.is_nobody?
- if User.current.is_nobody?
%h3
Login required, please
= link_to('login', session_new_url)
or
= link_to('signup', user_register_user_url)
in order to comment
- else
= form_for @comment, method: :post, remote: true do |f|
= hidden_field_tag :commentable_type, commentable.class
= hidden_field_tag :commentable_id, commentable.id
Expand Down
9 changes: 8 additions & 1 deletion src/api/app/views/webui2/webui/comment/_new.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
- unless User.current.is_nobody?
- if User.current.is_nobody?
.alert.alert-warning{ role: 'alert' }
Login required, please
= link_to('login', session_new_url)
or
= link_to('signup', user_register_user_url)
in order to comment
- else
= form_for @comment, action: 'webui2_create', method: :post, remote: true do |f|
= hidden_field_tag :commentable_type, commentable.class
= hidden_field_tag :commentable_id, commentable.id
Expand Down

0 comments on commit 0968458

Please sign in to comment.