From 390b2b136f52bf18232bfdacf99ef4d10a2f719a Mon Sep 17 00:00:00 2001 From: Peter Zimon Date: Mon, 4 Oct 2021 13:01:12 +0200 Subject: [PATCH] Added base files for Offers structure - Moving Offers outside settings to main menu - Moving Integrations and Staff to settings --- .../admin/app/components/gh-nav-menu/main.hbs | 9 ++++++++ ghost/admin/app/controllers/offer.js | 7 +++++++ ghost/admin/app/controllers/offers.js | 3 +++ ghost/admin/app/router.js | 11 ++++++---- ghost/admin/app/routes/offer.js | 3 +++ ghost/admin/app/routes/offers.js | 3 +++ ghost/admin/app/templates/offer.hbs | 16 ++++++++++++++ ghost/admin/app/templates/offers.hbs | 12 +++++++++++ ghost/admin/app/templates/settings.hbs | 21 +++++++++++++++++++ .../admin/public/assets/icons/percentage.svg | 1 + 10 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 ghost/admin/app/controllers/offer.js create mode 100644 ghost/admin/app/controllers/offers.js create mode 100644 ghost/admin/app/routes/offer.js create mode 100644 ghost/admin/app/routes/offers.js create mode 100644 ghost/admin/app/templates/offer.hbs create mode 100644 ghost/admin/app/templates/offers.hbs create mode 100644 ghost/admin/public/assets/icons/percentage.svg diff --git a/ghost/admin/app/components/gh-nav-menu/main.hbs b/ghost/admin/app/components/gh-nav-menu/main.hbs index 5ffc9005bc..d58499d6a7 100644 --- a/ghost/admin/app/components/gh-nav-menu/main.hbs +++ b/ghost/admin/app/components/gh-nav-menu/main.hbs @@ -86,11 +86,20 @@ {{/if}} + + {{#if (feature "offers")}} +
  • + {{svg-jar "percentage"}}Offers +
  • + {{else}}
  • {{svg-jar "module"}}Integrations
  • + {{/if}} {{/if}} + {{#unless (feature "offers")}}
  • {{svg-jar "staff"}}Staff
  • + {{/unless}} {{#if this.session.user.isOwnerOnly}} diff --git a/ghost/admin/app/controllers/offer.js b/ghost/admin/app/controllers/offer.js new file mode 100644 index 0000000000..feeb8099bb --- /dev/null +++ b/ghost/admin/app/controllers/offer.js @@ -0,0 +1,7 @@ +import Controller from '@ember/controller'; +import {action} from '@ember/object'; + +export default class MembersController extends Controller { + @action + save() {} +} \ No newline at end of file diff --git a/ghost/admin/app/controllers/offers.js b/ghost/admin/app/controllers/offers.js new file mode 100644 index 0000000000..256dbddc0e --- /dev/null +++ b/ghost/admin/app/controllers/offers.js @@ -0,0 +1,3 @@ +import Controller from '@ember/controller'; + +export default class MembersController extends Controller {} \ No newline at end of file diff --git a/ghost/admin/app/router.js b/ghost/admin/app/router.js index a7eb6a014a..df78671834 100644 --- a/ghost/admin/app/router.js +++ b/ghost/admin/app/router.js @@ -38,10 +38,6 @@ Router.map(function () { this.route('edit', {path: ':type/:post_id'}); }); - this.route('staff', function () { - this.route('user', {path: ':user_slug'}); - }); - this.route('tags'); this.route('tag.new', {path: '/tags/new'}); this.route('tag', {path: '/tags/:tag_slug'}); @@ -84,12 +80,19 @@ Router.map(function () { this.route('integrations.unsplash', {path: '/integrations/unsplash'}); this.route('integrations.zapier', {path: '/integrations/zapier'}); + this.route('staff', function () { + this.route('user', {path: ':user_slug'}); + }); + this.route('members', function () { this.route('import'); }); this.route('member.new', {path: '/members/new'}); this.route('member', {path: '/members/:member_id'}); + this.route('offers'); + this.route('offer'); + this.route('error404', {path: '/*path'}); this.route('designsandbox'); diff --git a/ghost/admin/app/routes/offer.js b/ghost/admin/app/routes/offer.js new file mode 100644 index 0000000000..11400a9d6d --- /dev/null +++ b/ghost/admin/app/routes/offer.js @@ -0,0 +1,3 @@ +import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; + +export default class MembersRoute extends AuthenticatedRoute {} \ No newline at end of file diff --git a/ghost/admin/app/routes/offers.js b/ghost/admin/app/routes/offers.js new file mode 100644 index 0000000000..11400a9d6d --- /dev/null +++ b/ghost/admin/app/routes/offers.js @@ -0,0 +1,3 @@ +import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; + +export default class MembersRoute extends AuthenticatedRoute {} \ No newline at end of file diff --git a/ghost/admin/app/templates/offer.hbs b/ghost/admin/app/templates/offer.hbs new file mode 100644 index 0000000000..507d99e01b --- /dev/null +++ b/ghost/admin/app/templates/offer.hbs @@ -0,0 +1,16 @@ +
    + +

    + Offers + {{svg-jar "arrow-right"}} + New offer +

    +
    + +
    +
    + +
    + Offer... +
    +
    \ No newline at end of file diff --git a/ghost/admin/app/templates/offers.hbs b/ghost/admin/app/templates/offers.hbs new file mode 100644 index 0000000000..fa0d6c4999 --- /dev/null +++ b/ghost/admin/app/templates/offers.hbs @@ -0,0 +1,12 @@ +
    + +

    Offers

    +
    + New offer +
    +
    + +
    + Offers... +
    +
    \ No newline at end of file diff --git a/ghost/admin/app/templates/settings.hbs b/ghost/admin/app/templates/settings.hbs index a9d09bc845..78ccf43e1a 100644 --- a/ghost/admin/app/templates/settings.hbs +++ b/ghost/admin/app/templates/settings.hbs @@ -46,6 +46,16 @@

    Set up primary and secondary menus

    + + {{#if (feature "offers")}} + + {{svg-jar "staff"}} +
    +

    Staff

    +

    Manage authors, editor and collaborators

    +
    +
    + {{/if}}
    Members
    @@ -75,6 +85,17 @@

    Add code to your publication

    + + {{#if (feature "offers")}} + + {{svg-jar "module"}} +
    +

    Integrations

    +

    Make Ghost work with apps and tools

    +
    +
    + {{/if}} + {{svg-jar "labs"}}
    diff --git a/ghost/admin/public/assets/icons/percentage.svg b/ghost/admin/public/assets/icons/percentage.svg new file mode 100644 index 0000000000..f9f65b238f --- /dev/null +++ b/ghost/admin/public/assets/icons/percentage.svg @@ -0,0 +1 @@ + \ No newline at end of file