Newer
Older
# Copyright (C) 2015 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana
#
# This file is part of portalmec.
#
# portalmec is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# portalmec is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with portalmec. If not, see <http://www.gnu.org/licenses/>.
Rails.application.routes.draw do
Bernardo Chagas
committed
# require 'sidekiq/web'
# mount Sidekiq::Web, at: '/sidekiq'
concern :deletable do
collection do
get :deleted
end
end

Mauricio Giacomini Girardello
committed
concern :followable do

Lucas Gabriel Lima
committed
post 'follow', as: :follow, action: :follow
delete 'follow', as: :unfollow, action: :unfollow
put 'follow', as: :follow_toggle, action: :follow_toggle

Lucas Gabriel Lima
committed
post 'tagging', as: :tagging, action: :tagging
delete 'tagging', as: :untagging, action: :untagging
concern :subjectable do
member do
post 'subjects', as: :subjecting, action: :subjecting
delete 'subjects', as: :unsubjecting, action: :unsubjecting
concern :stageable do
member do
post 'educational_stages', as: :add_stages, action: :add_stages
delete 'educational_stages', as: :remove_stages, action: :remove_stages
end
end
Mauricio Giacomini Girardello
committed
end
end
Mauricio Giacomini Girardello
committed
concern :downloadable do
member do
get 'download', as: :download, action: :download
Mauricio Giacomini Girardello
committed
end
end
Mauricio Giacomini Girardello
committed
concern :reviewable do
resources :reviews, only: [:index, :create, :update, :destroy], concerns: :deletable do
member do
post :rate
end
concern :submission do
collection do
get 'submissions/:id', action: :show_submission
end
member do
concern :highlights do
collection do
get :this_week
get :this_month
end
end
# GET /users/1/learning_objects/
concern :publisher do
get 'drafts', as: :get_drafts, action: :show_all_drafts
get 'learning_objects', as: :get_learning_objects, action: :show_all_learning_objects
get 'learning_objects/liked', as: :get_liked_learning_objects, action: :show_liked_learning_objects
get 'submissions', as: :get_submitted_learning_objects, action: :show_submitted_learning_objects
get 'collections', as: :get_collections, action: :show_all_collections
get 'collections/liked', as: :get_liked_collections, action: :show_liked_collections
# GET /learning_objects/1/versions/123
# GET /learning_objects/1/versions
# POST /learning_objects/1/versions/234/checkout
concern :versionable do
resources :versions, only: [:show, :index] do
member do
post :checkout
end
end
end
mount_devise_token_auth_for 'User', at: 'auth', controllers: {
omniauth_callbacks: 'v1/omniauth_callbacks'
}
resources :activities, only: [:index, :show] do
collection do
get 'me'
end
end
resources :users, concerns: [:followable, :deletable, :publisher, :versionable] do
resources :bookmarks, module: 'users', only: [:index, :create, :destroy]

Israel Barreto Sant'Anna
committed
get 'following/:object_type', to: 'users#following'
get 'followers', to: 'users#followers'
get 'activities', to: 'activities#user_activities'
get 'reviews/own', to: 'users#own_reviews'
get 'reviews/received', to: 'users#received_reviews'
post 'add_teacher', to: 'users#add_teacher'
delete 'remove_teacher', to: 'users#remove_teacher'
post 'teacher_request', to: 'users#create_teacher_request'
put 'teacher_request', to: 'users#update_teacher_request'
Marcela Ribeiro de Oliveira
committed
end
# search routes
resources :search, only: :index do
collection do
get :autocomplete
resources :collections, concerns: [:followable, :sociable, :downloadable, :reviewable, :taggable, :versionable, :deletable, :highlights, :subjectable, :stageable] do
member do
post :items, to: 'collections#add_object'
delete :items, to: 'collections#delete_object'
end
end
resources :learning_objects, concerns: [:sociable, :downloadable, :reviewable, :taggable, :versionable, :deletable, :highlights, :subjectable, :stageable, :submission] do
resource :chunk, module: 'learning_objects', only: [:create, :show]
resource :upload, module: 'learning_objects', only: :create
resource :publish, module: 'learning_objects', only: :create
collection do
get 'validate'
end
resources :attachment, module: 'learning_objects', only: [:destroy, :update, :index], on: :member
resources :institutions, concerns: :deletable do
member do
get :users, to: 'institutions#users'
end
Douglas A. C
committed
resources :complaints, only: [:index, :show, :create], concerns: :deletable
resources :languages, except: [:new, :edit]
resources :licenses, except: [:new, :edit]
resources :mime_types, except: [:new, :edit]
resources :object_types, except: [:new, :edit]
resources :scores, only: [:index, :show, :update]

Israel Barreto Sant'Anna
committed
resources :ratings, except: [:new, :edit]
resources :contacts
resources :suggestions
Bernardo Chagas
committed
resources :statistics, only: [:index]
post '/package', to: 'packages#link'
get '/subjects', to: 'subjects#index'
get '/educational_stages', to: 'educational_stages#index'
get 'learning_objects/magnetlink/:magnetlink', to: 'learning_objects#magnetlink', as: 'magnetlink_learning_objects'