Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: martianinteractive/LearnHVAC_web
...
head fork: martianinteractive/LearnHVAC_web
  • 3 commits
  • 42 files changed
  • 0 commit comments
  • 1 contributor
Showing with 43 additions and 526 deletions.
  1. +1 −7 app/controllers/admins/access_controller.rb
  2. +0 −2  app/controllers/admins/application_controller.rb
  3. +0 −6 app/controllers/admins/groups_controller.rb
  4. +0 −6 app/controllers/admins/institutions_controller.rb
  5. +0 −6 app/controllers/admins/master_scenarios_controller.rb
  6. +0 −5 app/controllers/admins/scenarios_controller.rb
  7. +1 −3 app/controllers/admins/settings/base_controller.rb
  8. +10 −14 app/controllers/admins/settings/client_versions_controller.rb
  9. +0 −4 app/controllers/admins/settings/educational_entities_controller.rb
  10. +0 −1  app/controllers/admins/settings_controller.rb
  11. +1 −8 app/controllers/admins/system_variables_controller.rb
  12. +0 −10 app/controllers/admins/users_controller.rb
  13. +1 −9 app/controllers/admins/variables_controller.rb
  14. +6 −7 app/controllers/admins/version_notes_controller.rb
  15. +1 −7 app/controllers/instructors/access_controller.rb
  16. +6 −8 app/controllers/instructors/alerts_controller.rb
  17. +1 −3 app/controllers/instructors/application_controller.rb
  18. +0 −3  app/controllers/instructors/client_versions_controller.rb
  19. +0 −38 app/controllers/instructors/emails_controller.rb
  20. +0 −7 app/controllers/instructors/groups_controller.rb
  21. +0 −7 app/controllers/instructors/scenarios_controller.rb
  22. +1 −12 app/controllers/instructors/variables_controller.rb
  23. +1 −7 app/controllers/managers/access_controller.rb
  24. +1 −2  app/controllers/managers/application_controller.rb
  25. +0 −5 app/controllers/managers/groups_controller.rb
  26. +0 −2  app/controllers/managers/scenarios_controller.rb
  27. +1 −7 app/controllers/managers/variables_controller.rb
  28. +0 −3  app/controllers/students/groups_controller.rb
  29. +4 −4 app/controllers/user_sessions_controller.rb
  30. +0 −7 app/controllers/users_controller.rb
  31. +0 −1  app/views/layouts/admins.html.haml
  32. +2 −3 app/views/layouts/instructors.html.haml
  33. +2 −3 app/views/layouts/managers.html.haml
  34. +3 −4 app/views/layouts/students.html.haml
  35. +0 −1  config/routes.rb
  36. +0 −20 vendor/plugins/crummy/MIT-LICENSE
  37. +0 −115 vendor/plugins/crummy/README.textile
  38. +0 −43 vendor/plugins/crummy/Rakefile
  39. +0 −1  vendor/plugins/crummy/VERSION
  40. +0 −2  vendor/plugins/crummy/init.rb
  41. +0 −119 vendor/plugins/crummy/lib/crummy.rb
  42. +0 −4 vendor/plugins/crummy/lib/tasks/crummy_tasks.rake
