fixed bug with number only tags breaking js
This commit is contained in:
@@ -78,12 +78,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
Danbooru.Blacklist.posts = function() {
|
Danbooru.Blacklist.posts = function() {
|
||||||
return $("article.post-preview");
|
return $(".post-preview");
|
||||||
}
|
}
|
||||||
|
|
||||||
Danbooru.Blacklist.post_match = function(post, blacklist) {
|
Danbooru.Blacklist.post_match = function(post, blacklist) {
|
||||||
var $post = $(post);
|
var $post = $(post);
|
||||||
var tags = $post.data("tags").match(/\S+/g) || [];
|
var tags = String($post.data("tags")).match(/\S+/g) || [];
|
||||||
tags.push("rating:" + $post.data("rating"));
|
tags.push("rating:" + $post.data("rating"));
|
||||||
tags.push("uploader:" + $post.data("uploader"));
|
tags.push("uploader:" + $post.data("uploader"));
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
var old_tags = $post.data("tags");
|
var old_tags = $post.data("tags");
|
||||||
|
|
||||||
$.each(commands, function(i, x) {
|
$.each(commands, function(i, x) {
|
||||||
var array = $post.data("tags").match(/\S+/g);
|
var array = String($post.data("tags")).match(/\S+/g);
|
||||||
$post.data("tags", Danbooru.TagScript.process(array, x).join(" "));
|
$post.data("tags", Danbooru.TagScript.process(array, x).join(" "));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -31,8 +31,10 @@ module ApplicationHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def compact_time(time)
|
def compact_time(time)
|
||||||
if time > Time.now.beginning_of_day
|
if time > Time.now.end_of_day
|
||||||
time_tag(time.strftime("%H:%M"), time)
|
time_tag(time.strftime("%b %e, %Y"), time)
|
||||||
|
elsif time > Time.now.beginning_of_day
|
||||||
|
time_tag(time.strftime("%l:%M %P"), time)
|
||||||
elsif time > Time.now.beginning_of_year
|
elsif time > Time.now.beginning_of_year
|
||||||
time_tag(time.strftime("%b %e"), time)
|
time_tag(time.strftime("%b %e"), time)
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -2,8 +2,9 @@ class Ban < ActiveRecord::Base
|
|||||||
after_create :update_feedback
|
after_create :update_feedback
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
belongs_to :banner, :class_name => "User"
|
belongs_to :banner, :class_name => "User"
|
||||||
attr_accessible :reason, :duration, :user_id
|
attr_accessible :reason, :duration, :user_id, :user_name
|
||||||
validate :user_is_inferior
|
validate :user_is_inferior
|
||||||
|
validates_presence_of :user_id, :reason, :duration
|
||||||
|
|
||||||
def self.is_banned?(user)
|
def self.is_banned?(user)
|
||||||
exists?(["user_id = ? AND expires_at > ?", user.id, Time.now])
|
exists?(["user_id = ? AND expires_at > ?", user.id, Time.now])
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="index">
|
<div class="index">
|
||||||
<h1>Bans</h1>
|
<h1>Bans</h1>
|
||||||
|
|
||||||
<table class="striped">
|
<table class="striped" width="100%">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>User</th>
|
<th>User</th>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<h1>Show Ban</h1>
|
<h1>Show Ban</h1>
|
||||||
<ul>
|
<ul>
|
||||||
<li><strong>User</strong>: <%= @ban.user.name %></li>
|
<li><strong>User</strong>: <%= @ban.user.name %></li>
|
||||||
<li><strong>Expires</strong>: <%= @ban.expires_at %></li>
|
<li><strong>Expires</strong>: <%= compact_time @ban.expires_at %></li>
|
||||||
<li><strong>Reason</strong>: <%= @ban.reason %></li>
|
<li><strong>Reason</strong>: <%= @ban.reason %></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,5 +9,5 @@
|
|||||||
<%= nav_link_to("Notes", notes_path(:group_by => "post")) %>
|
<%= nav_link_to("Notes", notes_path(:group_by => "post")) %>
|
||||||
<%= nav_link_to("Wiki", wiki_pages_path(:title => "help:home")) %>
|
<%= nav_link_to("Wiki", wiki_pages_path(:title => "help:home")) %>
|
||||||
<%= nav_link_to("Forum", forum_topics_path, :class => (CurrentUser.user.has_forum_been_updated? ? "forum-updated" : nil)) %>
|
<%= nav_link_to("Forum", forum_topics_path, :class => (CurrentUser.user.has_forum_been_updated? ? "forum-updated" : nil)) %>
|
||||||
<%= nav_link_to("»".html_safe, site_map_path, :id => "site-map-link") %>
|
<%= nav_link_to("More »".html_safe, site_map_path, :id => "site-map-link") %>
|
||||||
</menu>
|
</menu>
|
||||||
@@ -10,5 +10,6 @@
|
|||||||
<% if CurrentUser.is_janitor? %>
|
<% if CurrentUser.is_janitor? %>
|
||||||
<%= nav_link_to("Dashboard", moderator_dashboard_path) %>
|
<%= nav_link_to("Dashboard", moderator_dashboard_path) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<%= nav_link_to("More »".html_safe, site_map_path) %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
Reference in New Issue
Block a user