From 6a25d3e5d7849f0599bc038cd07a3d28b39e5729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=20Rodr=C3=ADguez?= Date: Thu, 10 Aug 2017 16:46:47 +0200 Subject: [PATCH 1/8] Test for the dashboard front --- spec/features/dashboard/dashboard_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 spec/features/dashboard/dashboard_spec.rb diff --git a/spec/features/dashboard/dashboard_spec.rb b/spec/features/dashboard/dashboard_spec.rb new file mode 100644 index 00000000..467154cc --- /dev/null +++ b/spec/features/dashboard/dashboard_spec.rb @@ -0,0 +1,17 @@ +require 'rails_helper' + +RSpec.feature "Dashboard", type: :feature do + context "when not logged in" do + it "should not be success" do + visit dashboard_path + expect(page.current_path).not_to eq dashboard_topics_path + end + end + + context "when logged in" do + it "should be success" do + visit dashboard_path + expect(page.status_code).to eq 200 + end + end +end \ No newline at end of file From e8e4b71fa118729bbdd7a68ae6701b3225640b1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=20Rodr=C3=ADguez?= Date: Thu, 10 Aug 2017 17:59:11 +0200 Subject: [PATCH 2/8] Use authentication filter instead of route namespacing This commit removes authenticate :user from routes.rb file, so it is not a namespace anymore. Instead, dashboard controllers use the authenticate filter to test for user authentication. --- .../dashboard/dashboard_controller.rb | 2 ++ config/routes.rb | 22 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/controllers/dashboard/dashboard_controller.rb b/app/controllers/dashboard/dashboard_controller.rb index 32cd1b05..87660d97 100644 --- a/app/controllers/dashboard/dashboard_controller.rb +++ b/app/controllers/dashboard/dashboard_controller.rb @@ -1,5 +1,7 @@ class Dashboard::DashboardController < ApplicationController + before_action :authenticate_user! + def index @videos = Video.count @playlists = Playlist.count diff --git a/config/routes.rb b/config/routes.rb index df7ecc68..f8058dc0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -13,20 +13,18 @@ root to: 'front#index' # Routes for the dashboard - authenticate :user do - namespace :dashboard do - root to: 'dashboard#index', as: '' - resources :topics - resources :videos, only: [:index, :new, :create] - resources :playlists do - get :videos, on: :member - resources :videos, except: [:index, :new, :create] do - put :move, on: :member - end + namespace :dashboard do + root to: 'dashboard#index', as: '' + resources :topics + resources :videos, only: [:index, :new, :create] + resources :playlists do + get :videos, on: :member + resources :videos, except: [:index, :new, :create] do + put :move, on: :member end - resources :users - resources :opinions end + resources :users + resources :opinions end get :terms, to: 'pages#terms' From 911c15e634fb9e789304fc14c8dd354b126cb780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=20Rodr=C3=ADguez?= Date: Thu, 10 Aug 2017 18:05:07 +0200 Subject: [PATCH 3/8] Moves the dashboard into a subdomain --- config/routes.rb | 45 +++++++++---------- spec/features/dashboard/dashboard_spec.rb | 3 ++ spec/features/dashboard/opinions_spec.rb | 3 ++ .../dashboard/playlist_videos_spec.rb | 3 ++ spec/features/dashboard/playlists_spec.rb | 3 ++ spec/features/dashboard/topics_spec.rb | 3 ++ spec/features/dashboard/videos_spec.rb | 5 +++ 7 files changed, 42 insertions(+), 23 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index f8058dc0..16fc046c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,37 +6,36 @@ get '/422', to: 'error#unprocessable_entity', via: :all get '/500', to: 'error#internal_server_error', via: :all - devise_for :users, controllers: { - sessions: 'users/sessions', - passwords: 'users/passwords' - } - root to: 'front#index' - - # Routes for the dashboard - namespace :dashboard do - root to: 'dashboard#index', as: '' - resources :topics - resources :videos, only: [:index, :new, :create] - resources :playlists do - get :videos, on: :member - resources :videos, except: [:index, :new, :create] do - put :move, on: :member + constraints subdomain: 'admin' do + devise_for :users, controllers: { sessions: 'users/sessions', passwords: 'users/passwords' } + namespace :dashboard, path: '' do + root to: 'dashboard#index', as: '' + resources :topics + resources :videos, only: [:index, :new, :create] + resources :playlists do + get :videos, on: :member + resources :videos, except: [:index, :new, :create] do + put :move, on: :member + end end + resources :users + resources :opinions end - resources :users - resources :opinions end - get :terms, to: 'pages#terms' - get :privacy, to: 'pages#privacy' - get :disclaimer, to: 'pages#disclaimer' - get :cookies, to: 'pages#cookies' - + # This is the public application. + root to: 'front#index' + resources :topics, only: [:index, :show], constraints: { format: :html } resources :videos, only: :index, constraints: { format: :html } resources :playlists, path: 'series', only: [:index, :show], constraints: { format: :html } do resources :videos, path: '/', only: [:show], constraints: { format: :html } end - resources :topics, only: [:index, :show], constraints: { format: :html } + + # These are general purpose pages that don't are resources actually. + get :terms, to: 'pages#terms' + get :privacy, to: 'pages#privacy' + get :disclaimer, to: 'pages#disclaimer' + get :cookies, to: 'pages#cookies' # Redirect old routes. get '/videos/:topic/:playlist/episodio/:video' => redirect('/series/%{playlist}/%{video}') diff --git a/spec/features/dashboard/dashboard_spec.rb b/spec/features/dashboard/dashboard_spec.rb index 467154cc..32ab816b 100644 --- a/spec/features/dashboard/dashboard_spec.rb +++ b/spec/features/dashboard/dashboard_spec.rb @@ -1,6 +1,9 @@ require 'rails_helper' RSpec.feature "Dashboard", type: :feature do + before { Capybara.default_host = "http://admin.example.com" } + after { Capybara.default_host = "http://www.example.com" } + context "when not logged in" do it "should not be success" do visit dashboard_path diff --git a/spec/features/dashboard/opinions_spec.rb b/spec/features/dashboard/opinions_spec.rb index 3d1bf273..7c1eeb8b 100644 --- a/spec/features/dashboard/opinions_spec.rb +++ b/spec/features/dashboard/opinions_spec.rb @@ -1,6 +1,9 @@ require 'rails_helper' RSpec.feature "Dashboard opinions", type: :feature do + before { Capybara.default_host = "http://admin.example.com" } + after { Capybara.default_host = "http://www.example.com" } + context "when not logged in" do it "should not be success" do visit dashboard_opinions_path diff --git a/spec/features/dashboard/playlist_videos_spec.rb b/spec/features/dashboard/playlist_videos_spec.rb index e774160a..9ab409b6 100644 --- a/spec/features/dashboard/playlist_videos_spec.rb +++ b/spec/features/dashboard/playlist_videos_spec.rb @@ -1,6 +1,9 @@ require 'rails_helper' RSpec.feature "Dashboard playlist videos", type: :feature do + before { Capybara.default_host = "http://admin.example.com" } + after { Capybara.default_host = "http://www.example.com" } + before(:each) { @playlist = FactoryGirl.create(:playlist) @videos = [ diff --git a/spec/features/dashboard/playlists_spec.rb b/spec/features/dashboard/playlists_spec.rb index 9eff89d4..ae6e0879 100644 --- a/spec/features/dashboard/playlists_spec.rb +++ b/spec/features/dashboard/playlists_spec.rb @@ -1,6 +1,9 @@ require 'rails_helper' RSpec.feature "Dashboard playlists", type: :feature do + before { Capybara.default_host = "http://admin.example.com" } + after { Capybara.default_host = "http://www.example.com" } + context "when not logged in" do it "should not be success" do visit dashboard_playlists_path diff --git a/spec/features/dashboard/topics_spec.rb b/spec/features/dashboard/topics_spec.rb index 32854953..b69bcdf9 100644 --- a/spec/features/dashboard/topics_spec.rb +++ b/spec/features/dashboard/topics_spec.rb @@ -1,6 +1,9 @@ require 'rails_helper' RSpec.feature "Dashboard topics", type: :feature do + before { Capybara.default_host = "http://admin.example.com" } + after { Capybara.default_host = "http://www.example.com" } + context "when not logged in" do it "should not be success" do visit dashboard_topics_path diff --git a/spec/features/dashboard/videos_spec.rb b/spec/features/dashboard/videos_spec.rb index 86a08b20..62c54c32 100644 --- a/spec/features/dashboard/videos_spec.rb +++ b/spec/features/dashboard/videos_spec.rb @@ -1,6 +1,9 @@ require 'rails_helper' RSpec.feature "Dashboard videos", type: :feature do + before { Capybara.default_host = "http://admin.example.com" } + after { Capybara.default_host = "http://www.example.com" } + context "when not logged in" do it "should not be success" do visit dashboard_videos_path @@ -59,6 +62,8 @@ click_button 'Crear Vídeo' }.to change { Video.count }.by 1 + # Test the video does not appear + Capybara.default_host = "http://www.example.com" visit root_path within '.recent-videos' do expect(page).not_to have_link 'My video title' From 3a5a8351780e74f00f0934b92b663bba9bdf3637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=20Rodr=C3=ADguez?= Date: Thu, 10 Aug 2017 18:14:17 +0200 Subject: [PATCH 4/8] Show user email in dashboard header --- app/views/layouts/dashboard/_header.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/dashboard/_header.html.erb b/app/views/layouts/dashboard/_header.html.erb index 9e251715..c210b60e 100644 --- a/app/views/layouts/dashboard/_header.html.erb +++ b/app/views/layouts/dashboard/_header.html.erb @@ -18,7 +18,8 @@ <%= navigation_link t('.users'), [:dashboard, :users] %> From be2372eadbb1adee25ad111b8dc11ded26026436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=20Rodr=C3=ADguez?= Date: Sat, 12 Aug 2017 00:20:30 +0200 Subject: [PATCH 5/8] Replaces admin subdomain with dashboard Same identifier as the dashboard namespace. Plus, less obvious to people typing random addresses in their browser. --- config/routes.rb | 11 ++++------- spec/features/dashboard/dashboard_spec.rb | 2 +- spec/features/dashboard/opinions_spec.rb | 2 +- spec/features/dashboard/playlist_videos_spec.rb | 2 +- spec/features/dashboard/playlists_spec.rb | 2 +- spec/features/dashboard/topics_spec.rb | 2 +- spec/features/dashboard/videos_spec.rb | 2 +- 7 files changed, 10 insertions(+), 13 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 16fc046c..0e494465 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,12 +1,11 @@ Rails.application.routes.draw do - # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html - # Application error routes get '/404', to: 'error#not_found', via: :all get '/422', to: 'error#unprocessable_entity', via: :all get '/500', to: 'error#internal_server_error', via: :all - constraints subdomain: 'admin' do + # Dashboard routes + constraints subdomain: 'dashboard' do devise_for :users, controllers: { sessions: 'users/sessions', passwords: 'users/passwords' } namespace :dashboard, path: '' do root to: 'dashboard#index', as: '' @@ -23,21 +22,19 @@ end end - # This is the public application. + # Main application routes root to: 'front#index' resources :topics, only: [:index, :show], constraints: { format: :html } resources :videos, only: :index, constraints: { format: :html } resources :playlists, path: 'series', only: [:index, :show], constraints: { format: :html } do resources :videos, path: '/', only: [:show], constraints: { format: :html } end - - # These are general purpose pages that don't are resources actually. get :terms, to: 'pages#terms' get :privacy, to: 'pages#privacy' get :disclaimer, to: 'pages#disclaimer' get :cookies, to: 'pages#cookies' - # Redirect old routes. + # Legacy routes (redirect only). get '/videos/:topic/:playlist/episodio/:video' => redirect('/series/%{playlist}/%{video}') get '/videos/:topic/:playlist' => redirect('/series/%{playlist}') get '/videos/:playlist' => redirect('/series/%{playlist}') diff --git a/spec/features/dashboard/dashboard_spec.rb b/spec/features/dashboard/dashboard_spec.rb index 32ab816b..1c453bff 100644 --- a/spec/features/dashboard/dashboard_spec.rb +++ b/spec/features/dashboard/dashboard_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' RSpec.feature "Dashboard", type: :feature do - before { Capybara.default_host = "http://admin.example.com" } + before { Capybara.default_host = "http://dashboard.example.com" } after { Capybara.default_host = "http://www.example.com" } context "when not logged in" do diff --git a/spec/features/dashboard/opinions_spec.rb b/spec/features/dashboard/opinions_spec.rb index 7c1eeb8b..f5ca88b4 100644 --- a/spec/features/dashboard/opinions_spec.rb +++ b/spec/features/dashboard/opinions_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' RSpec.feature "Dashboard opinions", type: :feature do - before { Capybara.default_host = "http://admin.example.com" } + before { Capybara.default_host = "http://dashboard.example.com" } after { Capybara.default_host = "http://www.example.com" } context "when not logged in" do diff --git a/spec/features/dashboard/playlist_videos_spec.rb b/spec/features/dashboard/playlist_videos_spec.rb index 9ab409b6..705e64ba 100644 --- a/spec/features/dashboard/playlist_videos_spec.rb +++ b/spec/features/dashboard/playlist_videos_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' RSpec.feature "Dashboard playlist videos", type: :feature do - before { Capybara.default_host = "http://admin.example.com" } + before { Capybara.default_host = "http://dashboard.example.com" } after { Capybara.default_host = "http://www.example.com" } before(:each) { diff --git a/spec/features/dashboard/playlists_spec.rb b/spec/features/dashboard/playlists_spec.rb index ae6e0879..3a1b2798 100644 --- a/spec/features/dashboard/playlists_spec.rb +++ b/spec/features/dashboard/playlists_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' RSpec.feature "Dashboard playlists", type: :feature do - before { Capybara.default_host = "http://admin.example.com" } + before { Capybara.default_host = "http://dashboard.example.com" } after { Capybara.default_host = "http://www.example.com" } context "when not logged in" do diff --git a/spec/features/dashboard/topics_spec.rb b/spec/features/dashboard/topics_spec.rb index b69bcdf9..3bb402e7 100644 --- a/spec/features/dashboard/topics_spec.rb +++ b/spec/features/dashboard/topics_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' RSpec.feature "Dashboard topics", type: :feature do - before { Capybara.default_host = "http://admin.example.com" } + before { Capybara.default_host = "http://dashboard.example.com" } after { Capybara.default_host = "http://www.example.com" } context "when not logged in" do diff --git a/spec/features/dashboard/videos_spec.rb b/spec/features/dashboard/videos_spec.rb index 62c54c32..a390e918 100644 --- a/spec/features/dashboard/videos_spec.rb +++ b/spec/features/dashboard/videos_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' RSpec.feature "Dashboard videos", type: :feature do - before { Capybara.default_host = "http://admin.example.com" } + before { Capybara.default_host = "http://dashboard.example.com" } after { Capybara.default_host = "http://www.example.com" } context "when not logged in" do From 49489a9e205f1056166076341318c3df9a701d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=20Rodr=C3=ADguez?= Date: Sat, 12 Aug 2017 01:03:48 +0200 Subject: [PATCH 6/8] Drop :dashboard namespace for route helpers Apply this commit to remove the :dashboard namespace on routes made using the route helper. This means that it is not required anymore to link to a dashboard page using dashboard_video_path, it can be done using video_path. It is not required to use [:dashboard, :videos], :videos can just be used. When linking to a public asset through the dashboard, remember to use the subdomain key in the URL helper to make sure the link points to the appropiate subdomain. --- .../dashboard/opinions_controller.rb | 6 ++--- .../dashboard/playlists_controller.rb | 6 ++--- .../dashboard/topics_controller.rb | 6 ++--- app/controllers/dashboard/users_controller.rb | 8 +++---- .../dashboard/videos_controller.rb | 10 ++++---- app/helpers/dashboard/videos_helper.rb | 24 +++++++++---------- app/views/dashboard/dashboard/index.html.erb | 10 ++++---- app/views/dashboard/opinions/_form.html.erb | 2 +- app/views/dashboard/opinions/edit.html.erb | 8 +++---- app/views/dashboard/opinions/index.html.erb | 10 ++++---- app/views/dashboard/opinions/new.html.erb | 6 ++--- app/views/dashboard/opinions/show.html.erb | 8 +++---- app/views/dashboard/playlists/_form.html.erb | 2 +- app/views/dashboard/playlists/edit.html.erb | 8 +++---- app/views/dashboard/playlists/index.html.erb | 14 +++++------ app/views/dashboard/playlists/new.html.erb | 6 ++--- app/views/dashboard/playlists/show.html.erb | 12 +++++----- app/views/dashboard/playlists/videos.html.erb | 20 ++++++++-------- app/views/dashboard/topics/_form.html.erb | 2 +- app/views/dashboard/topics/edit.html.erb | 8 +++---- app/views/dashboard/topics/index.html.erb | 10 ++++---- app/views/dashboard/topics/new.html.erb | 6 ++--- app/views/dashboard/topics/show.html.erb | 10 ++++---- app/views/dashboard/users/_form.html.erb | 2 +- app/views/dashboard/users/edit.html.erb | 8 +++---- app/views/dashboard/users/index.html.erb | 10 ++++---- app/views/dashboard/users/new.html.erb | 6 ++--- app/views/dashboard/users/show.html.erb | 8 +++---- app/views/dashboard/videos/_form.html.erb | 2 +- app/views/dashboard/videos/edit.html.erb | 8 +++---- app/views/dashboard/videos/index.html.erb | 12 +++++----- app/views/dashboard/videos/new.html.erb | 6 ++--- app/views/dashboard/videos/show.html.erb | 10 ++++---- app/views/layouts/dashboard/_header.html.erb | 10 ++++---- config/routes.rb | 2 +- spec/features/dashboard/dashboard_spec.rb | 6 ++--- spec/features/dashboard/opinions_spec.rb | 16 ++++++------- .../dashboard/playlist_videos_spec.rb | 22 ++++++++--------- spec/features/dashboard/playlists_spec.rb | 16 ++++++------- spec/features/dashboard/topics_spec.rb | 16 ++++++------- spec/features/dashboard/videos_spec.rb | 18 +++++++------- spec/helpers/dashboard/videos_helper_spec.rb | 18 +++++++------- 42 files changed, 199 insertions(+), 199 deletions(-) diff --git a/app/controllers/dashboard/opinions_controller.rb b/app/controllers/dashboard/opinions_controller.rb index f5e72de8..50c94ee8 100644 --- a/app/controllers/dashboard/opinions_controller.rb +++ b/app/controllers/dashboard/opinions_controller.rb @@ -13,7 +13,7 @@ def new def create @opinion = Opinion.new(opinion_params) if @opinion.save - redirect_to [:dashboard, :opinions], notice: t('.created') + redirect_to :opinions, notice: t('.created') else render :new end @@ -21,7 +21,7 @@ def create def update if @opinion.update_attributes(opinion_params) - redirect_to [:dashboard, :opinions], notice: t('.updated') + redirect_to :opinions, notice: t('.updated') else render :edit end @@ -29,7 +29,7 @@ def update def destroy @opinion.destroy! - redirect_to [:dashboard, :opinions], notice: t('.destroyed') + redirect_to :opinions, notice: t('.destroyed') end private diff --git a/app/controllers/dashboard/playlists_controller.rb b/app/controllers/dashboard/playlists_controller.rb index f0610ce4..dfe8aa1f 100644 --- a/app/controllers/dashboard/playlists_controller.rb +++ b/app/controllers/dashboard/playlists_controller.rb @@ -13,7 +13,7 @@ def new def create @playlist = Playlist.new(playlist_params) if @playlist.save - redirect_to [:dashboard, @playlist], notice: t('.created') + redirect_to @playlist, notice: t('.created') else render :new end @@ -21,7 +21,7 @@ def create def update if @playlist.update_attributes(playlist_params) - redirect_to [:dashboard, @playlist], notice: t('.updated') + redirect_to @playlist, notice: t('.updated') else render :edit end @@ -29,7 +29,7 @@ def update def destroy @playlist.destroy! - redirect_to [:dashboard, :playlists], notice: t('.destroyed') + redirect_to :playlists, notice: t('.destroyed') end def videos diff --git a/app/controllers/dashboard/topics_controller.rb b/app/controllers/dashboard/topics_controller.rb index b6d24782..d7e2801b 100644 --- a/app/controllers/dashboard/topics_controller.rb +++ b/app/controllers/dashboard/topics_controller.rb @@ -13,7 +13,7 @@ def new def create @topic = Topic.new(topic_params) if @topic.save - redirect_to [:dashboard, @topic], notice: t('.created') + redirect_to @topic, notice: t('.created') else render :new end @@ -21,7 +21,7 @@ def create def update if @topic.update_attributes(topic_params) - redirect_to [:dashboard, @topic], notice: t('.updated') + redirect_to @topic, notice: t('.updated') else render :edit end @@ -29,7 +29,7 @@ def update def destroy @topic.destroy! - redirect_to [:dashboard, :topics], notice: t('.destroyed') + redirect_to :topics, notice: t('.destroyed') end private diff --git a/app/controllers/dashboard/users_controller.rb b/app/controllers/dashboard/users_controller.rb index e3e7cdad..be157d23 100644 --- a/app/controllers/dashboard/users_controller.rb +++ b/app/controllers/dashboard/users_controller.rb @@ -13,7 +13,7 @@ def new def create @user = User.new(user_params) if @user.save - redirect_to [:dashboard, @user], notice: t('.created') + redirect_to @user, notice: t('.created') else render :new end @@ -21,7 +21,7 @@ def create def update if @user.update_attributes(user_params) - redirect_to [:dashboard, @user], notice: t('.updated') + redirect_to @user, notice: t('.updated') else render :edit end @@ -30,9 +30,9 @@ def update def destroy if @user != current_user @user.destroy! - redirect_to [:dashboard, :users], notice: t('.destroyed') + redirect_to :users, notice: t('.destroyed') else - redirect_to [:dashboard, :users], error: t('.current_user') + redirect_to :users, error: t('.current_user') end end diff --git a/app/controllers/dashboard/videos_controller.rb b/app/controllers/dashboard/videos_controller.rb index 199aebc2..e351fe13 100644 --- a/app/controllers/dashboard/videos_controller.rb +++ b/app/controllers/dashboard/videos_controller.rb @@ -13,7 +13,7 @@ def new def create @video = Video.new(video_params) if @video.save - redirect_to [:dashboard, @video.playlist, @video], notice: t('.created') + redirect_to [@video.playlist, @video], notice: t('.created') else render :new end @@ -21,7 +21,7 @@ def create def update if @video.update_attributes(video_params) - redirect_to [:dashboard, @video.playlist, @video], notice: t('.updated') + redirect_to [@video.playlist, @video], notice: t('.updated') else render :edit end @@ -29,7 +29,7 @@ def update def destroy @video.destroy! - redirect_to [:dashboard, :videos], notice: t('.destroyed') + redirect_to :videos, notice: t('.destroyed') end def move @@ -37,11 +37,11 @@ def move if params[:direction] == "up" @video.move_higher format.json { render json: { position: @video.position, direction: "up" } } - format.html { redirect_to [:videos, :dashboard, @video.playlist], notice: t('.moved') } + format.html { redirect_to [:videos, @video.playlist], notice: t('.moved') } elsif params[:direction] == "down" @video.move_lower format.json { render json: { position: @video.position, direction: "down" } } - format.html { redirect_to [:videos, :dashboard, @video.playlist], notice: t('.moved') } + format.html { redirect_to [:videos, @video.playlist], notice: t('.moved') } end end end diff --git a/app/helpers/dashboard/videos_helper.rb b/app/helpers/dashboard/videos_helper.rb index 18ed1db8..aebe9b22 100644 --- a/app/helpers/dashboard/videos_helper.rb +++ b/app/helpers/dashboard/videos_helper.rb @@ -1,25 +1,25 @@ module Dashboard::VideosHelper - def dashboard_video_path(video, options = {}) - dashboard_playlist_video_path(video, options.merge(playlist_id: video.playlist)) + def video_path(video, options = {}) + playlist_video_path(video, options.merge(playlist_id: video.playlist)) end - def edit_dashboard_video_path(video, options = {}) - edit_dashboard_playlist_video_path(video, options.merge(playlist_id: video.playlist)) + def edit_video_path(video, options = {}) + edit_playlist_video_path(video, options.merge(playlist_id: video.playlist)) end - def move_dashboard_video_path(video, options = {}) - move_dashboard_playlist_video_path(video, options.merge(playlist_id: video.playlist)) + def move_video_path(video, options = {}) + move_playlist_video_path(video, options.merge(playlist_id: video.playlist)) end - def dashboard_video_url(video, options = {}) - dashboard_playlist_video_url(video, options.merge(playlist_id: video.playlist)) + def video_url(video, options = {}) + playlist_video_url(video, options.merge(playlist_id: video.playlist)) end - def edit_dashboard_video_url(video, options = {}) - edit_dashboard_playlist_video_url(video, options.merge(playlist_id: video.playlist)) + def edit_video_url(video, options = {}) + edit_playlist_video_url(video, options.merge(playlist_id: video.playlist)) end - def move_dashboard_video_url(video, options = {}) - move_dashboard_playlist_video_url(video, options.merge(playlist_id: video.playlist)) + def move_video_url(video, options = {}) + move_playlist_video_url(video, options.merge(playlist_id: video.playlist)) end end diff --git a/app/views/dashboard/dashboard/index.html.erb b/app/views/dashboard/dashboard/index.html.erb index 6b980e02..dce23b6c 100644 --- a/app/views/dashboard/dashboard/index.html.erb +++ b/app/views/dashboard/dashboard/index.html.erb @@ -10,30 +10,30 @@

