diff --git a/app/assets/javascripts/local.js b/app/assets/javascripts/local.js index 427e4ee..caee771 100644 --- a/app/assets/javascripts/local.js +++ b/app/assets/javascripts/local.js @@ -152,8 +152,8 @@ $(function() { }); // User page - $("td#userNavi > div > a").click(function(){ - $("td#userData").fadeOut("fast"); + $("#user-profile li a").click(function(){ + $("#user-data").fadeOut("fast"); $.ajax({ type: "GET", url: window.location.protocol + "//" + window.location.host + "/" + window.location.pathname + ".js?page=" + $(this).attr('id'), diff --git a/app/assets/stylesheets/layout/_body.scss b/app/assets/stylesheets/layout/_body.scss index 5f90123..20ad9bd 100644 --- a/app/assets/stylesheets/layout/_body.scss +++ b/app/assets/stylesheets/layout/_body.scss @@ -8,6 +8,7 @@ body { padding: 0; width: 100%; min-height: 100%; + background-color: transparent; } body { diff --git a/app/assets/stylesheets/pages/_contests.scss b/app/assets/stylesheets/pages/_contests.scss index 856dd07..6216300 100644 --- a/app/assets/stylesheets/pages/_contests.scss +++ b/app/assets/stylesheets/pages/_contests.scss @@ -2,7 +2,7 @@ Contester */ -#matches { +div#matches { @include span-columns(12); margin: em(20) 0; } diff --git a/app/assets/stylesheets/pages/_matches.scss b/app/assets/stylesheets/pages/_matches.scss index ac8c637..e6a2fb5 100644 --- a/app/assets/stylesheets/pages/_matches.scss +++ b/app/assets/stylesheets/pages/_matches.scss @@ -2,7 +2,7 @@ Matches Listing */ -#matches { +table#matches { width: 100%; display: table; table-layout: auto; diff --git a/app/assets/stylesheets/pages/_users.scss b/app/assets/stylesheets/pages/_users.scss index fbd53b6..1ea124d 100644 --- a/app/assets/stylesheets/pages/_users.scss +++ b/app/assets/stylesheets/pages/_users.scss @@ -54,6 +54,26 @@ } } +#user-profile { + + .photo { + @include span-columns(12); + margin: em(20) 0; + text-align: center; + + img { + display: inline-block; + float: none; + width: auto; + } + } + + #user-data { + @include span-columns(12); + margin-bottom: em(20); + } +} + /* Agenda */ diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e8b807f..ac0751c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -54,18 +54,19 @@ module ApplicationHelper def printtime time, format return unless time + out = "" out << '' out << time.strftime(format) out << '' - raw out + + out.html_safe end def cascade model, list - out = "" - - list.each do |element| + out = list.map do |element| name = key = element + item = "" result = "" if element.instance_of?(Array) @@ -91,12 +92,19 @@ module ApplicationHelper result << h(str) end - out << "
" - out << "#{name.to_s.capitalize.gsub(/_s/, '').gsub(/_/, ' ')}: " - out << result - out << "
" + item << content_tag(:dt) do + "#{name.to_s.capitalize.gsub(/_s/, '').gsub(/_/, ' ')}" + end + item << content_tag(:dd) do + result + end + + item + end + + content_tag(:dl) do + out.join.html_safe end - raw out end def abslink text, url diff --git a/app/views/users/_general.html.erb b/app/views/users/_general.html.erb index da9692e..0fbecf4 100644 --- a/app/views/users/_general.html.erb +++ b/app/views/users/_general.html.erb @@ -1,8 +1,6 @@ -- Joined: <%= longtime @user.created_at %> -
+ Joined: <%= longtime @user.created_at %> + -- Lastvisit: <%= longtime @user.lastvisit %> +
+ Last visit: <%= longtime @user.lastvisit %>
<% if cuser and cuser.admin? %> @@ -31,7 +29,7 @@ <% end %> -<%= cascade @user, [ ["Comments", "posted_comments.count"], ["Matches", "matches.count"]] %> +<%= cascade @user, [["Comments", "posted_comments.count"], ["Matches", "matches.count"]] %> <% if @user.groups.count > 0 %>@@ -56,8 +54,8 @@ Contact -
-
- <%= image_tag @user.profile.avatar.url, :id => "user" %>
+
+
+ + <%= @user.username %> +-
- <%= @user.username %>
-
-
+ <%= image_tag @user.profile.avatar.url %>
+
- - -
- General
-
-
-
- Favorites
-
-
-
- Computer
-
-
- <% if @user.articles.count > 0 %>
-
- Articles
-
- <% end %>
-
- <% if @user.movies.count > 0 %>
-
- Movies
-
- <% end %>
+
+ |
+ <% if @user.movies.count > 0 %>
+
+
<%= render :partial => "general" %>
- |
-