Skip to content

Commit

Permalink
EZP-23767: create new translation basing on existing one
Browse files Browse the repository at this point in the history
  • Loading branch information
mhyndle committed Sep 3, 2015
1 parent 4287c98 commit 1bd0a27
Show file tree
Hide file tree
Showing 24 changed files with 2,203 additions and 24 deletions.
2 changes: 2 additions & 0 deletions Resources/config/css.yml
Expand Up @@ -15,6 +15,7 @@ system:
- 'bundles/ezplatformui/css/layout.css'
- 'bundles/ezplatformui/css/views/navigationhub.css'
- 'bundles/ezplatformui/css/views/confirmbox.css'
- 'bundles/ezplatformui/css/views/languageselectionbox.css'
- 'bundles/ezplatformui/css/views/notificationhub.css'
- 'bundles/ezplatformui/css/views/notification.css'
- 'bundles/ezplatformui/css/views/universaldiscovery.css'
Expand Down Expand Up @@ -90,6 +91,7 @@ system:
- 'bundles/ezplatformui/css/theme/views/loginform.css'
- 'bundles/ezplatformui/css/theme/views/bar.css'
- 'bundles/ezplatformui/css/theme/views/confirmbox.css'
- 'bundles/ezplatformui/css/theme/views/languageselectionbox.css'
- 'bundles/ezplatformui/css/theme/views/notificationhub.css'
- 'bundles/ezplatformui/css/theme/views/notification.css'
- 'bundles/ezplatformui/css/theme/views/universaldiscovery.css'
Expand Down
16 changes: 16 additions & 0 deletions Resources/config/yui.yml
Expand Up @@ -58,6 +58,8 @@ system:
- 'ez-universaldiscoveryview'
- 'ez-confirmboxviewservice'
- 'ez-confirmboxview'
- 'ez-languageselectionboxviewservice'
- 'ez-languageselectionboxview'
- 'ez-notificationhubviewservice'
- 'ez-notificationhubview'
- 'ez-usermodel'
Expand All @@ -66,6 +68,7 @@ system:
- 'ez-domstateplugin'
- 'ez-universaldiscoveryplugin'
- 'ez-confirmboxplugin'
- 'ez-languageselectionboxplugin'
- 'ez-notificationhubplugin'
- 'ez-positionplugin'
- 'ez-updatetreeplugin'
Expand All @@ -88,6 +91,7 @@ system:
- 'ez-savedraftplugin'
- 'ez-publishdraftplugin'
- 'ez-discarddraftplugin'
- 'array-extras'
path: %ez_platformui.public_dir%/js/views/services/ez-contenteditviewservice.js
ez-contentcreateviewservice:
requires: ['ez-contenteditviewservice']
Expand Down Expand Up @@ -116,6 +120,9 @@ system:
ez-confirmboxviewservice:
requires: ['ez-viewservice']
path: %ez_platformui.public_dir%/js/views/services/ez-confirmboxviewservice.js
ez-languageselectionboxviewservice:
requires: ['ez-viewservice']
path: %ez_platformui.public_dir%/js/views/services/ez-languageselectionboxviewservice.js
ez-notificationhubviewservice:
requires: ['ez-viewservice', 'ez-notificationlist']
path: %ez_platformui.public_dir%/js/views/services/ez-notificationhubviewservice.js
Expand Down Expand Up @@ -222,6 +229,12 @@ system:
confirmboxview-ez-template:
type: 'template'
path: %ez_platformui.public_dir%/templates/confirmbox.hbt
ez-languageselectionboxview:
requires: ['ez-templatebasedview', 'languageselectionboxview-ez-template']
path: %ez_platformui.public_dir%/js/views/ez-languageselectionboxview.js
languageselectionboxview-ez-template:
type: 'template'
path: %ez_platformui.public_dir%/templates/languageselectionbox.hbt
ez-notificationhubview:
requires: ['ez-view', 'ez-notificationview', 'ez-notificationlist', 'ez-height-change']
path: %ez_platformui.public_dir%/js/views/ez-notificationhubview.js
Expand Down Expand Up @@ -746,6 +759,9 @@ system:
ez-confirmboxplugin:
requires: ['plugin', 'base', 'ez-pluginregistry']
path: %ez_platformui.public_dir%/js/apps/plugins/ez-confirmboxplugin.js
ez-languageselectionboxplugin:
requires: ['plugin', 'base', 'ez-pluginregistry']
path: %ez_platformui.public_dir%/js/apps/plugins/ez-languageselectionboxplugin.js
ez-universaldiscoveryplugin:
requires: ['plugin', 'base', 'ez-pluginregistry']
path: %ez_platformui.public_dir%/js/apps/plugins/ez-universaldiscoveryplugin.js
Expand Down
11 changes: 11 additions & 0 deletions Resources/public/css/theme/views/actions/translate.css
Expand Up @@ -49,3 +49,14 @@
border-radius: 0.5em;
font-weight: bold;
}

.ez-view-translateactionview .ez-newtranslation-button {
background: #B8E986;
color: #333333;
font-size: 90%;
font-weight: bold;
}

.ez-view-translateactionview .ez-newtranslation-button:hover {
background: #B8E986;
}
62 changes: 62 additions & 0 deletions Resources/public/css/theme/views/languageselectionbox.css
@@ -0,0 +1,62 @@
/**
* Copyright (C) eZ Systems AS. All rights reserved.
* For full copyright and license information view LICENSE file distributed with this source code.
*/

.is-languageselectionbox-hidden .ez-languageselectionbox-container {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;

background: #000;
-webkit-transform: translateY(-100%);
transform: translateY(-100%);
}

.ez-languageselectionbox-container {
background: rgba(0, 0, 0, 0.6);
transition: all 0.3s;

-webkit-transform: translateY(0);
transform: translateY(0);
}

.ez-view-languageselectionboxview {
background: #D8D8D8;
border: 1px solid #aaa;
border-radius: 3px;
}

.ez-view-languageselectionboxview .ez-languageselectionbox-title {
font-size: 130%;
font-weight: normal;
color: #666;
}

.ez-view-languageselectionboxview .ez-languageselectionbox-languages {
background: #fff;
border: solid 1px #aaa;
border-radius: 3px;
}

.ez-view-languageselectionboxview .ez-translation {
cursor: pointer;
}

.ez-view-languageselectionboxview .ez-translation:hover {
background: #DDF5FF;
}

.ez-view-languageselectionboxview .ez-translation.is-translation-selected {
background: #CCE4FF;
}

.ez-view-languageselectionboxview .ez-languageselectionbox-close-icon:after {
color: #444;
font-size: 150%;
}

.ez-view-languageselectionboxview .ez-languageselectionbox-confirm {
font-weight: bold;
}
5 changes: 5 additions & 0 deletions Resources/public/css/views/actions/translate.css
Expand Up @@ -71,3 +71,8 @@
display: block;
padding: 0.1em 0.5em;
}

.ez-view-translateactionview .ez-newtranslation-button {
width: 17em;
margin: 0.5em;
}
88 changes: 88 additions & 0 deletions Resources/public/css/views/languageselectionbox.css
@@ -0,0 +1,88 @@
/**
* Copyright (C) eZ Systems AS. All rights reserved.
* For full copyright and license information view LICENSE file distributed with this source code.
*/

.ez-languageselectionbox-container {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 21000;

display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}

.is-languageselectionbox-hidden .ez-languageselectionbox-container {
display: none;
}

.ez-view-languageselectionboxview {
position: relative;
display: inline-block;
margin: auto;
padding: 1.5em 2.2em;
}

.ez-view-languageselectionboxview .ez-languageselectionbox-title {
margin: 0;
padding-bottom: 0.2em;
text-align: left;
}

.ez-view-languageselectionboxview .ez-languageselectionbox-close-icon {
position: absolute;
top: 0.2em;
right: 0.2em;
}

.ez-view-languageselectionboxview .ez-languageselectionbox-basetranslation {
display: block;
text-align: right;
margin: 1em 0;
}

.ez-view-languageselectionboxview .ez-languageselectionbox-languages {
display: block;
width: 30em;
overflow: hidden;
padding: 10px 0;
}

.ez-view-languageselectionboxview .ez-translation {
float: left;
width: 12em;
margin: 0 1em;
padding: 0.3em 0.5em;
list-style-type: none;
line-height: 1.8em;
}

.ez-view-languageselectionboxview .ez-languageselectionbox-existingtranslations-container {
display: none;
}

.ez-view-languageselectionboxview .ez-languageselectionbox-basetranslation-area {
display: none;
}

.ez-view-languageselectionboxview.is-base-translation-allowed .ez-languageselectionbox-basetranslation-area {
display: block;
}

.ez-view-languageselectionboxview.is-base-translations-list-visible .ez-languageselectionbox-existingtranslations-container {
display: block;
}

.ez-view-languageselectionboxview .ez-languageselectionbox-tools {
text-align: right;
margin: 2em 0 0 0;
}

.ez-view-languageselectionboxview .ez-languageselectionbox-confirm {
margin-left: 2em;
}
13 changes: 13 additions & 0 deletions Resources/public/js/apps/ez-platformuiapp.js
Expand Up @@ -84,6 +84,12 @@ YUI.add('ez-platformuiapp', function (Y) {
container: '.ez-confirmbox-container',
hideClass: 'is-confirmbox-hidden',
},
languageSelectionBox: {
type: Y.eZ.LanguageSelectionBoxView,
service: Y.eZ.LanguageSelectionBoxViewService,
container: '.ez-languageselectionbox-container',
hideClass: 'is-languageselectionbox-hidden',
},
notificationHub: {
type: Y.eZ.NotificationHubView,
service: Y.eZ.NotificationHubViewService,
Expand Down Expand Up @@ -732,6 +738,13 @@ YUI.add('ez-platformuiapp', function (Y) {
sideViews: {'navigationHub': true, 'discoveryBar': false},
view: 'studioPlusPresentationView',
callbacks: ['open', 'checkUser', 'handleSideViews', 'handleMainView']
}, {
name: "translateContent",
path: '/edit/:id/:languageCode/:baseLanguageCode',
service: Y.eZ.ContentEditViewService,
sideViews: {'navigationHub': false, 'discoveryBar': false},
view: 'contentEditView',
callbacks: ['open', 'checkUser', 'handleSideViews', 'handleMainView']
}, {
name: "editContent",
path: '/edit/:id/:languageCode',
Expand Down
42 changes: 42 additions & 0 deletions Resources/public/js/apps/plugins/ez-languageselectionboxplugin.js
@@ -0,0 +1,42 @@
/*
* Copyright (C) eZ Systems AS. All rights reserved.
* For full copyright and license information view LICENSE file distributed with this source code.
*/
YUI.add('ez-languageselectionboxplugin', function (Y) {
"use strict";
/**
* Provides the language selection box plugin
*
* @module ez-languageselectionboxplugin
*/
Y.namespace('eZ.Plugin');

/**
* The language selection box plugin. It's a plugin the application to set up the
* `languageSelect`, `languageSelected` and `cancelLanguageSelection` event handlers.
*
* @namespace eZ.Plugin
* @class LanguageSelectionBox
* @constructor
* @extends Plugin.Base
*/
Y.eZ.Plugin.LanguageSelectionBox = Y.Base.create('languageSelectionBoxPlugin', Y.Plugin.Base, [], {
initializer: function () {
var app = this.get('host');

app.on('*:languageSelect', function (e) {
app.showSideView('languageSelectionBox', e.config);
});

app.on(['*:languageSelected', '*:cancelLanguageSelection'], function (e) {
app.hideSideView('languageSelectionBox');
});
},
}, {
NS: 'languageSelectionBox',
});

Y.eZ.PluginRegistry.registerPlugin(
Y.eZ.Plugin.LanguageSelectionBox, ['platformuiApp']
);
});

0 comments on commit 1bd0a27

Please sign in to comment.