Commit 867fd30d authored by Ruben Davila's avatar Ruben Davila

Update some sections of the admin license page

parent 3a2c28c1
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']
......
......@@ -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?
......
- 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
......
......@@ -3,6 +3,7 @@ require_dependency 'gitlab/git'
module Gitlab
SUBDOMAIN_REGEX = %r{\Ahttps://[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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment