Commit 69b34276 authored by Antonio Terceiro's avatar Antonio Terceiro

Merge branch 'self-service-success' into 'master'

self_service: add success submission UI

See merge request !98
parents 2e848f56 256980dd
Pipeline #63846 failed with stage
in 33 minutes and 12 seconds
......@@ -2,7 +2,7 @@
<li><a href="/selfservice">Welcome <%= @user %>!</a></li>
<li class="active">Request Test</li>
</ol>
<% unless @error_msg.nil? %>
<% if @error_msg %>
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title">Form error</h3>
......@@ -10,6 +10,9 @@
<div class="panel-body"><%= @error_msg %></div>
</div>
<% end %>
<% if @success %>
<div class="alert alert-success" role="alert">Test submitted successfully!</div>
<% end %>
<header class="well">
<h1>Request Test</h1>
<p>You can choose to request a test by either uploading a JSON file or by filling the form.</p>
......
......@@ -66,7 +66,8 @@ module Debci
[200, [test_request].to_json]
# user submits test
else
201
@success = true
[201, erb(:self_service_test)]
end
end
......@@ -94,7 +95,8 @@ module Debci
@error_msg = error
halt(400, erb(:self_service_test))
else
201
@success = true
[201, erb(:self_service_test)]
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment