diff --git a/Gemfile b/Gemfile index ce006c104..f140d19f0 100644 --- a/Gemfile +++ b/Gemfile @@ -24,4 +24,5 @@ gem "mechanize" gem "nokogiri" gem "meta_search", :git => "git://github.com/ernie/meta_search.git" gem "silent-postgres" -gem "whenever", :require => false \ No newline at end of file +gem "whenever", :require => false +gem "bourbon" diff --git a/Gemfile.lock b/Gemfile.lock index 352b3e780..b482da19f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -48,6 +48,8 @@ GEM multi_json (~> 1.0) arel (2.1.4) bcrypt-ruby (2.1.4) + bourbon (0.1.5) + sass (>= 3.1) builder (3.0.0) daemons (1.1.4) delayed_job (2.1.4) @@ -103,6 +105,7 @@ GEM thor (~> 0.14.6) rake (0.9.2) rdoc (3.9.1) + sass (3.1.7) shoulda (2.11.3) silent-postgres (0.0.8) simple_form (1.4.2) @@ -134,6 +137,7 @@ PLATFORMS ruby DEPENDENCIES + bourbon delayed_job factory_girl ffaker! diff --git a/app/assets/javascripts/tag_script.js b/app/assets/javascripts/tag_script.js index 0cca5fff5..7efe2be24 100644 --- a/app/assets/javascripts/tag_script.js +++ b/app/assets/javascripts/tag_script.js @@ -35,7 +35,7 @@ } else if (command === "[reset]") { return []; } else if (command[0] === "-") { - return tags.reject(function(x) {return x == command.substr(1, 100)}) + return Danbooru.reject(tags, function(x) {return x === command.substr(1, 100)}); } else { tags.push(command) return tags; @@ -44,13 +44,13 @@ Danbooru.TagScript.run = function(post_id, tag_script) { var commands = this.parse(tag_script); - var post = Post.posts.get(post_id); - var old_tags = post.tags.join(" "); + var post = $("#p_" + post_id); + var old_tags = post.data("tags"); $.each(commands, function(i, x) { - post.tags = Danbooru.TagScript.process(post.tags, x); + post.data("tags", Danbooru.TagScript.process(post.data("tags"), x)); }) - Danbooru.Post.update(post_id, {"post[old_tags]": old_tags, "post[tags]": post.tags.join(" ")}); + Danbooru.Post.update(post_id, {"post[old_tags]": old_tags, "post[tags]": post.data("tags")}); } })(); diff --git a/app/assets/javascripts/uploads.js b/app/assets/javascripts/uploads.js index 4713e536d..2614604d1 100644 --- a/app/assets/javascripts/uploads.js +++ b/app/assets/javascripts/uploads.js @@ -1,4 +1,4 @@ -$(document).ready(function() { +$(function() { var img = $("#image-preview img"); if (img) { var height = img.attr("height"); @@ -7,7 +7,7 @@ $(document).ready(function() { var ratio = 400.0 / height; img.attr("height", height * ratio); img.attr("width", width * ratio); - $("#scale").val("Scaled " + parseInt(100 * ratio) + "%"); + $("#scale").html("Scaled " + parseInt(100 * ratio) + "%"); } } }); diff --git a/app/assets/javascripts/utility.js b/app/assets/javascripts/utility.js index 712f58bbc..d93a858d0 100644 --- a/app/assets/javascripts/utility.js +++ b/app/assets/javascripts/utility.js @@ -34,4 +34,14 @@ return all; } + + Danbooru.reject = function(array, f) { + var filtered = []; + $.each(array, function(i, x) { + if (!f(x)) { + filtered.push(x); + } + }); + return filtered; + } })(); diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 9310643d5..164835f74 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -1,4 +1,5 @@ /*= require "smoothness/jquery-ui-1.8.5.custom.css" */ +@import 'bourbon'; $link_color: #006FFA; $link_hover_color: #9093FF; diff --git a/app/controllers/artists_controller.rb b/app/controllers/artists_controller.rb index 33f226937..2f21c92ac 100644 --- a/app/controllers/artists_controller.rb +++ b/app/controllers/artists_controller.rb @@ -12,6 +12,11 @@ class ArtistsController < ApplicationController respond_with(@artist) end + def banned + @artists = Artist.where("is_banned = ?", true).order("name") + respond_with(@artists) + end + def index @search = Artist.search(params[:search]) @artists = @search.paginate(params[:page]) diff --git a/app/models/artist.rb b/app/models/artist.rb index c405f18d7..0990a30fe 100644 --- a/app/models/artist.rb +++ b/app/models/artist.rb @@ -166,6 +166,10 @@ class Artist < ActiveRecord::Base include NoteMethods include TagMethods + def ban! + + end + def initialize_creator self.creator_id = CurrentUser.user.id end diff --git a/app/views/artists/banned.html.erb b/app/views/artists/banned.html.erb new file mode 100644 index 000000000..abf9ca387 --- /dev/null +++ b/app/views/artists/banned.html.erb @@ -0,0 +1,13 @@ +
The following artists have requested they be removed from the site. Please do not upload any works from these artists. These artists all have implications pointing to the banned_artist tag.