Skip to content

Commit

Permalink
tl: allow choosing sort order (fix #371)
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsejet committed Mar 9, 2023
1 parent aa4bb7f commit 03dce35
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Expand Up @@ -11,7 +11,8 @@ You may need to clear browser cache to use location search.
- **Feature**: Allow bulk editing of EXIF attributes other than date/time
- **Feature**: Allow (optionally bulk) editing of collaborative tags
- **Feature**: Show list of tags in sidebar
- **Feature**: Configurable album sorting order ([#377](https://github.com/pulsejet/memories/issues/377))
- **Feature**: Configurable folder/album sorting order ([#371](https://github.com/pulsejet/memories/issues/371))
- **Feature**: Configurable album list sorting order ([#377](https://github.com/pulsejet/memories/issues/377))
- **Feature**: Allow archiving photos throw folder view ([#350](https://github.com/pulsejet/memories/issues/350))
- **Feature**: Add search bar to face cluster merge dialog ([#177](https://github.com/pulsejet/memories/issues/177))
- Other fixes and features ([milestone](https://github.com/pulsejet/memories/milestone/9?closed=1))
Expand Down
2 changes: 2 additions & 0 deletions lib/Controller/PageController.php
Expand Up @@ -76,6 +76,8 @@ public function main()
$pi('timelinePath', 'EMPTY');
$pi('foldersPath', '/');
$pi('showHidden', false);
$pi('sortFolderMonth', false);
$pi('sortAlbumMonth', 'true');
$pi('enableTopMemories', 'true');

// Apps enabled
Expand Down
29 changes: 29 additions & 0 deletions src/components/Settings.vue
Expand Up @@ -76,6 +76,27 @@
>
{{ t("memories", "Show hidden folders") }}
</NcCheckboxRadioSwitch>

<NcCheckboxRadioSwitch
:checked.sync="config_sortFolderMonth"
@update:checked="updateSortFolderMonth"
type="switch"
>
{{ t("memories", "Treat folders as albums (sort order)") }}
</NcCheckboxRadioSwitch>
</NcAppSettingsSection>

<NcAppSettingsSection
id="albums-settings"
:title="t('memories', 'Albums')"
>
<NcCheckboxRadioSwitch
:checked.sync="config_sortAlbumMonth"
@update:checked="updateSortAlbumMonth"
type="switch"
>
{{ t("memories", "Enable timeline view (sort order)") }}
</NcCheckboxRadioSwitch>
</NcAppSettingsSection>
</NcAppSettingsDialog>

Expand Down Expand Up @@ -190,6 +211,14 @@ export default defineComponent({
async updateShowHidden() {
await this.updateSetting("showHidden");
},
async updateSortFolderMonth() {
await this.updateSetting("sortFolderMonth");
},
async updateSortAlbumMonth() {
await this.updateSetting("sortAlbumMonth");
},
},
});
</script>
6 changes: 5 additions & 1 deletion src/components/Timeline.vue
Expand Up @@ -271,7 +271,11 @@ export default defineComponent({
},
isMonthView(): boolean {
return (
this.$route.name === "albums" || this.$route.name === "album-share"
(this.config_sortAlbumMonth &&
(this.$route.name === "albums" ||
this.$route.name === "album-share")) ||
(this.config_sortFolderMonth && this.$route.name === "folders") ||
this.$route.query.sort === "album"
);
},
/** Get view name for dynamic top matter */
Expand Down
4 changes: 4 additions & 0 deletions src/mixins/UserConfig.ts
Expand Up @@ -24,6 +24,10 @@ export default defineComponent({

config_showHidden:
loadState("memories", "showHidden", <string>"false") === "true",
config_sortFolderMonth:
loadState("memories", "sortFolderMonth", <string>"false") === "true",
config_sortAlbumMonth:
loadState("memories", "sortAlbumMonth", <string>"true") === "true",
config_enableTopMemories:
loadState("memories", "enableTopMemories", <string>"false") === "true",

Expand Down
2 changes: 2 additions & 0 deletions src/vue-globals.d.ts
Expand Up @@ -17,6 +17,8 @@ declare module "vue" {
config_timelinePath: string;
config_foldersPath: string;
config_showHidden: boolean;
config_sortFolderMonth: boolean;
config_sortAlbumMonth: boolean;
config_tagsEnabled: boolean;
config_recognizeEnabled: boolean;
config_facerecognitionInstalled: boolean;
Expand Down

0 comments on commit 03dce35

Please sign in to comment.