view changes

This commit is contained in:
albert
2011-08-22 16:28:31 -04:00
parent 24bf21540a
commit 2b7a8f2d67
10 changed files with 47 additions and 8 deletions

View File

@@ -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")});
}
})();

View File

@@ -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) + "%");
}
}
});

View File

@@ -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;
}
})();

View File

@@ -1,4 +1,5 @@
/*= require "smoothness/jquery-ui-1.8.5.custom.css" */
@import 'bourbon';
$link_color: #006FFA;
$link_hover_color: #9093FF;

View File

@@ -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])

View File

@@ -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

View File

@@ -0,0 +1,13 @@
<div id="c-artists">
<div id="a-banned">
<h1>Banned Artists</h1>
<p>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 <code>banned_artist</code> tag.</p>
<ul>
<% @artists.each do |artist| %>
<li><%= link_to artist.name, artist_path(artist) %></li>
<% end %>
</ul>
</div>
</div>