summaryrefslogtreecommitdiff
path: root/app/views/users/terms/index.html.haml
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-04-27 14:56:50 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2018-05-04 13:54:43 +0200
commit10aa55a770c2985c22c92d17b8a7ea90b0a09085 (patch)
tree15b66bb5e3f26d0a49c07bf781c644deb998f0c8 /app/views/users/terms/index.html.haml
parent65bea3f7d0bf30b5f9a9b3f94567474d3c8f7cbc (diff)
downloadgitlab-ce-10aa55a770c2985c22c92d17b8a7ea90b0a09085.tar.gz
Allow a user to accept/decline terms
When a user accepts, we store this in the agreements to keep track of which terms they accepted. We also update the flag on the user.
Diffstat (limited to 'app/views/users/terms/index.html.haml')
-rw-r--r--app/views/users/terms/index.html.haml12
1 files changed, 11 insertions, 1 deletions
diff --git a/app/views/users/terms/index.html.haml b/app/views/users/terms/index.html.haml
index 49fdab84069..614dab57331 100644
--- a/app/views/users/terms/index.html.haml
+++ b/app/views/users/terms/index.html.haml
@@ -1,2 +1,12 @@
+- redirect_params = { redirect: @redirect } if @redirect
.panel-content.rendered-terms
- = markdown_field(@terms, :terms)
+ = markdown_field(@term, :terms)
+.row-content-block.footer-block.clearfix
+ - if can?(current_user, :accept_terms, @term)
+ .pull-right
+ = button_to accept_term_path(@term, redirect_params), class: 'btn btn-success prepend-left-8' do
+ = _('Accept terms')
+ - if can?(current_user, :decline_terms, @term)
+ .pull-right
+ = button_to decline_term_path(@term, redirect_params), class: 'btn btn-default prepend-left-8' do
+ = _('Decline and sign out')