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
Léo-Paul Géneau
gitlab-ce
Commits
9f4fde04
Commit
9f4fde04
authored
Apr 03, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dont show project limit sidebar if user can own 100+ more projects
parent
d61a21d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
11 deletions
+16
-11
app/models/user.rb
app/models/user.rb
+5
-1
app/views/profiles/show.html.haml
app/views/profiles/show.html.haml
+11
-10
No files found.
app/models/user.rb
View file @
9f4fde04
...
...
@@ -325,9 +325,13 @@ class User < ActiveRecord::Base
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 @
9f4fde04
...
...
@@ -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