Config: Add UI.Zoom, Features.Albums & Features.People to Settings #799
This commit is contained in:
parent
e10cd76f7c
commit
c8322373ca
12 changed files with 47 additions and 35 deletions
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0{{if not .config.Settings.UI.Zoom }}, maximum-scale=1.0, user-scalable=no{{end}}">
|
||||
<title>{{ .config.SiteTitle }}</title>
|
||||
|
||||
<meta property="og:url" content="{{ .config.SiteUrl }}">
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0{{if not .config.Settings.UI.Zoom }}, maximum-scale=1.0, user-scalable=no{{end}}">
|
||||
|
||||
<title>{{ .config.SiteTitle }}</title>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0{{if not .config.Settings.UI.Zoom }}, maximum-scale=1.0, user-scalable=no{{end}}">
|
||||
|
||||
<title>{{ .config.SiteTitle }}</title>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0{{if not .config.Settings.UI.Zoom }}, maximum-scale=1.0, user-scalable=no{{end}}">
|
||||
|
||||
<title>{{ .config.SiteTitle }}{{if .config.SiteCaption}}: {{ .config.SiteCaption }}{{end}}</title>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0{{if not .config.Settings.UI.Zoom }}, maximum-scale=1.0, user-scalable=no{{end}}">
|
||||
|
||||
<title>{{ .config.SiteTitle }}</title>
|
||||
|
||||
|
|
|
@ -42,8 +42,8 @@
|
|||
<v-icon>edit</v-icon>
|
||||
</v-btn>
|
||||
<v-btn
|
||||
v-if="$config.feature('download')" fab dark
|
||||
small
|
||||
v-if="$config.feature('download')"
|
||||
fab dark small
|
||||
:title="$gettext('Download')"
|
||||
color="download"
|
||||
class="action-download"
|
||||
|
@ -53,6 +53,7 @@
|
|||
<v-icon>get_app</v-icon>
|
||||
</v-btn>
|
||||
<v-btn
|
||||
v-if="$config.feature('albums')"
|
||||
fab dark small
|
||||
:title="$gettext('Add to album')"
|
||||
color="album"
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
<template>
|
||||
<div>
|
||||
<v-container fluid class="pa-0" v-if="selection.length > 0">
|
||||
<v-container v-if="selection.length > 0" fluid class="pa-0">
|
||||
<v-speed-dial
|
||||
fixed bottom
|
||||
id="t-clipboard" v-model="expanded"
|
||||
fixed
|
||||
bottom
|
||||
direction="top"
|
||||
v-model="expanded"
|
||||
transition="slide-y-reverse-transition"
|
||||
:right="!rtl"
|
||||
:left="rtl"
|
||||
:class="`p-clipboard ${!rtl ? '--ltr' : '--rtl'} p-file-clipboard`"
|
||||
id="t-clipboard"
|
||||
>
|
||||
<v-btn
|
||||
fab dark
|
||||
slot="activator"
|
||||
slot="activator" fab
|
||||
dark
|
||||
color="accent darken-2"
|
||||
class="action-menu"
|
||||
>
|
||||
|
@ -22,24 +22,25 @@
|
|||
</v-btn>
|
||||
|
||||
<v-btn
|
||||
fab dark small
|
||||
v-if="$config.feature('download')" fab dark
|
||||
small
|
||||
:title="$gettext('Download')"
|
||||
color="download"
|
||||
@click.stop="download()"
|
||||
class="action-download"
|
||||
v-if="$config.feature('download')"
|
||||
:disabled="selection.length === 0"
|
||||
@click.stop="download()"
|
||||
>
|
||||
<v-icon>get_app</v-icon>
|
||||
</v-btn>
|
||||
|
||||
<v-btn
|
||||
v-if="$config.feature('albums')"
|
||||
fab dark small
|
||||
:title="$gettext('Add to album')"
|
||||
color="album"
|
||||
:disabled="selection.length === 0"
|
||||
@click.stop="dialog.album = true"
|
||||
class="action-album"
|
||||
@click.stop="dialog.album = true"
|
||||
>
|
||||
<v-icon>bookmark</v-icon>
|
||||
</v-btn>
|
||||
|
@ -47,8 +48,8 @@
|
|||
<v-btn
|
||||
fab dark small
|
||||
color="accent"
|
||||
@click.stop="clearClipboard()"
|
||||
class="action-clear"
|
||||
@click.stop="clearClipboard()"
|
||||
>
|
||||
<v-icon>clear</v-icon>
|
||||
</v-btn>
|
||||
|
@ -63,7 +64,7 @@ import Api from "common/api";
|
|||
import Notify from "common/notify";
|
||||
|
||||
export default {
|
||||
name: 'p-file-clipboard',
|
||||
name: 'PFileClipboard',
|
||||
props: {
|
||||
selection: Array,
|
||||
refresh: Function,
|
||||
|
@ -101,7 +102,7 @@ export default {
|
|||
},
|
||||
onDownload(path) {
|
||||
Notify.success(this.$gettext("Downloading…"));
|
||||
const link = document.createElement('a')
|
||||
const link = document.createElement('a');
|
||||
link.href = path;
|
||||
link.download = "photos.zip";
|
||||
link.click();
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
<template>
|
||||
<div>
|
||||
<v-container fluid class="pa-0" v-if="selection.length > 0">
|
||||
<v-container v-if="selection.length > 0" fluid class="pa-0">
|
||||
<v-speed-dial
|
||||
fixed bottom
|
||||
id="t-clipboard" v-model="expanded"
|
||||
fixed
|
||||
bottom
|
||||
direction="top"
|
||||
v-model="expanded"
|
||||
transition="slide-y-reverse-transition"
|
||||
:right="!rtl"
|
||||
:left="rtl"
|
||||
:class="`p-clipboard ${!rtl ? '--ltr' : '--rtl'} p-label-clipboard`"
|
||||
id="t-clipboard"
|
||||
>
|
||||
<v-btn
|
||||
fab dark
|
||||
slot="activator"
|
||||
slot="activator" fab
|
||||
dark
|
||||
color="accent darken-2"
|
||||
class="action-menu"
|
||||
>
|
||||
|
@ -34,12 +34,13 @@
|
|||
<v-icon>cloud_download</v-icon>
|
||||
</v-btn -->
|
||||
<v-btn
|
||||
v-if="$config.feature('albums')"
|
||||
fab dark small
|
||||
:title="$gettext('Add to album')"
|
||||
color="album"
|
||||
:disabled="selection.length === 0"
|
||||
@click.stop="dialog.album = true"
|
||||
class="action-album"
|
||||
@click.stop="dialog.album = true"
|
||||
>
|
||||
<v-icon>bookmark</v-icon>
|
||||
</v-btn>
|
||||
|
@ -47,9 +48,9 @@
|
|||
fab dark small
|
||||
color="remove"
|
||||
:title="$gettext('Delete')"
|
||||
@click.stop="dialog.delete = true"
|
||||
:disabled="selection.length === 0"
|
||||
class="action-delete"
|
||||
@click.stop="dialog.delete = true"
|
||||
>
|
||||
<v-icon>delete</v-icon>
|
||||
</v-btn>
|
||||
|
@ -57,8 +58,8 @@
|
|||
<v-btn
|
||||
fab dark small
|
||||
color="accent"
|
||||
@click.stop="clearClipboard()"
|
||||
class="action-clear"
|
||||
@click.stop="clearClipboard()"
|
||||
>
|
||||
<v-icon>clear</v-icon>
|
||||
</v-btn>
|
||||
|
@ -75,7 +76,7 @@ import Api from "common/api";
|
|||
import Notify from "common/notify";
|
||||
|
||||
export default {
|
||||
name: 'p-label-clipboard',
|
||||
name: 'PLabelClipboard',
|
||||
props: {
|
||||
selection: Array,
|
||||
refresh: Function,
|
||||
|
@ -126,7 +127,7 @@ export default {
|
|||
},
|
||||
onDownload(path) {
|
||||
Notify.success(this.$gettext("Downloading…"));
|
||||
const link = document.createElement('a')
|
||||
const link = document.createElement('a');
|
||||
link.href = path;
|
||||
link.download = "label.zip";
|
||||
link.click();
|
||||
|
|
|
@ -133,7 +133,7 @@
|
|||
</v-list-tile>
|
||||
</v-list-group>
|
||||
|
||||
<v-list-tile v-if="isMini" to="/albums" class="nav-albums" @click.stop="">
|
||||
<v-list-tile v-if="isMini && $config.feature('albums')" to="/albums" class="nav-albums" @click.stop="">
|
||||
<v-list-tile-action :title="$gettext('Albums')">
|
||||
<v-icon>photo_album</v-icon>
|
||||
</v-list-tile-action>
|
||||
|
@ -145,7 +145,7 @@
|
|||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
|
||||
<v-list-group v-if="!isMini" prepend-icon="photo_album" no-action>
|
||||
<v-list-group v-if="!isMini && $config.feature('albums')" prepend-icon="photo_album" no-action>
|
||||
<v-list-tile slot="activator" to="/albums" class="nav-albums" @click.stop="">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
<v-icon>get_app</v-icon>
|
||||
</v-btn>
|
||||
<v-btn
|
||||
v-if="context !== 'archive'" fab dark
|
||||
v-if="context !== 'archive' && config.settings.features.albums" fab dark
|
||||
small
|
||||
:title="$gettext('Add to album')"
|
||||
color="album"
|
||||
|
@ -109,7 +109,7 @@
|
|||
<v-icon>unarchive</v-icon>
|
||||
</v-btn>
|
||||
<v-btn
|
||||
v-if="isAlbum" fab dark
|
||||
v-if="isAlbum && config.settings.features.albums" fab dark
|
||||
small
|
||||
:title="$gettext('Remove')"
|
||||
color="remove"
|
||||
|
|
|
@ -16,6 +16,7 @@ import (
|
|||
// UISettings represents user interface settings.
|
||||
type UISettings struct {
|
||||
Scrollbar bool `json:"scrollbar" yaml:"Scrollbar"`
|
||||
Zoom bool `json:"zoom" yaml:"Zoom"`
|
||||
Theme string `json:"theme" yaml:"Theme"`
|
||||
Language string `json:"language" yaml:"Language"`
|
||||
}
|
||||
|
@ -39,8 +40,10 @@ type FeatureSettings struct {
|
|||
Review bool `json:"review" yaml:"Review"`
|
||||
Files bool `json:"files" yaml:"Files"`
|
||||
Folders bool `json:"folders" yaml:"Folders"`
|
||||
Albums bool `json:"albums" yaml:"Albums"`
|
||||
Moments bool `json:"moments" yaml:"Moments"`
|
||||
Estimates bool `json:"estimates" yaml:"Estimates"`
|
||||
People bool `json:"people" yaml:"People"`
|
||||
Labels bool `json:"labels" yaml:"Labels"`
|
||||
Places bool `json:"places" yaml:"Places"`
|
||||
Edit bool `json:"edit" yaml:"Edit"`
|
||||
|
@ -100,6 +103,7 @@ func NewSettings() *Settings {
|
|||
return &Settings{
|
||||
UI: UISettings{
|
||||
Scrollbar: true,
|
||||
Zoom: false,
|
||||
Theme: "default",
|
||||
Language: i18n.Default.Locale(),
|
||||
},
|
||||
|
@ -118,8 +122,10 @@ func NewSettings() *Settings {
|
|||
Private: true,
|
||||
Files: true,
|
||||
Folders: true,
|
||||
Albums: true,
|
||||
Moments: true,
|
||||
Estimates: true,
|
||||
People: true,
|
||||
Labels: true,
|
||||
Places: true,
|
||||
Edit: true,
|
||||
|
|
3
internal/config/testdata/settings.yml
vendored
3
internal/config/testdata/settings.yml
vendored
|
@ -1,5 +1,6 @@
|
|||
UI:
|
||||
Scrollbar: true
|
||||
Zoom: false
|
||||
Theme: onyx
|
||||
Language: de
|
||||
Templates:
|
||||
|
@ -14,8 +15,10 @@ Features:
|
|||
Review: true
|
||||
Files: true
|
||||
Folders: true
|
||||
Albums: true
|
||||
Moments: true
|
||||
Estimates: true
|
||||
People: true
|
||||
Labels: true
|
||||
Places: true
|
||||
Edit: true
|
||||
|
|
Loading…
Reference in a new issue