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 openSUSE#4775
  • Loading branch information
krauselukas committed Sep 17, 2018
1 parent b4d2a7a commit 62c50e6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/api/app/views/webui/comment/_new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@
= hidden_field_tag :commentable_id, commentable.id
~ f.text_area :body, size: '80x4', onkeyup: 'sz(this);', onclick: 'sz(this);', placeholder: 'Add a new comment (markdown markup supported)', required: 'required'
= f.submit 'Add comment'
- else
%h3
Login required, please
= link_to "login", session_new_url
or
= link_to "signup", user_register_user_url
in order to create comments

8 changes: 8 additions & 0 deletions src/api/app/views/webui2/webui/comment/_new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@
~ f.text_area :body, row: '4', onkeyup: 'sz(this);', onclick: 'sz(this);', placeholder: 'Add a new comment (markdown markup supported)',
required: 'required', class: 'w-100 mb-3 form-control'
= f.submit 'Add comment', class: 'btn btn-primary'
- else
%div{:class => "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 create comments

0 comments on commit 62c50e6

Please sign in to comment.