Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
0278b09697f7
Commit
9f4fde04
authored
Apr 03, 2013
by
Dmitriy Zaporozhets
Browse files
Dont show project limit sidebar if user can own 100+ more projects
parent
be1b00314a9e
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/models/user.rb
View file @
0278b096
...
...
@@ -325,9 +325,13 @@ def cared_merge_requests
MergeRequest
.
cared
(
self
)
end
def
projects_limit_left
projects_limit
-
owned_projects
.
count
end
def
projects_limit_percent
return
100
if
projects_limit
.
zero?
(
personal
_projects
.
count
.
to_f
/
projects_limit
)
*
100
(
owned
_projects
.
count
.
to_f
/
projects_limit
)
*
100
end
def
recent_push
project_id
=
nil
...
...
app/views/profiles/show.html.haml
View file @
0278b096
...
...
@@ -73,16 +73,17 @@
Want to share a team between projects?
=
link_to
new_team_path
,
class:
"btn btn-tiny"
do
Create a team
%fieldset
%legend
Personal projects:
%small
.pull-right
%span
=
current_user
.
owned_projects
.
count
of
%span
=
current_user
.
projects_limit
.padded
.progress
.bar
{
style:
"width: #{current_user.projects_limit_percent}%;"
}
-
unless
current_user
.
projects_limit_left
>
100
%fieldset
%legend
Owned projects:
%small
.pull-right
%span
=
current_user
.
owned_projects
.
count
of
%span
=
current_user
.
projects_limit
.padded
.progress
.bar
{
style:
"width: #{current_user.projects_limit_percent}%;"
}
%fieldset
%legend
...
...
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