Commit d30f5e01 by NGUYEN HOANG SON

Merge branch 'feature/1.4.3_dev_49153' into feature/1.4.3_dev

* feature/1.4.3_dev_49153:
  implement dashboard setting data, action
  add dashboard-setting html
parents dd2e479f 07c72174
<!DOCTYPE html>
<html lang="ja-JP">
<head>
<meta charset="utf-8">
<title>ダッシュボード設定</title>
<meta name="robots" content="index, follow">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<meta name="description" content="A Book Check">
<link rel="stylesheet" type="text/css" href="css/app.css">
<link rel="stylesheet" type="text/css" href="css/fontawesome_relative_path.css">
<link rel="stylesheet" type="text/css" href="css/header.css">
<link rel="stylesheet" type="text/css" href="css/footer.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="js/jquery-1.11.2.min.js?__UPDATEID__"></script>
<script src="script/check.js?__UPDATEID__"></script>
<script src="script/check-list.js?__UPDATEID__"></script>
<script src="script/check-foriOS.js"></script>
<script src="script/constant.js?__UPDATEID__"></script>
<script src="script/check-dashboard-setting.js"></script>
</head>
<body id="dashboard" onload="CHK_DashboardSetting.init();">
<header>
<nav class="navbar navbar-dark bg-primary position-fixed fixed-top w-100">
<a href="index.html" class="navbar-brand category-btn lht-0">
<i class="fas fa-chevron-left fs-12 p-1"></i>
<span class="d-none d-md-inline fs-10">
戻る
</span>
</a>
<h1 class="fs-10 font-weight-bold mb-0 text-white multi-lang" data-msg="dashboardSettingHeaderTitle">ダッシュボード設定</h1>
<div></div>
</nav>
</header>
<!-- setting -->
<section class="container-fluid main-section">
<main>
<h2 class="fs-8 font-weight-bold mt-4 pb-2 border-bottom text-dark multi-lang" data-msg="dashboardSettingDisplayHeader">表示切替</h2>
<div class="setting-table-wrap">
<table id="displayItems">
<tbody>
<!-- <tr>
<th><div class="font-weight-normal text-dark multi-lang" data-msg="dashboardSettingNewRegistrationTitle">新規報告</div></th>
<td>
<div class="toggle"><input type="checkbox" name="chk-new" /></div>
</td>
</tr> -->
</tbody>
</table>
</div>
</main>
</section>
<div id="footer"></div>
</body>
</html>
\ No newline at end of file
var CHK_DashboardSetting = {};
CHK_DashboardSetting.displayItems = [
{ id:'dashboardSettingNewReport', name: 'chk-new', enabled: true, title:'新規報告', msg: 'dashboardSettingNewRegistrationTitle'},
{ id:'dashboardSettingContinousWork', name: 'chk-proccess', enabled: true, title:'工程作業', msg: 'dashboardSettingContinousWorkTitle'},
{ id:'dashboardSettingReportWarning', name: 'chk-alert', enabled: true, title:'警告を含む作業', msg: 'dashboardSettingReportWarningTitle'},
{ id:'dashboardSettingDashboardHome', name: 'chk-home', enabled: false, title:'ダッシュボードをホーム画面にする', msg: 'dashboardSettingDashboardHomeTitle'},
];
CHK_DashboardSetting.loadLocalSettings = function() {
CHK_DashboardSetting.displayItems.forEach(function(item) {
let enabled = CHK_DashboardSetting.isSettingEnabled(item.id);
if (enabled == true || enabled == false) {
item.enabled = enabled;
}
});
}
CHK_DashboardSetting.saveLocalSetting = function(key, value) {
localStorage.setItem(key, value);
}
CHK_DashboardSetting.isSettingEnabled = function(key) {
var setting = localStorage.getItem(key);
if (setting == '1') {
return true;
} else if (setting == '0') {
return false;
}
return setting;
}
CHK_DashboardSetting.initDisplays = function() {
$("#displayItems tbody").empty();
CHK_DashboardSetting.displayItems.forEach(function(item) {
var html = CHK_DashboardSetting.initHtmlItem(item);
$("#displayItems tbody").append(html);
});
}
CHK_DashboardSetting.initHtmlItem = function(item) {
var titleDiv = '<div class="font-weight-normal text-dark multi-lang" data-msg="' + item.msg + '">' + item.title +'</div>';
var toggleClass = 'toggle';
if (item.enabled) {
toggleClass += ' checked';
}
var toggleDiv = '<div id="' + item.id + '" class="' + toggleClass + '"><input type="checkbox" name="' + item.name + '" /></div>';
var html = $('<tr>'
+ '<th>' + titleDiv + '</th>'
+ '<td>' + toggleDiv + '</td>'
+ '</tr>');
return html;
}
CHK_DashboardSetting.bindToggleClick = function() {
$(".toggle").on("click", function() {
$(this).toggleClass("checked");
var id = $(this).attr('id');
if ($(this).hasClass('checked')) {
CHK_DashboardSetting.saveLocalSetting(id, '1');
} else {
CHK_DashboardSetting.saveLocalSetting(id, '0');
}
});
}
CHK_DashboardSetting.init = function() {
CHK_DashboardSetting.loadLocalSettings();
CHK_DashboardSetting.initDisplays();
$("#footer").load("main-footer.html");
CHK_DashboardSetting.bindToggleClick();
}
\ No newline at end of file
...@@ -102,6 +102,13 @@ var msgMap = { // velocity? ...@@ -102,6 +102,13 @@ var msgMap = { // velocity?
sendMessageTitle: { ja: "メッセージ送信", ko: "Send Message", en: "Send Message" }, sendMessageTitle: { ja: "メッセージ送信", ko: "Send Message", en: "Send Message" },
distanceSupportTitle: { ja: "遠隔支援", ko: "Distance Support", en: "Distance Support" }, distanceSupportTitle: { ja: "遠隔支援", ko: "Distance Support", en: "Distance Support" },
chatTitle: { ja: "チャット", ko: "Chat", en: "Chat" }, chatTitle: { ja: "チャット", ko: "Chat", en: "Chat" },
//dashboard setting screen
dashboardSettingHeaderTitle: { ja: "ダッシュボード設定", ko: "Dashboard Settings", en: "Dashboard Settings" },
dashboardSettingDisplayHeader: { ja: "表示切替", ko: "Display", en: "Display"},
dashboardSettingNewRegistrationTitle: { ja: "新規報告", ko: "New Registration", en: "New Registration"},
dashboardSettingContinousWorkTitle: { ja: "工程作業", ko: "Continous Work", en: "Continous Work"},
dashboardSettingReportWarningTitle: { ja: "警告を含む作業", ko: "Report Warning", en: "Report Warning"},
dashboardSettingDashboardHomeTitle: { ja: "ダッシュボードをホーム画面にする", ko: "Dashboard Home", en: "Dashboard Home"},
}; };
// 言語取得 // 言語取得
......
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