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
867fd30d
Commit
867fd30d
authored
Jun 30, 2017
by
Ruben Davila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update some sections of the admin license page
parent
3a2c28c1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
10 deletions
+15
-10
app/controllers/trials_controller.rb
app/controllers/trials_controller.rb
+1
-3
app/helpers/license_helper.rb
app/helpers/license_helper.rb
+1
-1
app/views/admin/licenses/show.html.haml
app/views/admin/licenses/show.html.haml
+12
-6
lib/gitlab.rb
lib/gitlab.rb
+1
-0
No files found.
app/controllers/trials_controller.rb
View file @
867fd30d
class
TrialsController
<
ApplicationController
SUBSCRIPTIONS_PORTAL_URL
=
'https://customers.gitlab.com'
before_filter
:check_presence_of_license
def
new
...
...
@@ -24,7 +22,7 @@ class TrialsController < ApplicationController
end
def
save_license
result
=
HTTParty
.
post
(
"
#{
SUBSCRIPTIONS_PORTAL
_URL
}
/trials"
,
body:
params
)
result
=
HTTParty
.
post
(
"
#{
Gitlab
::
SUBSCRIPTIONS
_URL
}
/trials"
,
body:
params
)
if
result
.
ok?
@license
.
data
=
result
[
'license_key'
]
...
...
app/helpers/license_helper.rb
View file @
867fd30d
...
...
@@ -19,7 +19,7 @@ module LicenseHelper
def
trial_license_message
return
unless
signed_in?
&&
current_license
&
.
trial?
buy_now_link
=
link_to
(
'Buy now!'
,
'https://customers.gitlab.com/plans'
,
target:
'_blank'
)
buy_now_link
=
link_to
(
'Buy now!'
,
"
#{
Gitlab
::
SUBSCRIPTIONS_URL
}
/plans"
,
target:
'_blank'
)
message
=
if
current_license
.
expired?
if
current_user
.
admin?
...
...
app/views/admin/licenses/show.html.haml
View file @
867fd30d
-
page_title
"License"
%h3
.page-title
Your License
=
link_to
'Upload New License'
,
new_admin_license_path
,
class:
"btn btn-new pull-right"
-
if
current_license
.
trial?
=
link_to
'Buy License'
,
"
#{
Gitlab
::
SUBSCRIPTIONS_URL
}
/plans"
,
target:
'_blank'
,
class:
"btn btn-new pull-right"
=
link_to
'Upload New License'
,
new_admin_license_path
,
class:
"btn pull-right"
-
else
=
link_to
'Upload New License'
,
new_admin_license_path
,
class:
"btn btn-new pull-right"
%hr
...
...
@@ -32,11 +36,13 @@
Expired:
-
else
Expires:
%strong
-
if
@license
.
will_expire?
=
time_ago_with_tooltip
@license
.
expires_at
-
else
Never
-
if
@license
.
will_expire?
%strong
=
time_ago_with_tooltip
(
@license
.
expires_at
)
-
if
@license
.
trial?
-
remaining_days
=
(
@license
.
expires_at
-
Date
.
today
).
to_i
%span
=
"(Free trial will expire in
#{
pluralize
(
remaining_days
,
'day'
)
}
)"
-
else
%strong
Never
-
if
@license
.
expired?
%span
.label.label-danger.pull-right
...
...
lib/gitlab.rb
View file @
867fd30d
...
...
@@ -3,6 +3,7 @@ require_dependency 'gitlab/git'
module
Gitlab
SUBDOMAIN_REGEX
=
%r{
\A
https://[a-z0-9]+
\.
gitlab
\.
com
\z
}
COM_URL
=
'https://gitlab.com'
.
freeze
SUBSCRIPTIONS_URL
=
'https://customers.gitlab.com'
.
freeze
def
self
.
com?
# Check `gl_subdomain?` as well to keep parity with gitlab.com
...
...
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