From 31e36cf9eb346c5bf10dfc3e50e69e1b5d87d85e Mon Sep 17 00:00:00 2001 From: r888888888 Date: Fri, 17 Nov 2017 13:59:14 -0800 Subject: [PATCH] remove unused mobile layouts --- app/assets/stylesheets/specific/tags.scss | 4 ---- app/controllers/favorites_controller.rb | 8 -------- app/controllers/mobile/posts_controller.rb | 18 ------------------ app/views/layouts/mobile.html.erb | 21 --------------------- config/routes.rb | 5 ----- public/robots.txt | 1 - 6 files changed, 57 deletions(-) delete mode 100644 app/controllers/mobile/posts_controller.rb delete mode 100644 app/views/layouts/mobile.html.erb diff --git a/app/assets/stylesheets/specific/tags.scss b/app/assets/stylesheets/specific/tags.scss index 39b0593b7..f94a9f431 100644 --- a/app/assets/stylesheets/specific/tags.scss +++ b/app/assets/stylesheets/specific/tags.scss @@ -11,7 +11,3 @@ div#c-tags { } } } - -#mobile-tag-list { - display: none; -} diff --git a/app/controllers/favorites_controller.rb b/app/controllers/favorites_controller.rb index e006e6bed..564a5a11f 100644 --- a/app/controllers/favorites_controller.rb +++ b/app/controllers/favorites_controller.rb @@ -32,9 +32,6 @@ class FavoritesController < ApplicationController end respond_with(@post) do |format| - format.html do - redirect_to(mobile_post_path(@post)) - end format.js format.json do if @post @@ -51,16 +48,11 @@ class FavoritesController < ApplicationController if @post @post.remove_favorite!(CurrentUser.user) - path = mobile_post_path(@post) else Favorite.remove(post_id: params[:id], user: CurrentUser.user) - path = mobile_posts_path end respond_with(@post) do |format| - format.html do - redirect_to(path) - end format.js format.json do render :json => {:success => true}.to_json diff --git a/app/controllers/mobile/posts_controller.rb b/app/controllers/mobile/posts_controller.rb deleted file mode 100644 index 7f1c95b7b..000000000 --- a/app/controllers/mobile/posts_controller.rb +++ /dev/null @@ -1,18 +0,0 @@ -class Mobile::PostsController < ApplicationController - layout "mobile" - before_filter :set_mobile_mode - - def index - @post_set = PostSets::Post.new(params[:tags], params[:page], CurrentUser.user.per_page, raw: false) - @posts = @post_set.posts - end - - def show - @post = Post.find(params[:id]) - end - -private - def set_mobile_mode - CurrentUser.mobile_mode = true - end -end diff --git a/app/views/layouts/mobile.html.erb b/app/views/layouts/mobile.html.erb deleted file mode 100644 index eb7cd5ca1..000000000 --- a/app/views/layouts/mobile.html.erb +++ /dev/null @@ -1,21 +0,0 @@ - - - - <%= yield :page_title %> - - <%= csrf_meta_tag %> - <%= stylesheet_link_tag "mobile", :media => "screen" %> - <%= javascript_include_tag "jquery-1.11.1.min.js" %> - <%= javascript_include_tag "rails.js" %> - <%= Danbooru.config.custom_html_header_content %> - <%= yield :html_header %> - - -
-

<%= link_to Danbooru.config.app_name, "/" %>

-
-
- <%= yield :layout %> -
- - diff --git a/config/routes.rb b/config/routes.rb index 1f6f24d61..9e8e17021 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,9 +5,6 @@ Rails.application.routes.draw do resource :alias_and_implication_import, :only => [:new, :create] resource :dashboard, :only => [:show] end - namespace :mobile do - resources :posts, :only => [:index, :show] - end namespace :moderator do resource :bulk_revert, :only => [:new, :create] resource :dashboard, :only => [:show] @@ -329,8 +326,6 @@ Rails.application.routes.draw do resources :wpages, :controller => "wiki_pages" resources :ftopics, :controller => "forum_topics" resources :fposts, :controller => "forum_posts" - get "/m/posts", :controller => "mobile/posts", :action => "index" - get "/m/posts/:id", :controller => "mobile/posts", :action => "show" # legacy aliases get "/artist" => redirect {|params, req| "/artists?page=#{req.params[:page]}&search[name]=#{CGI::escape(req.params[:name].to_s)}"} diff --git a/public/robots.txt b/public/robots.txt index 017f78e6f..1ded15aa8 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -16,7 +16,6 @@ Disallow: /iqdb_queries Disallow: /ip_bans Disallow: /janitor_trials Disallow: /maintenance -Disallow: /mobile/ Disallow: /m/ Disallow: /mod_actions Disallow: /moderator