-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev/Leo' of https://github.com/tamu-edu-students/csce60…
…6-ELRC-OLEI_Project into dev/Leo
- Loading branch information
Showing
13 changed files
with
119 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#admins_controller.rb | ||
class AdminsController < ApplicationController | ||
def index | ||
@survey_responses = SurveyResponse.get_all_responses(page: params[:page], per_page: 20) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module AdminsHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<main> | ||
<h1 class="visually-hidden">Admin Dashboard</h1> | ||
<% if session[:userinfo].present? %> | ||
<h1>ADMIN DASHBOARD</h1> | ||
<h2>Welcome <%= session[:userinfo]['name'] %></h2> | ||
<hr> | ||
<h3>Survey Responses</h3> | ||
<div class="table-responsive"> | ||
<table class = "table"> | ||
<thead> | ||
<tr> | ||
<th>ID</th> | ||
<th>Profile</th> | ||
<th>Share Code</th> | ||
<th>Created At</th> | ||
</tr> | ||
</thead> | ||
<% if @survey_responses.present? %> | ||
<tbody> | ||
<% @survey_responses.each do |response| %> | ||
<tr> | ||
<td><%= response.id %></td> | ||
<td><%= response.profile.user_id %></td> | ||
<td><%= response.share_code %></td> | ||
<td><%= response.created_at.strftime('%Y-%m-%d %H:%M:%S') %></td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
<% end %> | ||
</table> | ||
</div> | ||
<% else %> | ||
<h1>Welcome.</h1> | ||
<h1>You are not logged in. Please login.</h1> | ||
<% end %> | ||
</main> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
Kaminari.configure do |config| | ||
# config.default_per_page = 25 | ||
# config.max_per_page = nil | ||
# config.window = 4 | ||
# config.outer_window = 0 | ||
# config.left = 0 | ||
# config.right = 0 | ||
# config.page_method_name = :page | ||
# config.param_name = :page | ||
# config.max_pages = nil | ||
# config.params_on_first_page = false | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require 'rails_helper' | ||
|
||
# Specs in this file have access to a helper object that includes | ||
# the AdminsHelper. For example: | ||
# | ||
# describe AdminsHelper do | ||
# describe "string concat" do | ||
# it "concats two strings with spaces" do | ||
# expect(helper.concat_strings("this","that")).to eq("this that") | ||
# end | ||
# end | ||
# end | ||
RSpec.describe AdminsHelper, type: :helper do | ||
pending "add some examples to (or delete) #{__FILE__}" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe "Admins", type: :request do | ||
describe "GET /index" do | ||
it "returns http success" do | ||
get "/admins/index" | ||
expect(response).to have_http_status(:success) | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe "admins/index.html.erb", type: :view do | ||
pending "add some examples to (or delete) #{__FILE__}" | ||
end |