Class: HubController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- HubController
- Defined in:
- app/controllers/hub_controller.rb
Constant Summary
Constants included from ProjectsHelper
ProjectsHelper::CLASSIFIER, ProjectsHelper::CLASSIFIER_ANNOTATION
Instance Method Summary collapse
- #handle_bad_tab_order ⇒ Object protected
-
#index ⇒ Object
GET /hub.
- #order_tabs ⇒ Object
- #set_links_to_render ⇒ Object protected
- #tasks ⇒ Object
- #update_tab_order ⇒ Object
Methods included from RedirectHelper
Methods included from RequestType
Methods included from LogRecent
Methods included from Cookies
#digest_cookie, #digested_cookie_exists?
Methods included from Whitelist
Methods included from ProjectsHelper
#cumulative_gb_per_year, #document_cumulative_gb_per_year, #document_gb_per_year, #gb_per_year, #image_cumulative_gb_per_year, #image_gb_per_year, #invalid_object, #project_classification, #project_link, #project_matches, #project_tag, #projects_list, #projects_search_form, #taxonworks_classification, #week_in_review_graphs
Methods included from Api::Intercept
Methods included from TokenAuthentication
#intercept_project, #intercept_user, #intercept_user_or_project, #project_token_authenticate, #token_authenticate
Instance Method Details
#handle_bad_tab_order ⇒ Object (protected)
36 37 38 39 40 41 42 43 44 |
# File 'app/controllers/hub_controller.rb', line 36 def handle_bad_tab_order # This is preventative only, it should never happen in real data, and may only occur when # we reset tab performance. if @sessions_current_user.hub_tab_order.empty? # TODO: update_column likely @sessions_current_user.update_attribute(:hub_tab_order, DEFAULT_HUB_TAB_ORDER) end true end |
#index ⇒ Object
GET /hub
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/hub_controller.rb', line 6 def index handle_bad_tab_order respond_to do |format| format.html {} # TODO not used?! # format.js { # render partial: 'navigation_index' # layout: nil # } format.json{ render json: helpers.hub_json } end end |
#order_tabs ⇒ Object
24 25 26 |
# File 'app/controllers/hub_controller.rb', line 24 def order_tabs handle_bad_tab_order end |
#set_links_to_render ⇒ Object (protected)
46 47 48 49 |
# File 'app/controllers/hub_controller.rb', line 46 def set_links_to_render @links_to_render = params[:list] @links_to_render ||= @sessions_current_user.hub_tab_order.first end |
#tasks ⇒ Object
20 21 22 |
# File 'app/controllers/hub_controller.rb', line 20 def tasks @tasks = UserTasks.hub_tasks(params[:category]) end |
#update_tab_order ⇒ Object
28 29 30 31 32 |
# File 'app/controllers/hub_controller.rb', line 28 def update_tab_order # TODO: update_column likely @sessions_current_user.update_attribute(:hub_tab_order, params[:order]) head :ok end |