Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added some reports

  • Loading branch information...
commit a1d48bd525b4c9abdb2b579021668dbb34144ef6 1 parent 7a23a5f
@greggroth authored
View
2  app/assets/stylesheets/students.css.less
@@ -10,7 +10,7 @@ fieldset.inputs ol > li {
list-style-type: none;
}
-td.check {
+th.check, td.check {
width: 10%;
}
View
4 app/controllers/professors_controller.rb
@@ -81,4 +81,8 @@ def destroy
format.json { head :no_content }
end
end
+
+ def committees
+ @professors = Professor.includes(:students,:committees).order('last_name')
+ end
end
View
12 app/controllers/students_controller.rb
@@ -85,4 +85,16 @@ def destroy
end
end
+ def incomplete_qualifier
+ @students = Student.incomplete_qual.order('last_name')
+ end
+
+ def incomplete_research
+ @ms_students = Student.incomplete_research(:ms).order('last_name')
+ @phd_students = Student.incomplete_research(:phd).order('last_name')
+ end
+
+ def incomplete_citi
+ @students = Student.current_students.incomplete_citi.order('last_name')
+ end
end
View
14 app/helpers/application_helper.rb
@@ -13,11 +13,11 @@ def committee_type(committee)
end
def formatted_degree(student)
- if @student.degree == "MS" && @student.thesis_ms
+ if student.degree == "Masters" && student.thesis_ms
"Masters student"
- elsif @student.degree == "MS" && !@student.thesis_ms
+ elsif student.degree == "Masters" && !student.thesis_ms
"Non-thesis Masters student"
- elsif @student.degree == "PhD"
+ elsif student.degree == "PhD"
"PhD Student"
end
end
@@ -25,4 +25,12 @@ def formatted_degree(student)
def display_date(date)
date.strftime("%B %d %Y at %l:%M%p")
end
+
+ def ok_or_not_ok(truthy)
+ if truthy
+ "<i class='icon-ok' />"
+ else
+ "<i class='icon-remove' />"
+ end
+ end
end
View
25 app/models/student.rb
@@ -12,6 +12,7 @@ class Student < ActiveRecord::Base
validates_presence_of :first_name, :last_name, :degree
validate :left_early_or_graduated
validates_uniqueness_of :last_name, scope: :first_name
+ validates_format_of :panther_id, with: /\d\d\d\-\d\d\-\d\d\d\d/, allow_nil: true
after_create :check_for_qualifier
@@ -20,7 +21,6 @@ def full_name
end
def committee(options = {})
- # puts options.has_key? :ms
case options
when :ms
professors.where('ms = true')
@@ -41,6 +41,10 @@ def phd_student?
degree == "PhD"
end
+ def ms_student?
+ degree == "Masters"
+ end
+
def self.current_students
self.where('status = ?', "Current student")
end
@@ -49,6 +53,25 @@ def self.past_students
self.where('status != ?', "Current student")
end
+ def self.incomplete_qual
+ self.joins(:qualifier).where('degree = ? AND (qualifiers.em = false OR qualifiers.quantum = false OR qualifiers.stat_mech = false OR qualifiers.class_mech = false)', "PhD")
+ end
+
+ def self.incomplete_research(options={})
+ case options
+ when :ms
+ self.where('degree = ? AND alt_research_1 = ?', 'Masters', '')
+ when :phd
+ self.where('degree = ? AND (alt_research_1 = ? OR alt_research_2 = ?)', 'PhD', '','')
+ else
+ self.incomplete_research(:ms) + self.incomplete_research(:phd)
+ end
+ end
+
+ def self.incomplete_citi
+ self.where('citi_online = false OR citi_discussion = false')
+ end
+
def build_default_qualifier
self.build_qualifier do |t|
t.em = false
View
51 app/views/devise/registrations/edit.html.slim
@@ -1,27 +1,24 @@
-h2
- | Edit #{resource_name.to_s.humanize}
-= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f|
- = devise_error_messages!
- div
- = f.label :email
- br/
- = f.email_field :email
- div
- = f.label :password
- i (leave blank if you don't want to change it)
- br/
- = f.password_field :password, :autocomplete => "off"
- div
- = f.label :password_confirmation
- br/
- = f.password_field :password_confirmation
- div
- = f.label :current_password
- i (we need your current password to confirm your changes)
- br/
- = f.password_field :current_password
- div= f.submit "Update"
-h3 Cancel my account
-p
- | Unhappy? #{link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete}.
-= link_to "Back", :back
+.login-container
+ h2 Change password
+ = form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f|
+ = devise_error_messages!
+ div
+ = f.label :email
+ = f.email_field :email
+ div
+ = f.label :password, "New password"
+ = f.password_field :password, :autocomplete => "off"
+ span.help-inline (leave blank if you don't want to change it)
+ div
+ = f.label :password_confirmation, "Confirm new password"
+ = f.password_field :password_confirmation
+ div
+ = f.label :current_password
+ = f.password_field :current_password
+ span.help-inline (we need your current password to confirm your changes)
+
+ div = f.submit "Update", class: "btn btn-primary"
+ h3 Cancel my account
+ p
+ | Unhappy? #{link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete}.
+ = link_to "Back", :back
View
12 app/views/layouts/application.html.slim
@@ -65,12 +65,18 @@ html lang="en"
.span3
.well.sidebar-nav
- if content_for?(:sidebar)
+ h3 Reports
ul.nav.nav-list
= yield(:sidebar)
- else
- h3 Related Links
- ul.nav.nav-list
- li = link_to "Physics Department Website", "http://www.phy-astr.gsu.edu/"
+ h3 Students Reports
+ ul
+ li = link_to "Unsatisfied qualifing exams", controller: :students, action: :incomplete_qualifier
+ li = link_to "Unsatisfied alternate research skills", controller: :students, action: :incomplete_research
+ li = link_to "Incomplete CITI training", controller: :students, action: :incomplete_citi
+ h3 Professor Reports
+ ul
+ li = link_to "Committees by professor", controller: :professors, action: :committees
footer
p &copy; 2012 Georgia State University Department of Physics and Astronomy
View
2  app/views/meetings/_form.html.slim
@@ -13,7 +13,7 @@
.tab-content
.tab-pane.active#1
= render "attendees", students: Student.current_students
- .tab-page#2
+ .tab-pane#2
= render "attendees", students: Student.past_students
.form-actions
= f.submit "Submit", class: "btn btn-primary"
View
4 app/views/meetings/index.html.slim
@@ -14,5 +14,5 @@ table class="table table-striped"
td = meeting.students.count
td = truncate(meeting.notes, length: 100)
td
- = link_to "Edit", edit_meeting_path(meeting)
- = link_to "Destroy", meeting_path(meeting), :method => :delete, :confirm => "#{t("web-app-theme.confirm", :default => "Are you sure?")}"
+ ' #{link_to "Edit", edit_meeting_path(meeting)}
+ ' #{link_to "Destroy", meeting_path(meeting), :method => :delete, :confirm => "#{t("web-app-theme.confirm", :default => "Are you sure?")}"}
View
21 app/views/professors/committees.slim
@@ -0,0 +1,21 @@
+h1 Professors and who they committee
+table.table
+ thead
+ tbody
+ - @professors.each do |professor|
+ tr
+ td = link_to professor.full_name, professor
+ td
+ - unless professor.committees.empty?
+ table.table.table-bordered
+ thead
+ tr
+ th Name
+ th MS
+ th PhD
+ tbody
+ - professor.committees.includes(:student).order('students.last_name').each do |committee|
+ tr
+ td = link_to committee.student.full_name, committee.student
+ td.check == committee.ms_chair ? "Chair" : ok_or_not_ok(committee.ms)
+ td.check == committee.phd_chair ? "Chair" : ok_or_not_ok(committee.phd)
View
16 app/views/students/_incomplete_research_table.slim
@@ -0,0 +1,16 @@
+table.table
+ thead
+ tr
+ th Name
+ th E-mail
+ th Degree
+ th Alternate Research 1
+ th Alternate Research 2
+ tbody
+ - students.each do |student|
+ tr
+ td = link_to student.full_name, student
+ td = mail_to student.email_1
+ td = student.degree
+ td = student.alt_research_1
+ td = student.ms_student? ? 'n/a' : student.alt_research_2
View
15 app/views/students/incomplete_citi.slim
@@ -0,0 +1,15 @@
+h1 List of Students with incomplete CITI Training
+table.table
+ thead
+ tr
+ th Name
+ th E-mail
+ th.check Online
+ th.check Discussion
+ tbody
+ - @students.each do |student|
+ tr
+ td = link_to student.full_name, student
+ td = mail_to student.email_1
+ td == ok_or_not_ok(student.citi_online)
+ td == ok_or_not_ok(student.citi_discussion)
View
20 app/views/students/incomplete_qualifier.slim
@@ -0,0 +1,20 @@
+h1 List of Students with incomplete Qualifying Exams
+table.table
+ thead
+ tr
+ th Name
+ th E-mail
+ th.check E&M
+ th.check Quantum
+ th.check Statistical
+ th.check Classical
+ tbody
+ - @students.each do |student|
+ tr
+ td = link_to student.full_name, student
+ td = mail_to student.email_1
+ td == ok_or_not_ok(student.qualifier.em)
+ td == ok_or_not_ok(student.qualifier.quantum)
+ td == ok_or_not_ok(student.qualifier.stat_mech)
+ td == ok_or_not_ok(student.qualifier.class_mech)
+
View
13 app/views/students/incomplete_research.slim
@@ -0,0 +1,13 @@
+h1 List of Students with incomplete Alternate Research Skills
+
+.tabbable
+ ul.nav.nav-tabs
+ li.active
+ a href="#1" data-toggle="tab" PhD Students
+ li
+ a href="#2" data-toggle="tab" Masters Students
+ .tab-content
+ .tab-pane.active#1
+ = render "incomplete_research_table", students: @phd_students
+ .tab-pane#2
+ = render "incomplete_research_table", students: @ms_students
View
8 config/routes.rb
@@ -2,12 +2,18 @@
devise_for :professors
root to: "students#index"
+
+ match 'students/incomplete_qualifier' => 'students#incomplete_qualifier'
+ match 'students/incomplete_research' => 'students#incomplete_research'
+ match 'students/incomplete_citi' => 'students#incomplete_citi'
+
+ match 'professors/committees' => 'professors#committees'
resources :professors
resources :students
resources :meetings
-
+
# The priority is based upon order of creation:
# first created -> highest priority.
Please sign in to comment.
Something went wrong with that request. Please try again.