Permalink
Browse files

Major UI Overhaul

Replaced Tokens with Chosen.  Also added student feedback functionality, etc.
  • Loading branch information...
1 parent 0d2f098 commit 0caffceae391fa9ed15c50cf98312a1b41dbdbe9 @kcalmes kcalmes committed Mar 10, 2012
Showing with 174 additions and 905 deletions.
  1. +0 −1 Gemfile
  2. +0 −5 Gemfile.lock
  3. +0 −4 app/controllers/academic_focuses_controller.rb
  4. +0 −4 app/controllers/fields_controller.rb
  5. +0 −4 app/controllers/financial_assistance_options_controller.rb
  6. +0 −4 app/controllers/industries_controller.rb
  7. +0 −4 app/controllers/languages_controller.rb
  8. +0 −4 app/controllers/locations_controller.rb
  9. +0 −3 app/controllers/long_term_goals_controller.rb
  10. +0 −4 app/controllers/providers_controller.rb
  11. +0 −4 app/controllers/semesters_controller.rb
  12. +0 −3 app/controllers/tags_controller.rb
  13. +0 −3 app/controllers/tasks_controller.rb
  14. +0 −3 app/helpers/academic_focuses_helper.rb
  15. +0 −3 app/helpers/application_helper.rb
  16. +0 −3 app/helpers/fields_helper.rb
  17. +0 −3 app/helpers/financial_assistance_options_helper.rb
  18. +0 −3 app/helpers/industries_helper.rb
  19. +0 −3 app/helpers/languages_helper.rb
  20. +0 −3 app/helpers/locations_helper.rb
  21. +0 −3 app/helpers/providers_helper.rb
  22. +0 −3 app/helpers/semesters_helper.rb
  23. +0 −4 app/models/ability.rb
  24. +0 −28 app/models/internship.rb
  25. +57 −39 app/views/internship_instances/_form.html.erb
  26. +1 −1 app/views/internship_instances/edit.html.erb
  27. +2 −2 app/views/internship_instances/index.html.erb
  28. +1 −2 app/views/internship_instances/new.html.erb
  29. +4 −4 app/views/internships/_form.html.erb
  30. +6 −7 app/views/layouts/application.html.erb
  31. +5 −3 app/views/layouts/map.html.erb
  32. +12 −12 app/views/map/index.html.erb
  33. +44 −45 app/views/short_term_goals/_form.html.erb
  34. +6 −4 app/views/tags/_form.html.erb
  35. +0 −14 config/routes.rb
  36. +1 −1 doc/README_FOR_APP
  37. +0 −403 public/javascripts/jquery.autoSuggest.js
  38. +8 −20 public/javascripts/map_script.js
  39. +4 −3 public/javascripts/templates/list_view.ejs
  40. +0 −231 public/stylesheets/autoSuggest.css
  41. +19 −0 public/stylesheets/main.css
  42. +4 −8 public/stylesheets/map_style.css
