Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
1c6df8e0
Commit
1c6df8e0
authored
Mar 24, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved profile & team member show
parent
fea64946
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
139 additions
and
81 deletions
+139
-81
app/assets/stylesheets/common.scss
app/assets/stylesheets/common.scss
+9
-6
app/models/user.rb
app/models/user.rb
+8
-1
app/views/dashboard/index.html.haml
app/views/dashboard/index.html.haml
+9
-0
app/views/devise/sessions/new.html.erb
app/views/devise/sessions/new.html.erb
+7
-0
app/views/devise/shared/_links.erb
app/views/devise/shared/_links.erb
+0
-6
app/views/profile/show.html.haml
app/views/profile/show.html.haml
+55
-28
app/views/team_members/show.html.haml
app/views/team_members/show.html.haml
+44
-39
db/migrate/20120323221339_add_bio_field_to_user.rb
db/migrate/20120323221339_add_bio_field_to_user.rb
+5
-0
db/schema.rb
db/schema.rb
+2
-1
No files found.
app/assets/stylesheets/common.scss
View file @
1c6df8e0
...
@@ -358,12 +358,15 @@ img.lil_av {
...
@@ -358,12 +358,15 @@ img.lil_av {
top
:
3px
;
top
:
3px
;
}
}
.media-grid
{
.profile_avatar_holder
{
h3
,
h2
,
h4
{
&
.media_h
{
padding-left
:
10px
;
float
:left
;
float
:left
;
}
width
:
90px
;
height
:
90px
;
margin-right
:
20px
;
img
{
width
:
90px
;
height
:
90px
;
background
:
#eee
;
}
}
}
}
...
...
app/models/user.rb
View file @
1c6df8e0
...
@@ -5,13 +5,19 @@ class User < ActiveRecord::Base
...
@@ -5,13 +5,19 @@ class User < ActiveRecord::Base
:recoverable
,
:rememberable
,
:trackable
,
:validatable
,
:omniauthable
:recoverable
,
:rememberable
,
:trackable
,
:validatable
,
:omniauthable
# Setup accessible (or protected) attributes for your model
# Setup accessible (or protected) attributes for your model
attr_accessible
:email
,
:password
,
:password_confirmation
,
:remember_me
,
attr_accessible
:email
,
:password
,
:password_confirmation
,
:remember_me
,
:bio
,
:name
,
:projects_limit
,
:skype
,
:linkedin
,
:twitter
,
:dark_scheme
,
:theme_id
:name
,
:projects_limit
,
:skype
,
:linkedin
,
:twitter
,
:dark_scheme
,
:theme_id
has_many
:users_projects
,
:dependent
=>
:destroy
has_many
:users_projects
,
:dependent
=>
:destroy
has_many
:projects
,
:through
=>
:users_projects
has_many
:projects
,
:through
=>
:users_projects
has_many
:my_own_projects
,
:class_name
=>
"Project"
,
:foreign_key
=>
:owner_id
has_many
:my_own_projects
,
:class_name
=>
"Project"
,
:foreign_key
=>
:owner_id
has_many
:keys
,
:dependent
=>
:destroy
has_many
:keys
,
:dependent
=>
:destroy
has_many
:recent_events
,
:class_name
=>
"Event"
,
:foreign_key
=>
:author_id
,
:order
=>
"id DESC"
has_many
:issues
,
has_many
:issues
,
:foreign_key
=>
:author_id
,
:foreign_key
=>
:author_id
,
:dependent
=>
:destroy
:dependent
=>
:destroy
...
@@ -38,6 +44,7 @@ class User < ActiveRecord::Base
...
@@ -38,6 +44,7 @@ class User < ActiveRecord::Base
:presence
=>
true
,
:presence
=>
true
,
:numericality
=>
{
:greater_than_or_equal_to
=>
0
}
:numericality
=>
{
:greater_than_or_equal_to
=>
0
}
validates
:bio
,
:length
=>
{
:within
=>
0
..
255
}
before_create
:ensure_authentication_token
before_create
:ensure_authentication_token
alias_attribute
:private_token
,
:authentication_token
alias_attribute
:private_token
,
:authentication_token
...
...
app/views/dashboard/index.html.haml
View file @
1c6df8e0
...
@@ -34,6 +34,15 @@
...
@@ -34,6 +34,15 @@
%br
%br
=
link_to
new_project_path
,
:class
=>
"btn"
do
=
link_to
new_project_path
,
:class
=>
"btn"
do
New Project »
New Project »
-
else
%hr
%div
You've reached project limit for your account.
You cannot create new projects.
.link_holder
%br
=
link_to
profile_path
,
:class
=>
"btn"
do
Your Profile »
.span10.left
=
render
"dashboard/projects_feed"
,
:projects
=>
@active_projects
.span10.left
=
render
"dashboard/projects_feed"
,
:projects
=>
@active_projects
-
if
@last_push
-
if
@last_push
.padded.prepend-top-20
.padded.prepend-top-20
...
...
app/views/devise/sessions/new.html.erb
View file @
1c6df8e0
...
@@ -9,6 +9,13 @@
...
@@ -9,6 +9,13 @@
<br/>
<br/>
<%=
f
.
submit
"Sign in"
,
:class
=>
"primary btn"
%>
<%=
f
.
submit
"Sign in"
,
:class
=>
"primary btn"
%>
<div
class=
"right"
>
<%=
render
:partial
=>
"devise/shared/links"
%>
</div>
<div
class=
"right"
>
<%=
render
:partial
=>
"devise/shared/links"
%>
</div>
<%-
if
devise_mapping
.
omniauthable?
%>
<%-
resource_class
.
omniauth_providers
.
each
do
|
provider
|
%>
<hr/>
<%=
link_to
"Sign in with
#{
provider
.
to_s
.
titleize
}
"
,
omniauth_authorize_path
(
resource_name
,
provider
),
:class
=>
"btn primary"
%>
<br
/>
<%
end
-%>
<%
end
-%>
<%
if
ldap_enable?
-%>
<%
if
ldap_enable?
-%>
<p>
<%=
link_to
"via LDAP"
,
user_omniauth_authorize_path
(
:ldap
)
%>
</p>
<p>
<%=
link_to
"via LDAP"
,
user_omniauth_authorize_path
(
:ldap
)
%>
</p>
<%
end
-%>
<%
end
-%>
...
...
app/views/devise/shared/_links.erb
View file @
1c6df8e0
...
@@ -17,9 +17,3 @@
...
@@ -17,9 +17,3 @@
<%-
if
devise_mapping
.
lockable?
&&
resource_class
.
unlock_strategy_enabled?
(
:email
)
&&
controller_name
!=
'unlocks'
%>
<%-
if
devise_mapping
.
lockable?
&&
resource_class
.
unlock_strategy_enabled?
(
:email
)
&&
controller_name
!=
'unlocks'
%>
<%=
link_to
"Didn't receive unlock instructions?"
,
new_unlock_path
(
resource_name
)
%>
<br
/>
<%=
link_to
"Didn't receive unlock instructions?"
,
new_unlock_path
(
resource_name
)
%>
<br
/>
<%
end
-%>
<%
end
-%>
<%-
if
devise_mapping
.
omniauthable?
%>
<%-
resource_class
.
omniauth_providers
.
each
do
|
provider
|
%>
<%=
link_to
"Sign in with
#{
provider
.
to_s
.
titleize
}
"
,
omniauth_authorize_path
(
resource_name
,
provider
)
%>
<br
/>
<%
end
-%>
<%
end
-%>
app/views/profile/show.html.haml
View file @
1c6df8e0
.media-grid
.row
=
link_to
"#"
do
.span10
=
image_tag
gravatar_icon
(
@user
.
email
,
90
),
:class
=>
"thumbnail"
.profile_avatar_holder
%h3
.media_h
=
image_tag
gravatar_icon
(
@user
.
email
,
90
),
:class
=>
"styled_image"
%h3
=
@user
.
name
=
@user
.
name
%br
%br
%small
%small
=
@user
.
email
=
@user
.
email
.right
.span6.right
%p
.alert-message.block-message
You can change your avatar at gravatar.com
%div
%div
%h5
.cgray
Personal projects:
%span
.right
%span
=
current_user
.
my_own_projects
.
count
of
%span
=
current_user
.
projects_limit
%h5
.cgray
SSH public keys:
%span
.right
%span
=
current_user
.
keys
.
count
%hr
%hr
=
form_for
@user
,
:url
=>
profile_update_path
,
:method
=>
:put
do
|
f
|
=
form_for
@user
,
:url
=>
profile_update_path
,
:method
=>
:put
do
|
f
|
...
@@ -18,23 +29,39 @@
...
@@ -18,23 +29,39 @@
%ul
%ul
-
@user
.
errors
.
full_messages
.
each
do
|
msg
|
-
@user
.
errors
.
full_messages
.
each
do
|
msg
|
%li
=
msg
%li
=
msg
.row
.span9
.clearfix
.clearfix
=
f
.
label
:name
=
f
.
label
:name
.input
=
f
.
text_field
:name
.input
=
f
.
text_field
:name
,
:class
=>
"xlarge"
%span
.help-block
Enter youre name, so people you know can recognize you.
.clearfix
.clearfix
=
f
.
label
:email
=
f
.
label
:email
.input
=
f
.
text_field
:email
.input
=
f
.
text_field
:email
,
:class
=>
"xlarge"
%span
.help-block
We also use email for avatar detection
.clearfix
.clearfix
=
f
.
label
:skype
=
f
.
label
:skype
.input
=
f
.
text_field
:skype
.input
=
f
.
text_field
:skype
,
:class
=>
"xlarge"
.clearfix
.clearfix
=
f
.
label
:linkedin
=
f
.
label
:linkedin
.input
=
f
.
text_field
:linkedin
.input
=
f
.
text_field
:linkedin
,
:class
=>
"xlarge"
.clearfix
.clearfix
=
f
.
label
:twitter
=
f
.
label
:twitter
.input
=
f
.
text_field
:twitter
.input
=
f
.
text_field
:twitter
,
:class
=>
"xlarge"
.clearfix
=
f
.
label
:bio
.input
=
f
.
text_area
:bio
,
:rows
=>
6
,
:class
=>
"xlarge"
,
:maxlength
=>
250
%span
.help-block
About yourself in fewer than 250 characters.
.span7.right
%p
.alert-message.block-message
%strong
Tip:
You can change your avatar at gravatar.com
.actions
.actions
=
f
.
submit
'Save'
,
:class
=>
"primary btn"
=
f
.
submit
'Save'
,
:class
=>
"primary btn"
-#= link_to "New project", new_project_path, :class => "btn small padded"
-#= link_to "New public key", new_key_path, :class => "btn small"
app/views/team_members/show.html.haml
View file @
1c6df8e0
-
allow_admin
=
can?
current_user
,
:admin_project
,
@project
-
allow_admin
=
can?
current_user
,
:admin_project
,
@project
-
user
=
@team_member
.
user
-
user
=
@team_member
.
user
.media-grid
=
link_to
"#"
do
.row
=
image_tag
gravatar_icon
(
user
.
email
,
60
),
:class
=>
"thumbnail"
,
:width
=>
60
.span8
%h3
.media_h
.profile_avatar_holder
=
image_tag
gravatar_icon
(
user
.
email
,
90
),
:class
=>
"styled_image"
%h3
=
user
.
name
=
user
.
name
%br
%br
%small
=
user
.
email
%small
=
user
.
email
.back_link
%br
.back_link
%br
=
link_to
team_project_path
(
@project
),
:class
=>
""
do
=
link_to
team_project_path
(
@project
),
:class
=>
""
do
←
To team list
←
To team list
%br
.span8.right
%table
.zebra-striped.borders
%div
%tr
%div
%td
Name
%h5
.cgray
%td
=
user
.
name
Member since:
%span
.right
%tr
=
@team_member
.
created_at
.
stamp
(
"Aug 21, 2011"
)
%td
Email
%h5
.cgray
%td
=
user
.
email
Project Access:
%small
(
#{
link_to
"read more"
,
help_permissions_path
,
:class
=>
"vlink"
}
)
%tr
%span
.right
%td
Member since
%td
=
@team_member
.
created_at
.
stamp
(
"Aug 21, 2011"
)
%tr
%td
Project Access
(
#{
link_to
"read more"
,
help_permissions_path
,
:class
=>
"vlink"
}
)
%td
=
form_for
(
@team_member
,
:as
=>
:team_member
,
:url
=>
project_team_member_path
(
@project
,
@team_member
))
do
|
f
|
=
form_for
(
@team_member
,
:as
=>
:team_member
,
:url
=>
project_team_member_path
(
@project
,
@team_member
))
do
|
f
|
=
f
.
select
:project_access
,
options_for_select
(
Project
.
access_options
,
@team_member
.
project_access
),
{},
:class
=>
"project-access-select"
,
:disabled
=>
!
allow_admin
=
f
.
select
:project_access
,
options_for_select
(
Project
.
access_options
,
@team_member
.
project_access
),
{},
:class
=>
"project-access-select"
,
:disabled
=>
!
allow_admin
%div
.prepend-top-20
-
unless
user
.
skype
.
empty?
-
unless
user
.
skype
.
empty?
%
tr
%
p
%
td
Skype:
%
b
Skype:
%td
=
user
.
skype
=
user
.
skype
-
unless
user
.
linkedin
.
empty?
-
unless
user
.
linkedin
.
empty?
%
tr
%
p
%
td
LinkedIn:
%
b
LinkedIn:
%td
=
user
.
linkedin
=
user
.
linkedin
-
unless
user
.
twitter
.
empty?
-
unless
user
.
twitter
.
empty?
%tr
%p
%td
Twitter:
%b
Twitter:
%td
=
user
.
twitter
=
user
.
twitter
-
unless
user
.
bio
.
empty?
%p
%b
Bio:
=
user
.
bio
=
render
user
.
recent_events
.
limit
(
3
)
-
if
can?
current_user
,
:admin_project
,
@project
-
if
can?
current_user
,
:admin_project
,
@project
.actions
.actions
...
...
db/migrate/20120323221339_add_bio_field_to_user.rb
0 → 100644
View file @
1c6df8e0
class
AddBioFieldToUser
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:bio
,
:string
,
:null
=>
true
end
end
db/schema.rb
View file @
1c6df8e0
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#
#
# It's strongly recommended to check this file into your version control system.
# It's strongly recommended to check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
:version
=>
201203
15132931
)
do
ActiveRecord
::
Schema
.
define
(
:version
=>
201203
23221339
)
do
create_table
"events"
,
:force
=>
true
do
|
t
|
create_table
"events"
,
:force
=>
true
do
|
t
|
t
.
string
"target_type"
t
.
string
"target_type"
...
@@ -155,6 +155,7 @@ ActiveRecord::Schema.define(:version => 20120315132931) do
...
@@ -155,6 +155,7 @@ ActiveRecord::Schema.define(:version => 20120315132931) do
t
.
string
"authentication_token"
t
.
string
"authentication_token"
t
.
boolean
"dark_scheme"
,
:default
=>
false
,
:null
=>
false
t
.
boolean
"dark_scheme"
,
:default
=>
false
,
:null
=>
false
t
.
integer
"theme_id"
,
:default
=>
1
,
:null
=>
false
t
.
integer
"theme_id"
,
:default
=>
1
,
:null
=>
false
t
.
string
"bio"
end
end
add_index
"users"
,
[
"email"
],
:name
=>
"index_users_on_email"
,
:unique
=>
true
add_index
"users"
,
[
"email"
],
:name
=>
"index_users_on_email"
,
:unique
=>
true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment