[#277] new title of the profile

This commit is contained in:
Alexander Machehin 2013-08-22 19:55:44 +06:00
parent e8bf76bf00
commit 3e9ad8dd58
8 changed files with 348 additions and 32 deletions

BIN
app/assets/images/gears.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -43,4 +43,9 @@ module ApplicationHelper
html << link_to('×', '#', :class => 'close close-alert', 'data-dismiss' => 'alert')
html << '</div></div>'
end
# Why 42? Because it is the Answer!
def short_message(message, length = 42)
truncate(message, :length => length, :omission => '…')
end
end

View File

@ -38,11 +38,6 @@ module CommitHelper
id[0..size-1]
end
def short_commit_message(message)
# Why 42? Because it is the Answer!
truncate(message, :length => 42, :omission => "...")
end
def commit_author_link(author)
name = author.name
email = author.email

View File

@ -1,4 +1,8 @@
-set_meta_tags :title => title_object(@group)
- edit_link = can?(:edit, @group) ? link_to(t("layout.edit"), edit_group_path(@group), :class => 'button') : nil
= render 'shared/profile', :uname => @group.name, :group => @group, :search_path => group_path, :projects => @projects, :edit_link => edit_link
- edit_url = can?(:edit, @group) ? edit_group_path(@group) : nil
= render 'shared/profile', :uname => @group.name,
:group => @group,
:search_path => group_path,
:projects => @projects,
:edit_url => edit_url

View File

@ -12,7 +12,7 @@
(#{commit_author_link(committer)})
%br
%span.date= commit_date(elem[0].committed_date)
%span.message{:title => elem[0].message}= short_commit_message(elem[0].message)
%span.message{:title => elem[0].message}= short_message(elem[0].message)
%td.lines
= index

View File

@ -1,25 +1,41 @@
- edit_link ||= nil
- edit_url ||= nil
- user ||= nil
- group ||= nil
- name ||= uname
.avatar
= image_tag avatar_url(user || group, :big)
- if edit_link
%br
= edit_link
.info
%h3= title uname
= name
- if user
%br
= mail_to user.email, user.email, :encode => "javascript"
%br
- desc, desc_title = if user
- [user.professional_experience, t('activerecord.attributes.user.professional_experience')]
- else
- [group.description , t('activerecord.attributes.group.description')]
- max_length = 35
.row
.span3
%div{:style => 'float: left;width: 81px; height: 81px;'}
= image_tag avatar_url(user || group, :big), :alt => (user || group).uname
%div{:style => 'float: left; width: 138px;'}
%h3{:style => 'margin: 0 0 0 10px;', :title => uname}= title short_message(uname, 16)
%p{:style => 'height: 20px; margin-left: 10px;', :title => user.try(:name)}
- if user
= short_message(user.name, 28)
= link_to image_tag('gears.png', :style => 'margin: 16px 0 0 10px;'), edit_url
.both
- if user
%h4= t("activerecord.attributes.user.professional_experience") + ":"
%p= user.professional_experience
- else
%h4= t("activerecord.attributes.group.description") + ":"
%p= group.description
%p{:style => 'margin-top: 10px;'}
- message = "#{t 'activerecord.attributes.user.email'}: "
= message
= mail_to user.email, short_message(user.email, max_length - message.length), :encode => 'javascript', :title => user.email
%p
- message = "#{t 'activerecord.attributes.user.site'}: "
= message
= link_to short_message(user.site, max_length - message.length), user.site, :title => user.site
%p{:title => user.company}= short_message("#{t 'activerecord.attributes.user.company'}: #{user.company}", max_length)
%p{:title => user.location}= short_message("#{t 'activerecord.attributes.user.location'}: #{user.location}", max_length)
.span6
%h3{:style => 'margin-top: 0;'}= desc_title
= desc
%hr{:color => 'dfe8ef', :size => '3', :style => 'margin-top: 20px;'}
.content
%h4= t("layout.projects.public_projects_list") + ":"
%p
@ -33,6 +49,3 @@
%br
= will_paginate projects
%br
:javascript
$('article .all').addClass('verybigpadding');

View File

@ -1,4 +1,10 @@
-set_meta_tags :title => title_object(@user)
- edit_link = can?(:edit, @user) ? link_to(t("layout.users.settings"), current_user == @user ? profile_settings_path : edit_admin_user_path(@user), :class => 'button width81') : nil
= render 'shared/profile', :uname => @user.uname, :name => @user.name, :user => @user, :search_path => user_path, :projects => @projects, :edit_link => edit_link
- edit_url = can?(:edit, @user) ? (current_user == @user ? profile_settings_path : edit_admin_user_path(@user)) : nil
= render 'shared/profile', :uname => @user.uname,
:name => @user.name,
:user => @user,
:search_path => user_path,
:projects => @projects,
:edit_url => edit_url

View File

@ -840,4 +840,297 @@ a.badge:hover {
}
.icon-remove-circle {
background-position: -168px -96px;
}
}
.hide-text {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.input-block-level {
display: block;
width: 100%;
min-height: 30px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.row {
margin-left: -20px;
*zoom: 1;
}
.row:before,
.row:after {
display: table;
content: "";
line-height: 0;
}
.row:after {
clear: both;
}
[class*="span"] {
float: left;
min-height: 1px;
margin-left: 20px;
}
.container,
.navbar-static-top .container,
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
width: 940px;
}
.span12 {
width: 940px;
}
.span11 {
width: 860px;
}
.span10 {
width: 780px;
}
.span9 {
width: 700px;
}
.span8 {
width: 620px;
}
.span7 {
width: 540px;
}
.span6 {
width: 460px;
}
.span5 {
width: 380px;
}
.span4 {
width: 300px;
}
.span3 {
width: 220px;
}
.span2 {
width: 140px;
}
.span1 {
width: 60px;
}
.offset12 {
margin-left: 980px;
}
.offset11 {
margin-left: 900px;
}
.offset10 {
margin-left: 820px;
}
.offset9 {
margin-left: 740px;
}
.offset8 {
margin-left: 660px;
}
.offset7 {
margin-left: 580px;
}
.offset6 {
margin-left: 500px;
}
.offset5 {
margin-left: 420px;
}
.offset4 {
margin-left: 340px;
}
.offset3 {
margin-left: 260px;
}
.offset2 {
margin-left: 180px;
}
.offset1 {
margin-left: 100px;
}
.row-fluid {
width: 100%;
*zoom: 1;
}
.row-fluid:before,
.row-fluid:after {
display: table;
content: "";
line-height: 0;
}
.row-fluid:after {
clear: both;
}
.row-fluid [class*="span"] {
display: block;
width: 100%;
min-height: 30px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
float: left;
margin-left: 2.127659574468085%;
*margin-left: 2.074468085106383%;
}
.row-fluid [class*="span"]:first-child {
margin-left: 0;
}
.row-fluid .controls-row [class*="span"] + [class*="span"] {
margin-left: 2.127659574468085%;
}
.row-fluid .span12 {
width: 100%;
*width: 99.94680851063829%;
}
.row-fluid .span11 {
width: 91.48936170212765%;
*width: 91.43617021276594%;
}
.row-fluid .span10 {
width: 82.97872340425532%;
*width: 82.92553191489361%;
}
.row-fluid .span9 {
width: 74.46808510638297%;
*width: 74.41489361702126%;
}
.row-fluid .span8 {
width: 65.95744680851064%;
*width: 65.90425531914893%;
}
.row-fluid .span7 {
width: 57.44680851063829%;
*width: 57.39361702127659%;
}
.row-fluid .span6 {
width: 48.93617021276595%;
*width: 48.88297872340425%;
}
.row-fluid .span5 {
width: 40.42553191489362%;
*width: 40.37234042553192%;
}
.row-fluid .span4 {
width: 31.914893617021278%;
*width: 31.861702127659576%;
}
.row-fluid .span3 {
width: 23.404255319148934%;
*width: 23.351063829787233%;
}
.row-fluid .span2 {
width: 14.893617021276595%;
*width: 14.840425531914894%;
}
.row-fluid .span1 {
width: 6.382978723404255%;
*width: 6.329787234042553%;
}
.row-fluid .offset12 {
margin-left: 104.25531914893617%;
*margin-left: 104.14893617021275%;
}
.row-fluid .offset12:first-child {
margin-left: 102.12765957446808%;
*margin-left: 102.02127659574467%;
}
.row-fluid .offset11 {
margin-left: 95.74468085106382%;
*margin-left: 95.6382978723404%;
}
.row-fluid .offset11:first-child {
margin-left: 93.61702127659574%;
*margin-left: 93.51063829787232%;
}
.row-fluid .offset10 {
margin-left: 87.23404255319149%;
*margin-left: 87.12765957446807%;
}
.row-fluid .offset10:first-child {
margin-left: 85.1063829787234%;
*margin-left: 84.99999999999999%;
}
.row-fluid .offset9 {
margin-left: 78.72340425531914%;
*margin-left: 78.61702127659572%;
}
.row-fluid .offset9:first-child {
margin-left: 76.59574468085106%;
*margin-left: 76.48936170212764%;
}
.row-fluid .offset8 {
margin-left: 70.2127659574468%;
*margin-left: 70.10638297872339%;
}
.row-fluid .offset8:first-child {
margin-left: 68.08510638297872%;
*margin-left: 67.9787234042553%;
}
.row-fluid .offset7 {
margin-left: 61.70212765957446%;
*margin-left: 61.59574468085106%;
}
.row-fluid .offset7:first-child {
margin-left: 59.574468085106375%;
*margin-left: 59.46808510638297%;
}
.row-fluid .offset6 {
margin-left: 53.191489361702125%;
*margin-left: 53.085106382978715%;
}
.row-fluid .offset6:first-child {
margin-left: 51.063829787234035%;
*margin-left: 50.95744680851063%;
}
.row-fluid .offset5 {
margin-left: 44.68085106382979%;
*margin-left: 44.57446808510638%;
}
.row-fluid .offset5:first-child {
margin-left: 42.5531914893617%;
*margin-left: 42.4468085106383%;
}
.row-fluid .offset4 {
margin-left: 36.170212765957444%;
*margin-left: 36.06382978723405%;
}
.row-fluid .offset4:first-child {
margin-left: 34.04255319148936%;
*margin-left: 33.93617021276596%;
}
.row-fluid .offset3 {
margin-left: 27.659574468085104%;
*margin-left: 27.5531914893617%;
}
.row-fluid .offset3:first-child {
margin-left: 25.53191489361702%;
*margin-left: 25.425531914893618%;
}
.row-fluid .offset2 {
margin-left: 19.148936170212764%;
*margin-left: 19.04255319148936%;
}
.row-fluid .offset2:first-child {
margin-left: 17.02127659574468%;
*margin-left: 16.914893617021278%;
}
.row-fluid .offset1 {
margin-left: 10.638297872340425%;
*margin-left: 10.53191489361702%;
}
.row-fluid .offset1:first-child {
margin-left: 8.51063829787234%;
*margin-left: 8.404255319148938%;
}
[class*="span"].hide,
.row-fluid [class*="span"].hide {
display: none;
}
[class*="span"].pull-right,
.row-fluid [class*="span"].pull-right {
float: right;
}