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
4a883f36
Commit
4a883f36
authored
Oct 02, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always associate a actual plan with a namespace
parent
6f0bb0b3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
5 deletions
+12
-5
app/controllers/groups/billings_controller.rb
app/controllers/groups/billings_controller.rb
+1
-1
app/controllers/profiles/billings_controller.rb
app/controllers/profiles/billings_controller.rb
+3
-1
app/views/groups/billings/index.html.haml
app/views/groups/billings/index.html.haml
+1
-1
app/views/shared/billings/_billing_plans.html.haml
app/views/shared/billings/_billing_plans.html.haml
+1
-1
ee/app/models/ee/namespace.rb
ee/app/models/ee/namespace.rb
+6
-1
No files found.
app/controllers/groups/billings_controller.rb
View file @
4a883f36
...
@@ -6,7 +6,7 @@ class Groups::BillingsController < Groups::ApplicationController
...
@@ -6,7 +6,7 @@ class Groups::BillingsController < Groups::ApplicationController
def
index
def
index
@top_most_group
=
@group
.
root_ancestor
if
@group
.
has_parent?
@top_most_group
=
@group
.
root_ancestor
if
@group
.
has_parent?
current_plan
=
(
@top_most_group
||
@group
).
actual_plan
current_plan
=
(
@top_most_group
||
@group
).
actual_plan
_name
@plans_data
=
FetchSubscriptionPlansService
.
new
(
plan:
current_plan
).
execute
@plans_data
=
FetchSubscriptionPlansService
.
new
(
plan:
current_plan
).
execute
end
end
end
end
app/controllers/profiles/billings_controller.rb
View file @
4a883f36
...
@@ -2,6 +2,8 @@ class Profiles::BillingsController < Profiles::ApplicationController
...
@@ -2,6 +2,8 @@ class Profiles::BillingsController < Profiles::ApplicationController
before_action
:verify_namespace_plan_check_enabled
before_action
:verify_namespace_plan_check_enabled
def
index
def
index
@plans_data
=
FetchSubscriptionPlansService
.
new
(
plan:
current_user
.
namespace
.
actual_plan
).
execute
@plans_data
=
FetchSubscriptionPlansService
.
new
(
plan:
current_user
.
namespace
.
actual_plan_name
)
.
execute
end
end
end
end
app/views/groups/billings/index.html.haml
View file @
4a883f36
-
page_title
"Billing"
-
page_title
"Billing"
-
if
@top_most_group
-
if
@top_most_group
-
top_most_group_plan
=
subscription_plan_info
(
@plans_data
,
@top_most_group
.
actual_plan
)
-
top_most_group_plan
=
subscription_plan_info
(
@plans_data
,
@top_most_group
.
actual_plan
_name
)
=
render
'shared/billings/billing_plan_header'
,
namespace:
@group
,
plan:
top_most_group_plan
,
parent_group:
@top_most_group
=
render
'shared/billings/billing_plan_header'
,
namespace:
@group
,
plan:
top_most_group_plan
,
parent_group:
@top_most_group
-
else
-
else
=
render
'shared/billings/billing_plans'
,
plans_data:
@plans_data
,
namespace:
@group
=
render
'shared/billings/billing_plans'
,
plans_data:
@plans_data
,
namespace:
@group
app/views/shared/billings/_billing_plans.html.haml
View file @
4a883f36
-
current_plan
=
subscription_plan_info
(
plans_data
,
namespace
.
actual_plan
)
-
current_plan
=
subscription_plan_info
(
plans_data
,
namespace
.
actual_plan
_name
)
-
if
current_plan
-
if
current_plan
=
render
'shared/billings/billing_plan_header'
,
namespace:
namespace
,
plan:
current_plan
=
render
'shared/billings/billing_plan_header'
,
namespace:
namespace
,
plan:
current_plan
...
...
ee/app/models/ee/namespace.rb
View file @
4a883f36
...
@@ -78,8 +78,13 @@ module EE
...
@@ -78,8 +78,13 @@ module EE
# The main difference between the "plan" column and this method is that "plan"
# The main difference between the "plan" column and this method is that "plan"
# returns nil / "" when it has no plan. Having no plan means it's a "free" plan.
# returns nil / "" when it has no plan. Having no plan means it's a "free" plan.
#
def
actual_plan
def
actual_plan
plan
&
.
name
||
FREE_PLAN
self
.
plan
||
Plan
.
find_by
(
name:
FREE_PLAN
)
end
def
actual_plan_name
actual_plan
&
.
name
||
FREE_PLAN
end
end
def
actual_shared_runners_minutes_limit
def
actual_shared_runners_minutes_limit
...
...
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