diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 8e0d3f2..9666b83 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -14,5 +14,4 @@ //= require jquery_ujs //= require turbolinks //= require_tree . -//= require twitter/bootstrap //= require jquery.ui.all diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index d2f2ec3..ee44657 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -8,7 +8,6 @@ * You're free to add application-wide styles to this file and they'll appear at the top of the * compiled file, but it's generally better to create a new file per style scope. * - *= require twitter/bootstrap *= require_tree . *= require jquery.ui.all */ \ No newline at end of file diff --git a/app/assets/stylesheets/main.css.scss b/app/assets/stylesheets/main.css.scss index 766563b..c46de11 100644 --- a/app/assets/stylesheets/main.css.scss +++ b/app/assets/stylesheets/main.css.scss @@ -276,7 +276,7 @@ html[xmlns] .clearfix { body { background: image-url('back_gray.png'); font-family: "Puritan", "Lucinda Grande", Helvetica, Arial, serif; - font-size: 1.5em; + font-size: 0.9em; line-height: 1.3em; color: #403f3f; } @@ -590,6 +590,16 @@ h4 { color: #FFFFFF; } +.alert { + padding: 15px; + margin-bottom: 20px; + border: 1px solid transparent; + border-radius: 4px; + background-color: #f2dede; + border-color: #eed3d7; + color: #b94a48; +} + /*** Specific Page Styling ***/ #sidebar { float:right; diff --git a/app/controllers/admin/bridge_controller.rb b/app/controllers/admin/bridge_controller.rb new file mode 100644 index 0000000..a172981 --- /dev/null +++ b/app/controllers/admin/bridge_controller.rb @@ -0,0 +1,19 @@ +class Admin::BridgeController < ApplicationController + def index + end + + def officer_photo_index + @officers = MemberSemester.current.officers + end + + def officer_photo_upload + officer = User.find_by_id(params[:user][:id]) + officer.picture = params[:file_info] + if officer.save + flash[:notice] = "Successfully uploaded photo for #{officer.full_name}" + else + flash[:alert] = "Failed to upload photo for #{officer.full_name}" + end + redirect_to admin_bridge_officer_index_path + end +end diff --git a/app/controllers/candidate_controller.rb b/app/controllers/candidate_controller.rb index 3338d60..efafa60 100644 --- a/app/controllers/candidate_controller.rb +++ b/app/controllers/candidate_controller.rb @@ -42,6 +42,6 @@ def submit_quiz end def autocomplete_officer_name - render :json => Role.members.includes(:users).all_users.map {|p| {:label => p.full_name, :id => p.id} } + render :json => Role.members.all_users.map {|p| {:label => p.full_name, :id => p.id} } end end diff --git a/app/models/member_semester.rb b/app/models/member_semester.rb index 643af22..1b04698 100644 --- a/app/models/member_semester.rb +++ b/app/models/member_semester.rb @@ -24,19 +24,19 @@ def name end def candidates - Role.semester_filter(self).candidates.includes(:users).all_users + Role.semester_filter(self).candidates.all_users end def officers - Role.semester_filter(self).officers.includes(:users).all_users + Role.semester_filter(self).officers.all_users end def committee_members - Role.semester_filter(self).committee_members.includes(:users).all_users + Role.semester_filter(self).committee_members.all_users end def members - Role.members.includes(:users).all_users + Role.members.all_users end end diff --git a/app/models/role.rb b/app/models/role.rb index 41681d8..1fb82dc 100644 --- a/app/models/role.rb +++ b/app/models/role.rb @@ -36,7 +36,7 @@ def position_for_semester(position, semester) #returns array of users def all_users - all.collect { |role| role.users }.flatten + all.includes(:users).collect { |role| role.users }.flatten end def current_officers_from_committee(committee) diff --git a/app/models/user.rb b/app/models/user.rb index 07c017a..538bad4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -50,6 +50,7 @@ class User < ActiveRecord::Base has_and_belongs_to_many :member_semesters has_attached_file :picture, :default_url => "/pictures/:normalized_file_name.png", #guess saved as png to work w/ old system, if this gets updated (should only have to do it for current officers) can swap this to assets/person_placeholder.png + :styles => {original: "125x100#"}, :path => ":rails_root/public/pictures/:normalized_file_name.:extension", :url => "/pictures/:normalized_file_name.:extension" diff --git a/app/views/admin/bridge/index.html.erb b/app/views/admin/bridge/index.html.erb new file mode 100644 index 0000000..c4da4d0 --- /dev/null +++ b/app/views/admin/bridge/index.html.erb @@ -0,0 +1,5 @@ +
<%= notice %>
-Grad semester: <%= @alum.grad_semester %> diff --git a/app/views/layouts/_officer_submenu.html.erb b/app/views/layouts/_officer_submenu.html.erb index 177f5d6..f3f6d06 100644 --- a/app/views/layouts/_officer_submenu.html.erb +++ b/app/views/layouts/_officer_submenu.html.erb @@ -121,7 +121,7 @@