Permalink
Browse files

Major search function improvements, new user page, improved reviews, …

…etc.
  • Loading branch information...
1 parent 550a01b commit 2b988ada2de336fd68e8b7a5fe6cf983f1c4594e @rkuykendall committed Jul 5, 2011
View
4 app/controllers/items_controller.rb
@@ -10,7 +10,7 @@ class ItemsController < ApplicationController
# GET /items
# GET /items.xml
def index
- @items = Item.search(params[:search], params[:page], params[:order])
+ @items = Item.search(params)
users = User.find(:all, :conditions => [ "login LIKE ?", "%#{params[:search]}%" ] )
if users.count == 1
@@ -110,7 +110,7 @@ def before_items
raise ActiveRecord::RecordNotFound if @item == nil
if @item.tc_id == 0
- @items = Item.search(params[:search], params[:page], params[:order], @item, nil)
+ @items = Item.search(params.merge!({:user => @user, :tc => @item}))
render :action => 'index'
elsif action_name != 'destroy'
@version = @item.find_version if @item.find_version
View
2 app/controllers/tags_controller.rb
@@ -15,7 +15,7 @@ def index
# GET /tags/1.xml
def show
@tag = Tag.find_by_name(params[:id])
- @items = @tag.items.search(params[:search], params[:page], params[:order]) if @tag
+ @items = @tag.items.search(params) if @tag
respond_to do |format|
format.html { render :template => "items/index" }
View
17 app/controllers/users_controller.rb
@@ -5,7 +5,7 @@ class UsersController < ApplicationController
# GET /users
# GET /users.xml
def index
- @users = User.find(:all, :order => 'admin DESC, login ASC', :conditions => [ 'items_count > 1 OR reviews_count > 1' ])
+ @users = User.find(:all, :order => 'admin DESC, login ASC', :conditions => [ 'items_count > 0 OR reviews_count > 1' ])
respond_to do |format|
format.html # index.rhtml
@@ -17,16 +17,23 @@ def index
# GET /users/1.xml
def show
@user = User.find_by_permalink(params[:id])
- @items = Item.search(params[:search], params[:page], params[:order], nil, @user)
+ raise ActiveRecord::RecordNotFound if @user == nil
+
+ @items = Item.search(params.merge!({:user => @user, :per_page => 50}))
+ @reviews = Review.find(:all, :order => 'created_at DESC', :conditions => [ 'user_id = ?', @user.id ] )
respond_to do |format|
- if current_user && current_user.admin == 1
- format.html { render :action => "show" }
+ if permission(@user)
+ format.html { render :action => "manage" }
else
- format.html { render :template => "items/index" }
+ format.html { render :action => "show" }
end
format.xml { render :xml => @items.to_xml }
end
+
+ rescue ActiveRecord::RecordNotFound
+ redirect_back_or_default('/')
+ flash[:notice] = "User #{params[:id]} does not exist."
end
# render new.rhtml
View
18 app/models/item.rb
@@ -75,22 +75,24 @@ def self.order_sql(k, conditions)
# end
- def self.search(search = '', page = 1, order = 'new', tc = nil, user = nil)
- conditions = [ 'name LIKE ?', "%#{search}%" ]
+ def self.search(args = {})
+ perpage = args[:per_page] || 10
+
+ conditions = [ 'name LIKE ?', "%#{ args[:search] || '' }%" ]
- if(!user)
+ if(!args[:user])
conditions[0] += ' AND versions_count > 0'
end
- if (tc)
+ if (args[:tc])
conditions[0] += ' AND tc_id = ?'
- conditions << tc.id
- elsif(user)
+ conditions << args[:tc].id
+ elsif(args[:user])
conditions[0] += ' AND user_id = ?'
- conditions << user
+ conditions << args[:user].id
end
- paginate :page => page, :order => order_sql(order,conditions), :conditions => conditions
+ paginate :page => args[:page], :order => order_sql(args[:order],conditions), :conditions => conditions, :per_page => perpage
end
View
25 app/views/items/_show.html.erb
@@ -0,0 +1,25 @@
+<% version = show.find_version %>
+<% screenshot = show.rand_screenshot %>
+
+<% if version != nil %>
+ <div class="map">
+ <%= download_button(version) %>
+ <h3><%= link_to clean(show.name), item_path(show) %> <%= clean(version.name) %></h3>
+ <h4><%= link_to clean(show.user.login), user_path(show.user) %> on <%= show.version_created_at.to_s(:readable_short) %></h4>
+ <div class="indent markdown">
+ <%= link_to ( image_tag url_for_file_column(screenshot, "file", "thumb")), item_path(show) if screenshot %>
+ <%= format(show.body) %>
+
+ <%= content_tag(:h5, "Notes for version "+clean(version.name)+":") if version.body != "" %>
+ <%= format(version.body) %>
+
+ <h4>
+ <%= pluralize(show.downloads.size, 'download') %>,
+ <%= pluralize(show.reviews.size, 'review') %>,
+ <%= pluralize(show.screenshots.size, 'screenshot') %>,
+ <%= "%.1f" % show.ratings_count %> rating
+ </h4>
+ </div>
+ </div>
+ <hr />
+<% end %>
View
39 app/views/items/index.html.erb
@@ -2,43 +2,18 @@
<div class="sidebar">
<%= render :partial => "layouts/sort" %>
+ <%= render :partial => "layouts/site" %>
<hr />
</div>
<div class="content">
- <% if @items != nil and @items.count > 0 %>
- <% for item in @items %>
- <% version = item.find_version %>
- <% screenshot = item.rand_screenshot %>
-
- <% if version != nil %>
- <div class="map">
- <%= download_button(version) %>
- <h3><%= link_to clean(item.name), item_path(item) %> <%= clean(version.name) %></h3>
- <h4><%= link_to clean(item.user.login), user_path(item.user) %> on <%= item.version_created_at.to_s(:readable_short) %></h4>
- <div class="indent markdown">
- <%= link_to ( image_tag url_for_file_column(screenshot, "file", "thumb")), item_path(item) if screenshot %>
- <%= format(item.body) %>
-
- <%= content_tag(:h5, "Notes for version "+clean(version.name)+":") if version.body != "" %>
- <%= format(version.body) %>
-
- <h4>
- <%= pluralize(item.downloads.size, 'download') %>,
- <%= pluralize(item.reviews.size, 'review') %>,
- <%= pluralize(item.screenshots.size, 'screenshot') %>,
- <%= "%.1f" % item.ratings_count %> rating
- </h4>
- </div>
- </div>
- <hr />
- <% end %>
- <% end %>
- <% else %>
- <p>There are no results to display.</p>
+ <% if @items.count == 0 %>
+ <p>There are no results to display.</p>
<% end %>
+ <%= render :partial => 'items/show', :collection => @items %>
+
<hr />
</div>
@@ -49,6 +24,4 @@
<hr />
-<%= will_paginate @items, :next_label => 'Next', :previous_label => 'Previous' %>
-
-<hr />
+<%= will_paginate @items, :next_label => 'Next', :previous_label => 'Previous' %>
View
2 app/views/items/show.html.erb
@@ -59,5 +59,3 @@
<hr />
</div>
-
-<hr />
View
19 app/views/layouts/_site.html.erb
@@ -0,0 +1,19 @@
+ <div class="navblock">
+ <h2 class="logo">Simplici7y Links</h2>
+ <ul>
+ <li><%= link_to 'About the project', item_path('simplici7y') %></li>
+ <li><%= link_to 'Popular tags', tags_path %></li>
+ <li><%= link_to 'Issue tracker', 'https://github.com/rkuykendall/Simplici7y/issues', :target => '_blank' %></li>
+ <li>
+ <script type="text/javascript" language="javascript">
+ <!--
+ ML="j\"/k0cK=t?i2.<:7>@b feRmnyld-p%usharoS";
+ MI="=RCQSED71GR:J8T>FTBES8C6OI3EHKRJJC=STBES8AS3OI3EHKRJJ<5TG@9POB0E587U:GMJ:5:?IN;4LN;41@UEHKCGECRHCEGR:J=2R@";
+ OT="";
+ for(j=0;j<MI.length;j++){
+ OT+=ML.charAt(MI.charCodeAt(j)-48);
+ }document.write(OT);
+ // --></script>
+ </li>
+ </ul>
+ </div>
View
60 app/views/layouts/_sort.html.erb
@@ -13,42 +13,30 @@
<% url = item_url(params[:id]) %>
<% end %>
- <h2><% form_tag(url, :method => :get) do %> <%= text_field_tag :search, params[:search], :placeholder => placeholder %> <% end %></h2>
- <%# content_tag(:li, ( link_to "New Submissions", params.merge(:order => :new) ) ) %>
- <%# content_tag(:li, ( link_to "Least updated", params.merge(:order => :old) ) ) %>
+ <div class="navblock search">
+ <h2><% form_tag(url, :method => :get) do %> <%= text_field_tag :search, params[:search], :placeholder => placeholder %> <% end %></h2>
+ <%# content_tag(:li, ( link_to "New Submissions", params.merge(:order => :new) ) ) %>
+ <%# content_tag(:li, ( link_to "Least updated", params.merge(:order => :old) ) ) %>
+ </div>
- <h2>Sort by User Reviews</h2>
- <ul>
- <%= content_tag(:li, ( link_to "Best Reviewed", params.merge(:order => :best) ) ) %>
- <%= content_tag(:li, ( link_to "Most Reviews", params.merge(:order => :loud) ) ) %>
- <%= content_tag(:li, ( link_to "Fewest Reviews", params.merge(:order => :quiet) ) ) %>
- <%# content_tag(:li, ( link_to "Worst Reviewed", params.merge(:order => :worst) ) ) %>
- </ul>
+ <div class="navblock">
+ <h2>Sort by User Reviews</h2>
+ <ul>
+ <%= content_tag(:li, ( link_to "Best Reviewed", params.merge(:order => :best) ) ) %>
+ <%= content_tag(:li, ( link_to "Most Reviews", params.merge(:order => :loud) ) ) %>
+ <%= content_tag(:li, ( link_to "Fewest Reviews", params.merge(:order => :quiet) ) ) %>
+ <%# content_tag(:li, ( link_to "Worst Reviewed", params.merge(:order => :worst) ) ) %>
+ </ul>
+ </div>
- <h2>Sort by Downloads</h2>
- <ul>
- <%= content_tag(:li, ( link_to "All Time", params.merge(:order => :popular) ) ) %>
- <%= content_tag(:li, ( link_to "Last 24 Hours", params.merge(:order => :day) ) ) %>
- <%= content_tag(:li, ( link_to "The Past Week", params.merge(:order => :week) ) ) %>
- <%= content_tag(:li, ( link_to "The Past Month", params.merge(:order => :month) ) ) %>
- <%# content_tag(:li, ( link_to "Fewest Downloads", params.merge(:order => :unpopular) ) ) %>
- </ul>
-
- <h2 class="logo">Simplici7y Links</h2>
- <ul>
- <li><%= link_to 'About the project', item_path('simplici7y') %></li>
- <li><%= link_to 'Popular tags', tags_path %></li>
- <li><%= link_to 'Issue tracker', 'https://github.com/rkuykendall/Simplici7y/issues', :target => '_blank' %></li>
- <li>
- <script type="text/javascript" language="javascript">
- <!--
- ML="j\"/k0cK=t?i2.<:7>@b feRmnyld-p%usharoS";
- MI="=RCQSED71GR:J8T>FTBES8C6OI3EHKRJJC=STBES8AS3OI3EHKRJJ<5TG@9POB0E587U:GMJ:5:?IN;4LN;41@UEHKCGECRHCEGR:J=2R@";
- OT="";
- for(j=0;j<MI.length;j++){
- OT+=ML.charAt(MI.charCodeAt(j)-48);
- }document.write(OT);
- // --></script>
- </li>
- </ul>
+ <div class="navblock">
+ <h2>Sort by Downloads</h2>
+ <ul>
+ <%= content_tag(:li, ( link_to "All Time", params.merge(:order => :popular) ) ) %>
+ <%= content_tag(:li, ( link_to "Last 24 Hours", params.merge(:order => :day) ) ) %>
+ <%= content_tag(:li, ( link_to "The Past Week", params.merge(:order => :week) ) ) %>
+ <%= content_tag(:li, ( link_to "The Past Month", params.merge(:order => :month) ) ) %>
+ <%# content_tag(:li, ( link_to "Fewest Downloads", params.merge(:order => :unpopular) ) ) %>
+ </ul>
+ </div>
View
56 app/views/layouts/_tags.html.erb
@@ -1,28 +1,34 @@
- <h2>Gameplay Types</h2>
- <ul>
- <li><%= link_to 'Every Man for Himself', tag_path('emfh') %></li>
- <li><%= link_to 'Solo / Cooperative', tag_path('solocoop') %></li>
- <li><%= link_to 'King of the Hill', tag_path('koth') %></li>
- <li><%= link_to 'Kill the Man with the Ball', tag_path('ktmwtb') %></li>
- <li><%= link_to 'Capture the Flag', tag_path('ctf') %></li>
- <li><%= link_to 'Survival', tag_path('survival') %></li>
- </ul>
+ <div class="navblock">
+ <h2>Gameplay Types</h2>
+ <ul>
+ <li><%= link_to 'Every Man for Himself', tag_path('emfh') %></li>
+ <li><%= link_to 'Solo / Cooperative', tag_path('solocoop') %></li>
+ <li><%= link_to 'King of the Hill', tag_path('koth') %></li>
+ <li><%= link_to 'Kill the Man with the Ball', tag_path('ktmwtb') %></li>
+ <li><%= link_to 'Capture the Flag', tag_path('ctf') %></li>
+ <li><%= link_to 'Survival', tag_path('survival') %></li>
+ </ul>
+ </div>
- <h2>File Types</h2>
- <ul>
- <li><%= link_to 'Map', tag_path('map') %></li>
- <li><%= link_to 'Scenario', tag_path('scenario') %></li>
- <li><%= link_to 'Plugin', tag_path('plugin') %></li>
- <li><%= link_to 'Enhancement', tag_path('enhancement') %></li>
- <li><%= link_to 'Script', tag_path('script') %></li>
- <li><%= link_to 'Physics', tag_path('physics') %></li>
- <li><%= link_to 'Utility', tag_path('utility') %></li>
- </ul>
+ <div class="navblock">
+ <h2>File Types</h2>
+ <ul>
+ <li><%= link_to 'Map', tag_path('map') %></li>
+ <li><%= link_to 'Scenario', tag_path('scenario') %></li>
+ <li><%= link_to 'Plugin', tag_path('plugin') %></li>
+ <li><%= link_to 'Enhancement', tag_path('enhancement') %></li>
+ <li><%= link_to 'Script', tag_path('script') %></li>
+ <li><%= link_to 'Physics', tag_path('physics') %></li>
+ <li><%= link_to 'Utility', tag_path('utility') %></li>
+ </ul>
+ </div>
- <h2>Scenarios</h2>
- <ul>
- <li><%= link_to 'Marathon', item_path('marathon') %></li>
- <li><%= link_to 'Marathon: Durandal', item_path('marathon-2-durandal') %></li>
- <li><%= link_to 'Marathon: Infinity', item_path('marathon-infinity') %></li>
- </ul>
+ <div class="navblock">
+ <h2>Scenarios</h2>
+ <ul>
+ <li><%= link_to 'Marathon', item_path('marathon') %></li>
+ <li><%= link_to 'Marathon: Durandal', item_path('marathon-2-durandal') %></li>
+ <li><%= link_to 'Marathon: Infinity', item_path('marathon-infinity') %></li>
+ </ul>
+ </div>
View
10 app/views/layouts/application.rhtml
@@ -41,22 +41,18 @@
<div id="container">
<% if flash[:notice] %>
<div class="notice"><%= flash[:notice] %></div>
- <% else %>
- <div class="notice">
- All maps and reviews submitted July 2nd were lost while updating S7. I am sorry for losing anything you wrote that day.
- </div>
- <% end %>
-
- <% if true %>
<% elsif !logged_in? %>
<div class="notice">
+ Welcome to Simplici7y, file sharing for the
+ <a href="http://marathon.sourceforge.net/" target="blank">Aleph One</a> community.
<%= link_to "Sign up", signup_url %> or
<%= link_to "log in", login_url %>
to start adding and reviewing files.
</div>
<% end %>
<%= yield %>
+ <hr />
</div>
<div id="footer">
View
2 app/views/reviews/_show.rhtml
@@ -1,7 +1,7 @@
<% if show && show.item %>
<div class="review relevancy-<%= show.relevancy.to_s %>">
<%= stars(show.rating) %>
- <h3><%= clean(show.title) %> <%= '( ' + ( link_to clean(show.item.name), item_path(show.item) ) + ' )' if controller.action_name != 'show' %></h3>
+ <h3><%= clean(show.title) %> <%= '<span>' + ( link_to clean(show.item.name), item_path(show.item) ) + '</span>' if controller.action_name != 'show' or controller.controller_name != 'items' %></h3>
<h4><%= link_to clean(show.user.login), user_path(show.user) %> on <%= show.created_at.to_s(:readable_short) %>, Version <%= clean(show.version.name) %></h4>
<% if permission(show) %>
View
5 app/views/reviews/index.html.erb
@@ -5,8 +5,7 @@
<div class="content">
<%= render :partial => 'show', :collection => @reviews %>
+ <hr />
</div>
-<%= will_paginate @reviews, :next_label => 'Next', :previous_label => 'Previous' %>
-
-<hr />
+<%= will_paginate @reviews, :next_label => 'Next', :previous_label => 'Previous' %>
View
4 app/views/screenshots/index.html.erb
@@ -19,6 +19,4 @@
<div class="ss_edit">
<%= link_to 'New screenshot', new_item_screenshot_path(@item), :class => 'button positive add-image' %>
-</div>
-
-<hr />
+</div>
View
8 app/views/tags/index.html.erb
@@ -1,7 +1,5 @@
<% for tag in @tags %>
-
- <span style="font-size: <%= ( tag.popularity.to_i + 60)/2 %>px; line-height: 1em; padding: 5px; display: inline-block;"><%= link_to clean(tag.name), tag_url(tag) %></span>
-
+ <span style="font-size: <%= ( tag.popularity.to_i + 60)/2 %>px;">
+ <%= link_to clean(tag.name), tag_url(tag) %>
+ </span>
<% end %>
-
-<hr />
View
47 app/views/users/manage.html.erb
@@ -0,0 +1,47 @@
+<div class="simple">
+
+ <h2>Your Uploads</h2>
+
+ <% if @items[0] == nil %>
+ <p>You can use Simplici7y to share something with the Aleph One community.</p>
+ <%= link_to "Add your first item", new_item_url, :class => 'button positive add' %>
+ <% else %>
+ <p><%= link_to "Add a new item", new_item_url, :class => 'button positive add' %></p>
+ <% for item in @items %>
+ <% versions = item.versions %>
+ <% if versions[0] != nil %>
+ <div class="manage_map">
+ <table class="manage">
+ <tr>
+ <th scope="col">Version</th>
+ <th scope="col">Downloads</th>
+ <th scope="col">Uploaded</th>
+ </tr>
+ <% for version in versions %>
+ <tr class="<%= "newest" if version == item.find_version %>">
+ <td width="100px">
+ <%= clean(version.name) %>
+ </td>
+ <td width="100px"><%= version.downloads.size %></td>
+ <td width="100px"><%= version.created_at.to_s(:readable_short) %></td>
+ </tr>
+ <% end %>
+ </table>
+
+ <h3><%= link_to clean(truncate(item.name, 16)), item_path(item) %></h3>
+ <%= pluralize(item.reviews.size, 'review') %><br /> <%= pluralize(item.downloads.size, 'downloads') %>
+ <hr />
+ </div>
+ <% else %>
+ <div class="notice">
+ <%= clean(truncate(item.name, 16)) %> is missing its first version: <%= link_to 'add version', new_item_version_url(item) %> or <%= link_to "destroy", item_url(item), :class => 'controls', :confirm => "Are you sure?", :method => :delete %>.
+ </div>
+ <% end %>
+ <% end %>
+ <% end %>
+
+</div>
+
+<%= will_paginate @items, :next_label => 'Next', :previous_label => 'Previous' %>
+
+<hr />
View
55 app/views/users/show.html.erb
@@ -1,51 +1,10 @@
<div class="content">
-
- <h2>Your Uploads</h2>
-
- <% if @items[0] == nil %>
- <p>You can use Simplici7y to share something with the Aleph One community.</p>
- <%= link_to "Add your first item", new_item_url, :class => 'button positive add' %>
- <% else %>
- <p><%= link_to "Add a new item", new_item_url, :class => 'button positive add' %></p>
- <% for item in @items %>
- <% versions = item.versions %>
- <% if versions[0] != nil %>
- <div class="manage_map">
- <table class="manage">
- <tr>
- <th scope="col">Version</th>
- <th scope="col">Downloads</th>
- <th scope="col">Uploaded</th>
- </tr>
- <% for version in versions %>
- <tr class="<%= "newest" if version == item.find_version %>">
- <td width="100px">
- <% if version == item.find_version %>
- <%= clean(version.name) %></small>
- <% else %>
- <%= clean(version.name) %>
- <% end %>
- </td>
- <td><%= version.downloads.size %></td>
- <td><%= version.created_at.to_s(:readable_short) %></td>
- </tr>
- <% end %>
- </table>
-
- <h3><%= link_to clean(item.name), item_path(item) %></h3>
- <%= pluralize(item.reviews.size, 'review') %><br /> <%= pluralize(item.downloads.size, 'downloads') %>
- <hr />
- </div>
- <% else %>
- <div class="notice">
- <%= clean(item.name) %> is missing its first revision, <%= link_to 'add one', new_item_version_url(item) %> or <%= link_to "Destroy it", item_url(item), :class => 'controls', :confirm => "Are you sure?", :method => :delete %>.
- </div>
- <% end %>
- <% end %>
-
- <%= will_paginate @items, :next_label => 'Next', :previous_label => 'Previous' %>
- <% end %>
-
+ <%= render :partial => "layouts/sort" %>
+ <hr />
+
+ <%= render :partial => 'items/show', :collection => @items %>
</div>
-<hr />
+<div class="content">
+ <%= render :partial => 'reviews/show', :collection => @reviews %>
+</div>
View
3 db/migrate/20110703232022_add_user_count_caches.rb
@@ -6,6 +6,9 @@ def self.up
User.reset_column_information
User.find(:all).each do |u|
+ # This command will fail to write if the column is identified as a counter cache.
+ # Remove the counter cache => true from the review model before running.
+ # For some reason, items works just fine.
u.update_attribute :reviews_count, Review.find(:all, :conditions => [ "user_id = ?", u.id ]).length
u.update_attribute :items_count, Item.find(:all, :conditions => [ "versions_count > 0 AND user_id = ?", u.id ]).length
end
View
55 db/migrate/20110704185846_update_ratings_caches.rb
@@ -0,0 +1,55 @@
+class UpdateRatingsCaches < ActiveRecord::Migration
+ def self.up
+ for item in Item.find(:all)
+
+ puts item.name
+
+ #--------------------[ Update Rating Relevancy ]--------------------#
+
+ reviews = item.reviews.find(:all, :order => 'created_at DESC')
+ version = item.versions.reverse[0]
+
+ reviews.each_with_index do |review, index|
+ # Start at zero
+ review.relevancy = 0
+
+ # If it's an old version, bump it to 1
+ review.relevancy = 1 if review.version_id != version.id
+
+ # If there's a newer review, bump it to 3
+ (0...index).each do |r|
+ reviews[index].relevancy = 2 if reviews[r].user_id == review.user_id
+ end
+
+ # If it's by the owner, bump it to 2
+ review.relevancy = 2 if review.user_id == item.user_id
+ end
+ reviews.each(&:save!)
+
+
+
+ #--------------------[ Update Rating Counts ]--------------------#
+
+ total = 0.0
+ average = 0.0
+ weighted = 0.0
+ reviews = item.reviews.find(:all, :conditions => [ 'relevancy < 2' ])
+ count = reviews.length.to_f
+
+ if count > 0
+ for review in reviews
+ total += review.rating
+ end
+
+ average = total / count
+ weighted = average + ( average - 2.5 ) * ( count / 10.0 )
+ end
+
+ item.update_attributes(:ratings_count => average, :ratings_weighted_count => weighted)
+
+ end
+ end
+
+ def self.down
+ end
+end
View
2 db/schema.rb
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20110703232022) do
+ActiveRecord::Schema.define(:version => 20110704185846) do
create_table "downloads", :force => true do |t|
t.integer "user_id"
View
124 public/stylesheets/application.css
@@ -1,3 +1,4 @@
+
/* ==============================
Meyer CSS Reset
============================== */
@@ -66,19 +67,21 @@ html, body {
width: 960px;
margin: 0 auto;
}
-
-.content { /* 480px in the end, half */
- width: 460px;
- padding-left: 20px;
- float: left;
-}
-
-.sidebar { /* 240px in the end, one fourth */
- width: 220px;
- margin-left: 20px;
- float: left;
- display: inline; /* floats are handled as block elements, this is to fix
- a margin collapsing bug in IE */
+ .content { /* 480px in the end, half */
+ width: 460px;
+ padding-left: 20px;
+ float: left;
+ }
+ .sidebar { /* 240px in the end, one fourth */
+ width: 220px;
+ margin-left: 20px;
+ float: left;
+ display: inline; /* floats are handled as block elements, this is to fix
+ a margin collapsing bug in IE */
+ }
+ .simple, form.cmxform { /* Center of the page */
+ width: 560px;
+ padding: 30px 200px 0 200px;
}
hr {
@@ -400,6 +403,15 @@ div#menu a.username {
Footer
============================== */
+html {
+ background-color: #343434;
+}
+
+body {
+ background-color: white;
+}
+
+
div#footer {
clear: both;
@@ -501,25 +513,49 @@ div.notice {
margin-bottom: 10px;
}
-.sidebar ul {
+
+/* ==============================
+ Navblocks
+ ============================== */
+
+.navblock {
+ width: 220px;
+ margin: 0;
+ padding: 0;
+}
+
+.navblock ul {
margin-bottom: 20px;
}
- .sidebar ul li {
+ .navblock ul li {
list-style: none;
}
- .sidebar ul li a:link,
- .sidebar ul li a:visited {
+ .navblock ul li a:link,
+ .navblock ul li a:visited {
color: #666;
}
- .sidebar ul li a:hover {
+ .navblock ul li a:hover {
color: #336699;
}
- .sidebar ul li a:active {
+ .navblock ul li a:active {
color: #fff;
}
+#container .content .navblock {
+ float: left;
+}
+
+#container .content .navblock + hr {
+ margin-bottom: 20px;
+}
+
+#container .content .navblock.search,
+#container .content .navblock.search input {
+ width: 440px;
+}
+
#search {
- width: 180px;
+ width: 195px;
padding: 2px;
margin: 0;
margin-bottom: 15px;
@@ -559,6 +595,10 @@ div.manage_map {
color: #666;
}
+.manage_map hr {
+ width: 560px;
+}
+
div.quote img {
float: right;
border: 1px solid black;
@@ -571,11 +611,6 @@ div.quote img {
CMX Form
============================== */
-form.cmxform {
- width: 560px;
- padding: 30px 200px 0 200px;
-}
-
form.cmxform em {
font-style: normal;
color: #f00;
@@ -734,6 +769,28 @@ div.review {
margin-bottom: 30px;
}
+h3 span,
+h3 span a {
+ color: #ccc;
+ text-decoration: none;
+}
+
+
+/* ==============================
+ Tags
+ ============================== */
+
+body.tags #container span {
+ line-height: 1em;
+ padding: 5px;
+ display: inline-block;
+}
+
+body.tags #container span a {
+ text-decoration: none;
+}
+
+
/* ==============================
Users
@@ -751,6 +808,23 @@ div.user {
float: left;
}
+div.user {
+ background-image: -webkit-gradient(
+ linear,
+ left bottom,
+ left top,
+ color-stop(0.46, rgb(252,252,252)),
+ color-stop(0.73, rgb(255,255,255))
+ );
+ background-image: -moz-linear-gradient(
+ center bottom,
+ rgb(252,252,252) 46%,
+ rgb(255,255,255) 73%
+ );
+}
+div.user:hover {
+ background-image: none;
+}
body.users.index #container a {
text-decoration: none;

0 comments on commit 2b988ad

Please sign in to comment.