Created
February 18, 2009 20:17
-
-
Save renchap/66516 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From ec2fc33bd8404699bebe7170e0e65d558185f29e Mon Sep 17 00:00:00 2001 | |
From: Renaud Chaput <[email protected]> | |
Date: Wed, 18 Feb 2009 21:04:40 +0100 | |
Subject: [PATCH] Cosmetic changes to character page | |
--- | |
app/controllers/characters_controller.rb | 2 +- | |
app/views/changes/_change.html.haml | 3 +- | |
app/views/characters/show_valid.html.haml | 36 +++++++++++++++++------------ | |
public/stylesheets/sass/general.sass | 10 ++++++++ | |
4 files changed, 33 insertions(+), 18 deletions(-) | |
diff --git a/app/controllers/characters_controller.rb b/app/controllers/characters_controller.rb | |
index 0a954d1..95cf2a8 100644 | |
--- a/app/controllers/characters_controller.rb | |
+++ b/app/controllers/characters_controller.rb | |
@@ -17,7 +17,7 @@ class CharactersController < ApplicationController | |
flash[:error] = "Character not in database" | |
redirect_to :root and return | |
end | |
- @latest_changes = @character.changes.find :all, :limit => 10, :order => 'created_at DESC' | |
+ @latest_changes = @character.changes.find :all, :limit => 20, :order => 'created_at DESC' | |
render :action => "show_#{@character.status}" | |
end | |
diff --git a/app/views/changes/_change.html.haml b/app/views/changes/_change.html.haml | |
index 44f5dda..277112f 100644 | |
--- a/app/views/changes/_change.html.haml | |
+++ b/app/views/changes/_change.html.haml | |
@@ -1,2 +1 @@ | |
-%li | |
- = change_line change | |
\ No newline at end of file | |
+%li= change_line change | |
\ No newline at end of file | |
diff --git a/app/views/characters/show_valid.html.haml b/app/views/characters/show_valid.html.haml | |
index 9969f16..1ff44e3 100644 | |
--- a/app/views/characters/show_valid.html.haml | |
+++ b/app/views/characters/show_valid.html.haml | |
@@ -1,28 +1,34 @@ | |
- @atom_feed = formatted_changes_character_url(@character, :atom) | |
-%h2=h @character.name | |
-%p=h @character.realm.full_name | |
-%p | |
- = "Level #{@character.level} #{@character.character_race.name} #{@character.character_class.name}" | |
- | |
-%p | |
- = "Gender : #{human_gender @character.gender}" | |
+%h2 | |
+ ="#{h @character.name}" | |
+ %span#realm_name= "(#{@character.realm.full_name})" | |
-%p | |
- = "Guild : #{@character.guild ? @character.guild.name : 'none'}" | |
+#guild= "<#{@character.guild.name}>" | |
+%p= "#{human_gender @character.gender} level #{@character.level} #{@character.character_race.name} #{@character.character_class.name}" | |
+ | |
%p | |
= "Last update : #{@character.last_armory_update.to_date.to_s}" | |
- | |
+ | |
+#recent_changes | |
+ %h3= 'Recent changes ' + link_to(image_tag('feed.png', :size => '12x12', :alt => 'Atom Feed'), formatted_changes_character_url(@character, :atom)) | |
+ %ul | |
+ = render(:partial => 'changes/change', :collection => @latest_changes) || '<li>No recent changes</li>' | |
+ %p= link_to 'All changes', changes_character_url(@character) | |
+ | |
#graphs | |
%h3 Graphs | |
%ul | |
%li | |
=link_to('Level evolution', character_level_graph_path(@character)) | |
- | |
-#recent_changes | |
- %h3= 'Recent changes ' + link_to(image_tag('feed.png', :size => '12x12', :alt => 'Atom Feed'), formatted_changes_character_url(@character, :atom)) | |
+ | |
+#titles | |
+ %h3 Titles | |
%ul | |
- = render(:partial => 'changes/change', :collection => @latest_changes) || '<p>No recent changes</p>' | |
- %p= link_to 'All changes', changes_character_url(@character) | |
+ - if @character.titles | |
+ - for title in @character.titles | |
+ %li= title.applied_to @character | |
+ - else | |
+ %li No titles found for this character | |
%p= watch_link | |
diff --git a/public/stylesheets/sass/general.sass b/public/stylesheets/sass/general.sass | |
index 6f2d672..f0717cf 100644 | |
--- a/public/stylesheets/sass/general.sass | |
+++ b/public/stylesheets/sass/general.sass | |
@@ -88,7 +88,17 @@ a | |
ul | |
padding-left: 5px | |
+h3 | |
+ margin: 5px 0 2px 0 | |
+ | |
+ul | |
+ margin: 0 | |
+ | |
+#recent_changes | |
+ float: right | |
+ | |
#footer | |
clear: both | |
font-size: 0.7em | |
text-align: center | |
+ padding-bottom: 2px | |
-- | |
1.6.0.5+GitX |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment