diff --git a/app/controllers/artists_controller.rb b/app/controllers/artists_controller.rb index 77aae6f7d..8ba5bb468 100644 --- a/app/controllers/artists_controller.rb +++ b/app/controllers/artists_controller.rb @@ -1,6 +1,6 @@ class ArtistsController < ApplicationController respond_to :html, :xml, :json - before_filter :member_only, :except => [:index, :show, :banned] + before_filter :member_only, :except => [:index, :show, :show_or_new, :banned] before_filter :builder_only, :only => [:destroy] before_filter :admin_only, :only => [:ban, :unban] before_filter :load_artist, :only => [:ban, :unban, :show, :edit, :update, :destroy, :undelete] @@ -93,7 +93,9 @@ class ArtistsController < ApplicationController if @artist redirect_to artist_path(@artist) else - redirect_to new_artist_path(:name => params[:name]) + @artist = Artist.new(name: params[:name]) + @post_set = PostSets::Artist.new(@artist) + respond_with(@artist) end end diff --git a/app/controllers/bulk_update_requests_controller.rb b/app/controllers/bulk_update_requests_controller.rb index 57214efe6..49b6be349 100644 --- a/app/controllers/bulk_update_requests_controller.rb +++ b/app/controllers/bulk_update_requests_controller.rb @@ -1,6 +1,6 @@ class BulkUpdateRequestsController < ApplicationController respond_to :html, :xml, :json, :js - before_filter :member_only + before_filter :member_only, :except => [:index, :show] before_filter :admin_only, :only => [:approve] before_filter :load_bulk_update_request, :except => [:new, :create, :index] diff --git a/app/controllers/dmails_controller.rb b/app/controllers/dmails_controller.rb index 3a27011af..1ffc2abf5 100644 --- a/app/controllers/dmails_controller.rb +++ b/app/controllers/dmails_controller.rb @@ -1,6 +1,6 @@ class DmailsController < ApplicationController respond_to :html, :xml, :json - before_filter :member_only + before_filter :member_only, except: [:index, :show, :destroy, :mark_all_as_read] def new if params[:respond_to_id] diff --git a/app/controllers/favorites_controller.rb b/app/controllers/favorites_controller.rb index 2623cee9c..895b9c32e 100644 --- a/app/controllers/favorites_controller.rb +++ b/app/controllers/favorites_controller.rb @@ -1,5 +1,5 @@ class FavoritesController < ApplicationController - before_filter :member_only + before_filter :member_only, except: [:index] respond_to :html, :xml, :json skip_before_filter :api_check diff --git a/app/controllers/forum_posts_controller.rb b/app/controllers/forum_posts_controller.rb index e3970036a..c69c61a7b 100644 --- a/app/controllers/forum_posts_controller.rb +++ b/app/controllers/forum_posts_controller.rb @@ -1,6 +1,6 @@ class ForumPostsController < ApplicationController respond_to :html, :xml, :json, :js - before_filter :member_only, :except => [:index, :show] + before_filter :member_only, :except => [:index, :show, :search] before_filter :load_post, :only => [:edit, :show, :update, :destroy, :undelete] before_filter :check_min_level, :only => [:edit, :show, :update, :destroy, :undelete] skip_before_filter :api_check diff --git a/app/controllers/iqdb_queries_controller.rb b/app/controllers/iqdb_queries_controller.rb index e5b88b425..abd23e002 100644 --- a/app/controllers/iqdb_queries_controller.rb +++ b/app/controllers/iqdb_queries_controller.rb @@ -1,6 +1,5 @@ # todo: move this to iqdbs class IqdbQueriesController < ApplicationController - before_filter :member_only respond_to :html, :json, :xml def index diff --git a/app/controllers/maintenance/user/api_keys_controller.rb b/app/controllers/maintenance/user/api_keys_controller.rb index 8f4844be4..e29330524 100644 --- a/app/controllers/maintenance/user/api_keys_controller.rb +++ b/app/controllers/maintenance/user/api_keys_controller.rb @@ -1,7 +1,6 @@ module Maintenance module User class ApiKeysController < ApplicationController - before_filter :member_only before_filter :check_privilege before_filter :authenticate!, :except => [:show] rescue_from ::SessionLoader::AuthenticationFailure, :with => :authentication_failed diff --git a/app/controllers/maintenance/user/dmail_filters_controller.rb b/app/controllers/maintenance/user/dmail_filters_controller.rb index f5a0ce855..040d5e532 100644 --- a/app/controllers/maintenance/user/dmail_filters_controller.rb +++ b/app/controllers/maintenance/user/dmail_filters_controller.rb @@ -2,7 +2,6 @@ module Maintenance module User class DmailFiltersController < ApplicationController before_filter :ensure_ownership - before_filter :member_only respond_to :html, :json, :xml def edit diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index bed70f667..d4648a971 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -1,6 +1,6 @@ class NotesController < ApplicationController respond_to :html, :xml, :json, :js - before_filter :member_only, :except => [:index, :show] + before_filter :member_only, :except => [:index, :show, :search] def search end diff --git a/app/controllers/reports_controller.rb b/app/controllers/reports_controller.rb index afd255094..95478709b 100644 --- a/app/controllers/reports_controller.rb +++ b/app/controllers/reports_controller.rb @@ -1,5 +1,5 @@ class ReportsController < ApplicationController - before_filter :member_only + before_filter :member_only, :except => [:upload_tags] before_filter :gold_only, :only => [:similar_users] before_filter :moderator_only, :only => [:post_versions, :post_versions_create] diff --git a/app/controllers/saved_searches_controller.rb b/app/controllers/saved_searches_controller.rb index 83d02d062..67c41c4c7 100644 --- a/app/controllers/saved_searches_controller.rb +++ b/app/controllers/saved_searches_controller.rb @@ -1,5 +1,4 @@ class SavedSearchesController < ApplicationController - before_filter :member_only before_filter :check_availability respond_to :html, :xml, :json, :js diff --git a/app/controllers/uploads_controller.rb b/app/controllers/uploads_controller.rb index 66207db1c..d2228ac30 100644 --- a/app/controllers/uploads_controller.rb +++ b/app/controllers/uploads_controller.rb @@ -1,5 +1,5 @@ class UploadsController < ApplicationController - before_filter :member_only + before_filter :member_only, except: [:index, :show] respond_to :html, :xml, :json, :js def new diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index d501df51f..b837dc652 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,6 +1,5 @@ class UsersController < ApplicationController respond_to :html, :xml, :json - before_filter :member_only, :only => [:edit, :update] skip_before_filter :api_check def new diff --git a/app/controllers/wiki_pages_controller.rb b/app/controllers/wiki_pages_controller.rb index 213aefb29..ae707acc9 100644 --- a/app/controllers/wiki_pages_controller.rb +++ b/app/controllers/wiki_pages_controller.rb @@ -1,6 +1,6 @@ class WikiPagesController < ApplicationController respond_to :html, :xml, :json, :js - before_filter :member_only, :except => [:index, :show, :show_or_new] + before_filter :member_only, :except => [:index, :search, :show, :show_or_new] before_filter :builder_only, :only => [:destroy] before_filter :normalize_search_params, :only => [:index] @@ -32,6 +32,9 @@ class WikiPagesController < ApplicationController end end + def search + end + def show if params[:id] =~ /\A\d+\Z/ @wiki_page = WikiPage.find(params[:id]) diff --git a/app/views/artists/_show.html.erb b/app/views/artists/_show.html.erb new file mode 100644 index 000000000..d36f490f6 --- /dev/null +++ b/app/views/artists/_show.html.erb @@ -0,0 +1,28 @@ +
<%= link_to "View wiki page", @artist.wiki_page %>
+ <% end %> + + <%= yield %> + +<%= link_to "View wiki page", @artist.wiki_page %>
- <% end %> - - <% if @artist.visible? %> -The artist requested removal of this page.
- <% end %> - -The artist requested removal of this page.
+ <% end %> <% end %> diff --git a/app/views/artists/show_or_new.html.erb b/app/views/artists/show_or_new.html.erb new file mode 100644 index 000000000..221f69869 --- /dev/null +++ b/app/views/artists/show_or_new.html.erb @@ -0,0 +1,5 @@ +<%= render layout: "show" do %> +This artist entry does not exist. <%= link_to "Create new artist entry", new_artist_path(name: params[:name]) %>.
+