FEATURE: adds header text/background color to site (#6462)

This commit is contained in:
Joffrey JAFFEUX 2018-10-08 11:52:57 +02:00 committed by GitHub
parent 40fa96777d
commit 22187508e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -42,7 +42,9 @@ class SiteController < ApplicationController
apple_touch_icon_url: UrlHelper.absolute(SiteSetting.apple_touch_icon_url), apple_touch_icon_url: UrlHelper.absolute(SiteSetting.apple_touch_icon_url),
favicon_url: UrlHelper.absolute(SiteSetting.favicon_url), favicon_url: UrlHelper.absolute(SiteSetting.favicon_url),
title: SiteSetting.title, title: SiteSetting.title,
description: SiteSetting.site_description description: SiteSetting.site_description,
header_primary_color: ColorScheme.hex_for_name('header_primary') || '333333',
header_background_color: ColorScheme.hex_for_name('header_background') || 'ffffff'
} }
results[:mobile_logo_url] = SiteSetting.mobile_logo_url.presence results[:mobile_logo_url] = SiteSetting.mobile_logo_url.presence

View File

@ -21,6 +21,8 @@ describe SiteController do
expect(json["apple_touch_icon_url"]).to eq("https://boom.com/apple/logo.png") expect(json["apple_touch_icon_url"]).to eq("https://boom.com/apple/logo.png")
expect(json["logo_small_url"]).to eq("http://boom.com/uploads/logo_small.png") expect(json["logo_small_url"]).to eq("http://boom.com/uploads/logo_small.png")
expect(json["mobile_logo_url"]).to eq("https://a.a/a.png") expect(json["mobile_logo_url"]).to eq("https://a.a/a.png")
expect(json["header_primary_color"]).to eq("333333")
expect(json["header_background_color"]).to eq("ffffff")
end end
end end