From 9b19672b4e44a695eaed4b4e28f6caa222865cfc Mon Sep 17 00:00:00 2001 From: Damien Pobel Date: Thu, 5 Feb 2015 17:18:01 +0100 Subject: [PATCH 01/11] EZP-23986: Renamed the zones to Plaform, Studio and Studio Plus --- .../public/css/theme/views/navigationhub.css | 27 ++++--- Resources/public/css/views/navigationhub.css | 20 ++--- .../public/js/views/ez-navigationhubview.js | 50 +++++------- .../services/ez-navigationhubviewservice.js | 24 +++--- Resources/public/templates/navigationhub.hbt | 7 +- .../assets/ez-navigationhubview-tests.js | 80 +++++++++---------- Tests/js/views/ez-navigationhubview.html | 7 +- .../ez-navigationhubviewservice-tests.js | 78 +++++++++--------- 8 files changed, 139 insertions(+), 154 deletions(-) diff --git a/Resources/public/css/theme/views/navigationhub.css b/Resources/public/css/theme/views/navigationhub.css index 48a591d67..9c8dd5a1f 100644 --- a/Resources/public/css/theme/views/navigationhub.css +++ b/Resources/public/css/theme/views/navigationhub.css @@ -55,7 +55,7 @@ float: left; text-align: center; font-family: 'ez-platformui-icomoon'; - font-size: 150%; + font-size: 135%; -webkit-font-smoothing: antialiased; } @@ -68,15 +68,15 @@ } } -.ez-view-navigationhubview .ez-create-zone:before { +.ez-view-navigationhubview .ez-platform-zone:before { content: "\E611"; } -.ez-view-navigationhubview .ez-optimize-zone:before { +.ez-view-navigationhubview .ez-studioplus-zone:before { content: "\E612"; } -.ez-view-navigationhubview .ez-deliver-zone:before { +.ez-view-navigationhubview .ez-studio-zone:before { content: "\E60D"; } @@ -85,12 +85,22 @@ vertical-align: middle; } -.ez-view-navigationhubview .ez-navigation .ez-navigation-item, -.ez-view-navigationhubview .ez-zone-name { +.ez-view-navigationhubview .ez-navigation .ez-navigation-item { font-weight: bold; color: #333; } +.ez-view-navigationhubview .ez-zone-name { + color: #333; + font-size: 110%; +} + +@media (max-width:62em) { + .ez-view-navigationhubview .ez-zone-name { + font-size: 100%; + } +} + .ez-view-navigationhubview .ez-navigation .ez-logo { opacity: 0; visibility: visible; @@ -150,11 +160,6 @@ border-bottom: 3px solid #528036; } -.ez-view-navigationhubview .ez-zone-hint { - color: #777; - font-size: 80%; -} - .ez-view-navigationhubview .ez-link a { color: #333; font-size: 85%; diff --git a/Resources/public/css/views/navigationhub.css b/Resources/public/css/views/navigationhub.css index 4c33c7a98..59df75005 100644 --- a/Resources/public/css/views/navigationhub.css +++ b/Resources/public/css/views/navigationhub.css @@ -4,9 +4,9 @@ */ .ez-view-navigationhubview .ez-zones-navigation, -.ez-view-navigationhubview .ez-navigation-create, -.ez-view-navigationhubview .ez-navigation-deliver, -.ez-view-navigationhubview .ez-navigation-optimize { +.ez-view-navigationhubview .ez-navigation-platform, +.ez-view-navigationhubview .ez-navigation-studio, +.ez-view-navigationhubview .ez-navigation-studioplus { list-style-type: none; margin: 0; padding: 0; @@ -30,9 +30,8 @@ display: inline-block; } -.ez-view-navigationhubview .ez-zone-name, -.ez-view-navigationhubview .ez-zone-hint { - margin: 0 0 0 2.6rem; +.ez-view-navigationhubview .ez-zone-name { + margin: 0.3rem 0 0 2.6rem; } .ez-view-navigationhubview .ez-logo { @@ -43,7 +42,7 @@ .ez-view-navigationhubview .ez-zone, .ez-view-navigationhubview .ez-link, .ez-view-navigationhubview .ez-user-info { - padding: 1em; + padding: 0.8em 1em; } .ez-view-navigationhubview .ez-user-info { @@ -157,13 +156,8 @@ vertical-align: middle; } - .ez-view-navigationhubview .ez-zone-hint { - display: none; - } - .ez-view-navigationhubview .ez-zone-name { - margin: 0.2em 0 0 1.9rem; - font-size: 90%; + margin: 0.2rem 0 0 1.9rem; } .ez-view-navigationhubview .ez-zones-navigation .ez-settings a { diff --git a/Resources/public/js/views/ez-navigationhubview.js b/Resources/public/js/views/ez-navigationhubview.js index b5911145d..a649a7f13 100644 --- a/Resources/public/js/views/ez-navigationhubview.js +++ b/Resources/public/js/views/ez-navigationhubview.js @@ -16,7 +16,7 @@ YUI.add('ez-navigationhubview', function (Y) { NAVIGATION_HIDDEN = 'is-navigation-hidden', SUB_MENU_OPEN = 'is-sub-menu-open', NAVIGATION_SEL = '.ez-navigation', - DEFAULT_ACTIVE_NAV = 'create', + DEFAULT_ACTIVE_NAV = 'platform', NAVIGATION_NODE_CLASS_TPL = 'ez-navigation-{identifier}', ZONE_ACTIVE = 'is-zone-active'; @@ -101,14 +101,14 @@ YUI.add('ez-navigationhubview', function (Y) { _handleSelectedItem: function () { var matchedRoute = this.get('matchedRoute'); - Y.Object.each(this.get('zones'), function (zone) { + Y.Object.each(this.get('zones'), function (zone, key) { var inZone = false; - Y.Array.each(this.get(zone.identifier + 'NavigationItems'), function (item) { + Y.Array.each(this.get(key + 'NavigationItems'), function (item) { inZone = (item.matchRoute(matchedRoute) || inZone); }); if ( inZone ) { - this.set('activeNavigation', zone.identifier); + this.set('activeNavigation', key); } }, this); }, @@ -483,8 +483,8 @@ YUI.add('ez-navigationhubview', function (Y) { }, { ATTRS: { /** - * Stores the list of zone (Create, Deliver, Optimize) and the - * corresponding data. + * Object describing the available zones (Platform, Studio), the + * key is the zone identifier, the value is the zone name. * * @attribute zones * @type Object @@ -492,75 +492,63 @@ YUI.add('ez-navigationhubview', function (Y) { */ zones: { value: { - 'create': { - name: 'Create', - hint: 'Creating & Editing', - identifier: 'create', - }, - 'deliver': { - name: 'Deliver', - hint: 'Publishing & Engagin', - identifier: 'deliver', - }, - 'optimize': { - name: 'Optimize', - hint: 'Statistics & Analytics', - identifier: 'optimize', - }, + 'platform': 'Platform', + 'studio': 'Studio', + 'studioplus': 'Studio Plus', }, readOnly: true, }, /** * Stores the navigation view item views instance for each item in - * the navigation for the create zone. This attribute accepts either + * the navigation for the platform zone. This attribute accepts either * an array of already build views or an array of object with at a * `Constructor` property and optionally a `config` property holding * an object to pass to the constructor function. * - * @attribute createNavigationItems + * @attribute platformNavigationItems * @type Array of Y.View * @writeOnce */ - createNavigationItems: { + platformNavigationItems: { setter: '_buildNavigationViews', writeOnce: true, }, /** * Stores the navigation view item views instance for each item in - * the navigation for the optimize zone. This attribute accepts either + * the navigation for the studio zone. This attribute accepts either * an array of already build views or an array of object with at a * `Constructor` property and optionally a `config` property holding * an object to pass to the constructor function. * - * @attribute createNavigationItems + * @attribute studioNavigationItems * @type Array of Y.View * @writeOnce */ - optimizeNavigationItems: { + studioNavigationItems: { setter: '_buildNavigationViews', writeOnce: true, }, /** * Stores the navigation view item views instance for each item in - * the navigation for the deliver zone. This attribute accepts either + * the navigation for the studioplus zone. This attribute accepts either * an array of already build views or an array of object with at a * `Constructor` property and optionally a `config` property holding * an object to pass to the constructor function. * - * @attribute createNavigationItems + * @attribute studioplusNavigationItems * @type Array of Y.View * @writeOnce */ - deliverNavigationItems: { + studioplusNavigationItems: { setter: '_buildNavigationViews', writeOnce: true, }, /** - * Contains the identifier ('create', 'optimize', ...) of the + * Contains the identifier ('platform', 'studio', ...) of the * currently active navigation. When set, this attribute updates the * `_navigationMenu` property with the corresponding Node * diff --git a/Resources/public/js/views/services/ez-navigationhubviewservice.js b/Resources/public/js/views/services/ez-navigationhubviewservice.js index 88547b48e..4e4947246 100644 --- a/Resources/public/js/views/services/ez-navigationhubviewservice.js +++ b/Resources/public/js/views/services/ez-navigationhubviewservice.js @@ -75,9 +75,9 @@ YUI.add('ez-navigationhubviewservice', function (Y) { _getViewParameters: function () { return { user: this.get('app').get('user'), - createNavigationItems: this.get('createNavigationItems'), - deliverNavigationItems: this.get('deliverNavigationItems'), - optimizeNavigationItems: this.get('optimizeNavigationItems'), + platformNavigationItems: this.get('platformNavigationItems'), + studioNavigationItems: this.get('studioNavigationItems'), + studioplusNavigationItems: this.get('studioplusNavigationItems'), matchedRoute: this._matchedRoute(), }; }, @@ -145,20 +145,20 @@ YUI.add('ez-navigationhubviewservice', function (Y) { }, { ATTRS: { /** - * Stores the navigation item objects for the 'create' zone. Each + * Stores the navigation item objects for the 'platform' zone. Each * object must contain a `Constructor` property referencing * the constructor function to use to build the navigation item * view and a `config` property will be used as a configuration * object for the navigation item view. This configuration must * contain a `title` and an `identifier` properties. * - * @attribute createNavigationItems + * @attribute platformNavigationItems * @type Array * @default array containing the object the 'Content structure' and * 'Media library' items * @readOnly */ - createNavigationItems: { + platformNavigationItems: { valueFn: function () { // TODO these location ids should be taken from the REST // root ressource instead of being hardcoded @@ -179,37 +179,37 @@ YUI.add('ez-navigationhubviewservice', function (Y) { }, /** - * Stores the navigation item objects for the 'optimize' zone. Each + * Stores the navigation item objects for the 'studioplus' zone. Each * object must contain a `Constructor` property referencing * the constructor function to use to build the navigation item * view and a `config` property will be used as a configuration * object for the navigation item view. This configuration must * contain a `title` and an `identifier` properties. * - * @attribute optimizeNavigationItems + * @attribute studioplusNavigationItems * @type Array * @default empty array * @readOnly */ - optimizeNavigationItems: { + studioplusNavigationItems: { value: [], readOnly: true, }, /** - * Stores the navigation item objects for the 'deliver' zone. Each + * Stores the navigation item objects for the 'studio' zone. Each * object must contain a `Constructor` property referencing * the constructor function to use to build the navigation item * view and a `config` property will be used as a configuration * object for the navigation item view. This configuration must * contain a `title` and an `identifier` properties. * - * @attribute deliverNavigationItems + * @attribute studioNavigationItems * @type Array * @default empty array * @readOnly */ - deliverNavigationItems: { + studioNavigationItems: { value: [], readOnly: true, }, diff --git a/Resources/public/templates/navigationhub.hbt b/Resources/public/templates/navigationhub.hbt index 67076e43b..f5cd69ab9 100644 --- a/Resources/public/templates/navigationhub.hbt +++ b/Resources/public/templates/navigationhub.hbt @@ -5,9 +5,8 @@ {{#each zones }} -
  • -

    {{ name }}

    -

    {{ hint }}

    +
  • +

    {{ . }}

  • {{/each}}