2026-01-02 13:41:09 +00:00
|
|
|
# Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/
|
2021-10-21 05:21:51 +00:00
|
|
|
|
|
|
|
|
class MobileController < ApplicationController
|
|
|
|
|
def index
|
2023-02-20 09:55:34 +00:00
|
|
|
render(layout: 'layouts/mobile', locals: { locale: current_user&.preferences&.dig(:locale) })
|
2021-10-21 05:21:51 +00:00
|
|
|
end
|
2022-11-07 12:05:57 +00:00
|
|
|
|
|
|
|
|
def service_worker
|
|
|
|
|
render(file: Rails.root.join("public/#{ViteRuby.config.public_output_dir}/sw.js"), layout: false)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def manifest
|
|
|
|
|
name = Setting.get('organization').presence || Setting.get('product_name').presence || 'Zammad'
|
|
|
|
|
|
|
|
|
|
render(
|
|
|
|
|
layout: false,
|
|
|
|
|
json: {
|
|
|
|
|
id: '/mobile/',
|
|
|
|
|
short_name: 'Zammad',
|
|
|
|
|
name: name,
|
|
|
|
|
# TODO
|
|
|
|
|
# dir: "ltr",
|
|
|
|
|
# lang: "en-US",
|
|
|
|
|
orientation: 'portrait',
|
|
|
|
|
background_color: '#191919',
|
|
|
|
|
theme_color: '#191919',
|
|
|
|
|
display: 'standalone',
|
|
|
|
|
start_url: '/mobile/',
|
|
|
|
|
icons: [
|
2023-11-30 11:03:30 +00:00
|
|
|
# files are relative to manifest.webmanifest and are stored in public/assets/frontend
|
|
|
|
|
{ src: '../assets/frontend/app-icon-512.png', sizes: '512x512', type: 'image/png' },
|
|
|
|
|
{ src: '../assets/frontend/app-icon-192.png', sizes: '192x192', type: 'image/png' },
|
2022-11-07 12:05:57 +00:00
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
content_type: 'application/manifest+json'
|
|
|
|
|
)
|
|
|
|
|
end
|
2021-10-21 05:21:51 +00:00
|
|
|
end
|