<%= @videos %>

<%= t('.videos', count: @videos) %>

-

<%= link_to t('.manage_videos'), [:dashboard, :videos], class: 'btn btn-default btn-block' %>

+

<%= link_to t('.manage_videos'), :videos, class: 'btn btn-default btn-block' %>

<%= @playlists %>

<%= t('.playlists', count: @playlists) %>

-

<%= link_to t('.manage_playlists'), [:dashboard, :playlists], class: 'btn btn-default btn-block' %>

+

<%= link_to t('.manage_playlists'), :playlists, class: 'btn btn-default btn-block' %>

<%= @topics %>

<%= t('.topics', count: @topics) %>

-

<%= link_to t('.manage_topics'), [:dashboard, :topics], class: 'btn btn-default btn-block' %>

+

<%= link_to t('.manage_topics'), :topics, class: 'btn btn-default btn-block' %>

<%= @users %>

<%= t('.users', count: @users) %>

-

<%= link_to t('.manage_users'), [:dashboard, :users], class: 'btn btn-default btn-block' %>

+

<%= link_to t('.manage_users'), :users, class: 'btn btn-default btn-block' %>

<%= @opinions %>

<%= t('.opinions', count: @opinions) %>

-

<%= link_to t('.manage_opinions'), [:dashboard, :opinions], class: 'btn btn-default btn-block' %>

+

<%= link_to t('.manage_opinions'), :opinions, class: 'btn btn-default btn-block' %>

\ No newline at end of file diff --git a/app/views/dashboard/opinions/_form.html.erb b/app/views/dashboard/opinions/_form.html.erb index aa89bc5f..e09d6a2a 100644 --- a/app/views/dashboard/opinions/_form.html.erb +++ b/app/views/dashboard/opinions/_form.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for [:dashboard, @opinion] do |form| %> +<%= simple_form_for @opinion do |form| %> <%= form.input :from %> <%= form.input :message, as: :text %> <%= form.input :url, as: :url %> diff --git a/app/views/dashboard/opinions/edit.html.erb b/app/views/dashboard/opinions/edit.html.erb index c183a8a2..91a4dc12 100644 --- a/app/views/dashboard/opinions/edit.html.erb +++ b/app/views/dashboard/opinions/edit.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @playlist %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), [:dashboard, @opinion], class: 'btn btn-default' %> + <%= link_to t('.cancel'), @opinion, class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/opinions/index.html.erb b/app/views/dashboard/opinions/index.html.erb index 1efc726e..e9934c74 100644 --- a/app/views/dashboard/opinions/index.html.erb +++ b/app/views/dashboard/opinions/index.html.erb @@ -1,13 +1,13 @@ <% content_for :header do %>

<%= t('.opinions') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.new_opinion'), [:new, :dashboard, :opinion], class: 'btn btn-success' %> + <%= link_to t('.new_opinion'), [:new, :opinion], class: 'btn btn-success' %> <% end %> @@ -20,10 +20,10 @@ <% @opinions.each do |opinion| %> - + <% end %> diff --git a/app/views/dashboard/opinions/new.html.erb b/app/views/dashboard/opinions/new.html.erb index 749fde0b..c6c187d0 100644 --- a/app/views/dashboard/opinions/new.html.erb +++ b/app/views/dashboard/opinions/new.html.erb @@ -1,14 +1,14 @@ <% content_for :header do %>

<%= t('.new_opinion') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), [:dashboard, :opinions], class: 'btn btn-default' %> + <%= link_to t('.cancel'), :opinions, class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/opinions/show.html.erb b/app/views/dashboard/opinions/show.html.erb index c1a0bfb0..ebb23675 100644 --- a/app/views/dashboard/opinions/show.html.erb +++ b/app/views/dashboard/opinions/show.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @opinion %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.edit'), [:edit, :dashboard, @opinion], class: 'btn btn-default' %> - <%= button_to t('.destroy'), [:dashboard, @opinion], method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, @opinion], class: 'btn btn-default' %> + <%= button_to t('.destroy'), @opinion, method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> <% end %>
<%= link_to opinion.from, [:dashboard, opinion] %><%= link_to opinion.from, opinion %> - <%= link_to t('.edit'), [:edit, :dashboard, opinion], class: 'btn btn-xs btn-default' %> - <%= button_to t('.destroy'), [:dashboard, opinion], method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, opinion], class: 'btn btn-xs btn-default' %> + <%= button_to t('.destroy'), opinion, method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %>
diff --git a/app/views/dashboard/playlists/_form.html.erb b/app/views/dashboard/playlists/_form.html.erb index 61e73c88..e21fca17 100644 --- a/app/views/dashboard/playlists/_form.html.erb +++ b/app/views/dashboard/playlists/_form.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for [:dashboard, @playlist] do |form| %> +<%= simple_form_for @playlist do |form| %> <%= form.input :title %> <%= form.input :description, as: :text %> <%= form.input :youtube_id %> diff --git a/app/views/dashboard/playlists/edit.html.erb b/app/views/dashboard/playlists/edit.html.erb index b86016ee..78696977 100644 --- a/app/views/dashboard/playlists/edit.html.erb +++ b/app/views/dashboard/playlists/edit.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @playlist %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), [:dashboard, @playlist], class: 'btn btn-default' %> + <%= link_to t('.cancel'), @playlist, class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/playlists/index.html.erb b/app/views/dashboard/playlists/index.html.erb index b4bfc54f..4c520b24 100644 --- a/app/views/dashboard/playlists/index.html.erb +++ b/app/views/dashboard/playlists/index.html.erb @@ -1,13 +1,13 @@ <% content_for :header do %>

<%= t('.playlists') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.new_playlist'), [:new, :dashboard, :playlist], class: 'btn btn-success' %> + <%= link_to t('.new_playlist'), [:new, :playlist], class: 'btn btn-success' %> <% end %>
@@ -22,12 +22,12 @@ <% @playlists.each do |playlist| %> - - - + + + <% end %> diff --git a/app/views/dashboard/playlists/new.html.erb b/app/views/dashboard/playlists/new.html.erb index 09d24b13..a65cbe59 100644 --- a/app/views/dashboard/playlists/new.html.erb +++ b/app/views/dashboard/playlists/new.html.erb @@ -1,14 +1,14 @@ <% content_for :header do %>

