Skip to content

Commit

Permalink
Merge pull request #58 from YaleSTC/walk_in_center
Browse files Browse the repository at this point in the history
Walk in center
  • Loading branch information
caseywatts committed Oct 21, 2014
2 parents f28e29e + 4e003ac commit beb62cf
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 21 deletions.
24 changes: 12 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ GEM
debug_inspector (0.0.2)
diff-lcs (1.2.5)
erubis (2.7.0)
execjs (2.2.1)
factory_girl (4.4.0)
execjs (2.2.2)
factory_girl (4.5.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.4.1)
factory_girl (~> 4.4.0)
factory_girl_rails (4.5.0)
factory_girl (~> 4.5.0)
railties (>= 3.0.0)
faraday (0.9.0)
multipart-post (>= 1.2, < 3)
Expand Down Expand Up @@ -115,7 +115,7 @@ GEM
json (~> 1.8)
multi_xml (>= 0.5.2)
i18n (0.6.11)
jbuilder (2.2.2)
jbuilder (2.2.3)
activesupport (>= 3.0.0, < 5)
multi_json (~> 1.2)
jquery-rails (3.1.2)
Expand All @@ -132,18 +132,18 @@ GEM
mail (2.6.1)
mime-types (>= 1.16, < 3)
method_source (0.8.2)
mime-types (2.4.1)
mime-types (2.4.3)
mini_portile (0.6.0)
minitest (5.4.2)
multi_json (1.10.1)
multi_xml (0.5.5)
multipart-post (2.0.0)
mysql2 (0.3.16)
net-ldap (0.8.0)
netrc (0.7.7)
netrc (0.8.0)
nokogiri (1.6.3.1)
mini_portile (= 0.6.0)
octokit (3.4.0)
octokit (3.4.2)
sawyer (~> 0.5.3)
parser (2.2.0.pre.5)
ast (>= 1.1, < 3.0)
Expand Down Expand Up @@ -260,8 +260,8 @@ GEM
simple_form (3.0.2)
actionpack (~> 4.0)
activemodel (~> 4.0)
slim (2.0.3)
temple (~> 0.6.6)
slim (2.1.0)
temple (~> 0.6.9)
tilt (>= 1.3.3, < 2.1)
slop (3.6.0)
spring (1.1.3)
Expand All @@ -275,7 +275,7 @@ GEM
activesupport (>= 3.0)
sprockets (>= 2.8, < 4.0)
sqlite3 (1.3.9)
temple (0.6.8)
temple (0.6.9)
terminal-table (1.4.5)
thor (0.19.1)
thread_safe (0.3.4)
Expand All @@ -291,7 +291,7 @@ GEM
json (>= 1.8.0)
xpath (2.0.0)
nokogiri (~> 1.3)
yaleldap (1.0.6)
yaleldap (1.0.8)
net-ldap

PLATFORMS
Expand Down
6 changes: 5 additions & 1 deletion app/controllers/distribution_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ def personlookup
@name = attributes[:first_name] + " " + attributes[:last_name]
@email = attributes[:email]
@affiliation = attributes[:school] + " " + attributes[:college_abbreviation] + " " + attributes[:class_year]
@affiliation = "Unknown Affiliation" if @affiliation.blank?
# @affiliation = "Unknown Affiliation" if @affiliation.blank?
@curriculum = attributes[:major]
# @curriculum = "No Curriculum/Major" if @curriculum.blank?
@organization = attributes[:organization]
# @organization = "No Organization" if @organization.blank?
@sn_destination_url = "https://yale.service-now.com/incident.do?sys_id=-1&sysparm_query=caller_id=" + sys_id + "^u_contact=" + sys_id
@phonebook_destination_url = "http://directory.yale.edu/phonebook/index.htm?searchString=upi%3D" + upi
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/events_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def lookup
end

