Skip to content

Commit

Permalink
Merge pull request #5868 from krauselukas/hint_comment
Browse files Browse the repository at this point in the history
Ask for login or signup in comment section
  • Loading branch information
saraycp committed Sep 18, 2018
2 parents 9277beb + 0968458 commit 7e4e30b
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 7e4e30b

Please sign in to comment.