<%= t('.new_playlist') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), [:dashboard, :playlists], class: 'btn btn-default' %> + <%= link_to t('.cancel'), :playlists, class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/playlists/show.html.erb b/app/views/dashboard/playlists/show.html.erb index 47925b0e..5b51e303 100644 --- a/app/views/dashboard/playlists/show.html.erb +++ b/app/views/dashboard/playlists/show.html.erb @@ -1,16 +1,16 @@ <% content_for :header do %>

<%= @playlist %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.videos'), [:videos, :dashboard, @playlist], class: 'btn btn-default' %> - <%= link_to t('.edit'), [:edit, :dashboard, @playlist], class: 'btn btn-default' %> - <%= button_to t('.destroy'), [:dashboard, @playlist], method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.videos'), [:videos, @playlist], class: 'btn btn-default' %> + <%= link_to t('.edit'), [:edit, @playlist], class: 'btn btn-default' %> + <%= button_to t('.destroy'), @playlist, method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> <% end %>
<%= link_to playlist.title, [:dashboard, playlist] %><%= link_to playlist.topic.title, [:dashboard, playlist.topic] rescue t('.no_topic') %><%= link_to playlist.videos.length, [:videos, :dashboard, playlist] %><%= link_to playlist.title, playlist %><%= link_to playlist.topic.title, playlist.topic rescue t('.no_topic') %><%= link_to playlist.videos.length, [:videos, playlist] %> - <%= link_to t('.edit'), [:edit, :dashboard, playlist], class: 'btn btn-xs btn-default' %> - <%= button_to t('.destroy'), [:dashboard, playlist], method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, playlist], class: 'btn btn-xs btn-default' %> + <%= button_to t('.destroy'), playlist, method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %>
@@ -28,7 +28,7 @@ - + diff --git a/app/views/dashboard/playlists/videos.html.erb b/app/views/dashboard/playlists/videos.html.erb index 97ba3a92..16630755 100644 --- a/app/views/dashboard/playlists/videos.html.erb +++ b/app/views/dashboard/playlists/videos.html.erb @@ -1,17 +1,17 @@ <% content_for :header do %>

<%= @playlist %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.back'), [:dashboard, @playlist], class: 'btn btn-default' %> - <%= link_to t('.edit'), [:edit, :dashboard, @playlist], class: 'btn btn-default' %> - <%= button_to t('.destroy'), [:dashboard, @playlist], method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.back'), @playlist, class: 'btn btn-default' %> + <%= link_to t('.edit'), [:edit, @playlist], class: 'btn btn-default' %> + <%= button_to t('.destroy'), @playlist, method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> <% end %>
<%= t('.topic') %><%= link_to @playlist.topic.title, [:dashboard, @playlist.topic] rescue t('.no_topic') %><%= link_to @playlist.topic.title, @playlist.topic rescue t('.no_topic') %>
<%= t('.card') %>
@@ -27,13 +27,13 @@ <% @videos.each do |video| %> - + <% end %> diff --git a/app/views/dashboard/topics/_form.html.erb b/app/views/dashboard/topics/_form.html.erb index 957f340a..cd2ba5ad 100644 --- a/app/views/dashboard/topics/_form.html.erb +++ b/app/views/dashboard/topics/_form.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for [:dashboard, @topic] do |form| %> +<%= simple_form_for @topic do |form| %> <%= form.input :title %> <%= form.input :description, as: :text %> <%= form.input :color do %> diff --git a/app/views/dashboard/topics/edit.html.erb b/app/views/dashboard/topics/edit.html.erb index 5047a4c9..391172fb 100644 --- a/app/views/dashboard/topics/edit.html.erb +++ b/app/views/dashboard/topics/edit.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @topic %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), [:dashboard, @topic], class: 'btn btn-default' %> + <%= link_to t('.cancel'), @topic, class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/topics/index.html.erb b/app/views/dashboard/topics/index.html.erb index 9daac209..7fbccb9f 100644 --- a/app/views/dashboard/topics/index.html.erb +++ b/app/views/dashboard/topics/index.html.erb @@ -1,13 +1,13 @@ <% content_for :header do %>

<%= t('.topics') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.new_topic'), [:new, :dashboard, :topic], class: 'btn btn-success' %> + <%= link_to t('.new_topic'), [:new, :topic], class: 'btn btn-success' %> <% end %>
<%= video.position %><%= link_to video.title, [:dashboard, video] %><%= link_to video.title, video %> - <%= button_to t('.up'), move_dashboard_video_path(video), params: { direction: 'up' }, remote: true, method: :put, class: 'video-move-up btn btn-xs btn-info' %> - <%= button_to t('.down'), move_dashboard_video_path(video), params: { direction: 'down' }, remote: true, method: :put, class: 'video-move-down btn btn-xs btn-info' %> + <%= button_to t('.up'), [:move, video], params: { direction: 'up' }, remote: true, method: :put, class: 'video-move-up btn btn-xs btn-info' %> + <%= button_to t('.down'), [:move, video], params: { direction: 'down' }, remote: true, method: :put, class: 'video-move-down btn btn-xs btn-info' %> - <%= link_to t('.edit'), [:edit, :dashboard, video], class: 'btn btn-xs btn-default' %> + <%= link_to t('.edit'), [:edit, video], class: 'btn btn-xs btn-default' %>
@@ -21,11 +21,11 @@ <% @topics.each do |topic| %> - + <% end %> diff --git a/app/views/dashboard/topics/new.html.erb b/app/views/dashboard/topics/new.html.erb index 68bf13ee..7bf32975 100644 --- a/app/views/dashboard/topics/new.html.erb +++ b/app/views/dashboard/topics/new.html.erb @@ -1,14 +1,14 @@ <% content_for :header do %>

<%= t('.new_topic') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), [:dashboard, :topics], class: 'btn btn-default' %> + <%= link_to t('.cancel'), :topics, class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/topics/show.html.erb b/app/views/dashboard/topics/show.html.erb index d128b367..8752ddc0 100644 --- a/app/views/dashboard/topics/show.html.erb +++ b/app/views/dashboard/topics/show.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @topic %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.edit'), [:edit, :dashboard, @topic], class: 'btn btn-default' %> - <%= button_to t('.destroy'), [:dashboard, @topic], method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, @topic], class: 'btn btn-default' %> + <%= button_to t('.destroy'), @topic, method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> <% end %>
<%= link_to topic.title, [:dashboard, topic] %><%= link_to topic.title, topic %> <%= topic.playlists.count %> - <%= link_to t('.edit'), [:edit, :dashboard, topic], class: 'btn btn-xs btn-default' %> - <%= button_to t('.destroy'), [:dashboard, topic], method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, topic], class: 'btn btn-xs btn-default' %> + <%= button_to t('.destroy'), topic, method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %>
@@ -34,7 +34,7 @@ diff --git a/app/views/dashboard/users/_form.html.erb b/app/views/dashboard/users/_form.html.erb index e3e50db6..6add47b4 100644 --- a/app/views/dashboard/users/_form.html.erb +++ b/app/views/dashboard/users/_form.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for [:dashboard, @user] do |form| %> +<%= simple_form_for @user do |form| %> <%= form.input :email %> <%= form.input :password %> <%= form.input :password_confirmation %> diff --git a/app/views/dashboard/users/edit.html.erb b/app/views/dashboard/users/edit.html.erb index 8d1c5ee6..1880bdf4 100644 --- a/app/views/dashboard/users/edit.html.erb +++ b/app/views/dashboard/users/edit.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @user %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), [:dashboard, @user], class: 'btn btn-default' %> + <%= link_to t('.cancel'), @user, class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/users/index.html.erb b/app/views/dashboard/users/index.html.erb index 08b9d0f1..7fe9988f 100644 --- a/app/views/dashboard/users/index.html.erb +++ b/app/views/dashboard/users/index.html.erb @@ -1,13 +1,13 @@ <% content_for :header do %>