View
8 app/controllers/admins/access_controller.rb
@@ -2,7 +2,7 @@ class Admins::AccessController < Admins::ApplicationController
layout 'bootstrap'
- before_filter :find_scenario, :add_crumbs
+ before_filter :find_scenario
cache_sweeper :membership_sweeper, :only => [:create, :destroy]
@@ -40,10 +40,4 @@ def find_scenario
@scenario = Scenario.find(params[:scenario_id])
end
- def add_crumbs
- add_crumb "Scenarios", [:admins, :scenarios]
- add_crumb @scenario.name, [:admins, @scenario]
- add_crumb "Manage Access", [:admins, @scenario, :accesses]
- end
-
end
View
2  app/controllers/admins/application_controller.rb
@@ -4,8 +4,6 @@ class Admins::ApplicationController < ApplicationController
before_filter :require_admin
- add_crumb "Dashboard", '/admins/dashboard'
-
def load_variables_filters
@filters = {}
[:disabled, :is_fault, :fault_is_active].each do |filter|
View
6 app/controllers/admins/groups_controller.rb
@@ -6,8 +6,6 @@ class Admins::GroupsController < Admins::ApplicationController
cache_sweeper :group_sweeper, :only => [:create, :update, :destroy]
- add_crumb("Classes") { |instance| instance.send :admins_classes_path }
-
def index
@groups = Group.all :include => {:members => :institution}
end
@@ -19,13 +17,11 @@ def show
def new
@group = Group.new
@created_scenarios = @instructor.created_scenarios
- add_crumb "New Group", new_admins_class_path
end
def edit
@group = Group.find(params[:id])
@created_scenarios = @group.creator.created_scenarios
- add_crumb "Editing #{@group.name}", edit_admins_class_path(@group)
end
def create
@@ -34,7 +30,6 @@ def create
if @group.save
redirect_to(admins_class_path(@group), :notice => 'Group was successfully created.')
else
- add_crumb "New Group", new_admins_class_path
render :action => "new"
end
end
@@ -45,7 +40,6 @@ def update
if @group.update_attributes(params[:group])
redirect_to(admins_class_path(@group), :notice => 'Group was successfully updated.')
else
- add_crumb "Editing #{@group.name}", edit_admins_class_path(@group)
render :action => "edit"
end
end
View
6 app/controllers/admins/institutions_controller.rb
@@ -2,7 +2,6 @@ class Admins::InstitutionsController < Admins::ApplicationController
layout 'bootstrap'
- add_crumb("Institutions") { |instance| instance.send :admins_institutions_path }
cache_sweeper :institution_sweeper, :only => [:create, :update, :destroy]
@@ -13,17 +12,14 @@ def index
def show
@institution = Institution.find(params[:id])
@users = @institution.users.paginate :page => params[:page], :per_page => 25
- add_crumb @institution.name, admins_institution_path(@institution)
end
def new
@institution = Institution.new
- add_crumb "New Institution", new_admins_institution_path
end
def edit
@institution = Institution.find(params[:id])
- add_crumb "Editing #{@institution.name}", edit_admins_institution_path(@institution)
end
def create
@@ -31,7 +27,6 @@ def create
if @institution.save
redirect_to(admins_institution_path(@institution), :notice => 'Institution was successfully created.')
else
- add_crumb "New Institution", new_admins_institution_path
render :action => "new"
end
end
@@ -41,7 +36,6 @@ def update
if @institution.update_attributes(params[:institution])
redirect_to(admins_institution_path(@institution), :notice => 'Institution was successfully updated.')
else
- add_crumb "Editing #{@institution.name}", edit_admins_institution_path(@institution)
render :action => "edit"
end
end
View
6 app/controllers/admins/master_scenarios_controller.rb
@@ -18,7 +18,6 @@ class Admins::MasterScenariosController < Admins::ApplicationController
subject_buttons :cancel_master_scenario, :only => [ :new, :edit, :create, :update ]
inner_tabs :master_scenario_details, :only => [ :show, :edit ]
- add_crumb("Master Scenarios") { |instance| instance.send :admins_master_scenarios_path }
def index
@master_scenarios = MasterScenario.all(:include => [:user, :client_version])
@@ -29,16 +28,13 @@ def tag
end
def show
- add_crumb @master_scenario.name, admins_master_scenario_path(@master_scenario)
end
def new
@master_scenario = MasterScenario.new
- add_crumb "New Scenario", new_admins_master_scenario_path
end
def edit
- add_crumb "Editing #{@master_scenario.name}", edit_admins_master_scenario_path(@master_scenario)
end
def clone
@@ -54,7 +50,6 @@ def create
if @master_scenario.save
redirect_to([:admins, @master_scenario], :notice => "Scenario was succesfully created.")
else
- add_crumb "New Scenario", new_admins_master_scenario_path
render :action => "new"
end
end
@@ -63,7 +58,6 @@ def update
if @master_scenario.update_attributes(params[:master_scenario])
redirect_to([:admins, @master_scenario], :notice => "Scenario was succesfully updated.")
else
- add_crumb "Editing #{@master_scenario.name}", edit_admins_master_scenario_path(@master_scenario)
render :action => "edit"
end
end
View
5 app/controllers/admins/scenarios_controller.rb
@@ -9,7 +9,6 @@ class Admins::ScenariosController < Admins::ApplicationController
inner_tabs :scenario_details
- add_crumb("Instructor Scenarios") { |instance| instance.send :admins_scenarios_path }
def index
@scenarios = Scenario.all(:include => [:users, :master_scenario])
@@ -22,7 +21,6 @@ def list
end
def show
- add_crumb @scenario.name, admins_scenario_path(@scenario)
end
def new
@@ -30,11 +28,9 @@ def new
:longterm_stop_date => Time.now+7.days,
:realtime_start_datetime => Time.now
)
- add_crumb "New Scenario", new_admins_scenario_path
end
def edit
- add_crumb "Editing #{@scenario.name}", edit_admins_scenario_path(@scenario)
end
def create
@@ -51,7 +47,6 @@ def update
if @scenario.update_attributes(params[:scenario])
redirect_to(admins_scenario_path(@scenario), :notice => 'Scenarios was succesfully udpated.')
else
- add_crumb "Editing #{@scenario.name}", edit_admins_scenario_path(@scenario)
render :action => "edit"
end
end
View
4 app/controllers/admins/settings/base_controller.rb
@@ -1,4 +1,2 @@
class Admins::Settings::BaseController < Admins::ApplicationController
- add_crumb("Settings") { |instance| instance.send :admins_settings_path }
-
-end
+end
View
24 app/controllers/admins/settings/client_versions_controller.rb
@@ -1,50 +1,46 @@
class Admins::Settings::ClientVersionsController < Admins::Settings::BaseController
- add_crumb("Desktop Application Versions") { |instance| instance.send :admins_settings_client_versions_path }
-
+
def index
@client_versions = ClientVersion.paginate :page => params[:page], :per_page => 10, :order => "release_date DESC"
end
def show
@client_version = ClientVersion.find(params[:id])
- add_crumb "Version #{@client_version.version}", admins_settings_client_version_path(@client_version)
end
-
+
def new
@client_version = ClientVersion.new
- add_crumb "New Version", new_admins_settings_client_version_path
end
-
+
def edit
@client_version = ClientVersion.find(params[:id])
- add_crumb "Edit Version #{@client_version.version}", edit_admins_settings_client_version_path(@client_version)
end
-
+
def create
@client_version = ClientVersion.new(params[:client_version])
-
+
if @client_version.save
redirect_to(admins_settings_client_version_path(@client_version), :notice => 'Version was successfully created.')
else
render :action => "new"
end
end
-
+
def update
@client_version = ClientVersion.find(params[:id])
-
+
if @client_version.update_attributes(params[:client_version])
redirect_to(admins_settings_client_version_path(@client_version), :notice => 'Version was successfully updated.')
else
render :action => "edit"
end
end
-
+
def destroy
@client_version = ClientVersion.find(params[:id])
@client_version.destroy
-
+
redirect_to(admins_settings_client_versions_path)
end
-
+
end
View
4 app/controllers/admins/settings/educational_entities_controller.rb
@@ -1,5 +1,4 @@
class Admins::Settings::EducationalEntitiesController < Admins::Settings::BaseController
- add_crumb("Educational Entities") { |instance| instance.send :admins_settings_educational_entities_path }
def index
@colleges = College.paginate :page => params[:page], :per_page => 50, :order => "value ASC"
@@ -12,17 +11,14 @@ def search
def new
@college = College.new
- add_crumb "New Entity", new_admins_settings_educational_entity_path
end
def show
@college = College.find(params[:id])
- add_crumb @college.value, admins_settings_educational_entity_path(@college)
end
def edit
@college = College.find(params[:id])
- add_crumb "Editing #{@college.value}", edit_admins_settings_educational_entity_path(@college)
end
def create
View
1  app/controllers/admins/settings_controller.rb
@@ -3,7 +3,6 @@ class Admins::SettingsController < Admins::ApplicationController
layout 'bootstrap'
def index
- add_crumb "Settings", "settings"
end
end
View
9 app/controllers/admins/system_variables_controller.rb
@@ -5,7 +5,7 @@ class Admins::SystemVariablesController < Admins::ApplicationController
helper :sort
include SortHelper
- before_filter :find_master_scenario, :add_crumbs
+ before_filter :find_master_scenario
before_filter :find_system_variable, :only => [:show, :edit, :update]
before_filter :initialize_variables_sort, :load_variables_filters, :only => [:index]
@@ -40,7 +40,6 @@ def new
end
def edit
- add_crumb "Editing #{@system_variable.name}", edit_admins_master_scenario_system_variable_path(@master_scenario, @system_variable)
end
def create
@@ -89,12 +88,6 @@ def yaml_dump
private
- def add_crumbs
- add_crumb "Master Scenarios", admins_master_scenarios_path
- add_crumb @master_scenario.name, admins_master_scenario_path(@master_scenario)
- add_crumb "System Variables", admins_master_scenario_system_variables_path(@master_scenario)
- end
-
def find_master_scenario
@master_scenario = MasterScenario.find(params[:master_scenario_id])
end
View
10 app/controllers/admins/users_controller.rb
@@ -3,7 +3,6 @@ class Admins::UsersController < Admins::ApplicationController
layout 'bootstrap'
before_filter :get_role, :except => [:list_groups]
- before_filter :add_crumbs, :except => [:list_groups]
before_filter :get_list_instructors
cache_sweeper :user_sweeper, :only => [:create, :update, :destroy]
@@ -28,21 +27,18 @@ def filter
def show
@user = User.find(params[:id])
- add_crumb @user.name, admins_user_path(@user)
end
def new
@user = User.new
@user.role_code = @role
@groups = Group.all
- add_crumb "New #{params[:role].humanize}", new_admins_user_path(:role => params[:role])
end
def edit
@user = User.find(params[:id])
@instructors = User.instructor.to_a
@groups = Group.all
- add_crumb "Editing #{@user.name}", edit_admins_user_path(:role => params[:role])
end
def create
@@ -55,7 +51,6 @@ def create
Group.find_by_code(@user.group_code).create_memberships(@user) if @user.has_role?(:student)
redirect_to(admins_user_path(@user, :role => params[:role], :group=>@groups, :anchor => "ui-tabs-1"), :notice => 'User was successfully created.')
else
- add_crumb "New #{params[:role].humanize}", new_admins_user_path(:role => params[:role])
render :action => "new"
end
end
@@ -68,7 +63,6 @@ def update
if @user.update_attributes(params[:user])
redirect_to(admins_user_path(@user, :role => params[:role]), :notice => 'User was successfully updated.')
else
- add_crumb "Editing #{@user.name}", edit_admins_user_path(:role => params[:role])
render :action => "edit"
end
end
@@ -102,8 +96,4 @@ def get_role
@role = User::ROLES[params[:role].to_sym]
end
- def add_crumbs
- add_crumb params[:role].pluralize.humanize, admins_users_path(:role => params[:role])
- end
-
end
View
10 app/controllers/admins/variables_controller.rb
@@ -3,7 +3,7 @@ class Admins::VariablesController < Admins::ApplicationController
helper :sort
include SortHelper
- before_filter :find_scenario, :add_crumbs
+ before_filter :find_scenario
before_filter :find_scenario_variable, :only => [:show, :edit, :update]
before_filter :initialize_variables_sort, :load_variables_filters, :only => [:index]
@@ -38,7 +38,6 @@ def show
end
def edit
- add_crumb "Edit", edit_admins_scenario_variable_path(@scenario, @scenario_variable)
end
def create
@@ -76,19 +75,12 @@ def drop
private
- def add_crumbs
- add_crumb "Instructor Scenarios", admins_scenarios_path
- add_crumb @scenario.name, admins_scenario_path(@scenario)
- add_crumb "Variables", admins_scenario_variables_path(@scenario)
- end
-
def find_scenario
@scenario = Scenario.find(params[:scenario_id])
end
def find_scenario_variable
@scenario_variable = @scenario.variables.find(params[:id])
- add_crumb @scenario_variable.name, admins_scenario_variable_path(@scenario, @scenario_variable)
end
def can_cache_variables?
View
13 app/controllers/admins/version_notes_controller.rb
@@ -1,15 +1,14 @@
class Admins::VersionNotesController < Admins::ApplicationController
before_filter :find_master_scenario
-
+
def new
- add_crumb @master_scenario.name, admins_master_scenario_path(@master_scenario)
@version_note = VersionNote.new
end
-
+
def create
@version_note = VersionNote.new(params[:version_note])
@version_note.master_scenario = @master_scenario
-
+
if @version_note.save
flash[:notice] = "Notes were successfully created."
redirect_back_or_default(admins_master_scenario_path(@master_scenario))
@@ -17,11 +16,11 @@ def create
render :action => "new"
end
end
-
+
private
-
+
def find_master_scenario
@master_scenario = MasterScenario.find(params[:master_scenario_id])
end
-
+
end
View
8 app/controllers/instructors/access_controller.rb
@@ -2,7 +2,7 @@ class Instructors::AccessController < Instructors::ApplicationController
layout 'bootstrap'
- before_filter :find_scenario, :add_crumbs
+ before_filter :find_scenario
inner_tabs :manage_access
subject_buttons :scenario, :only => :show
@@ -24,10 +24,4 @@ def find_scenario
@scenario = current_user.created_scenarios.find(params[:scenario_id])
end
- def add_crumbs
- add_crumb "Scenarios", instructors_scenarios_path
- add_crumb @scenario.name, instructors_scenario_path(@scenario)
- add_crumb "Manage Access", [:instructors, @scenario, :accesses]
- end
-
end
View
14 app/controllers/instructors/alerts_controller.rb
@@ -1,22 +1,20 @@
-class Instructors::AlertsController < Instructors::ApplicationController
+class Instructors::AlertsController < Instructors::ApplicationController
before_filter :find_scenario
-
+
def index
- add_crumb("Notifications")
@alerts = @scenario.scenario_alerts.unread.paginate :page => params[:page], :per_page => 25
end
-
+
def update
@alert = @scenario.scenario_alerts.unread.criteria.id(params[:id]).first
@alert.update_attributes(:read => true)
redirect_to :back
end
-
+
private
-
+
def find_scenario
@scenario = current_user.created_scenarios.with_unread_alerts.criteria.id(params[:scenario_id]).first
- add_crumb(@scenario.name, instructors_scenario_path(@scenario))
end
-
+
end
View
4 app/controllers/instructors/application_controller.rb
@@ -1,6 +1,4 @@
class Instructors::ApplicationController < ApplicationController
before_filter :require_instructor
layout "instructors"
-
- add_crumb "Dashboard", '/instructors/dashboard'
-end
+end
View
3  app/controllers/instructors/client_versions_controller.rb
@@ -1,8 +1,5 @@
class Instructors::ClientVersionsController < Instructors::ApplicationController
- add_crumb("Client Versions") { |instance| instance.send :instructors_client_versions_path }
-
def index
@client_versions = ClientVersion.paginate :page => params[:page], :per_page => 10, :order => "release_date DESC"
end
-
end
View
38 app/controllers/instructors/emails_controller.rb
@@ -1,38 +0,0 @@
-class Instructors::EmailsController < Instructors::ApplicationController
-
- layout 'bootstrap'
-
- before_filter :find_group
-
- def index
- @emails = @group.notification_emails.paginate(:page => params[:page], :per_page => 25, :order => "id desc")
- add_crumb "Emails", instructors_class_emails_path(@group)
- end
-
- def show
- @email = @group.notification_emails.find(params[:id])
- end
-
- def new
- @email = @group.notification_emails.new
- add_crumb "New Email", new_instructors_class_email_path(@group)
- end
-
- def create
- @email = @group.notification_emails.new(params[:class_notification_email])
-
- if @email.save
- redirect_to instructors_class_email_path(@group, @email), :notice => "The notification email has been sent"
- else
- render :action => :new
- end
- end
-
- private
-
- def find_group
- @group = current_user.managed_groups.find(params[:class_id])
- add_crumb @group.name, instructors_class_path(@group)
- end
-
-end
View
7 app/controllers/instructors/groups_controller.rb
@@ -6,8 +6,6 @@ class Instructors::GroupsController < Instructors::ApplicationController
cache_sweeper :group_sweeper, :only => [:create, :update, :destroy]
- add_crumb("Classes") { |instance| instance.send :instructors_classes_path }
-
subject_buttons :group, :only => [:show]
subject_buttons :cancel_group, :only => [:new, :edit, :create, :update]
@@ -18,16 +16,13 @@ def index
end
def show
- add_crumb @group.name, instructors_class_path(@group)
end
def new
@group = current_user.managed_groups.build
- add_crumb "New Class", new_instructors_class_path
end
def edit
- add_crumb "Editing #{@group.name}", edit_instructors_class_path
end
def create
@@ -38,7 +33,6 @@ def create
redirect_to(instructors_class_path(@group), :notice => 'Group was successfully created.')
else
render :action => "new"
- add_crumb "New Group", new_instructors_class_path
end
end
@@ -47,7 +41,6 @@ def update
redirect_to(instructors_class_path(@group), :notice => 'Group was successfully updated.')
else
render :action => "edit"
- add_crumb "Editing #{@group.name}", edit_instructors_class_path
end
end
View
7 app/controllers/instructors/scenarios_controller.rb
@@ -11,14 +11,11 @@ class Instructors::ScenariosController < Instructors::ApplicationController
inner_tabs :scenario_details
- add_crumb("Scenarios") { |instance| instance.send :instructors_scenarios_path }
-
def index
@scenarios = current_user.created_scenarios.paginate :page => params[:page], :per_page => 25
end
def show
- add_crumb @scenario.name, instructors_scenario_path(@scenario)
end
def new
@@ -26,11 +23,9 @@ def new
:longterm_stop_date => Time.now+7.days,
:realtime_start_datetime => Time.now
)
- add_crumb "New Scenario", new_instructors_scenario_path
end
def edit
- add_crumb "Editing #{@scenario.name}", edit_instructors_scenario_path(@scenario)
end
def create
@@ -41,7 +36,6 @@ def create
redirect_to instructors_scenario_path(@scenario), :notice => 'Scenario was successfully created.'
else
render :action => "new"
- add_crumb "New Scenario", new_instructors_scenario_path
end
end
@@ -50,7 +44,6 @@ def update
redirect_to instructors_scenario_path(@scenario), :notice => 'Scenario was successfully updated.'
else
render :action => "edit"
- add_crumb "Editing #{@scenario.name}", edit_instructors_scenario_path(@scenario)
end
end
View
13 app/controllers/instructors/variables_controller.rb
@@ -5,7 +5,7 @@ class Instructors::VariablesController < Instructors::ApplicationController
helper :sort
include SortHelper
- before_filter :find_scenario, :add_crumbs
+ before_filter :find_scenario
before_filter :find_scenario_variable, :only => [:show, :edit, :update]
before_filter :initialize_variables_sort, :only => :index
@@ -32,15 +32,12 @@ def index
def new
@scenario_variable = ScenarioVariable.new
- add_crumb "New Variable", new_instructors_scenario_variable_path
end
def show
- add_crumb @scenario_variable.display_name, instructors_scenario_variable_path(@scenario, @scenario_variable)
end
def edit
- add_crumb "Editing #{@scenario_variable.display_name}", edit_instructors_scenario_variable_path(@scenario, @scenario_variable)
end
def create
@@ -49,7 +46,6 @@ def create
if @scenario_variable.save
redirect_to(instructors_scenario_variable_path(@scenario, @scenario_variable), :notice => 'ScenarioVariable was successfully created.')
else
- add_crumb "New Variable", new_instructors_scenario_variable_path
render :action => "new"
end
end
@@ -59,7 +55,6 @@ def update
redirect_to(instructors_scenario_variable_path(@scenario, @scenario_variable), :notice => 'ScenarioVariable was successfully updated.')
else
render :action => "edit"
- add_crumb "Editing #{@scenario_variable.display_name}", edit_instructors_scenario_variable_path(@scenario, @scenario_variable)
end
end
@@ -80,12 +75,6 @@ def drop
private
- def add_crumbs
- add_crumb "Scenarios", instructors_scenarios_path
- add_crumb @scenario.name, instructors_scenario_path(@scenario)
- add_crumb "Manage Variables", instructors_scenario_variables_path(@scenario)
- end
-
def find_scenario
@scenario = current_user.created_scenarios.find(params[:scenario_id])
end
View
8 app/controllers/managers/access_controller.rb
@@ -2,7 +2,7 @@ class Managers::AccessController < Managers::ApplicationController
layout 'bootstrap'
- before_filter :find_scenario, :add_crumbs
+ before_filter :find_scenario
cache_sweeper :membership_sweeper, :only => [:create, :destroy]
@@ -34,10 +34,4 @@ def find_scenario
@scenario = current_user.institution.scenarios.find(params[:scenario_id])
end
- def add_crumbs
- add_crumb "Scenarios", [:managers, :scenarios]
- add_crumb @scenario.name, [:managers, @scenario]
- add_crumb "Manage Access", [:managers, @scenario, :accesses]
- end
-
end
View
3  app/controllers/managers/application_controller.rb
@@ -1,5 +1,4 @@
class Managers::ApplicationController < ApplicationController
before_filter :require_manager
layout "managers"
- add_crumb "Dashboard", "/managers/dashboard"
-end
+end
View
5 app/controllers/managers/groups_controller.rb
@@ -8,23 +8,18 @@ class Managers::GroupsController < Managers::ApplicationController
cache_sweeper :group_sweeper, :only => [:create, :update, :destroy]
- add_crumb("Classes") { |instance| instance.send :managers_classes_path }
-
def index
@groups = current_user.institution.groups.paginate :page => params[:page], :per_page => 25, :order => "users.last_name", :include => :members
end
def show
- add_crumb @group.name, managers_class_path
end
def new
@group = Group.new(:creator => @instructor)
- add_crumb "New Group", new_managers_class_path
end
def edit
- add_crumb "Editing #{@group.name}", edit_managers_class_path
end
def create
View
2  app/controllers/managers/scenarios_controller.rb
@@ -3,14 +3,12 @@ class Managers::ScenariosController < Managers::ApplicationController
layout 'bootstrap'
before_filter :find_scenario, :only => [:show]
- add_crumb("Scenarios") { |instance| instance.send :managers_scenarios_path }
def index
@scenarios = current_user.institution.scenarios.paginate(:page => params[:page], :per_page => 25)
end
def show
- add_crumb @scenario.name, managers_scenario_path(@scenario)
end
def list
View
8 app/controllers/managers/variables_controller.rb
@@ -4,7 +4,7 @@ class Managers::VariablesController < Managers::ApplicationController
helper :sort
include SortHelper
- before_filter :find_scenario, :add_crumbs
+ before_filter :find_scenario
before_filter :initialize_variables_sort, :only => [:index]
def index
@@ -21,10 +21,4 @@ def find_scenario
@scenario = current_user.institution.scenarios.find(params[:scenario_id])
end
- def add_crumbs
- add_crumb "Scenarios", managers_scenarios_path
- add_crumb @scenario.name, managers_scenario_path(@scenario)
- add_crumb "Variables", managers_scenario_variables_path(@scenario)
- end
-
end
View
3  app/controllers/students/groups_controller.rb
@@ -2,15 +2,12 @@ class Students::GroupsController < Students::ApplicationController
layout 'bootstrap'
- add_crumb("Classes") { |instance| instance.send :students_classes_path }
-
def index
@groups = current_user.groups.paginate :page => params[:page], :per_page => 25
end
def show
@group = current_user.groups.find(params[:id])
- add_crumb @group.name, students_class_path(@group)
end
end
View
8 app/controllers/user_sessions_controller.rb
@@ -3,11 +3,11 @@ class UserSessionsController < ApplicationController
layout "signin"
before_filter :require_no_user, :only => [:new, :create]
before_filter :require_user, :only => :destroy
-
+
def new
@user_session = UserSession.new
end
-
+
def create
@user_session = UserSession.new(params[:user_session])
if @user_session.save
@@ -17,11 +17,11 @@ def create
render :action => 'new'
end
end
-
+
def destroy
@user_session = UserSession.find
@user_session.destroy
flash[:notice] = "Successfully logged out."
redirect_to login_path
end
-end
+end
View
7 app/controllers/users_controller.rb
@@ -3,7 +3,6 @@ class UsersController < ApplicationController
layout 'bootstrap'
before_filter :require_user
- before_filter :set_dashboard_crumb
cache_sweeper :user_sweeper, :only => :update
@@ -12,11 +11,9 @@ class UsersController < ApplicationController
:if => proc { |c| c.send(:flash_empty?) }
def show
- add_crumb current_user.name, profile_path
end
def edit
- add_crumb "Editing #{current_user.name}", edit_profile_path
end
def update
@@ -53,8 +50,4 @@ def set_layout
self.class.layout current_user_layout
end
- def set_dashboard_crumb
- add_crumb "Dashboard", current_dashboard_path
- end
-
end
View
1  app/views/layouts/admins.html.haml
@@ -58,7 +58,6 @@
.fluid
.content
- = render_crumbs.html_safe
= display_flash
= yield
- if @show_connection
View
5 app/views/layouts/instructors.html.haml
@@ -30,9 +30,9 @@
%li= link_to "Log-out", logout_path
- else
%li= link_to "Sign Up", signup_path
-
+
.border
- &nbsp;
+ &nbsp;
.main
.dl10.navigation
- if logged_in?
@@ -47,7 +47,6 @@
.fluid
.content
- = render_crumbs.html_safe
= display_flash
= yield
= render :partial => "layouts/connection" if @show_connection
View
5 app/views/layouts/managers.html.haml
@@ -29,9 +29,9 @@
%li= link_to "Log-out", logout_path
- else
%li= link_to "Sign Up", signup_path
-
+
.border
- &nbsp;
+ &nbsp;
.main
.dl10.navigation
- if logged_in?
@@ -48,7 +48,6 @@
.fluid
.content
- = render_crumbs.html_safe
= display_flash
= yield
= render :partial => "layouts/connection" if @show_connection
View
7 app/views/layouts/students.html.haml
@@ -27,9 +27,9 @@
%li= link_to "Log-out", logout_path
- else
%li= link_to "Sign Up", signup_path
-
+
.border
- &nbsp;
+ &nbsp;
.main
.dl10.navigation
- if logged_in?
@@ -37,10 +37,9 @@
%li
= link_to "Your Classes", students_classes_path
= link_to "Community Directory", directory_path
-
+
.fluid
.content
- = render_crumbs.html_safe
= display_flash
= yield
= render :partial => "layouts/connection" if @show_connection
View
1  config/routes.rb
@@ -69,7 +69,6 @@
resources :classes, :controller => :groups do
resources :students, :only => [:index, :show]
resources :memberships, :only => [:destroy]
- resources :emails
end
end
View
20 vendor/plugins/crummy/MIT-LICENSE
@@ -1,20 +0,0 @@
-Copyright (c) 2008 [name of plugin creator]
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
115 vendor/plugins/crummy/README.textile
@@ -1,115 +0,0 @@
-h1. Crummy
-
-h2. Introduction
-
-Crummy is a simple and tasty way to add breadcrumbs to your Rails applications.
-
-h2. Install
-
-The gem is hosted on gemcutter, so if you haven’t already, add it as a gem source:
-
-<pre>
- <code>
- gem sources -a http://gemcutter.org/
- </code>
-</pre>
-
-Then install the Formtastic gem:
-
-<pre>
- <code>
- gem install crummy
- </code>
-</pre>
-
-You can also install it as a Rails plugin:
-
-<pre>
- <code>
- script/plugin install git://github.com/zachinglis/crummy.git
- </code>
-</pre>
-
-h2. Example
-
-In your controllers you may add_crumb either like a before_filter or within a method (It is also available to views).
-
-<pre>
- <code>
- class ApplicationController
- add_crumb "Home", '/'
- end
-
- class BusinessController < ApplicationController
- add_crumb("Businesses") { |instance| instance.send :businesses_path }
- add_crumb("Comments", :only => "comments") { |instance| instance.send :businesses_comments_path }
- before_filter :load_comment, :only => "show"
- add_crumb :comment, :only => "show"
-
- def show
- add_crumb @business.display_name, @business
- end
-
- def load_comment
- @comment = Comment.find(params[:id])
- end
- end
- </code>
-</pre>
-
-Then in your view:
-
-<pre>
- <code>
- <%= render_crumbs %>
- </code>
-</pre>
-
-h2. Options for render_crumb_
-
-render_crumbs renders the list of crumbs as either html or xml
-
-It takes 3 options
-
-The output format. Can either be :xml or :html. Defaults to :html
-
-<code>:format => (:html|:xml)</code>
-
-The seperator text. It does not assume you want spaces on either side so you must specify. Defaults to <code>&raquo;</code> for :html and <code><crumb></code> for :xml
-
-<code>:seperator => string</code>
-
-Render links in the output. Defaults to +true+
-
-<code>:link => boolean</code>
-
-h3. Examples
-
-<pre>
- <code>
- render_crumbs #=> <a href="/">Home</a> &raquo; <a href="/businesses">Businesses</a>
- render_crumbs :seperator => ' | ' #=> <a href="/">Home</a> | <a href="/businesses">Businesses</a>
- render_crumbs :format => :xml #=> <crumb href="/">Home</crumb><crumb href="/businesses">Businesses</crumb>
- </code>
-</pre>
-A crumb with a nil link will just output plain text.
-
-h2. Notes
-
-The variable set is set to @_crumbs as to not conflict with your code.
-
-h2. Todo
-
-* Port over rspecs from project to plugin (Fully tested in a project)
-* Accept instances of models as a single argument
-* Allow for variables in names. (The workaround is to do your own before_filter for that currently)
-
-h2. Credits
-
-* "Zach Inglis":http://zachinglis.com
-* "Rein Henrichs":http://reinh.com
-* "Les Hill":http://blog.leshill.org/
-* "Sandro Turriate":http://turriate.com/
-* "Przemysław Kowalczyk":http://szeryf.wordpress.com/2008/06/13/easy-and-flexible-breadcrumbs-for-rails/ - feature ideas
-
-*Copyright (c) 2008 Zach Inglis, released under the MIT license*
View
43 vendor/plugins/crummy/Rakefile
@@ -1,43 +0,0 @@
-require 'rubygems'
-require 'rake'
-
-desc 'Default: run unit tests.'
-task :default => :test
-
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "crummy"
- gem.summary = %Q{Tasty breadcrumbs!}
- gem.description = %Q{Crummy is a simple and tasty way to add breadcrumbs to your Rails applications.}
- gem.email = "zach@lt3media.com"
- gem.homepage = "http://github.com/zachinglis/crummy"
- gem.authors = ["Zach Inglis"]
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
-end
-
-require 'rake/testtask'
-desc 'Test the crummy plugin.'
-Rake::TestTask.new(:test) do |t|
- t.libs << 'lib'
- t.pattern = 'test/**/*_test.rb'
- t.verbose = true
-end
-
-begin
- gem 'hanna'
- require 'hanna/rdoctask'
-rescue LoadError
- require 'rake/rdoctask'
-end
-desc 'Generate documentation for the crummy plugin.'
-Rake::RDocTask.new(:rdoc) do |rdoc|
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'Crummy: Tasty Breadcrumbs'
- rdoc.options << '--line-numbers' << '--inline-source'
- rdoc.rdoc_files.include('README.textile')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
View
1  vendor/plugins/crummy/VERSION
@@ -1 +0,0 @@
-0.1.0
View
2  vendor/plugins/crummy/init.rb
@@ -1,2 +0,0 @@
-ActionController::Base.send :include, Crummy::ControllerMethods
-ActionView::Base.send :include, Crummy::ViewMethods
View
119 vendor/plugins/crummy/lib/crummy.rb
@@ -1,119 +0,0 @@
-module Crummy
- module ControllerMethods
- module ClassMethods
- # Add a crumb to the crumbs array.
- #
- # add_crumb("Home", "/")
- # add_crumb("Business") { |instance| instance.business_path }
- #
- # Works like a before_filter so +:only+ and +except+ both work.
- def add_crumb(name, *args)
- options = args.extract_options!
- url = args.first
- raise ArgumentError, "Need more arguments" unless name or options[:record] or block_given?
- raise ArgumentError, "Cannot pass url and use block" if url && block_given?
- before_filter(options) do |instance|
- url = yield instance if block_given?
- url = instance.send url if url.is_a? Symbol
- record = instance.instance_variable_get("@#{name}") unless url or block_given?
- if record and record.respond_to? :to_param
- name, url = record.to_s, instance.url_for(record)
- end
-
- # FIXME: url = instance.url_for(name) if name.respond_to?("to_param") && url.nil?
- # FIXME: Add ||= for the name, url above
- instance.add_crumb(name, url)
- end
- end
- end
-
- module InstanceMethods
- # Add a crumb to the crumbs array.
- #
- # add_crumb("Home", "/")
- # add_crumb("Business") { |instance| instance.business_path }
- #
- def add_crumb(name, url=nil)
- crumbs.push [name, url]
- end
-
- # Lists the crumbs as an array
- def crumbs
- get_or_set_ivar "@_crumbs", []
- end
-
- def get_or_set_ivar(var, value) # :nodoc:
- instance_variable_set var, instance_variable_get(var) || value
- end
- private :get_or_set_ivar
- end
-
- def self.included(receiver) # :nodoc:
- receiver.extend ClassMethods
- receiver.send :include, InstanceMethods
- end
- end
-
- module ViewMethods
- # List the crumbs as an array
- def crumbs
- @_crumbs ||= [] # Give me something to push to
- end
-
- # Add a crumb to the +crumbs+ array
- def add_crumb(name, url=nil)
- crumbs.push [name, url]
- end
-
- # Render the list of crumbs as either html or xml
- #
- # Takes 3 options:
- # The output format. Can either be xml or html. Default :html
- # :format => (:html|:xml)
- # The seperator text. It does not assume you want spaces on either side so you must specify. Default +&raquo;+ for :html and +crumb+ for xml
- # :seperator => string
- # Render links in the output. Default +true+
- # :link => boolean
- #
- # Examples:
- # render_crumbs #=> <a href="/">Home</a> &raquo; <a href="/businesses">Businesses</a>
- # render_crumbs :seperator => ' | ' #=> <a href="/">Home</a> | <a href="/businesses">Businesses</a>
- # render_crumbs :format => :xml #=> <crumb href="/">Home</crumb><crumb href="/businesses">Businesses</crumb>
- #
- # The only argument is for the seperator text. It does not assume you want spaces on either side so you must specify. Defaults to +&raquo;+
- #
- # render_crumbs(" . ") #=> <a href="/">Home</a> . <a href="/businesses">Businesses</a>
- #
- def render_crumbs(options = {})
- options[:format] = :html if options[:format] == nil
- if options[:seperator] == nil
- options[:seperator] = " &raquo; " if options[:format] == :html
- options[:seperator] = "crumb" if options[:format] == :xml
- end
- options[:links] = true if options[:links] == nil
- case options[:format]
- when :html
- crumbs.collect do |crumb|
- crumb_to_html crumb, options[:links]
- end * options[:seperator]
- when :xml
- crumbs.collect do |crumb|
- crumb_to_xml crumb, options[:links], options[:seperator]
- end * ''
- else
- raise "Unknown breadcrumb output format"
- end
- end
-
- def crumb_to_html(crumb, links)
- name, url = crumb
- url && links ? link_to(name, url) : name
- end
-
- def crumb_to_xml(crumb, links, seperator)
- name, url = crumb
- url && links ? "<#{seperator} href=\"#{url}\">#{name}</#{seperator}>" : "<#{seperator}>#{name}</#{seperator}>"
- end
-
- end
-end
View
4 vendor/plugins/crummy/lib/tasks/crummy_tasks.rake
@@ -1,4 +0,0 @@
-# desc "Explaining what the task does"
-# task :crummy do
-# # Task goes here
-# end

No commit comments for this range

Something went wrong with that request. Please try again.