[Kimchi-devel] [PATCH] [Wok] Create file structure to Wok tab

Samuel Henrique De Oliveira Guimaraes samuel.guimaraes at eldorado.org.br
Thu Feb 25 15:33:16 UTC 2016


Ok, working on it.

Regards,
Samuel

-----Original Message-----
From: kimchi-devel-bounces at ovirt.org [mailto:kimchi-devel-bounces at ovirt.org] On Behalf Of Aline Manera
Sent: quarta-feira, 24 de fevereiro de 2016 17:31
To: Kimchi Devel <kimchi-devel at ovirt.org>
Subject: Re: [Kimchi-devel] [PATCH] [Wok] Create file structure to Wok tab


Samuel,

Replace the settings.html.tmpl content to the tab content.
Then you will need to update the way the UI is generated.
Today it gets the tab-ext.xml only for the plugins and load the tabs accordingly.
You will need to update wok.main.js to get the tab-ext.xml file from wok (GET /ui/config/tab-ext.xml), parse it, generate the tabs for Wok and then do the similar flow for all the active plugins.
My proposal is to display the Wok tabs prior to the plugins tabs.

Does that make sense?

Regards,
Aline Manera

On 02/24/2016 03:39 PM, Aline Manera wrote:
> Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
> ---
>   IBM-license-blacklist            |  1 +
>   configure.ac                     |  2 ++
>   src/wok/config.py.in             |  6 ++++++
>   ui/Makefile.am                   |  2 +-
>   ui/config/Makefile.am            | 22 ++++++++++++++++++++++
>   ui/config/tab-ext.xml            | 10 ++++++++++
>   ui/pages/Makefile.am             |  2 ++
>   ui/pages/tabs/Makefile.am        | 20 ++++++++++++++++++++
>   ui/pages/tabs/settings.html.tmpl | 31 +++++++++++++++++++++++++++++++
>   9 files changed, 95 insertions(+), 1 deletion(-)
>   create mode 100644 ui/config/Makefile.am
>   create mode 100644 ui/config/tab-ext.xml
>   create mode 100644 ui/pages/tabs/Makefile.am
>   create mode 100644 ui/pages/tabs/settings.html.tmpl
>
> diff --git a/IBM-license-blacklist b/IBM-license-blacklist index 
> 133f119..7210b82 100644
> --- a/IBM-license-blacklist
> +++ b/IBM-license-blacklist
> @@ -65,6 +65,7 @@ ui/css/src/vendor/compass-mixins/lib/compass/utilities/lists/.*.scss
>   ui/css/src/vendor/compass-mixins/lib/compass/utilities/sprites/.*.scss
>   ui/css/src/vendor/compass-mixins/lib/compass/utilities/tables/.*.scss
>   ui/css/src/vendor/compass-mixins/lib/compass/utilities/text/.*.scss
> +ui/config/tab-ext.xml
>   ui/images/theme-default/.*.svg
>   ui/libs/bootstrap-editable/LICENSE
>   ui/libs/bootstrap-editable/dist/css/bootstrap-editable.css
> diff --git a/configure.ac b/configure.ac index 9925753..0a5ce80 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -142,6 +142,8 @@ AC_CONFIG_FILES([
>       ui/libs/list-js/Makefile
>       ui/libs/typeahead/Makefile
>       ui/pages/Makefile
> +    ui/pages/tabs/Makefile
> +    ui/config/Makefile
>       contrib/Makefile
>       contrib/DEBIAN/Makefile
>       contrib/DEBIAN/control
> diff --git a/src/wok/config.py.in b/src/wok/config.py.in index 
> 40fbcda..5138d13 100644
> --- a/src/wok/config.py.in
> +++ b/src/wok/config.py.in
> @@ -188,6 +188,12 @@ class WokConfig(dict):
>               'tools.sessions.timeout': SESSIONSTIMEOUT,
>               'tools.wokauth.on': False
>           },
> +        '/ui/config/tab-ext.xml': {
> +            'tools.staticfile.on': True,
> +            'tools.staticfile.filename': os.path.join(paths.ui_dir,
> +                                                      'config/tab-ext.xml'),
> +            'tools.nocache.on': True
> +        },
>           '/base64/jquery.base64.js': {
>               'tools.staticfile.on': True,
>               'tools.staticfile.filename': 
> '%s/base64/jquery.base64.js' % diff --git a/ui/Makefile.am 
> b/ui/Makefile.am index c3ee649..07218dc 100644
> --- a/ui/Makefile.am
> +++ b/ui/Makefile.am
> @@ -17,7 +17,7 @@
>   # See the License for the specific language governing permissions and
>   # limitations under the License.
>
> -SUBDIRS = base64 css images js libs pages
> +SUBDIRS = base64 css images js libs pages config
>
>   uidir = $(datadir)/wok/ui
>
> diff --git a/ui/config/Makefile.am b/ui/config/Makefile.am new file 
> mode 100644 index 0000000..a723dff
> --- /dev/null
> +++ b/ui/config/Makefile.am
> @@ -0,0 +1,22 @@
> +#
> +# Project Wok
> +#
> +# Copyright IBM Corp, 2016
> +#
> +# Licensed under the Apache License, Version 2.0 (the "License"); # 
> +you may not use this file except in compliance with the License.
> +# You may obtain a copy of the License at #
> +#     http://www.apache.org/licenses/LICENSE-2.0
> +#
> +# Unless required by applicable law or agreed to in writing, software 
> +# distributed under the License is distributed on an "AS IS" BASIS, # 
> +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> +# See the License for the specific language governing permissions and 
> +# limitations under the License.
> +
> +xmldir = $(datadir)/wok/ui/config
> +
> +dist_xml_DATA = \
> +	tab-ext.xml \
> +	$(NULL)
> diff --git a/ui/config/tab-ext.xml b/ui/config/tab-ext.xml new file 
> mode 100644 index 0000000..0b0e2b6
> --- /dev/null
> +++ b/ui/config/tab-ext.xml
> @@ -0,0 +1,10 @@
> +<?xml version="1.0" encoding="utf-8"?> <tabs-ext>
> +    <functionality>Wok</functionality>
> +    <tab>
> +        <access role="admin" mode="admin"/>
> +        <access role="user" mode="none"/>
> +        <title>Settings</title>
> +        <path>tabs/settings.html</path>
> +    </tab>
> +</tabs-ext>
> diff --git a/ui/pages/Makefile.am b/ui/pages/Makefile.am index 
> 0b13c0d..5b8370d 100644
> --- a/ui/pages/Makefile.am
> +++ b/ui/pages/Makefile.am
> @@ -17,6 +17,8 @@
>   # See the License for the specific language governing permissions and
>   # limitations under the License.
>
> +SUBDIRS = tabs
> +
>   htmldir = $(datadir)/wok/ui/pages
>
>   dist_html_DATA = $(wildcard *.tmpl) $(NULL) diff --git 
> a/ui/pages/tabs/Makefile.am b/ui/pages/tabs/Makefile.am new file mode 
> 100644 index 0000000..351ba1b
> --- /dev/null
> +++ b/ui/pages/tabs/Makefile.am
> @@ -0,0 +1,20 @@
> +#
> +# Project Wok
> +#
> +# Copyright IBM Corp, 2013-2016
> +#
> +# Licensed under the Apache License, Version 2.0 (the "License"); # 
> +you may not use this file except in compliance with the License.
> +# You may obtain a copy of the License at #
> +#     http://www.apache.org/licenses/LICENSE-2.0
> +#
> +# Unless required by applicable law or agreed to in writing, software 
> +# distributed under the License is distributed on an "AS IS" BASIS, # 
> +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> +# See the License for the specific language governing permissions and 
> +# limitations under the License.
> +
> +tabshtmldir = $(datadir)/wok/ui/pages/tabs
> +
> +dist_tabshtml_DATA = $(wildcard *.html.tmpl) $(NULL)
> diff --git a/ui/pages/tabs/settings.html.tmpl 
> b/ui/pages/tabs/settings.html.tmpl
> new file mode 100644
> index 0000000..811f147
> --- /dev/null
> +++ b/ui/pages/tabs/settings.html.tmpl
> @@ -0,0 +1,31 @@
> +#*
> +* Project Wok
> +*
> +* Copyright IBM Corp, 2016
> +*
> +* Licensed under the Apache License, Version 2.0 (the "License");
> +* you may not use this file except in compliance with the License.
> +* You may obtain a copy of the License at
> +*
> +*     http://www.apache.org/licenses/LICENSE-2.0
> +*
> +* Unless required by applicable law or agreed to in writing, software
> +* distributed under the License is distributed on an "AS IS" BASIS,
> +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> +* See the License for the specific language governing permissions and
> +* limitations under the License.
> +*#
> +#unicode UTF-8
> +#import gettext
> +#from wok.cachebust import href
> +#silent t = gettext.translation($lang.domain, $lang.localedir, 
> +languages=$lang.lang, fallback=True) #silent _ = t.gettext #silent _t 
> += t.gettext <!DOCTYPE html> <html> <head> </head> <body> <p>Content 
> +here</p> </body> </html>

_______________________________________________
Kimchi-devel mailing list
Kimchi-devel at ovirt.org
http://lists.ovirt.org/mailman/listinfo/kimchi-devel



More information about the Kimchi-devel mailing list