admin interface generation
This commit is contained in:
parent
9e27ba379e
commit
6a3f652dd7
12
app/controllers/admin/auth_controller.rb
Normal file
12
app/controllers/admin/auth_controller.rb
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
module Admin
|
||||||
|
class AuthController < AdminController
|
||||||
|
def login
|
||||||
|
end
|
||||||
|
|
||||||
|
def auth
|
||||||
|
end
|
||||||
|
|
||||||
|
def logout
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
21
app/controllers/admin/question_controller.rb
Normal file
21
app/controllers/admin/question_controller.rb
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
module Admin
|
||||||
|
class QuestionController < AdminController
|
||||||
|
def index
|
||||||
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
end
|
||||||
|
|
||||||
|
def view
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
21
app/controllers/admin/quiz_controller.rb
Normal file
21
app/controllers/admin/quiz_controller.rb
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
module Admin
|
||||||
|
class QuizController < AdminController
|
||||||
|
def index
|
||||||
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
end
|
||||||
|
|
||||||
|
def view
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
21
app/controllers/admin/user_controller.rb
Normal file
21
app/controllers/admin/user_controller.rb
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
module Admin
|
||||||
|
class UserController < AdminController
|
||||||
|
def index
|
||||||
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
end
|
||||||
|
|
||||||
|
def view
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
2
app/controllers/admin_controller.rb
Normal file
2
app/controllers/admin_controller.rb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
class AdminController < ApplicationController
|
||||||
|
end
|
2
app/views/admin/auth/login.html.erb
Normal file
2
app/views/admin/auth/login.html.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<h1>Admin::Auth#login</h1>
|
||||||
|
<p>Find me in app/views/admin/auth/login.html.erb</p>
|
2
app/views/admin/auth/logout.html.erb
Normal file
2
app/views/admin/auth/logout.html.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<h1>Admin::Auth#logout</h1>
|
||||||
|
<p>Find me in app/views/admin/auth/logout.html.erb</p>
|
2
app/views/admin/question/edit.html.erb
Normal file
2
app/views/admin/question/edit.html.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<h1>Admin::Questions#edit</h1>
|
||||||
|
<p>Find me in app/views/admin/questions/edit.html.erb</p>
|
2
app/views/admin/question/index.html.erb
Normal file
2
app/views/admin/question/index.html.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<h1>Admin::Questions#index</h1>
|
||||||
|
<p>Find me in app/views/admin/questions/index.html.erb</p>
|
2
app/views/admin/question/new.html.erb
Normal file
2
app/views/admin/question/new.html.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<h1>Admin::Questions#new</h1>
|
||||||
|
<p>Find me in app/views/admin/questions/new.html.erb</p>
|
2
app/views/admin/question/view.html.erb
Normal file
2
app/views/admin/question/view.html.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<h1>Admin::Questions#view</h1>
|
||||||
|
<p>Find me in app/views/admin/questions/view.html.erb</p>
|
2
app/views/admin/quiz/edit.html.erb
Normal file
2
app/views/admin/quiz/edit.html.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<h1>Admin::Quizes#edit</h1>
|
||||||
|
<p>Find me in app/views/admin/quizes/edit.html.erb</p>
|
2
app/views/admin/quiz/index.html.erb
Normal file
2
app/views/admin/quiz/index.html.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<h1>Admin::Quizes#index</h1>
|
||||||
|
<p>Find me in app/views/admin/quizes/index.html.erb</p>
|
2
app/views/admin/quiz/new.html.erb
Normal file
2
app/views/admin/quiz/new.html.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<h1>Admin::Quizes#new</h1>
|
||||||
|
<p>Find me in app/views/admin/quizes/new.html.erb</p>
|
2
app/views/admin/quiz/view.html.erb
Normal file
2
app/views/admin/quiz/view.html.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<h1>Admin::Quizes#view</h1>
|
||||||
|
<p>Find me in app/views/admin/quizes/view.html.erb</p>
|
2
app/views/admin/user/edit.html.erb
Normal file
2
app/views/admin/user/edit.html.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<h1>Admin::Users#edit</h1>
|
||||||
|
<p>Find me in app/views/admin/users/edit.html.erb</p>
|
2
app/views/admin/user/index.html.erb
Normal file
2
app/views/admin/user/index.html.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<h1>Admin::Users#index</h1>
|
||||||
|
<p>Find me in app/views/admin/users/index.html.erb</p>
|
2
app/views/admin/user/new.html.erb
Normal file
2
app/views/admin/user/new.html.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<h1>Admin::Users#new</h1>
|
||||||
|
<p>Find me in app/views/admin/users/new.html.erb</p>
|
2
app/views/admin/user/view.html.erb
Normal file
2
app/views/admin/user/view.html.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<h1>Admin::Users#view</h1>
|
||||||
|
<p>Find me in app/views/admin/users/view.html.erb</p>
|
@ -23,5 +23,11 @@ module SkillAssessmentApp
|
|||||||
|
|
||||||
config.action_mailer.delivery_method = :mailjet
|
config.action_mailer.delivery_method = :mailjet
|
||||||
config.action_mailer.default_url_options = { host: ENV['full_app_url'] }
|
config.action_mailer.default_url_options = { host: ENV['full_app_url'] }
|
||||||
|
|
||||||
|
config.generators do |g|
|
||||||
|
g.assets false
|
||||||
|
g.helper false
|
||||||
|
g.routes false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,4 +1,31 @@
|
|||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
|
post "/admin/login", to: "admin/auth#auth", as: :admin_auth
|
||||||
|
get "/admin/logout", to: "admin/auth#logout", as: :admin_logout
|
||||||
|
get "/admin", to: "admin/auth#login", as: :admin
|
||||||
|
|
||||||
|
get "/admin/quizzes", to: "admin/quiz#index", as: :admin_quizzes
|
||||||
|
get "/admin/quiz/new", to: "admin/quiz#new", as: :admin_new_quiz
|
||||||
|
post "/admin/quiz/create", to: "admin/quiz#create", as: :admin_create_quiz
|
||||||
|
get "/admin/quiz/:quiz_id", to: "admin/quiz#view", as: :admin_quiz
|
||||||
|
get "/admin/quiz/:quiz_id/edit", to: "admin/quiz#edit", as: :admin_edit_quiz
|
||||||
|
post "/admin/quiz/:quiz_id/update", to: "admin/quiz#update", as: :admin_update_quiz
|
||||||
|
|
||||||
|
get "/admin/users", to: "admin/user#index", as: :admin_users
|
||||||
|
get "/admin/user/new", to: "admin/user#new", as: :admin_new_user
|
||||||
|
post "/admin/user/create", to: "admin/user#create", as: :admin_create_user
|
||||||
|
get "/admin/user/:user_id", to: "admin/user#view", as: :admin_user
|
||||||
|
get "/admin/user/:user_id/edit", to: "admin/user#edit", as: :admin_edit_user
|
||||||
|
post "/admin/user/:user_id/update", to: "admin/user#update", as: :admin_update_user
|
||||||
|
|
||||||
|
get "/admin/questions", to: "admin/question#index", as: :admin_questions
|
||||||
|
get "/admin/question/new", to: "admin/question#new", as: :admin_new_question
|
||||||
|
post "/admin/question/create", to: "admin/question#create", as: :admin_create_question
|
||||||
|
get "/admin/question/:question_id", to: "admin/question#view", as: :admin_question
|
||||||
|
get "/admin/question/:question_id/edit", to: "admin/question#edit", as: :admin_edit_question
|
||||||
|
post "/admin/question/:question_id/update", to: "admin/question#update", as: :admin_update_question
|
||||||
|
|
||||||
|
#########################################################################################
|
||||||
|
|
||||||
post "/validate", to: "candidate#validate", as: :validate_candidate
|
post "/validate", to: "candidate#validate", as: :validate_candidate
|
||||||
get "/login(/:test_id)", to: "candidate#login", as: :login
|
get "/login(/:test_id)", to: "candidate#login", as: :login
|
||||||
get "/welcome", to: "candidate#welcome", as: :welcome
|
get "/welcome", to: "candidate#welcome", as: :welcome
|
||||||
|
21
test/controllers/admin/auth_controller_test.rb
Normal file
21
test/controllers/admin/auth_controller_test.rb
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
module Admin
|
||||||
|
class AuthControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
test "should get login" do
|
||||||
|
get admin_url
|
||||||
|
assert_response :success
|
||||||
|
assert_template 'admin/auth/login'
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get auth" do
|
||||||
|
post admin_auth_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get logout" do
|
||||||
|
get admin_logout_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
35
test/controllers/admin/question_controller_test.rb
Normal file
35
test/controllers/admin/question_controller_test.rb
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
module Admin
|
||||||
|
class QuestionControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
test "should get index" do
|
||||||
|
get admin_questions_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get new" do
|
||||||
|
get admin_new_question_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should post create" do
|
||||||
|
post admin_create_question_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get view" do
|
||||||
|
get admin_question_url questions(:fed5).to_i
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get edit" do
|
||||||
|
get admin_edit_question_url questions(:fed5).to_i
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should post update question" do
|
||||||
|
post admin_update_question_url questions(:fed5).to_i
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
35
test/controllers/admin/quiz_controller_test.rb
Normal file
35
test/controllers/admin/quiz_controller_test.rb
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
module Admin
|
||||||
|
class QuizControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
test "should get index" do
|
||||||
|
get admin_quizzes_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get new" do
|
||||||
|
get admin_new_quiz_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should post create" do
|
||||||
|
post admin_create_quiz_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get view" do
|
||||||
|
get admin_quiz_url quizzes(:fed).to_i
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get edit" do
|
||||||
|
get admin_edit_quiz_url quizzes(:fed).to_i
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should post update quiz" do
|
||||||
|
post admin_update_quiz_url quizzes(:fed).to_i
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
35
test/controllers/admin/user_controller_test.rb
Normal file
35
test/controllers/admin/user_controller_test.rb
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
module Admin
|
||||||
|
class UserControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
test "should get index" do
|
||||||
|
get admin_users_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get new" do
|
||||||
|
get admin_new_user_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should post create" do
|
||||||
|
post admin_create_user_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get view" do
|
||||||
|
get admin_user_url users(:recruiter).to_i
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get edit" do
|
||||||
|
get admin_edit_user_url users(:recruiter).to_i
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should post update user" do
|
||||||
|
post admin_update_user_url users(:recruiter).to_i
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
4
test/controllers/admin_controller_test.rb
Normal file
4
test/controllers/admin_controller_test.rb
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class AdminControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user