def wipe_attendance
# @event = Event.find(params[:event_id])
@event = Event.find(params[:event_id])
@event.attendance_entries.destroy_all
flash[:notice] = "All attendance entries for this event have been wiped."
redirect_to event_attendance_entries_path(@event)
Expand Down
2 changes: 1 addition & 1 deletion app/models/attendance_entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class AttendanceEntry < ActiveRecord::Base
def get_ldap_attributes
attributes = YaleLDAP.lookup(upi: upi.to_s)
.slice(:first_name, :nickname, :last_name, :upi, :netid,
:email, :college_name, :college_abbreviation,
:email, :organization, :curriculum, :college_name, :college_abbreviation,
:class_year, :school, :telephone, :address)
self.update_attributes(attributes)
end
Expand Down
2 changes: 2 additions & 0 deletions app/views/attendance_entries/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<%= f.input :email %>
</div>
<div class="col-md-6">
<%= f.input :organization %>
<%= f.input :curriculum %>
<%= f.input :school %>
<%= f.input :college_name %>
<%= f.input :college_abbreviation %>
Expand Down
10 changes: 10 additions & 0 deletions app/views/attendance_entries/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@
<%= @attendance_entry.email %>
</p>

<p>
<strong>Organization:</strong>
<%= @attendance_entry.organization %>
</p>

<p>
<strong>Curriculum:</strong>
<%= @attendance_entry.curriculum %>
</p>

<p>
<strong>School:</strong>
<%= @attendance_entry.school %>
Expand Down
6 changes: 3 additions & 3 deletions app/views/distribution/home.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
</div>

<div class="col-md-5 col-md-offset-1">
<h3>Person Lookup
<h3>Walk In Center
<%= link_to distribution_personlookup_path, class: "btn btn-lg btn-default pull-right" do %>
<span class="glyphicon glyphicon-search"></span> Person Lookup
<span class="glyphicon glyphicon-search"></span> Walk In Center
<% end %>
</h3>
<p>CardSwipr can quickly tell you about a person after they swipe their card. It can both take you to a person's Yale Phonebook entry and open a Service Now Incident with their name already filled out. This feature is used in some Walk-In Computing Support centers around campus.</p>
<p>CardSwipr can quickly tell you about a person after they swipe their card. It can both take you to a person's Yale Phonebook entry and open a Service Now Incident with their name already filled out. This feature does not keep a list of everyone who was swiped, this is just for quick lookups. This is used in some Walk-In Centers around campus.</p>
<%= image_tag "GeneralLookupScreenshot.png", class: "img-responsive img-thumbnail" %>
</div>

Expand Down
4 changes: 3 additions & 1 deletion app/views/distribution/personlookup.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="col-md-12">
<h1>Person Lookup</h1>
<h1>Walk In Center</h1>
</div>

<div class="col-md-6">
Expand Down Expand Up @@ -43,6 +43,8 @@
<div class="panel-body">
<h4><%= @name %></h4>
<h5>Affiliation: <%= @affiliation %></h5>
<h5>Curriculum: <%= @curriculum %></h5>
<h5>Organization: <%= @organization %></h5>
<br>
<div class="btn-group">
<div class="btn-group">
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/_navigation.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<% if can? :read, :personlookup %>
<li>
<%= link_to distribution_personlookup_path do %>
<span class="glyphicon glyphicon-search"></span> Person Lookup
<span class="glyphicon glyphicon-search"></span> Walk In Center
<% end %>
</li>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class AddCurriculumOrganizationToAttendanceEntries < ActiveRecord::Migration
def change
add_column :attendance_entries, :organization, :string
add_column :attendance_entries, :curriculum, :string
end
end
16 changes: 15 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20141012204208) do
ActiveRecord::Schema.define(version: 20141021165539) do

create_table "attendance_entries", force: true do |t|
t.string "first_name"
Expand All @@ -30,6 +30,8 @@
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "checked_in", default: false
t.string "organization"
t.string "curriculum"
end

create_table "events", force: true do |t|
Expand All @@ -44,6 +46,18 @@
t.integer "user_id", null: false
end

create_table "sessions", force: true do |t|
t.string "session_id", null: false
t.string "cas_ticket"
t.text "data"
t.datetime "created_at"
t.datetime "updated_at"
end

add_index "sessions", ["cas_ticket"], name: "index_sessions_on_cas_ticket"
add_index "sessions", ["session_id"], name: "index_sessions_on_session_id"
add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at"

create_table "users", force: true do |t|
t.string "first_name"
t.string "last_name"
Expand Down

0 comments on commit beb62cf

Please sign in to comment.