[DE mobile] Add check app options into Settings, fix template
This commit is contained in:
parent
44a6b8ef07
commit
04d3792e5a
|
@ -2,7 +2,9 @@
|
|||
"Settings": {
|
||||
"textSettings": "Settings",
|
||||
"textDone": "Done",
|
||||
"textFind": "Find",
|
||||
"textFindAndReplace": "Find and Replace",
|
||||
"textReaderMode": "Reader Mode",
|
||||
"textDocumentSettings": "Document Settings",
|
||||
"textApplicationSettings": "Application Settings",
|
||||
"textDownload": "Download",
|
||||
|
|
|
@ -36,6 +36,11 @@
|
|||
height: 22px;
|
||||
.encoded-svg-background('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 22 22" fill="@{themeColor}"><g><path d="M15.8,15c1.4-1.6,2.2-3.7,2.2-5.9c0-5-4-9-9-9C4,0,0,4,0,9c0,5,4,9,9,9c2.3,0,4.4-0.9,5.9-2.2l5.8,5.8l0.2-0.6l0.7-0.2L15.8,15z M9,17c-4.4,0-8-3.6-8-8c0-4.4,3.6-8,8-8c4.4,0,8,3.6,8,8C17,13.5,13.5,17,9,17z"/></g></svg>');
|
||||
}
|
||||
&.icon-reader {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
.encoded-svg-background('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 22 22" fill="@{themeColor}"><g><path d="M17,21H1V9h6V2l0,0h10v5h1V1H6.2L0,7.6V22h18v-3h-1V21z M6,2.8V8H1.1L6,2.8z M13,8c-5.1,0-9,5-9,5s4.1,5,9,5c5,0,9-5,9-5S18,8,13,8z M8.7,15.5C6.8,14.4,6.4,13,6.4,13s0.4-1.5,2.4-2.6C8.3,11.2,8,12,8,13C8,13.9,8.3,14.8,8.7,15.5z M13,16.7c-2.1,0-3.7-1.7-3.7-3.7c0-2.1,1.7-3.7,3.7-3.7c2.1,0,3.7,1.7,3.7,3.7C16.7,15.1,15.1,16.7,13,16.7z M17.3,15.5c0.4-0.7,0.7-1.6,0.7-2.5c0-1-0.3-1.8-0.7-2.6c2,1.1,3.4,2.6,3.4,2.6S19.2,14.4,17.3,15.5z M13,11.7c-0.7,0-1.3,0.6-1.3,1.3s0.6,1.3,1.3,1.3s1.3-0.6,1.3-1.3S13.7,11.7,13,11.7z"/></g></svg>');
|
||||
}
|
||||
&.icon-doc-setup {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
|
|
|
@ -50,6 +50,11 @@
|
|||
height: 22px;
|
||||
.encoded-svg-background('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 22 22" fill="@{themeColor}"><g><path d="M19.5,16.8L16,13.3c0.7-1.1,1.1-2.4,1.1-3.8C17,5.4,13.6,2,9.5,2S2,5.4,2,9.5S5.4,17,9.5,17c1.4,0,2.7-0.4,3.8-1.1l3.5,3.5c0.7,0.7,1.9,0.7,2.6,0C20.2,18.7,20.2,17.6,19.5,16.8z M9.5,15.3c-3.2,0-5.8-2.6-5.8-5.8s2.6-5.8,5.8-5.8s5.8,2.6,5.8,5.8S12.7,15.3,9.5,15.3z"/></g></svg>');
|
||||
}
|
||||
&.icon-reader {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
.encoded-svg-background('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 22 22" fill="@{themeColor}"><g><path d="M17,21H1V9h6V2l0,0h10v5h1V1H6.2L0,7.6V22h18v-3h-1V21z M6,2.8V8H1.1L6,2.8z M13,8c-5.1,0-9,5-9,5s4.1,5,9,5c5,0,9-5,9-5S18,8,13,8z M8.7,15.5C6.8,14.4,6.4,13,6.4,13s0.4-1.5,2.4-2.6C8.3,11.2,8,12,8,13C8,13.9,8.3,14.8,8.7,15.5z M13,16.7c-2.1,0-3.7-1.7-3.7-3.7c0-2.1,1.7-3.7,3.7-3.7c2.1,0,3.7,1.7,3.7,3.7C16.7,15.1,15.1,16.7,13,16.7z M17.3,15.5c0.4-0.7,0.7-1.6,0.7-2.5c0-1-0.3-1.8-0.7-2.6c2,1.1,3.4,2.6,3.4,2.6S19.2,14.4,17.3,15.5z M13,11.7c-0.7,0-1.3,0.6-1.3,1.3s0.6,1.3,1.3,1.3s1.3-0.6,1.3-1.3S13.7,11.7,13,11.7z"/></g></svg>');
|
||||
}
|
||||
&.icon-doc-setup {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
|
|
|
@ -2,6 +2,7 @@ import React, {Component, useEffect} from 'react';
|
|||
import {View,Page,Navbar,NavRight,Link,Popup,Popover,Icon,ListItem,List} from 'framework7-react';
|
||||
import { withTranslation } from 'react-i18next';
|
||||
import {f7} from 'framework7-react';
|
||||
import { observer, inject } from "mobx-react";
|
||||
import {Device} from '../../../../../common/mobile/utils/device';
|
||||
|
||||
import DocumentSettingsController from "../../controller/settings/DocumentSettings";
|
||||
|
@ -47,7 +48,7 @@ const routes = [
|
|||
];
|
||||
|
||||
|
||||
const SettingsList = withTranslation()(props => {
|
||||
const SettingsList = inject("storeAppOptions")( observer( withTranslation()( props => {
|
||||
const {t} = props;
|
||||
const _t = t('Settings', {returnObjects: true});
|
||||
const navbar = <Navbar title={_t.textSettings}>
|
||||
|
@ -62,42 +63,91 @@ const SettingsList = withTranslation()(props => {
|
|||
useEffect(() => {
|
||||
});
|
||||
|
||||
// set mode
|
||||
const appOptions = props.storeAppOptions;
|
||||
let _isEdit = false,
|
||||
_canDownload = false,
|
||||
_canDownloadOrigin = false,
|
||||
_canReader = false,
|
||||
_canAbout = true,
|
||||
_canHelp = true,
|
||||
_canPrint = false;
|
||||
if (appOptions.isDisconnected) {
|
||||
_isEdit = false;
|
||||
if (!appOptions.enableDownload)
|
||||
_canPrint = _canDownload = _canDownloadOrigin = false;
|
||||
} else {
|
||||
_isEdit = appOptions.isEdit;
|
||||
_canReader = !appOptions.isEdit && !appOptions.isRestrictedEdit && appOptions.canReader;
|
||||
_canDownload = appOptions.canDownload;
|
||||
_canDownloadOrigin = appOptions.canDownloadOrigin;
|
||||
_canPrint = appOptions.canPrint;
|
||||
if (appOptions.customization && appOptions.canBrandingExt) {
|
||||
_canAbout = (appOptions.customization.about!==false);
|
||||
}
|
||||
if (appOptions.customization) {
|
||||
_canHelp = (appOptions.customization.help!==false);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={props.style} stackPages={true} routes={routes}>
|
||||
<Page>
|
||||
{navbar}
|
||||
<List>
|
||||
{!props.inPopover &&
|
||||
<ListItem title={_t.textFindAndReplace}>
|
||||
<ListItem title={!_isEdit ? _t.textFind : _t.textFindAndReplace}>
|
||||
<Icon slot="media" icon="icon-search"></Icon>
|
||||
</ListItem>
|
||||
}
|
||||
<ListItem link="#" title={_t.textDocumentSettings} onClick={onoptionclick.bind(this, '/document-settings/')}>
|
||||
<Icon slot="media" icon="icon-doc-setup"></Icon>
|
||||
</ListItem>
|
||||
{_canReader &&
|
||||
<ListItem title={_t.textReaderMode}> {/*ToDo*/}
|
||||
<Icon slot="media" icon="icon-reader"></Icon>
|
||||
<Toggle checked={false} onToggleChange={() => {}}/>
|
||||
</ListItem>
|
||||
}
|
||||
{/*ToDo: settings-orthography*/}
|
||||
{_isEdit &&
|
||||
<ListItem link="#" title={_t.textDocumentSettings} onClick={onoptionclick.bind(this, '/document-settings/')}>
|
||||
<Icon slot="media" icon="icon-doc-setup"></Icon>
|
||||
</ListItem>
|
||||
}
|
||||
<ListItem title={_t.textApplicationSettings} link="#" onClick={onoptionclick.bind(this, "/application-settings/")}>
|
||||
<Icon slot="media" icon="icon-app-settings"></Icon>
|
||||
</ListItem>
|
||||
<ListItem title={_t.textDownload} link="#" onClick={onoptionclick.bind(this, "/download/")}>
|
||||
{_canDownload &&
|
||||
<ListItem title={_t.textDownload} link="#" onClick={onoptionclick.bind(this, "/download/")}>
|
||||
<Icon slot="media" icon="icon-download"></Icon>
|
||||
</ListItem>
|
||||
}
|
||||
{_canDownloadOrigin &&
|
||||
<ListItem title={_t.textDownload} link="#" onClick={() => {}}> {/*ToDo*/}
|
||||
<Icon slot="media" icon="icon-download"></Icon>
|
||||
</ListItem>
|
||||
<ListItem title={_t.textPrint}>
|
||||
<Icon slot="media" icon="icon-print"></Icon>
|
||||
</ListItem>
|
||||
}
|
||||
{_canPrint &&
|
||||
<ListItem title={_t.textPrint}>
|
||||
<Icon slot="media" icon="icon-print"></Icon>
|
||||
</ListItem>
|
||||
}
|
||||
<ListItem title={_t.textDocumentInfo} link="#" onClick={onoptionclick.bind(this, "/document-info/")}>
|
||||
<Icon slot="media" icon="icon-info"></Icon>
|
||||
</ListItem>
|
||||
<ListItem title={_t.textHelp} link="#">
|
||||
<Icon slot="media" icon="icon-help"></Icon>
|
||||
</ListItem>
|
||||
<ListItem title={_t.textAbout} link="#">
|
||||
<Icon slot="media" icon="icon-about"></Icon>
|
||||
</ListItem>
|
||||
{_canHelp &&
|
||||
<ListItem title={_t.textHelp} link="#">
|
||||
<Icon slot="media" icon="icon-help"></Icon>
|
||||
</ListItem>
|
||||
}
|
||||
{_canAbout &&
|
||||
<ListItem title={_t.textAbout} link="#">
|
||||
<Icon slot="media" icon="icon-about"></Icon>
|
||||
</ListItem>
|
||||
}
|
||||
</List>
|
||||
</Page>
|
||||
</View>
|
||||
)
|
||||
});
|
||||
})));
|
||||
|
||||
class SettingsView extends Component {
|
||||
constructor(props) {
|
||||
|
|
Loading…
Reference in a new issue