diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 0ef93728e..e49cb7055 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -194,7 +194,7 @@ menu { li { margin: 0; - padding: 0; + padding: 0 1em 0 0; list-style-type: none; display: inline; } @@ -253,6 +253,10 @@ span.ui-icon { margin-right: 0.25em; } +strong { + font-weight: bold; +} + table tfoot { margin-top: 2em; } diff --git a/app/controllers/artists_controller.rb b/app/controllers/artists_controller.rb index c12590cb4..33f226937 100644 --- a/app/controllers/artists_controller.rb +++ b/app/controllers/artists_controller.rb @@ -24,11 +24,7 @@ class ArtistsController < ApplicationController def show @artist = Artist.find(params[:id]) - - if @artist - @posts = Danbooru.config.select_posts_visible_to_user(CurrentUser.user, Post.tag_match(@artist.name).limit(6)) - end - + @post_set = PostSets::Artist.new(@artist) respond_with(@artist) end diff --git a/app/controllers/favorites_controller.rb b/app/controllers/favorites_controller.rb index da5ca2d47..ad6b4c6ea 100644 --- a/app/controllers/favorites_controller.rb +++ b/app/controllers/favorites_controller.rb @@ -8,10 +8,10 @@ class FavoritesController < ApplicationController end def create - Post.find(params[:id]).add_favorite(CurrentUser.user) + Post.find(params[:post_id]).add_favorite!(CurrentUser.user) end def destroy - Post.find(params[:id]).remove_favorite(CurrentUser.user) + Post.find(params[:post_id]).remove_favorite!(CurrentUser.user) end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 27eec3318..f4ca50d16 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -35,8 +35,6 @@ module ApplicationHelper protected def nav_link_match(controller, url) - puts "controller=#{controller} url=#{url}" - url =~ case controller when "sessions", "users" /^\/(session|users)/ diff --git a/app/logical/post_sets/artist.rb b/app/logical/post_sets/artist.rb new file mode 100644 index 000000000..cccb64013 --- /dev/null +++ b/app/logical/post_sets/artist.rb @@ -0,0 +1,10 @@ +module PostSets + class Artist < Post + attr_reader :artist + + def initialize(artist) + super(:tags => artist.name) + @artist = artist + end + end +end diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index dc48648d6..1504f960e 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -4,7 +4,7 @@ class WikiPage < ActiveRecord::Base after_save :create_version belongs_to :creator, :class_name => "User" validates_uniqueness_of :title, :case_sensitive => false - validates_presence_of :body, :title + validates_presence_of :title validate :validate_locker_is_janitor attr_accessible :title, :body, :is_locked scope :titled, lambda {|title| where(["title = ?", title.downcase.tr(" ", "_")])} diff --git a/app/views/artists/new.html.erb b/app/views/artists/new.html.erb index a0a57cc02..af8563014 100644 --- a/app/views/artists/new.html.erb +++ b/app/views/artists/new.html.erb @@ -1,6 +1,9 @@
-

New Artist

+

New Artist

+ + <%= error_messages_for :artist %> + <%= render "form" %>
diff --git a/app/views/artists/search.html.erb b/app/views/artists/search.html.erb index 7053b6ea6..bfbb28e36 100644 --- a/app/views/artists/search.html.erb +++ b/app/views/artists/search.html.erb @@ -1,8 +1,8 @@