Skip to content

Commit ae013fc

Browse files
author
Joe Tanner
committed
allow a plugin to override the signup form, refs #CNVS-4198
test plan: - go to /register_from_website - the forms should behave normally Change-Id: I317f4a8404cbf00f2de112a88421c724834e6181 Reviewed-on: https://gerrit.instructure.com/18470 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Jon Jensen <jon@instructure.com> QA-Review: Cam Theriault <cam@instructure.com>
1 parent 3efc586 commit ae013fc

4 files changed

Lines changed: 4 additions & 2 deletions

File tree

app/coffeescripts/registration/signupDialog.coffee

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ define [
1818
return unless templates[id]
1919
$node = $nodes[id] ?= $('<div />')
2020
$node.html templates[id](
21+
form_url: ENV.FORM_URL
2122
terms_url: "http://www.instructure.com/terms-of-use"
2223
privacy_url: "http://www.instructure.com/privacy-policy"
2324
)

app/controllers/users_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,7 @@ def external_tool
623623

624624
def new
625625
return redirect_to(root_url) if @current_user
626+
js_env[:FORM_URL] ||= '/users' # can be overridden in a plugin
626627
render :layout => 'bare'
627628
end
628629

app/views/jst/registration/parentDialog.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="registration-dialog">
2-
<form class="form-horizontal bootstrap-form" method="post" action="/users">
2+
<form class="form-horizontal bootstrap-form" method="post" action="{{form_url}}">
33
<div class="control-group">
44
<label class="control-label" for="parent_name">{{#t "labels.name"}}Your Name{{/t}}</label>
55
<div class="controls">

app/views/jst/registration/teacherDialog.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="registration-dialog">
2-
<form class="form-horizontal bootstrap-form" method="post" action="/users">
2+
<form class="form-horizontal bootstrap-form" method="post" action="{{form_url}}">
33
<div class="control-group">
44
<label class="control-label" for="teacher_name">{{#t "labels.name"}}Name{{/t}}</label>
55
<div class="controls">

0 commit comments

Comments
 (0)