From 5e743ca2eb89182a440adf515375f32ffcefeddb Mon Sep 17 00:00:00 2001 From: Mark Moser Date: Mon, 20 Mar 2017 14:38:57 -0500 Subject: [PATCH] more headings --- app/views/admin/candidate/index.html.erb | 2 ++ app/views/admin/profile/view.html.erb | 2 ++ app/views/admin/question/index.html.erb | 2 ++ app/views/admin/question/new.html.erb | 2 ++ app/views/admin/quiz/edit.html.erb | 7 ++++++- app/views/admin/quiz/index.html.erb | 2 ++ app/views/admin/quiz/new.html.erb | 2 ++ app/views/admin/quiz/view.html.erb | 3 ++- app/views/admin/result/index.html.erb | 2 ++ app/views/admin/user/edit.html.erb | 7 ++++++- app/views/admin/user/index.html.erb | 5 ++++- app/views/admin/user/new.html.erb | 7 ++++++- app/views/admin/user/view.html.erb | 7 +++++-- test/controllers/admin/user_controller_test.rb | 4 ++-- 14 files changed, 45 insertions(+), 9 deletions(-) diff --git a/app/views/admin/candidate/index.html.erb b/app/views/admin/candidate/index.html.erb index ff15be9..9601475 100644 --- a/app/views/admin/candidate/index.html.erb +++ b/app/views/admin/candidate/index.html.erb @@ -3,6 +3,8 @@ content_for :title, "Candidates - Skills Assessment Admin" %> +

Candidates

+ <%= link_to("Create New Candidate", admin_new_candidate_path, { class: "" }) if policy(Candidate).create? %> diff --git a/app/views/admin/profile/view.html.erb b/app/views/admin/profile/view.html.erb index cdad8fa..2f1b7d3 100644 --- a/app/views/admin/profile/view.html.erb +++ b/app/views/admin/profile/view.html.erb @@ -3,6 +3,8 @@ content_for :title, "Profile - Skills Assessment Admin" %> +

Profile

+
Name: <%= current_user.name %>
email: <%= current_user.email %>
Role: <%= current_user.role %>
diff --git a/app/views/admin/question/index.html.erb b/app/views/admin/question/index.html.erb index 8675446..996962d 100644 --- a/app/views/admin/question/index.html.erb +++ b/app/views/admin/question/index.html.erb @@ -3,6 +3,8 @@ content_for :title, "Questions - Skills Assessment Admin" %> +

Questions

+ <% quizzes = @questions.group_by{ |q| q.quiz.name } %> <% quizzes.each do |quiz, questions| %>

<%= quiz %>

diff --git a/app/views/admin/question/new.html.erb b/app/views/admin/question/new.html.erb index cfda31c..03d113c 100644 --- a/app/views/admin/question/new.html.erb +++ b/app/views/admin/question/new.html.erb @@ -3,4 +3,6 @@ content_for :title, "New Question - Skills Assessment Admin" %> +

New Question

+ <%= render partial: 'form', locals: {question: @question, action: admin_create_question_path } %> diff --git a/app/views/admin/quiz/edit.html.erb b/app/views/admin/quiz/edit.html.erb index 8d59f22..9e3a780 100644 --- a/app/views/admin/quiz/edit.html.erb +++ b/app/views/admin/quiz/edit.html.erb @@ -1,3 +1,8 @@ -<% content_for :section_title, "Edit: #{@quiz.name}" %> +<% + content_for :section_title, "Edit: #{@quiz.name}" + content_for :title, "Quizzes - Skills Assessment Admin" +%> + +

Edit: <%=@quiz.name %>

<%= render partial: 'form', locals: { quiz: @quiz, action: admin_update_quiz_path } %> diff --git a/app/views/admin/quiz/index.html.erb b/app/views/admin/quiz/index.html.erb index 6383a43..9c0199b 100644 --- a/app/views/admin/quiz/index.html.erb +++ b/app/views/admin/quiz/index.html.erb @@ -3,5 +3,7 @@ content_for :title, "Quizzes - Skills Assessment Admin" %> +

Quizzes