<%= t('.users') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.new_user'), [:new, :dashboard, :user], class: 'btn btn-success' %> + <%= link_to t('.new_user'), [:new, :user], class: 'btn btn-success' %> <% end %>
    <% @topic.playlists.each do |playlist| %> -
  • <%= link_to playlist.title, [:dashboard, playlist] %>
  • +
  • <%= link_to playlist.title, playlist %>
  • <% end %>
@@ -21,11 +21,11 @@ <% @users.each do |user| %> - + <% end %> diff --git a/app/views/dashboard/users/new.html.erb b/app/views/dashboard/users/new.html.erb index a1827f18..8e86996f 100644 --- a/app/views/dashboard/users/new.html.erb +++ b/app/views/dashboard/users/new.html.erb @@ -1,14 +1,14 @@ <% content_for :header do %>

<%= t('.new_user') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), [:dashboard, :users], class: 'btn btn-default' %> + <%= link_to t('.cancel'), :users, class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/users/show.html.erb b/app/views/dashboard/users/show.html.erb index 57758dd7..7894a1f4 100644 --- a/app/views/dashboard/users/show.html.erb +++ b/app/views/dashboard/users/show.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @user %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.edit'), [:edit, :dashboard, @user], class: 'btn btn-success' %> - <%= button_to t('.destroy'), [:dashboard, @user], method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') }, disabled: current_user == @user %> + <%= link_to t('.edit'), [:edit, @user], class: 'btn btn-success' %> + <%= button_to t('.destroy'), @user, method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') }, disabled: current_user == @user %> <% end %>
<%= link_to user.email, [:dashboard, user] %><%= link_to user.email, user %> <%= user.last_sign_in_at %> - <%= link_to t('.edit'), [:edit, :dashboard, user], class: 'btn btn-xs btn-default' %> - <%= button_to t('.destroy'), [:dashboard, user], method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') }, disabled: current_user == user %> + <%= link_to t('.edit'), [:edit, user], class: 'btn btn-xs btn-default' %> + <%= button_to t('.destroy'), user, method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') }, disabled: current_user == user %>
diff --git a/app/views/dashboard/videos/_form.html.erb b/app/views/dashboard/videos/_form.html.erb index f5f08878..2a1cf556 100644 --- a/app/views/dashboard/videos/_form.html.erb +++ b/app/views/dashboard/videos/_form.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for [:dashboard, @video] do |form| %> +<%= simple_form_for @video do |form| %> <%= form.input :title %> <%= form.input :description, as: :text %> <%= form.input :youtube_id %> diff --git a/app/views/dashboard/videos/edit.html.erb b/app/views/dashboard/videos/edit.html.erb index d607609c..9a83921a 100644 --- a/app/views/dashboard/videos/edit.html.erb +++ b/app/views/dashboard/videos/edit.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @video %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), [:dashboard, @video], class: 'btn btn-default' %> + <%= link_to t('.cancel'), @video, class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/videos/index.html.erb b/app/views/dashboard/videos/index.html.erb index 06d727c9..4c0c8c64 100644 --- a/app/views/dashboard/videos/index.html.erb +++ b/app/views/dashboard/videos/index.html.erb @@ -1,13 +1,13 @@ <% content_for :header do %>

<%= t('.videos') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.new_video'), [:new, :dashboard, :video], class: 'btn btn-success' %> + <%= link_to t('.new_video'), [:new, :video], class: 'btn btn-success' %> <% end %>
@@ -23,13 +23,13 @@ <% @videos.each do |video| %> - - + + <% end %> diff --git a/app/views/dashboard/videos/new.html.erb b/app/views/dashboard/videos/new.html.erb index 5bf2b56a..fc398846 100644 --- a/app/views/dashboard/videos/new.html.erb +++ b/app/views/dashboard/videos/new.html.erb @@ -1,14 +1,14 @@ <% content_for :header do %>

<%= t('.new_video') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), [:dashboard, :videos], class: 'btn btn-default' %> + <%= link_to t('.cancel'), :videos, class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/videos/show.html.erb b/app/views/dashboard/videos/show.html.erb index a9b39170..bdc7033a 100644 --- a/app/views/dashboard/videos/show.html.erb +++ b/app/views/dashboard/videos/show.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @video %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.edit'), [:edit, :dashboard, @video], class: 'btn btn-default' %> - <%= button_to t('.destroy'), [:dashboard, @video], method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, @video], class: 'btn btn-default' %> + <%= button_to t('.destroy'), @video, method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> <% end %>
<%= link_to video.title, [:dashboard, video] %><%= link_to video.playlist.title, [:dashboard, video.playlist] %><%= link_to video.title, video %><%= link_to video.playlist.title, video.playlist %> <%= l video.published_at, format: :long %> <%= distance_of_time_in_words video.updated_at, DateTime.now %> - <%= link_to t('.edit'), [:edit, :dashboard, video], class: 'btn btn-xs btn-default' %> - <%= button_to t('.destroy'), [:dashboard, video], method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, video], class: 'btn btn-xs btn-default' %> + <%= button_to t('.destroy'), video, method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %>
@@ -31,7 +31,7 @@ - + diff --git a/app/views/layouts/dashboard/_header.html.erb b/app/views/layouts/dashboard/_header.html.erb index c210b60e..d358795d 100644 --- a/app/views/layouts/dashboard/_header.html.erb +++ b/app/views/layouts/dashboard/_header.html.erb @@ -8,14 +8,14 @@ - <%= link_to 'makigas', :dashboard, class: 'navbar-brand'%> + <%= link_to 'makigas', :root, class: 'navbar-brand'%> \ No newline at end of file diff --git a/app/views/dashboard/opinions/_form.html.erb b/app/views/dashboard/opinions/_form.html.erb index e09d6a2a..aa89bc5f 100644 --- a/app/views/dashboard/opinions/_form.html.erb +++ b/app/views/dashboard/opinions/_form.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for @opinion do |form| %> +<%= simple_form_for [:dashboard, @opinion] do |form| %> <%= form.input :from %> <%= form.input :message, as: :text %> <%= form.input :url, as: :url %> diff --git a/app/views/dashboard/opinions/edit.html.erb b/app/views/dashboard/opinions/edit.html.erb index 91a4dc12..c183a8a2 100644 --- a/app/views/dashboard/opinions/edit.html.erb +++ b/app/views/dashboard/opinions/edit.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @playlist %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), @opinion, class: 'btn btn-default' %> + <%= link_to t('.cancel'), [:dashboard, @opinion], class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/opinions/index.html.erb b/app/views/dashboard/opinions/index.html.erb index e9934c74..1efc726e 100644 --- a/app/views/dashboard/opinions/index.html.erb +++ b/app/views/dashboard/opinions/index.html.erb @@ -1,13 +1,13 @@ <% content_for :header do %>

<%= t('.opinions') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.new_opinion'), [:new, :opinion], class: 'btn btn-success' %> + <%= link_to t('.new_opinion'), [:new, :dashboard, :opinion], class: 'btn btn-success' %> <% end %>
<%= t('.playlist') %><%= link_to @video.playlist.title, [:dashboard, @video.playlist] %><%= link_to @video.playlist.title, @video.playlist %>
<%= t('.published_at') %>
@@ -20,10 +20,10 @@ <% @opinions.each do |opinion| %> - + <% end %> diff --git a/app/views/dashboard/opinions/new.html.erb b/app/views/dashboard/opinions/new.html.erb index c6c187d0..749fde0b 100644 --- a/app/views/dashboard/opinions/new.html.erb +++ b/app/views/dashboard/opinions/new.html.erb @@ -1,14 +1,14 @@ <% content_for :header do %>