View
@@ -7,7 +7,6 @@ gem 'rails', '3.0.7'
gem 'sqlite3', :group => :development
gem 'jquery-rails'
-gem 'autosuggest-rb'
gem 'cancan'
gem 'thin', :group => :production
View
@@ -31,9 +31,6 @@ GEM
annotate (2.4.0)
ansi (1.2.5)
arel (2.0.10)
- autosuggest-rb (0.1.5)
- rails (~> 3.0)
- yajl-ruby
builder (2.1.2)
cancan (1.6.5)
daemons (1.1.4)
@@ -82,14 +79,12 @@ GEM
turn (0.8.2)
ansi (>= 1.2.2)
tzinfo (0.3.27)
- yajl-ruby (0.8.2)
PLATFORMS
ruby
DEPENDENCIES
annotate
- autosuggest-rb
cancan
jquery-rails
mysql2 (< 0.3)
@@ -92,8 +92,4 @@ def destroy
format.xml { head :ok }
end
end
-
- def autosuggest
- render :json => view_context.academic_focuses_json(AcademicFocus.where("name like ?", "%#{params[:query]}%").order(:name))
- end
end
@@ -92,8 +92,4 @@ def destroy
format.xml { head :ok }
end
end
-
- def autosuggest
- render :json => view_context.fields_json(Field.where("name like ?", "%#{params[:query]}%").order(:name))
- end
end
@@ -89,8 +89,4 @@ def destroy
format.xml { head :ok }
end
end
-
- def autosuggest
- render :json => view_context.financial_assistance_options_json(FinancialAssistanceOption.where("name like ?", "%#{params[:query]}%").order(:name))
- end
end
@@ -87,8 +87,4 @@ def destroy
format.xml { head :ok }
end
end
-
- def autosuggest
- render :json => view_context.industries_json(Industry.where("name like ?", "%#{params[:query]}%").order(:name))
- end
end
@@ -89,8 +89,4 @@ def destroy
format.xml { head :ok }
end
end
-
- def autosuggest
- render :json => view_context.languages_json(Language.where("name like ?", "%#{params[:query]}%").order(:name))
- end
end
@@ -89,8 +89,4 @@ def destroy
format.xml { head :ok }
end
end
-
- def autosuggest
- render :json => view_context.locations_json(Location.where("city like ?", "%#{params[:query]}%").order(:city))
- end
end
@@ -89,7 +89,4 @@ def destroy
format.xml { head :ok }
end
end
- def autosuggest
- render :json => view_context.model_to_json(LongTermGoal.where("name like ?", "%#{params[:query]}%").order(:name))
- end
end
@@ -90,8 +90,4 @@ def destroy
format.xml { head :ok }
end
end
-
- def autosuggest
- render :json => view_context.providers_json(Provider.where("name like ?", "%#{params[:query]}%").order(:name))
- end
end
@@ -89,8 +89,4 @@ def destroy
format.xml { head :ok }
end
end
-
- def autosuggest
- render :json => view_context.semesters_json(Semester.where("name like ?", "%#{params[:query]}%").order(:name))
- end
end
@@ -89,7 +89,4 @@ def destroy
format.xml { head :ok }
end
end
- def autosuggest
- render :json => view_context.model_to_json(Tag.where("name like ?", "%#{params[:query]}%").order(:name))
- end
end
@@ -89,7 +89,4 @@ def destroy
format.xml { head :ok }
end
end
- def autosuggest
- render :json => view_context.model_to_json(Task.where("name like ?", "%#{params[:query]}%").order(:name))
- end
end
@@ -1,5 +1,2 @@
module AcademicFocusesHelper
- def academic_focuses_json(objects)
- (objects.map!{|obj|{:name => obj.name + ' (' + obj.academic_focus_type.name + ')', :value => obj.id}}).to_json
- end
end
@@ -29,9 +29,6 @@ def theme_box(grid, title, header = true, hidden = false, &block)
raw output
end
- def model_to_json(objects)
- (objects.map!{|obj|{:name => obj.name, :value => obj.id}}).to_json
- end
def system_messages(messages)
html = ''
#types of flashes to use: warning, error, message, notice
@@ -1,5 +1,2 @@
module FieldsHelper
- def fields_json(objects)
- (objects.map!{|obj|{:name => obj.name + ' (' + obj.industry.name + ')', :value => obj.id}}).to_json
- end
end
@@ -1,5 +1,2 @@
module FinancialAssistanceOptionsHelper
- def financial_assistance_options_json(objects)
- (objects.map!{|obj|{:name => obj.name, :value => obj.id}}).to_json
- end
end
@@ -1,5 +1,2 @@
module IndustriesHelper
- def industries_json(objects)
- (objects.map!{|obj|{:name => obj.name, :value => obj.id}}).to_json
- end
end
@@ -1,5 +1,2 @@
module LanguagesHelper
- def languages_json(objects)
- (objects.map!{|obj|{:name => obj.name, :value => obj.id}}).to_json
- end
end
@@ -1,5 +1,2 @@
module LocationsHelper
- def locations_json(objects)
- (objects.map!{|obj|{:name => obj.city + ', ' + obj.country.name, :value => obj.id}}).to_json
- end
end
@@ -1,5 +1,2 @@
module ProvidersHelper
- def providers_json(objects)
- (objects.map!{|obj|{:name => obj.name, :value => obj.id}}).to_json
- end
end
@@ -1,5 +1,2 @@
module SemestersHelper
- def semesters_json(objects)
- (objects.map!{|obj|{:name => obj.name, :value => obj.id}}).to_json
- end
end
@@ -60,8 +60,6 @@ def initialize(user)
can :read, :students
- can :autosuggest, :all
-
elsif user.has_role ['student']
can :index, :pages
can :index, :map
@@ -82,8 +80,6 @@ def initialize(user)
can :make, :advisement_appointment
- can :autosuggest, :all
-
else
cannot :read, :all
end
@@ -18,34 +18,6 @@ class Internship < ActiveRecord::Base
#attr_accessible :name, :field_tokens, :language_tokens
- attr_reader :field_tokens, :language_tokens, :semester_tokens,
- :financial_assistance_option_tokens, :academic_focus_tokens,
- :location_tokens
-
- # TOKEN PROCESSING FOR AUTO-COMPLETE
- def set_fields=(ids)
- self.field_ids = ids.split(",")
- end
-
- def set_semesters=(ids)
- self.semester_ids = ids.split(",")
- end
-
- def set_financial_assistance_options=(ids)
- self.financial_assistance_option_ids = ids.split(",")
- end
-
- def set_academic_focuses=(ids)
- self.academic_focus_ids = ids.split(",")
- end
-
- def set_languages=(ids)
- self.language_ids = ids.split(",")
- end
-
- def set_locations=(ids)
- self.location_ids = ids.split(",")
- end
end
# == Schema Information
@@ -2,51 +2,69 @@
<% if @internship_instance.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@internship_instance.errors.count, "error") %> prohibited this internship_instance from being saved:</h2>
-
<ul>
<% @internship_instance.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
- <div class="field">
- <%= f.label :internship_id %><br />
- <%= f.collection_select :internship_id, Internship.all, :id, :name %>
- </div>
- <div class="field">
- <%= f.label :student_id %><br />
- <%= f.collection_select :student_id, Student.all, :id, :name %>
- </div>
- <div class="field">
- <%= f.label :comments %><br />
- <%= f.text_area :comments %>
- </div>
- <div class="field">
- <%= f.label :rating %><br />
- <%= f.text_field :rating %>
- </div>
- <div class="field">
- <%= f.label :recommended %><br />
- <%= f.check_box :recommended %>
- </div>
- <div class="field">
- <%= f.label :semester_id %><br />
- <%= f.collection_select :semester_id, Semester.all, :id, :name %>
+
+ <div class="actions grid_16">
+ <% content_tag :button, :type => :submit, :class => "green round_all" do %>
+ <%= image_tag "icons/small/white/Bended%20Arrow%20Right.png" %>
+ <span>Save this Student Feedback Entry!</span>
+ <% end %>
</div>
- <div class="field">
- <%= f.label :job_offered %><br />
- <%= f.check_box :job_offered %>
- </div>
- <div class="field">
- <%= f.label :job_accepted %><br />
- <%= f.check_box :job_accepted %>
- </div>
- <div class="field">
- <%= f.label :can_contact %><br />
- <%= f.check_box :can_contact %>
- </div>
- <div class="actions">
- <%= f.submit %>
- </div>
+ <%= theme_box(8, "", false) do %>
+ <div class="field">
+ <%= f.label :internship_id %>
+ <%= f.collection_select :internship_id, Internship.all, :id, :name, {}, {:class => 'chosen'} %>
+ </div>
+ <div class="field">
+ <%= f.label :student_id %>
+ <%= f.collection_select :student_id, Student.all, :id, :name, {}, {:class => 'chosen'} %>
+ </div>
+ <div class="field">
+ <%= f.label :comments %>
+ <%= f.text_area :comments %>
+ </div>
+ <div class="field">
+ <%= f.label :rating %>
+ <%= f.text_field :rating, {:disabled => true} %>
+ <div id="slider" style="width: 50%;"></div>
+
+ </div>
+ <div class="field">
+ <%= f.label :semester_id %>
+ <%= f.collection_select :semester_id, Semester.all, :id, :name %>
+ </div>
+ <div class="input_group">
+ <%= f.check_box :recommended %><b>Recommended</b><br />
+ <%= f.check_box :job_offered %><b>job Offered</b><br />
+ <%= f.check_box :job_accepted %><b>Job Accepted</b><br />
+ <%= f.check_box :can_contact %><b>Can Contact</b>
+ </div>
+ <% end %>
<% end %>
+
+<style>
+ #internship_instance_rating{
+ border: 0px;
+ background-color: transparent;
+ }
+</style>
+<script>
+ $(function() {
+ $( "#slider" ).slider({
+ value:1,
+ min: 1,
+ max: 5,
+ step: 1,
+ slide: function( event, ui ) {
+ $( "#internship_instance_rating" ).val( ui.value );
+ }
+ });
+ $( "#internship_instance_rating" ).val( $( "#slider" ).slider( "value" ) );
+ });
+ </script>
@@ -1,4 +1,4 @@
-<h1>Editing internship_instance</h1>
+<h1>Editing Student Feedback Entry</h1>
<%= render 'form' %>
@@ -1,4 +1,4 @@
-<h2>Internship Instances</h2>
+<h2>Student Feedback Entries</h2>
<div class="box round_all">
<table class="display datatable index_tables">
<thead>
@@ -58,7 +58,7 @@
<%= link_to new_internship_instance_path do %>
<button class="skin_colour round_all">
<img src="<%= icon_path %>/Document.png" alt="New Internship Instance" />
- <span>New Internship Instance</span>
+ <span>New Student Feedback Entry</span>
</button>
<% end %>
</div>
@@ -1,5 +1,4 @@
-<h1>New internship_instance</h1>
+<h1>New Student Feedback Entry</h1>
<%= render 'form' %>
-<%= link_to 'Back', internship_instances_path %>
Oops, something went wrong. Retry.

0 comments on commit 0caffce

Please sign in to comment.