diff --git a/CHANGELOG-EE b/CHANGELOG-EE index bef9ac70c6..b841f224a7 100644 --- a/CHANGELOG-EE +++ b/CHANGELOG-EE @@ -1,3 +1,6 @@ +v 6.8.0 + - Customise sign-in page with custom text and logo + v 6.7.1 - Handle LDAP errors in Adapter#dn_matches_filter? diff --git a/app/assets/images/brand_logo.png b/app/assets/images/brand_logo.png new file mode 100644 index 0000000000..1abd7d68d6 Binary files /dev/null and b/app/assets/images/brand_logo.png differ diff --git a/app/assets/javascripts/appearances.js.coffee b/app/assets/javascripts/appearances.js.coffee new file mode 100644 index 0000000000..24f83d18bb --- /dev/null +++ b/app/assets/javascripts/appearances.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index ce36c1132e..2ce09a6553 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -72,6 +72,7 @@ @import "sections/dashboard.scss"; @import "sections/stat_graph.scss"; @import "sections/groups.scss"; +@import "sections/appearances.scss"; /** * Code highlight diff --git a/app/assets/stylesheets/sections/appearances.scss b/app/assets/stylesheets/sections/appearances.scss new file mode 100644 index 0000000000..addf79cfb1 --- /dev/null +++ b/app/assets/stylesheets/sections/appearances.scss @@ -0,0 +1,4 @@ +.appearance-logo-preview { + max-width: 400px; + margin-bottom: 20px; +} diff --git a/app/assets/stylesheets/sections/login.scss b/app/assets/stylesheets/sections/login.scss index a78a9cd487..61e2795b33 100644 --- a/app/assets/stylesheets/sections/login.scss +++ b/app/assets/stylesheets/sections/login.scss @@ -5,12 +5,19 @@ font-weight: 200; } - .login-box{ - max-width: 304px; + .login-box { position: relative; - @include border-radius(5px); margin: auto; - background: white; + padding: 20px; + background: #f5f5f5; + border: 1px solid #EEE; + } + + .brand-image { + margin-bottom: 20px; + img { + max-width: 100%; + } } .login-logo{ @@ -19,7 +26,7 @@ } .form-control { - background-color: #f1f1f1; + background-color: #FFF; font-size: 16px; padding: 14px 10px; width: 100%; diff --git a/app/controllers/admin/appearances_controller.rb b/app/controllers/admin/appearances_controller.rb new file mode 100644 index 0000000000..94e53ec641 --- /dev/null +++ b/app/controllers/admin/appearances_controller.rb @@ -0,0 +1,39 @@ +class Admin::AppearancesController < Admin::ApplicationController + before_filter :set_appearance, except: :create + + def show + end + + def preview + end + + def create + @appearance = Appearance.new(appearance_params) + + if @appearance.save + redirect_to admin_appearances_path, notice: 'Appearance was successfully created.' + else + render action: 'show' + end + end + + def update + if @appearance.update(appearance_params) + redirect_to admin_appearances_path, notice: 'Appearance was successfully updated.' + else + render action: 'show' + end + end + + private + + # Use callbacks to share common setup or constraints between actions. + def set_appearance + @appearance = Appearance.last || Appearance.new + end + + # Only allow a trusted parameter "white list" through. + def appearance_params + params.require(:appearance).permit(:title, :description, :logo, :updated_by) + end +end diff --git a/app/helpers/appearances_helper.rb b/app/helpers/appearances_helper.rb new file mode 100644 index 0000000000..80b9ed3a14 --- /dev/null +++ b/app/helpers/appearances_helper.rb @@ -0,0 +1,45 @@ +module AppearancesHelper + def brand_title + if brand_item + brand_item.title + else + 'GitLab Enterprise Edition' + end + end + + def brand_image + logo = if brand_item + brand_item.logo + else + 'brand_logo.png' + end + + image_tag logo + end + + def brand_text + default_text =<