Skip to content

Commit

Permalink
added case studies view, form view, and method illustration files
Browse files Browse the repository at this point in the history
  • Loading branch information
yipu-z committed Jun 5, 2014
1 parent 9353bed commit 74315ae
Show file tree
Hide file tree
Showing 42 changed files with 524 additions and 82 deletions.
7 changes: 7 additions & 0 deletions app/controllers/collection_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ def casestudies
# ]

@casestudies = CaseStudy.all
# test = @casestudies
# render :json => test
end
def form
id = params["n"] == nil ? 1 : params["n"].to_i
# render :text => id
@cs = CaseStudy.where("id=?", id).first;
# render :json => @cs
end

def send_casestudy
render :json => params
end
end
2 changes: 2 additions & 0 deletions app/helpers/collection_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module CollectionHelper
end
105 changes: 81 additions & 24 deletions app/views/collection/casestudies.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
<%= stylesheet_link_tag "collection", :media => "all" %>
<style>
h3 {margin: 0;}
h4 {margin: 0.33em 0;}
h4 {margin: 0.33em 0; font-size: 13pt;}
p {font-size: 12pt;}
hr {border-top: 3px solid #eee;
width: 100%;
}
.thumbnail{
width: 100px;
height: 100px;
}

.mainPic{
/*width: 100%;*/
max-height: 200px;
/*height: 250px;*/
}

#attributes tr:nth-child(odd) { background-color:#eee; }
#attributes tr:nth-child(even) { background-color:#fff; }

</style>


Expand Down Expand Up @@ -37,12 +55,32 @@ h4 {margin: 0.33em 0;}
</div>
</div>

<hr width="3000" height="100" align="left">
<hr>
<br>

<% @casestudies.each do |cs| %>
<div class="grid_12 omega">
<img src="/FedEx2.png" alt="FedEx2" width="250" height="250">
<div class="grid_5 omega">
<img src="/AMA2.png" alt="AMA2" class='mainPic'>
</div>

<div class="grid_2 omega">
</div>

<div class="grid_5 omega">
<table>
<tr>
<td><img src="/" alt="AMA2" class='thumbnail'></td>
<td><img src="/" alt="AMA2" class='thumbnail'></td>
<td><img src="/" alt="AMA2" class='thumbnail'></td>
</tr>
<tr>
<td><img src="/" alt="AMA2" class='thumbnail'></td>
<td><img src="/" alt="AMA2" class='thumbnail'></td>
<td><img src="/" alt="AMA2" class='thumbnail'></td>
</tr>
</table>
</div>
</div>

<div class="grid_12 omega">
Expand All @@ -54,64 +92,83 @@ h4 {margin: 0.33em 0;}
<div class="grid_12">
<div class="grid_5 omega">
<p><%=cs.description %></p>

<br>
<br>

<h3>Methods</h3>
<br>
<p>Brainstormimg</p>
<p>Focus Group</p>
<p>Storyboarding</p>
<p>Wireframe</p>

<br>
<br>

<h3>Resources</h3>
<br>
<p>AMA_CaseStudy1.pdf</p>
<p>AMA_CaseStudy2.pdf</p>
<p>AMA_CaseStudy3.pdf</p>
</div>

<div class="grid_2 omega">
</div>

<div class="grid_5 omega">
<table style="width:300px">
<table id="attributes">
<tr>
<td>Develepment Cycle</td>
<td><%= @cs.developmentCycle %></td>
<td><%= cs.developmentCycle.humanize %></td>
</tr>

<tr>
<td bgcolor="#E0E0EB"> Design Phase</td>
<td><%=@cs.designPhase%></td>
<td> Design Phase</td>
<td><%=cs.designPhase.humanize%></td>
</tr>
<td>Project Domain</td>
<td><%=@cs.rojectDomain%></td>
<td><%=cs.projectDomain.humanize%></td>
</tr>
<tr>
<td bgcolor="#E0E0EB">Remote Project</td>
<td><%=@cs.remoteProject%></td>
<td>Remote Project</td>
<td><%=cs.remoteProject.humanize%></td>
</tr>
<tr>
<td>Customer is User</td>
<td><%=@cs.customerIsUser%></td>
<td><%=cs.customerIsUser.humanize%></td>
</tr>
<tr>
<td bgcolor="#E0E0EB">Customer Type</td>
<td><%=@customerType%></td>
<td>Customer Type</td>
<td><%=cs.customerType.humanize%></td>
</tr>
<tr>
<td>Age Group of User</td>
<td><%=userAge%></td>
<td><%=cs.userAge.humanize%></td>
</tr>
<tr>
<td bgcolor="#E0E0EB">Privacy Level</td>
<td><%=privacyLevel%></td>
<td>Privacy Level</td>
<td><%=cs.privacyLevel.humanize%></td>
</tr>
<tr>
<td>Social Setting</td>
<td><%=socialSetting%></td>
<td><%=cs.socialSetting.humanize%></td>
</tr>
<tr>
<td bgcolor="#E0E0EB">Company Name</td>
<td><%=companyName%></td>
<td>Company Name</td>
<td><%=cs.companyName.humanize%></td>
</tr>
<tr>
<td>Author Name</td>
<td><%=authorName%></td>
<td><%=cs.authorName%></td>
</tr>
<tr>
<td bgcolor="#E0E0EB">Author Email</td>
<td><%=authorEmail%></td>
<td>Author Email</td>
<td><%=cs.authorEmail.humanize%></td>
</tr>
<tr>
<td>Other Contact Info</td>
<td><%=authorOther%></td>
<td><%=cs.authorOther.humanize%></td>
</tr>


Expand All @@ -124,7 +181,7 @@ h4 {margin: 0.33em 0;}
</div>



