forked from External/greenlight
		
	cleanup controllers and routes
This commit is contained in:
		| @@ -10,18 +10,6 @@ class LandingController < ApplicationController | |||||||
|     end |     end | ||||||
|   end |   end | ||||||
|  |  | ||||||
|   # GET /token.json |  | ||||||
|   def new_meeting |  | ||||||
|     respond_to do |format| |  | ||||||
|       meeting_url = resource_url('meetings', helpers.new_meeting_token) |  | ||||||
|       format.json { render :json => { :messageKey => "ok", :message => "New meeting URL created", :status => :ok, :response => { :meeting_url => meeting_url} }, :status => status } |  | ||||||
|     end |  | ||||||
|   end |  | ||||||
|  |  | ||||||
|   def meeting |  | ||||||
|     render_meeting |  | ||||||
|   end |  | ||||||
|  |  | ||||||
|   def admin? |   def admin? | ||||||
|     @user == current_user |     @user == current_user | ||||||
|   end |   end | ||||||
| @@ -30,16 +18,13 @@ class LandingController < ApplicationController | |||||||
|   private |   private | ||||||
|  |  | ||||||
|   def render_meeting |   def render_meeting | ||||||
|     @resource = params[:resource] |     params[:action] = 'meetings' | ||||||
|     @meeting_token = params[:id] || @meeting_token = helpers.new_meeting_token |  | ||||||
|     @refreshable = (params[:resource] == 'meetings' && !params.has_key?(:id)) |  | ||||||
|     render :action => 'meeting' |     render :action => 'meeting' | ||||||
|   end |   end | ||||||
|  |  | ||||||
|   def render_room |   def render_room | ||||||
|     @resource = params[:resource] |     params[:action] = 'rooms' | ||||||
|     @meeting_token = params[:id] |     @user = User.find_by(username: params[:id]) | ||||||
|     @user = User.find_by(username: @meeting_token) |  | ||||||
|     if @user.nil? |     if @user.nil? | ||||||
|       redirect_to root_path |       redirect_to root_path | ||||||
|       return |       return | ||||||
|   | |||||||
| @@ -1,20 +1,15 @@ | |||||||
| Rails.application.routes.draw do | Rails.application.routes.draw do | ||||||
|   resources :users, only: [:edit, :update] |   resources :users, only: [:edit, :update] | ||||||
|  |  | ||||||
|   # This should be removed once before being released |  | ||||||
|   get '/auth/:provider/callback', to: 'sessions#create' |  | ||||||
|   ########################################################### |  | ||||||
|  |  | ||||||
|   get '/users/auth/:provider/callback', to: 'sessions#create' |  | ||||||
|   get '/users/logout', to: 'sessions#destroy', as: :user_logout |   get '/users/logout', to: 'sessions#destroy', as: :user_logout | ||||||
|   get '/meetings/join/:resource/:id', to: 'bbb#join', as: :bbb_join |  | ||||||
|   get '/meetings/new', to: 'landing#new_meeting', as: :new_meeting |   get '/auth/:provider/callback', to: 'sessions#create' | ||||||
|  |  | ||||||
|   # There are two resources [meetings|rooms] |   # There are two resources [meetings|rooms] | ||||||
|   # meetings offer a landing page for NON authenticated users to create and join session in BigBlueButton |   # meetings offer a landing page for NON authenticated users to create and join session in BigBlueButton | ||||||
|   # rooms offer a customized landing page for authenticated users to create and join session in BigBlueButton |   # rooms offer a customized landing page for authenticated users to create and join session in BigBlueButton | ||||||
|   get '/:resource(/:id)', to: 'landing#index', as: :resource |   get '/:resource(/:id)', to: 'landing#index', as: :resource | ||||||
|  |   get '/:resource/:id/join', to: 'bbb#join', as: :bbb_join | ||||||
|  |  | ||||||
|   root to: 'landing#meeting', :resource => "meetings" |   root to: 'landing#index', :resource => "meetings" | ||||||
|   # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html |   # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html | ||||||
| end | end | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user