fixed tag category coloring, fixed tag category expiration when updating, work on migration

This commit is contained in:
albert
2011-10-10 17:08:29 -04:00
parent 5fb1a17516
commit e011c36ffe
13 changed files with 228 additions and 11 deletions

View File

@@ -20,6 +20,18 @@ article.post-preview.blacklisted-active {
}
div#c-posts {
li.category-1 a {
color: #A00;
}
li.category-3 a {
color: #A0A;
}
li.category-4 a {
color: #0A0;
}
span.post-count {
color: #CCC;
margin-left: 0.2em;

View File

@@ -66,7 +66,7 @@ class Tag < ActiveRecord::Base
end
def update_category_cache
Cache.put("tc:#{Cache.sanitize(name)}", category)
Cache.put("tc:#{Cache.sanitize(name)}", category, 1.hour)
end
end
@@ -95,6 +95,7 @@ class Tag < ActiveRecord::Base
if tag
if category > 0
tag.update_category_cache
tag.update_column(:category, category)
end

View File

@@ -33,7 +33,7 @@ private
def build_list_item(tag, template, options)
html = ""
html << %{<li data-tag-type="#{categories[tag]}" data-tag-name="#{u(tag)}">}
html << %{<li class="category-#{categories[tag]}">}
if CurrentUser.user.is_privileged?
html << %{<a href="/wiki_pages?title=#{u(tag)}">?</a> }

View File

@@ -24,7 +24,7 @@
</div>
<% content_for(:page_title) do %>
/login
/sign in
<% end %>
<%= render "secondary_links" %>

View File

@@ -1,11 +1,9 @@
<div id="c-users">
<div id="a-edit">
<h1>Edit Settings</h1>
<h1>Settings</h1>
<%= simple_form_for @user do |f| %>
<fieldset>
<legend>Basic</legend>
<%= f.input :email, :required => Danbooru.config.enable_email_verification?, :hint => "Your email address (used for messages and for password resets)" %>
<%= f.input :time_zone, :hint => "Your local time zone" %>
<%= f.input :receive_email_notifications, :hint => "Enable to receive email notification when you receive a DMail" %>
@@ -17,8 +15,6 @@
</fieldset>
<fieldset>
<legend>Password</legend>
<%= f.input :password, :hint => "What you want your new password to be (leave blank if you don't want to change your password)", :label => "New password", :input_html => {:autocomplete => "off"} %>
<%= f.input :old_password, :hint => "Your old password (you must enter your password if updating your name or password)", :as => :password, :input_html => {:autocomplete => "off"} %>
</fieldset>
@@ -29,7 +25,7 @@
</div>
<% content_for(:page_title) do %>
/Users/<%= @user.name %>/Settings
/settings
<% end %>
<%= render "secondary_links" %>

View File

@@ -1,6 +1,6 @@
<div id="c-users">
<div id="a-show">
<h1>Show User: <%= @presenter.name %></h1>
<h1><%= @presenter.name %></h1>
<dl>
<dt>Join Date</dt>