view changes
This commit is contained in:
1
Gemfile
1
Gemfile
@@ -25,3 +25,4 @@ gem "nokogiri"
|
|||||||
gem "meta_search", :git => "git://github.com/ernie/meta_search.git"
|
gem "meta_search", :git => "git://github.com/ernie/meta_search.git"
|
||||||
gem "silent-postgres"
|
gem "silent-postgres"
|
||||||
gem "whenever", :require => false
|
gem "whenever", :require => false
|
||||||
|
gem "bourbon"
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ GEM
|
|||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
arel (2.1.4)
|
arel (2.1.4)
|
||||||
bcrypt-ruby (2.1.4)
|
bcrypt-ruby (2.1.4)
|
||||||
|
bourbon (0.1.5)
|
||||||
|
sass (>= 3.1)
|
||||||
builder (3.0.0)
|
builder (3.0.0)
|
||||||
daemons (1.1.4)
|
daemons (1.1.4)
|
||||||
delayed_job (2.1.4)
|
delayed_job (2.1.4)
|
||||||
@@ -103,6 +105,7 @@ GEM
|
|||||||
thor (~> 0.14.6)
|
thor (~> 0.14.6)
|
||||||
rake (0.9.2)
|
rake (0.9.2)
|
||||||
rdoc (3.9.1)
|
rdoc (3.9.1)
|
||||||
|
sass (3.1.7)
|
||||||
shoulda (2.11.3)
|
shoulda (2.11.3)
|
||||||
silent-postgres (0.0.8)
|
silent-postgres (0.0.8)
|
||||||
simple_form (1.4.2)
|
simple_form (1.4.2)
|
||||||
@@ -134,6 +137,7 @@ PLATFORMS
|
|||||||
ruby
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
|
bourbon
|
||||||
delayed_job
|
delayed_job
|
||||||
factory_girl
|
factory_girl
|
||||||
ffaker!
|
ffaker!
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
} else if (command === "[reset]") {
|
} else if (command === "[reset]") {
|
||||||
return [];
|
return [];
|
||||||
} else if (command[0] === "-") {
|
} 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 {
|
} else {
|
||||||
tags.push(command)
|
tags.push(command)
|
||||||
return tags;
|
return tags;
|
||||||
@@ -44,13 +44,13 @@
|
|||||||
|
|
||||||
Danbooru.TagScript.run = function(post_id, tag_script) {
|
Danbooru.TagScript.run = function(post_id, tag_script) {
|
||||||
var commands = this.parse(tag_script);
|
var commands = this.parse(tag_script);
|
||||||
var post = Post.posts.get(post_id);
|
var post = $("#p_" + post_id);
|
||||||
var old_tags = post.tags.join(" ");
|
var old_tags = post.data("tags");
|
||||||
|
|
||||||
$.each(commands, function(i, x) {
|
$.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")});
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
$(document).ready(function() {
|
$(function() {
|
||||||
var img = $("#image-preview img");
|
var img = $("#image-preview img");
|
||||||
if (img) {
|
if (img) {
|
||||||
var height = img.attr("height");
|
var height = img.attr("height");
|
||||||
@@ -7,7 +7,7 @@ $(document).ready(function() {
|
|||||||
var ratio = 400.0 / height;
|
var ratio = 400.0 / height;
|
||||||
img.attr("height", height * ratio);
|
img.attr("height", height * ratio);
|
||||||
img.attr("width", width * ratio);
|
img.attr("width", width * ratio);
|
||||||
$("#scale").val("Scaled " + parseInt(100 * ratio) + "%");
|
$("#scale").html("Scaled " + parseInt(100 * ratio) + "%");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -34,4 +34,14 @@
|
|||||||
|
|
||||||
return all;
|
return all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Danbooru.reject = function(array, f) {
|
||||||
|
var filtered = [];
|
||||||
|
$.each(array, function(i, x) {
|
||||||
|
if (!f(x)) {
|
||||||
|
filtered.push(x);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return filtered;
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
/*= require "smoothness/jquery-ui-1.8.5.custom.css" */
|
/*= require "smoothness/jquery-ui-1.8.5.custom.css" */
|
||||||
|
@import 'bourbon';
|
||||||
|
|
||||||
$link_color: #006FFA;
|
$link_color: #006FFA;
|
||||||
$link_hover_color: #9093FF;
|
$link_hover_color: #9093FF;
|
||||||
|
|||||||
@@ -12,6 +12,11 @@ class ArtistsController < ApplicationController
|
|||||||
respond_with(@artist)
|
respond_with(@artist)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def banned
|
||||||
|
@artists = Artist.where("is_banned = ?", true).order("name")
|
||||||
|
respond_with(@artists)
|
||||||
|
end
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@search = Artist.search(params[:search])
|
@search = Artist.search(params[:search])
|
||||||
@artists = @search.paginate(params[:page])
|
@artists = @search.paginate(params[:page])
|
||||||
|
|||||||
@@ -166,6 +166,10 @@ class Artist < ActiveRecord::Base
|
|||||||
include NoteMethods
|
include NoteMethods
|
||||||
include TagMethods
|
include TagMethods
|
||||||
|
|
||||||
|
def ban!
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
def initialize_creator
|
def initialize_creator
|
||||||
self.creator_id = CurrentUser.user.id
|
self.creator_id = CurrentUser.user.id
|
||||||
end
|
end
|
||||||
|
|||||||
13
app/views/artists/banned.html.erb
Normal file
13
app/views/artists/banned.html.erb
Normal 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>
|
||||||
@@ -38,6 +38,7 @@ Danbooru::Application.routes.draw do
|
|||||||
end
|
end
|
||||||
collection do
|
collection do
|
||||||
get :search
|
get :search
|
||||||
|
get :banned
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
resources :artist_versions, :only => [:index]
|
resources :artist_versions, :only => [:index]
|
||||||
|
|||||||
Reference in New Issue
Block a user