Commit c70c499e authored by Rubén Dávila's avatar Rubén Dávila

Apply some small refactors after code review

parent 6fa078b6
......@@ -60,9 +60,10 @@ module LicenseHelper
end
def new_trial_url
return_to_url = URI.encode(Gitlab.config.gitlab.url)
uri = URI.parse(Gitlab::SUBSCRIPTIONS_URL)
uri.path = '/trials/new'
uri.query = "return_to=#{Gitlab.config.gitlab.url}"
uri.query = "return_to=#{return_to_url}"
uri.to_s
end
......
......@@ -201,10 +201,6 @@ class License < ActiveRecord::Base
return unless license && license.valid?
license
end
def trial
all.detect { |license| license.trial? }
end
end
def data_filename
......
- admin_without_ee_license = !current_license && current_user.admin?
.row.blank-state-parent-container{ class: "#{ 'has-start-trial-container' if admin_without_ee_license }" }
.row.blank-state-parent-container{ class: ('has-start-trial-container' if admin_without_ee_license) }
.section-container.section-welcome{ class: "#{ 'col-md-6' if admin_without_ee_license }" }
.container.section-body
.blank-state.blank-state-welcome
......
.page-with-sidebar.js-page-with-sidebar{ class: "#{('page-with-new-sidebar' if defined?(@new_sidebar) && @new_sidebar)} #{page_gutter_class}" }
.page-with-sidebar.js-page-with-sidebar{ class: [('page-with-new-sidebar' if @new_sidebar), page_gutter_class] }
- if show_new_nav?
- if defined?(nav) && nav
= render "layouts/nav/#{nav}"
......
- if current_license&.trial? && license_message.present?
.alert.alert-dismissible.gitlab-ee-trial-banner.hidden.js-gitlab-ee-trial-banner{ role: 'alert', 'data-license-expiry' => current_license.expires_at }
.alert.alert-dismissible.gitlab-ee-trial-banner.hidden.js-gitlab-ee-trial-banner{ role: 'alert', data: { license_expiry: current_license.expires_at }}
%button.close{ type: 'button', 'data-dismiss' => 'alert', 'aria-label' => 'Dismiss banner' }
= icon('times', 'aria-hidden' => 'true')
%p
......
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