<br>
<br>
<hr width="3000" size="50" align="left">

Expand Down
82 changes: 55 additions & 27 deletions app/views/collection/form.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,57 @@
<%= stylesheet_link_tag "collection", :media => "all" %>

<script>
// find the element $("form input");
// FOR ALL THE INPUTS, GET THE VALUES $(input1).val()
// same format .json { title: b}
// MAIN
$(function(){

var data = {
"title": "A Case Study of Non-User-Centered Design for a Police Emergency-Response System Aaron",
"mainImage":"AMA1.png",
"developmentCycle":"Product Refinement",
"designPhase":"Problem Assessment"
}
$('#submit').click(function(){

// TODO
var allInputs = $('input');

for(var i = 0; i < allInputs.length; i++) {
// console.log($(allInputs[i]).attr('data-name'),$(allInputs[i]).val() );

// //title
// // val
var el = allInputs[i]
var name = $(el).attr('data-name');
var val = $(el).val();

if(typeof name !== undefined)
data[name] = val;
}



///
$.ajax({
type: "POST",
url: "/collection/send_casestudy",
data: data,
success: function(data){
console.log(data);
},
dataType: "json"
});

<h1> <%= @cs.title %>

});


})
</script>
<h1> <%= @cs.title %>
<button id='submit'> Submit </button>
<div id="form2" class="slide">
<div class="container">
<div class="row">
Expand All @@ -17,25 +66,18 @@
<div class="row">
<p class="label full-label">Title</p>
<p class="label"></p>
<input value="<%= @cs.title %>">
<input data-name="title" value="<%= @cs.title %>">
<br class="clearfix">
</div>
</div>

<div class="multiple row">
<div class="row">
<p class="label full-label">Subtitle</p>
<p class="label"></p>
<input value="<%= @cs.subTitle %>">
<br class="clearfix">
</div>
</div>


<div class="multiple row">
<div class="row">
<p class="label full-label">Company Name</p>
<p class="label"></p>
<input value="<%= @cs.companyName %>">
<input data-name="companyName" value="<%= @cs.companyName %>">
<br class="clearfix">
</div>
</div>
Expand Down Expand Up @@ -189,22 +231,6 @@
</div>


<div class="multiple row">
<div class="row">
<p class="label">Sub Methods</p>
<input value="<%= @cs.subMethods %>">
<br class="clearfix">
</div>


<div class="multiple row">
<div class="row">
<p class="label">More Details</p>
<input value="<%= @cs.detailMethods %>">
<br class="clearfix">
</div>


<div class="multiple row">
<div class="row">
<p class="label full-label">Contact Info</p>
Expand Down Expand Up @@ -296,3 +322,5 @@
</div>
</div>
</div>


3 changes: 3 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
get "collection/form"


post "collection/send_casestudy"


get :about, to: "main_pages#about"

get :contact, to: "main_pages#contact"
Expand Down
4 changes: 2 additions & 2 deletions db/migrate/20140529195539_create_case_studies.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
class CreateCaseStudies < ActiveRecord::Migration

@@cs_attributes = ["mainImage", "title", "subTitle", "companyName", "developmentCycle", "designPhase", "projectDomain", "customerIsUser", "remoteProject", "customerType", "userAge", "privacyLevel", "socialSetting", "description", "methods", "subMethods", "detailMethods", "authorName", "authorEmail", "authorOther", "permissionToUse", "imageResource", "PDFResource", "url", "timePeriod"]
@@cs_attributes = ["mainImage", "title", "companyName", "developmentCycle", "designPhase", "projectDomain", "customerIsUser", "remoteProject", "customerType", "userAge", "privacyLevel", "socialSetting", "description", "methods", "authorName", "authorEmail", "authorOther", "permissionToUse", "imageResource", "PDFResource", "url", "timePeriod"]
def change
create_table :case_studies do |t|
@@cs_attributes.each do |x|
t.string x.to_sym
t.string x.to_sym, :default => ""
end
t.timestamps
end
Expand Down
47 changes: 22 additions & 25 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,31 +47,28 @@
add_index "admin_users", ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true

create_table "case_studies", force: true do |t|
t.string "mainImage"
t.string "title"
t.string "subTitle"
t.string "companyName"
t.string "developmentCycle"
t.string "designPhase"
t.string "projectDomain"
t.string "customerIsUser"
t.string "remoteProject"
t.string "customerType"
t.string "userAge"
t.string "privacyLevel"
t.string "socialSetting"
t.string "description"
t.string "methods"
t.string "subMethods"
t.string "detailMethods"
t.string "authorName"
t.string "authorEmail"
t.string "authorOther"
t.string "permissionToUse"
t.string "imageResource"
t.string "PDFResource"
t.string "url"
t.string "timePeriod"
t.string "mainImage", default: ""
t.string "title", default: ""
t.string "companyName", default: ""
t.string "developmentCycle", default: ""
t.string "designPhase", default: ""
t.string "projectDomain", default: ""
t.string "customerIsUser", default: ""
t.string "remoteProject", default: ""
t.string "customerType", default: ""
t.string "userAge", default: ""
t.string "privacyLevel", default: ""
t.string "socialSetting", default: ""
t.string "description", default: ""
t.string "methods", default: ""
t.string "authorName", default: ""
t.string "authorEmail", default: ""
t.string "authorOther", default: ""
t.string "permissionToUse", default: ""
t.string "imageResource", default: ""
t.string "PDFResource", default: ""
t.string "url", default: ""
t.string "timePeriod", default: ""
t.datetime "created_at"
t.datetime "updated_at"
end
Expand Down
Binary file added public/CaseStudyImages/AMA2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 74315ae

Please sign in to comment.