2016-02-13 13:29:53 -05:00
|
|
|
class MetadataController < ApplicationController
|
2015-09-20 11:00:30 -04:00
|
|
|
layout false
|
2016-03-20 22:18:40 -04:00
|
|
|
skip_before_filter :preload_json, :check_xhr, :redirect_to_login_if_required
|
2015-09-20 11:00:30 -04:00
|
|
|
|
2016-02-13 13:29:53 -05:00
|
|
|
def manifest
|
2015-09-20 11:00:30 -04:00
|
|
|
manifest = {
|
|
|
|
short_name: SiteSetting.title,
|
2016-03-20 22:18:40 -04:00
|
|
|
display: 'standalone',
|
2015-09-20 11:00:30 -04:00
|
|
|
orientation: 'portrait',
|
2016-03-20 22:18:40 -04:00
|
|
|
start_url: "#{Discourse.base_uri}/",
|
|
|
|
background_color: "##{ColorScheme.hex_for_name('secondary')}",
|
|
|
|
theme_color: "##{ColorScheme.hex_for_name('header_background')}"
|
2015-09-20 11:00:30 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
render json: manifest.to_json
|
|
|
|
end
|
2016-02-13 13:29:53 -05:00
|
|
|
|
|
|
|
def opensearch
|
|
|
|
render file: "#{Rails.root}/app/views/metadata/opensearch.xml"
|
|
|
|
end
|
2015-09-20 11:00:30 -04:00
|
|
|
end
|