From b7d2a51ee73969c576d1bc9d9cd2fe8a7726214c Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sat, 13 Jan 2018 12:12:17 -0800 Subject: [PATCH] flesh out settings more --- routes/_components/NotLoggedInHome.html | 2 +- routes/_utils/mastodon.js | 2 +- .../settings/_components/SettingsLayout.html | 2 +- routes/settings/_components/SettingsList.html | 11 +++++ .../_components/SettingsListItem.html | 22 +++++++++ routes/settings/_components/SettingsNav.html | 40 ++++++++--------- routes/settings/about.html | 2 +- routes/settings/index.html | 45 +++++-------------- routes/settings/instances/[instanceName].html | 22 +++++++++ .../{instances.html => instances/add.html} | 40 +++++++---------- routes/settings/instances/index.html | 38 ++++++++++++++++ 11 files changed, 144 insertions(+), 82 deletions(-) create mode 100644 routes/settings/_components/SettingsList.html create mode 100644 routes/settings/_components/SettingsListItem.html create mode 100644 routes/settings/instances/[instanceName].html rename routes/settings/{instances.html => instances/add.html} (72%) create mode 100644 routes/settings/instances/index.html diff --git a/routes/_components/NotLoggedInHome.html b/routes/_components/NotLoggedInHome.html index 798e1f2..92b1162 100644 --- a/routes/_components/NotLoggedInHome.html +++ b/routes/_components/NotLoggedInHome.html @@ -7,7 +7,7 @@

Pinafore is a web client for Mastodon, optimized for speed and simplicity.

-

To get started, log in to an instance.

+

To get started, log in to an instance.

Don't have an instance? Join Mastodon!

diff --git a/routes/_utils/mastodon.js b/routes/_utils/mastodon.js index 9542623..94e7794 100644 --- a/routes/_utils/mastodon.js +++ b/routes/_utils/mastodon.js @@ -1,5 +1,5 @@ const WEBSITE = 'https://pinafore.social' -const REDIRECT_URI = (typeof location !== 'undefined' ? location.origin : 'https://pinafore.social') + '/settings/instances' +const REDIRECT_URI = (typeof location !== 'undefined' ? location.origin : 'https://pinafore.social') + '/settings/instances/add' const SCOPES = 'read write follow' const CLIENT_NAME = 'Pinafore' diff --git a/routes/settings/_components/SettingsLayout.html b/routes/settings/_components/SettingsLayout.html index 4f2bb9b..78111fb 100644 --- a/routes/settings/_components/SettingsLayout.html +++ b/routes/settings/_components/SettingsLayout.html @@ -1,4 +1,4 @@ - +
diff --git a/routes/settings/_components/SettingsList.html b/routes/settings/_components/SettingsList.html new file mode 100644 index 0000000..fd5c8ea --- /dev/null +++ b/routes/settings/_components/SettingsList.html @@ -0,0 +1,11 @@ +
    + +
+ \ No newline at end of file diff --git a/routes/settings/_components/SettingsListItem.html b/routes/settings/_components/SettingsListItem.html new file mode 100644 index 0000000..f322fee --- /dev/null +++ b/routes/settings/_components/SettingsListItem.html @@ -0,0 +1,22 @@ +
  • {{label}}
  • + \ No newline at end of file diff --git a/routes/settings/_components/SettingsNav.html b/routes/settings/_components/SettingsNav.html index c882c14..cbe6137 100644 --- a/routes/settings/_components/SettingsNav.html +++ b/routes/settings/_components/SettingsNav.html @@ -2,9 +2,12 @@
      {{#each navItems as navItem}}
    • - +
    • {{/each}} +
    • + +
    @@ -39,21 +42,10 @@ import SettingsNavItem from './SettingsNavItem.html' const NAV_ITEMS = { - home: { - name: 'home', - href: '/settings', - label: 'Settings' - }, - about: { - name: 'about', - href: '/settings/about', - label: 'About Pinafore' - }, - instances: { - name: 'instances', - href: '/settings/instances', - label: 'Instances' - } + 'settings': 'Settings', + 'settings/about': 'About Pinafore', + 'settings/instances': 'Instances', + 'settings/instances/add': 'Add an instance', } export default { @@ -62,11 +54,19 @@ }, computed: { navItems: page => { - let res = [NAV_ITEMS.home] - if (page === 'home') { - return res + let res = [] + let breadcrumbs = page.split('/') + let path = '' + for (let i = 0; i < breadcrumbs.length - 1; i++) { + let currentPage = breadcrumbs[i] + path += currentPage + res.push({ + label: NAV_ITEMS[path], + href: `/${path}`, + name: path + }) + path += '/' } - res.push(NAV_ITEMS[page]) return res } } diff --git a/routes/settings/about.html b/routes/settings/about.html index 6e8f616..fa3258a 100644 --- a/routes/settings/about.html +++ b/routes/settings/about.html @@ -3,7 +3,7 @@ - +

    About Pinafore

    Pinafore is open-source software created by Nolan Lawson.

    diff --git a/routes/settings/index.html b/routes/settings/index.html index b1f7071..5ea4b4d 100644 --- a/routes/settings/index.html +++ b/routes/settings/index.html @@ -3,51 +3,28 @@ - +

    Settings

    - + + + +
    - \ No newline at end of file + \ No newline at end of file diff --git a/routes/settings/instances/[instanceName].html b/routes/settings/instances/[instanceName].html new file mode 100644 index 0000000..dc8666b --- /dev/null +++ b/routes/settings/instances/[instanceName].html @@ -0,0 +1,22 @@ +<:Head> + {{params.instanceName}} + + + + +

    {{params.instanceName}}

    +
    +
    + \ No newline at end of file diff --git a/routes/settings/instances.html b/routes/settings/instances/add.html similarity index 72% rename from routes/settings/instances.html rename to routes/settings/instances/add.html index 87dd738..bd81995 100644 --- a/routes/settings/instances.html +++ b/routes/settings/instances/add.html @@ -1,33 +1,25 @@ <:Head> - Instances + Add an Instance - -

    Instances

    + +

    Add an Instance

    {{#if $isUserLoggedIn}} -
      - {{#each $loggedInInstancesAsList as instance}} -
    • - {{instance.name}} -
    • - {{/each}} -
    +

    Connect to an instance to log in.

    {{else}} -

    Connect to an instance to start using Pinafore.

    +

    Log in to an instance to start using Pinafore.

    {{/if}} - {{#if !$isUserLoggedIn}} -
    - - - -
    - {{/if}} +
    + + + +
    {{#if !$isUserLoggedIn}} -

    Don't have an instance? Join Mastodon!

    +

    Don't have an instance? Join Mastodon!

    {{/if}}
    @@ -55,11 +47,11 @@ } \ No newline at end of file