<%= t('.new_opinion') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), :opinions, class: 'btn btn-default' %> + <%= link_to t('.cancel'), [:dashboard, :opinions], class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/opinions/show.html.erb b/app/views/dashboard/opinions/show.html.erb index ebb23675..c1a0bfb0 100644 --- a/app/views/dashboard/opinions/show.html.erb +++ b/app/views/dashboard/opinions/show.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @opinion %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.edit'), [:edit, @opinion], class: 'btn btn-default' %> - <%= button_to t('.destroy'), @opinion, method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, :dashboard, @opinion], class: 'btn btn-default' %> + <%= button_to t('.destroy'), [:dashboard, @opinion], method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> <% end %>
<%= link_to opinion.from, opinion %><%= link_to opinion.from, [:dashboard, opinion] %> - <%= link_to t('.edit'), [:edit, opinion], class: 'btn btn-xs btn-default' %> - <%= button_to t('.destroy'), opinion, method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, :dashboard, opinion], class: 'btn btn-xs btn-default' %> + <%= button_to t('.destroy'), [:dashboard, opinion], method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %>
diff --git a/app/views/dashboard/playlists/_form.html.erb b/app/views/dashboard/playlists/_form.html.erb index e21fca17..61e73c88 100644 --- a/app/views/dashboard/playlists/_form.html.erb +++ b/app/views/dashboard/playlists/_form.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for @playlist do |form| %> +<%= simple_form_for [:dashboard, @playlist] do |form| %> <%= form.input :title %> <%= form.input :description, as: :text %> <%= form.input :youtube_id %> diff --git a/app/views/dashboard/playlists/edit.html.erb b/app/views/dashboard/playlists/edit.html.erb index 78696977..b86016ee 100644 --- a/app/views/dashboard/playlists/edit.html.erb +++ b/app/views/dashboard/playlists/edit.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @playlist %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), @playlist, class: 'btn btn-default' %> + <%= link_to t('.cancel'), [:dashboard, @playlist], class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/playlists/index.html.erb b/app/views/dashboard/playlists/index.html.erb index 4c520b24..b4bfc54f 100644 --- a/app/views/dashboard/playlists/index.html.erb +++ b/app/views/dashboard/playlists/index.html.erb @@ -1,13 +1,13 @@ <% content_for :header do %>

<%= t('.playlists') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.new_playlist'), [:new, :playlist], class: 'btn btn-success' %> + <%= link_to t('.new_playlist'), [:new, :dashboard, :playlist], class: 'btn btn-success' %> <% end %>
@@ -22,12 +22,12 @@ <% @playlists.each do |playlist| %> - - - + + + <% end %> diff --git a/app/views/dashboard/playlists/new.html.erb b/app/views/dashboard/playlists/new.html.erb index a65cbe59..09d24b13 100644 --- a/app/views/dashboard/playlists/new.html.erb +++ b/app/views/dashboard/playlists/new.html.erb @@ -1,14 +1,14 @@ <% content_for :header do %>

<%= t('.new_playlist') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), :playlists, class: 'btn btn-default' %> + <%= link_to t('.cancel'), [:dashboard, :playlists], class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/playlists/show.html.erb b/app/views/dashboard/playlists/show.html.erb index 5b51e303..47925b0e 100644 --- a/app/views/dashboard/playlists/show.html.erb +++ b/app/views/dashboard/playlists/show.html.erb @@ -1,16 +1,16 @@ <% content_for :header do %>

<%= @playlist %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.videos'), [:videos, @playlist], class: 'btn btn-default' %> - <%= link_to t('.edit'), [:edit, @playlist], class: 'btn btn-default' %> - <%= button_to t('.destroy'), @playlist, method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.videos'), [:videos, :dashboard, @playlist], class: 'btn btn-default' %> + <%= link_to t('.edit'), [:edit, :dashboard, @playlist], class: 'btn btn-default' %> + <%= button_to t('.destroy'), [:dashboard, @playlist], method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> <% end %>
<%= link_to playlist.title, playlist %><%= link_to playlist.topic.title, playlist.topic rescue t('.no_topic') %><%= link_to playlist.videos.length, [:videos, playlist] %><%= link_to playlist.title, [:dashboard, playlist] %><%= link_to playlist.topic.title, [:dashboard, playlist.topic] rescue t('.no_topic') %><%= link_to playlist.videos.length, [:videos, :dashboard, playlist] %> - <%= link_to t('.edit'), [:edit, playlist], class: 'btn btn-xs btn-default' %> - <%= button_to t('.destroy'), playlist, method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, :dashboard, playlist], class: 'btn btn-xs btn-default' %> + <%= button_to t('.destroy'), [:dashboard, playlist], method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %>
@@ -28,7 +28,7 @@ - + diff --git a/app/views/dashboard/playlists/videos.html.erb b/app/views/dashboard/playlists/videos.html.erb index 16630755..97ba3a92 100644 --- a/app/views/dashboard/playlists/videos.html.erb +++ b/app/views/dashboard/playlists/videos.html.erb @@ -1,17 +1,17 @@ <% content_for :header do %>

<%= @playlist %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.back'), @playlist, class: 'btn btn-default' %> - <%= link_to t('.edit'), [:edit, @playlist], class: 'btn btn-default' %> - <%= button_to t('.destroy'), @playlist, method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.back'), [:dashboard, @playlist], class: 'btn btn-default' %> + <%= link_to t('.edit'), [:edit, :dashboard, @playlist], class: 'btn btn-default' %> + <%= button_to t('.destroy'), [:dashboard, @playlist], method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> <% end %>
<%= t('.topic') %><%= link_to @playlist.topic.title, @playlist.topic rescue t('.no_topic') %><%= link_to @playlist.topic.title, [:dashboard, @playlist.topic] rescue t('.no_topic') %>
<%= t('.card') %>
@@ -27,13 +27,13 @@ <% @videos.each do |video| %> - + <% end %> diff --git a/app/views/dashboard/topics/_form.html.erb b/app/views/dashboard/topics/_form.html.erb index cd2ba5ad..957f340a 100644 --- a/app/views/dashboard/topics/_form.html.erb +++ b/app/views/dashboard/topics/_form.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for @topic do |form| %> +<%= simple_form_for [:dashboard, @topic] do |form| %> <%= form.input :title %> <%= form.input :description, as: :text %> <%= form.input :color do %> diff --git a/app/views/dashboard/topics/edit.html.erb b/app/views/dashboard/topics/edit.html.erb index 391172fb..5047a4c9 100644 --- a/app/views/dashboard/topics/edit.html.erb +++ b/app/views/dashboard/topics/edit.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @topic %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), @topic, class: 'btn btn-default' %> + <%= link_to t('.cancel'), [:dashboard, @topic], class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/topics/index.html.erb b/app/views/dashboard/topics/index.html.erb index 7fbccb9f..9daac209 100644 --- a/app/views/dashboard/topics/index.html.erb +++ b/app/views/dashboard/topics/index.html.erb @@ -1,13 +1,13 @@ <% content_for :header do %>

<%= t('.topics') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.new_topic'), [:new, :topic], class: 'btn btn-success' %> + <%= link_to t('.new_topic'), [:new, :dashboard, :topic], class: 'btn btn-success' %> <% end %>
<%= video.position %><%= link_to video.title, video %><%= link_to video.title, [:dashboard, video] %> - <%= button_to t('.up'), [:move, video], params: { direction: 'up' }, remote: true, method: :put, class: 'video-move-up btn btn-xs btn-info' %> - <%= button_to t('.down'), [:move, video], params: { direction: 'down' }, remote: true, method: :put, class: 'video-move-down btn btn-xs btn-info' %> + <%= button_to t('.up'), move_dashboard_video_path(video), params: { direction: 'up' }, remote: true, method: :put, class: 'video-move-up btn btn-xs btn-info' %> + <%= button_to t('.down'), move_dashboard_video_path(video), params: { direction: 'down' }, remote: true, method: :put, class: 'video-move-down btn btn-xs btn-info' %> - <%= link_to t('.edit'), [:edit, video], class: 'btn btn-xs btn-default' %> + <%= link_to t('.edit'), [:edit, :dashboard, video], class: 'btn btn-xs btn-default' %>
@@ -21,11 +21,11 @@ <% @topics.each do |topic| %> - + <% end %> diff --git a/app/views/dashboard/topics/new.html.erb b/app/views/dashboard/topics/new.html.erb index 7bf32975..68bf13ee 100644 --- a/app/views/dashboard/topics/new.html.erb +++ b/app/views/dashboard/topics/new.html.erb @@ -1,14 +1,14 @@ <% content_for :header do %>

