This repository has been archived by the owner on Dec 10, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from compserv/kevin/admin_bridge
Kevin/admin bridge
- Loading branch information
Showing
16 changed files
with
86 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
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,5 @@ | ||
<h1>Bridge Admin</h1> | ||
|
||
<ul> | ||
<li><%= link_to 'Photo Upload', admin_bridge_officer_index_path %></li> | ||
</ul> |
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,16 @@ | ||
<h1>Officer Photo Upload</h1> | ||
<%= form_tag nil, :multipart => true do %> | ||
<div class="field"> | ||
<%= label :name, "Officer Name" %> | ||
<%= collection_select(:user, :id, @officers, :id, :full_name) %> </br> | ||
</div> | ||
<div class="field"> | ||
<%= label :picture, "Picture" %> | ||
<%= file_field_tag :file_info %> | ||
</div> | ||
<div class="field"> | ||
<%= label :submit, "" %> | ||
<label> </label> | ||
<%= submit_tag "Save changes" %> | ||
</div> | ||
<% 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
<p id="notice"><%= notice %></p> | ||
|
||
<p> | ||
<strong>Grad semester:</strong> | ||
<%= @alum.grad_semester %> | ||
|
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,19 @@ | ||
require 'spec_helper' | ||
|
||
describe Admin::BridgeController do | ||
|
||
describe "GET 'index'" do | ||
it "returns http success" do | ||
get 'index' | ||
response.should be_success | ||
end | ||
end | ||
|
||
describe "GET 'officer_photo_upload'" do | ||
it "returns http success" do | ||
get 'officer_photo_upload' | ||
response.should be_success | ||
end | ||
end | ||
|
||
end |