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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
ddb3a56b
Commit
ddb3a56b
authored
Jan 04, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move ee-specific helpers to their own file
parent
241678fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
44 deletions
+47
-44
app/helpers/ee/groups_helper.rb
app/helpers/ee/groups_helper.rb
+47
-0
app/helpers/groups_helper.rb
app/helpers/groups_helper.rb
+0
-44
No files found.
app/helpers/ee/groups_helper.rb
0 → 100644
View file @
ddb3a56b
module
EE
module
GroupsHelper
def
group_shared_runner_limits_quota
(
group
)
used
=
group
.
shared_runners_minutes
.
to_i
if
group
.
shared_runners_minutes_limit_enabled?
limit
=
group
.
actual_shared_runners_minutes_limit
status
=
group
.
shared_runners_minutes_used?
?
'over_quota'
:
'under_quota'
else
limit
=
'Unlimited'
status
=
'disabled'
end
content_tag
(
:span
,
class:
"shared_runners_limit_
#{
status
}
"
)
do
"
#{
used
}
/
#{
limit
}
"
end
end
def
group_shared_runner_limits_percent_used
(
group
)
return
0
unless
group
.
shared_runners_minutes_limit_enabled?
100
*
group
.
shared_runners_minutes
.
to_i
/
group
.
actual_shared_runners_minutes_limit
end
def
group_shared_runner_limits_progress_bar
(
group
)
percent
=
[
group_shared_runner_limits_percent_used
(
group
),
100
].
min
status
=
if
percent
==
100
'danger'
elsif
percent
>=
80
'warning'
else
'success'
end
options
=
{
class:
"progress-bar progress-bar-
#{
status
}
"
,
style:
"width:
#{
percent
}
%;"
}
content_tag
:div
,
class:
'progress'
do
content_tag
:div
,
nil
,
options
end
end
end
end
app/helpers/groups_helper.rb
View file @
ddb3a56b
...
...
@@ -58,50 +58,6 @@ module GroupsHelper
end
end
def
group_shared_runner_limits_quota
(
group
)
used
=
group
.
shared_runners_minutes
.
to_i
if
group
.
shared_runners_minutes_limit_enabled?
limit
=
group
.
actual_shared_runners_minutes_limit
status
=
group
.
shared_runners_minutes_used?
?
'over_quota'
:
'under_quota'
else
limit
=
'Unlimited'
status
=
'disabled'
end
content_tag
(
:span
,
class:
"shared_runners_limit_
#{
status
}
"
)
do
"
#{
used
}
/
#{
limit
}
"
end
end
def
group_shared_runner_limits_percent_used
(
group
)
return
0
unless
group
.
shared_runners_minutes_limit_enabled?
100
*
group
.
shared_runners_minutes
.
to_i
/
group
.
actual_shared_runners_minutes_limit
end
def
group_shared_runner_limits_progress_bar
(
group
)
percent
=
[
group_shared_runner_limits_percent_used
(
group
),
100
].
min
status
=
if
percent
==
100
'danger'
elsif
percent
>=
80
'warning'
else
'success'
end
options
=
{
class:
"progress-bar progress-bar-
#{
status
}
"
,
style:
"width:
#{
percent
}
%;"
}
content_tag
:div
,
class:
'progress'
do
content_tag
:div
,
nil
,
options
end
end
def
group_issues
(
group
)
IssuesFinder
.
new
(
current_user
,
group_id:
group
.
id
).
execute
end
...
...
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