<%= t('.new_topic') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), :topics, class: 'btn btn-default' %> + <%= link_to t('.cancel'), [:dashboard, :topics], class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/topics/show.html.erb b/app/views/dashboard/topics/show.html.erb index 8752ddc0..d128b367 100644 --- a/app/views/dashboard/topics/show.html.erb +++ b/app/views/dashboard/topics/show.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @topic %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.edit'), [:edit, @topic], class: 'btn btn-default' %> - <%= button_to t('.destroy'), @topic, method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, :dashboard, @topic], class: 'btn btn-default' %> + <%= button_to t('.destroy'), [:dashboard, @topic], method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> <% end %>
<%= link_to topic.title, topic %><%= link_to topic.title, [:dashboard, topic] %> <%= topic.playlists.count %> - <%= link_to t('.edit'), [:edit, topic], class: 'btn btn-xs btn-default' %> - <%= button_to t('.destroy'), topic, method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, :dashboard, topic], class: 'btn btn-xs btn-default' %> + <%= button_to t('.destroy'), [:dashboard, topic], method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %>
@@ -34,7 +34,7 @@ diff --git a/app/views/dashboard/users/_form.html.erb b/app/views/dashboard/users/_form.html.erb index 6add47b4..e3e50db6 100644 --- a/app/views/dashboard/users/_form.html.erb +++ b/app/views/dashboard/users/_form.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for @user do |form| %> +<%= simple_form_for [:dashboard, @user] do |form| %> <%= form.input :email %> <%= form.input :password %> <%= form.input :password_confirmation %> diff --git a/app/views/dashboard/users/edit.html.erb b/app/views/dashboard/users/edit.html.erb index 1880bdf4..8d1c5ee6 100644 --- a/app/views/dashboard/users/edit.html.erb +++ b/app/views/dashboard/users/edit.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @user %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), @user, class: 'btn btn-default' %> + <%= link_to t('.cancel'), [:dashboard, @user], class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/users/index.html.erb b/app/views/dashboard/users/index.html.erb index 7fe9988f..08b9d0f1 100644 --- a/app/views/dashboard/users/index.html.erb +++ b/app/views/dashboard/users/index.html.erb @@ -1,13 +1,13 @@ <% content_for :header do %>

<%= t('.users') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.new_user'), [:new, :user], class: 'btn btn-success' %> + <%= link_to t('.new_user'), [:new, :dashboard, :user], class: 'btn btn-success' %> <% end %>
    <% @topic.playlists.each do |playlist| %> -
  • <%= link_to playlist.title, playlist %>
  • +
  • <%= link_to playlist.title, [:dashboard, playlist] %>
  • <% end %>
@@ -21,11 +21,11 @@ <% @users.each do |user| %> - + <% end %> diff --git a/app/views/dashboard/users/new.html.erb b/app/views/dashboard/users/new.html.erb index 8e86996f..a1827f18 100644 --- a/app/views/dashboard/users/new.html.erb +++ b/app/views/dashboard/users/new.html.erb @@ -1,14 +1,14 @@ <% content_for :header do %>

<%= t('.new_user') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), :users, class: 'btn btn-default' %> + <%= link_to t('.cancel'), [:dashboard, :users], class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/users/show.html.erb b/app/views/dashboard/users/show.html.erb index 7894a1f4..57758dd7 100644 --- a/app/views/dashboard/users/show.html.erb +++ b/app/views/dashboard/users/show.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @user %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.edit'), [:edit, @user], class: 'btn btn-success' %> - <%= button_to t('.destroy'), @user, method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') }, disabled: current_user == @user %> + <%= link_to t('.edit'), [:edit, :dashboard, @user], class: 'btn btn-success' %> + <%= button_to t('.destroy'), [:dashboard, @user], method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') }, disabled: current_user == @user %> <% end %>
<%= link_to user.email, user %><%= link_to user.email, [:dashboard, user] %> <%= user.last_sign_in_at %> - <%= link_to t('.edit'), [:edit, user], class: 'btn btn-xs btn-default' %> - <%= button_to t('.destroy'), user, method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') }, disabled: current_user == user %> + <%= link_to t('.edit'), [:edit, :dashboard, user], class: 'btn btn-xs btn-default' %> + <%= button_to t('.destroy'), [:dashboard, user], method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') }, disabled: current_user == user %>
diff --git a/app/views/dashboard/videos/_form.html.erb b/app/views/dashboard/videos/_form.html.erb index 2a1cf556..f5f08878 100644 --- a/app/views/dashboard/videos/_form.html.erb +++ b/app/views/dashboard/videos/_form.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for @video do |form| %> +<%= simple_form_for [:dashboard, @video] do |form| %> <%= form.input :title %> <%= form.input :description, as: :text %> <%= form.input :youtube_id %> diff --git a/app/views/dashboard/videos/edit.html.erb b/app/views/dashboard/videos/edit.html.erb index 9a83921a..d607609c 100644 --- a/app/views/dashboard/videos/edit.html.erb +++ b/app/views/dashboard/videos/edit.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @video %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), @video, class: 'btn btn-default' %> + <%= link_to t('.cancel'), [:dashboard, @video], class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/videos/index.html.erb b/app/views/dashboard/videos/index.html.erb index 4c0c8c64..06d727c9 100644 --- a/app/views/dashboard/videos/index.html.erb +++ b/app/views/dashboard/videos/index.html.erb @@ -1,13 +1,13 @@ <% content_for :header do %>

<%= t('.videos') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.new_video'), [:new, :video], class: 'btn btn-success' %> + <%= link_to t('.new_video'), [:new, :dashboard, :video], class: 'btn btn-success' %> <% end %>
@@ -23,13 +23,13 @@ <% @videos.each do |video| %> - - + + <% end %> diff --git a/app/views/dashboard/videos/new.html.erb b/app/views/dashboard/videos/new.html.erb index fc398846..5bf2b56a 100644 --- a/app/views/dashboard/videos/new.html.erb +++ b/app/views/dashboard/videos/new.html.erb @@ -1,14 +1,14 @@ <% content_for :header do %>

<%= t('.new_video') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), :videos, class: 'btn btn-default' %> + <%= link_to t('.cancel'), [:dashboard, :videos], class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/videos/show.html.erb b/app/views/dashboard/videos/show.html.erb index bdc7033a..a9b39170 100644 --- a/app/views/dashboard/videos/show.html.erb +++ b/app/views/dashboard/videos/show.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @video %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.edit'), [:edit, @video], class: 'btn btn-default' %> - <%= button_to t('.destroy'), @video, method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, :dashboard, @video], class: 'btn btn-default' %> + <%= button_to t('.destroy'), [:dashboard, @video], method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> <% end %>
<%= link_to video.title, video %><%= link_to video.playlist.title, video.playlist %><%= link_to video.title, [:dashboard, video] %><%= link_to video.playlist.title, [:dashboard, video.playlist] %> <%= l video.published_at, format: :long %> <%= distance_of_time_in_words video.updated_at, DateTime.now %> - <%= link_to t('.edit'), [:edit, video], class: 'btn btn-xs btn-default' %> - <%= button_to t('.destroy'), video, method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, :dashboard, video], class: 'btn btn-xs btn-default' %> + <%= button_to t('.destroy'), [:dashboard, video], method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %>
@@ -31,7 +31,7 @@ - + diff --git a/app/views/layouts/dashboard/_header.html.erb b/app/views/layouts/dashboard/_header.html.erb index d358795d..c210b60e 100644 --- a/app/views/layouts/dashboard/_header.html.erb +++ b/app/views/layouts/dashboard/_header.html.erb @@ -8,14 +8,14 @@ - <%= link_to 'makigas', :root, class: 'navbar-brand'%> + <%= link_to 'makigas', :dashboard, class: 'navbar-brand'%>
<%= t('.playlist') %><%= link_to @video.playlist.title, @video.playlist %><%= link_to @video.playlist.title, [:dashboard, @video.playlist] %>
<%= t('.published_at') %>