+ <%= render partial: 'admin/quiz/table_list', locals: { quizzes: @quizzes } %> <%= link_to('New Quiz', admin_new_quiz_path, { class: "" }) %> diff --git a/app/views/admin/quiz/new.html.erb b/app/views/admin/quiz/new.html.erb index 15b084a..3fbcb49 100644 --- a/app/views/admin/quiz/new.html.erb +++ b/app/views/admin/quiz/new.html.erb @@ -3,4 +3,6 @@ content_for :title, "New Quiz - Skills Assessment Admin" %> +

New Quiz

+ <%= render partial: 'form', locals: { quiz: @quiz, action: admin_create_quiz_path } %> diff --git a/app/views/admin/quiz/view.html.erb b/app/views/admin/quiz/view.html.erb index 9eaef16..53e78e0 100644 --- a/app/views/admin/quiz/view.html.erb +++ b/app/views/admin/quiz/view.html.erb @@ -3,7 +3,8 @@ content_for :title, "Quiz - Skills Assessment Admin" %> -
<%= @quiz.name %>
+

<%= @quiz.name %>

+
<%= @quiz.dept %>
<%= @quiz.unit %>
<%= link_to('Edit', admin_edit_quiz_path(@quiz.to_i), { class: "" }) %> diff --git a/app/views/admin/result/index.html.erb b/app/views/admin/result/index.html.erb index 19e46ec..3a12f75 100644 --- a/app/views/admin/result/index.html.erb +++ b/app/views/admin/result/index.html.erb @@ -3,6 +3,8 @@ content_for :title, "Quiz Results - Skills Assessment Admin" %> +

Results

+
diff --git a/app/views/admin/user/edit.html.erb b/app/views/admin/user/edit.html.erb index fe6198c..aee0a91 100644 --- a/app/views/admin/user/edit.html.erb +++ b/app/views/admin/user/edit.html.erb @@ -1,3 +1,8 @@ -<% content_for :section_title, "Edit: #{@user.name}" %> +<% + content_for :section_title, "Edit: #{@user.name}" + content_for :title, "Users - Skills Assessment Admin" +%> + +

Edit <%= @user.name %>

<%= render partial: 'form', locals: {user: @user, action: admin_update_user_path } %> diff --git a/app/views/admin/user/index.html.erb b/app/views/admin/user/index.html.erb index f4ff850..d370447 100644 --- a/app/views/admin/user/index.html.erb +++ b/app/views/admin/user/index.html.erb @@ -1,4 +1,7 @@ -<% content_for :section_title, "Users" %> +<% + content_for :section_title, "Users" + content_for :title, "Users - Skills Assessment Admin" +%>

Users

diff --git a/app/views/admin/user/new.html.erb b/app/views/admin/user/new.html.erb index d0e4c66..11ec238 100644 --- a/app/views/admin/user/new.html.erb +++ b/app/views/admin/user/new.html.erb @@ -1,3 +1,8 @@ -<% content_for :section_title, "New User" %> +<% + content_for :section_title, "Users" + content_for :title, "Users - Skills Assessment Admin" +%> + +

New User

<%= render partial: 'form', locals: {user: @user, action: admin_create_user_path } %> diff --git a/app/views/admin/user/view.html.erb b/app/views/admin/user/view.html.erb index 56b6f42..39485e5 100644 --- a/app/views/admin/user/view.html.erb +++ b/app/views/admin/user/view.html.erb @@ -1,6 +1,9 @@ -<% content_for :section_title, "#{@user.name}" %> +<% + content_for :section_title, "Users" + content_for :title, "Users - Skills Assessment Admin" +%> -
<%= @user.name %>
+

<%= @user.name %>

<%= mail_to(@user.email) %>
<%= @user.role %>
diff --git a/test/controllers/admin/user_controller_test.rb b/test/controllers/admin/user_controller_test.rb index a66deae..6141ff6 100644 --- a/test/controllers/admin/user_controller_test.rb +++ b/test/controllers/admin/user_controller_test.rb @@ -44,7 +44,7 @@ module Admin user = users(:recruiter) get admin_user_url user.to_i assert_response :success - assert_select 'div', user.name + assert_select 'h1', user.name end test "should get edit" do @@ -62,7 +62,7 @@ module Admin assert_redirected_to admin_user_path(user.to_i) get admin_user_url user.to_i - assert_select 'div', 'new name' + assert_select 'h1', 'new name' end test "should fail to update user" do
<%= sortable "test_hash", "Test ID" %>