Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • portalmec/portalmec
  • rfhferreira/cleanning-portalmec
2 results
Show changes
Showing
with 497 additions and 20 deletions
# 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/>.
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers a minimum and maximum.
# Any libraries that use thread pools should be configured to match
......
# 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
# require 'sidekiq/web'
# mount Sidekiq::Web, at: '/sidekiq'
......@@ -12,6 +32,7 @@ Rails.application.routes.draw do
member do
post 'follow', as: :follow, action: :follow
delete 'follow', as: :unfollow, action: :unfollow
put 'follow', as: :follow_toggle, action: :follow_toggle
end
end
......@@ -22,15 +43,34 @@ Rails.application.routes.draw do
end
end
concern :subjectable do
member do
post 'subjects', as: :subjecting, action: :subjecting
delete 'subjects', as: :unsubjecting, action: :unsubjecting
end
end
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
concern :sociable do
member do
post 'like', as: :like, action: :like
delete 'like', as: :unlike, action: :unlike
put 'like', as: :like, action: :like
end
end
concern :downloadable do
member do
get 'download', as: :download, action: :download
end
end
concern :reviewable do
resources :reviews, only: [:index, :create, :show, :destroy], concerns: :deletable do
resources :reviews, only: [:index, :create, :update, :destroy], concerns: :deletable do
member do
post :rate
end
......@@ -44,6 +84,18 @@ Rails.application.routes.draw do
end
end
# GET /users/1/learning_objects/
concern :publisher do
member 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_submissions, action: :show_submissions
get 'collections', as: :get_collections, action: :show_all_collections
get 'collections/liked', as: :get_liked_collections, action: :show_liked_collections
end
end
# GET /learning_objects/1/versions/123
# GET /learning_objects/1/versions
# POST /learning_objects/1/versions/234/checkout
......@@ -55,40 +107,84 @@ Rails.application.routes.draw do
end
end
concern :evaluable do
member do
post 'reject', action: :reject
post 'accept', action: :accept
end
end
concern :relatable do
member do
get 'show_related', action: :show_related
post 'treat_related', action: :treat_related
end
end
scope :v1 do
mount_devise_token_auth_for 'User', skip: [:omniauth_callbacks], at: :auth
mount_devise_token_auth_for 'User', at: 'auth', controllers: {
omniauth_callbacks: 'v1/omniauth_callbacks',
sessions: 'v1/sessions'
}
end
namespace :v1 do
resources :activities, only: :index
resources :activities, only: [:index, :show] do
collection do
get 'me'
post 'view'
end
end
resources :feed, only: [:index]
resources :users, concerns: [:followable, :deletable] do
resources :users, concerns: [:followable, :deletable, :publisher, :versionable] do
resources :bookmarks, module: 'users', only: [:index, :create, :destroy]
member do
resources :bookmarks, module: 'users', only: [:index, :create, :destroy]
get 'watching/:object_type', to: 'users#watching'
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'
put 'reactivate_user', to: 'users#reactivate_user'
post 'add_teacher', to: 'users#add_teacher'
delete 'remove_teacher', to: 'users#remove_teacher'
end
collection do
get 'teacher_requests'
post 'teacher_request', to: 'users#create_teacher_request'
put 'teacher_request', to: 'users#update_teacher_request'
end
end
resources :reviews, only: :show
# search routes
resources :search, only: :index do
collection do
get :autocomplete
get :tag
end
end
resources :collections, concerns: [:followable, :sociable, :reviewable, :taggable, :versionable, :deletable, :highlights] do
resources :email, only: :create
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, :reviewable, :taggable, :versionable, :deletable, :highlights] do
resources :learning_objects, concerns: [:sociable, :downloadable, :reviewable, :taggable, :versionable, :deletable, :highlights, :subjectable, :stageable] do
member do
resource :chunk, module: 'learning_objects', only: [:create, :show]
resource :upload, module: 'learning_objects', only: :create
resource :publish, module: 'learning_objects', only: :create
end
collection do
get 'validate'
end
resources :attachment, module: 'learning_objects', only: [:destroy, :update, :index], on: :member
end
resources :institutions, concerns: :deletable do
......@@ -97,7 +193,12 @@ Rails.application.routes.draw do
end
end
resources :complaints, only: [:index, :create], concerns: :deletable
resources :submissions, except: :update do
member do
post :answer
end
end
resources :complaints, only: [:index, :show, :create], concerns: [:deletable, :evaluable, :relatable]
resources :languages, except: [:new, :edit]
resources :licenses, except: [:new, :edit]
resources :mime_types, except: [:new, :edit]
......@@ -105,7 +206,15 @@ Rails.application.routes.draw do
resources :roles, except: [:new, :edit]
resources :scores, only: [:index, :show, :update]
resources :ratings, except: [:new, :edit]
resources :contacts
resources :suggestions
resources :statistics, only: [:index]
resources :complaint_reasons, except: [:destroy]
resources :questions, except: [:destroy]
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'
end
end
# 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/>.
# Use this file to easily define all of your cron jobs.
#
# It's helpful, but not entirely necessary to understand cron before proceeding.
......@@ -20,6 +39,11 @@
# Learn more: http://github.com/javan/whenever
# update score of learning objects
every 6.hours do
rake 'score:calculate_all'
every 1.days do
rake 'score:calculate_sync'
end
#Reassign submitted LO that has expired
every :sunday, at: '3am' do
rake 'submission:reassign'
end
\ No newline at end of file
# 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/>.
# Be sure to restart your server when you modify this file.
# Your secret key is used for verifying the integrity of signed cookies.
......
# 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/>.
#
# IMPORTANT:
# If you plan to run workers on different machines, use the full hostname,
......@@ -8,13 +27,15 @@
:pidfile: ./shared/pids/sidekiq.pid
:logfile: ./shared/logs/sidekiq.log
:queues:
- default
- score
- convert_video
- searchkick
- [attachment_cache, 2]
- [package_cache, 3]
- [high_priority, 5]
- [dspace, 5]
- [package_cache, 4]
- [attachment_cache, 3]
- [searchkick, 2]
- [default, 1]
- [thumbnail, 1]
- [review, 1]
- [score, 1]
- [convert_video, 1]
# :daemon: true
development: &development
......
# 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/>.
%w(
.ruby-version
.rbenv-vars
......
# 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/>.
class DeviseCreateUsers < ActiveRecord::Migration[4.2]
def change
create_table(:users) do |t|
......
# 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/>.
class DeviseTokenAuthCreateUsers < ActiveRecord::Migration[4.2]
def change
change_table(:users) do |t|
......
# 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/>.
class CreateRoles < ActiveRecord::Migration[4.2]
def change
create_table :roles do |t|
......
# 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/>.
class CreateJoinTableUsersRoles < ActiveRecord::Migration[4.2]
def change
create_join_table :users, :roles do |t|
......
# 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/>.
class AddNameColumnToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :name, :string
......
# 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/>.
class AddAttachmentAvatarToUsers < ActiveRecord::Migration[4.2]
def self.up
change_table :users do |t|
......
# 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/>.
class CreateCarousels < ActiveRecord::Migration[4.2]
def change
create_table :carousels do |t|
......
# 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/>.
class AddImageColumnToCarousels < ActiveRecord::Migration[4.2]
def up
add_attachment :carousels, :image
......
# 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/>.
class CreateLanguages < ActiveRecord::Migration[4.2]
def change
create_table :languages do |t|
......
# 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/>.
class CreateObjectTypes < ActiveRecord::Migration[4.2]
def change
create_table :object_types do |t|
......
# 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/>.
class CreateLearningObjects < ActiveRecord::Migration[4.2]
def change
create_table :learning_objects do |t|
......
# 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/>.
class CreateTopics < ActiveRecord::Migration[4.2]
def change
create_table :topics do |t|
......
# 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/>.
class LearningObjectsTopics < ActiveRecord::Migration[4.2]
def change
create_table :learning_objects_topics do |t|
......
# 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/>.
class CreateInstitutions < ActiveRecord::Migration[4.2]
def change
create_table :institutions do |t|
......