From 03b4a1e878edbe23c0cb89551e5b2a9f32965869 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 15 Dec 2020 15:54:51 +0100 Subject: [PATCH] IDEMPIERE-4580 Refactor about credits (#433) * IDEMPIERE-4580 Refactor about credits Implement Credits as an HTML file visible in root folder Change size of about window --- Credits.html | 9 ++ org.adempiere.server-feature/build.properties | 14 +- .../WEB-INF/src/metainfo/zk/lang-addon.xml | 2 +- .../adempiere/webui/window/AboutWindow.java | 132 ++++-------------- .../default/css/fragment/window-size.css.dsp | 8 +- 5 files changed, 45 insertions(+), 120 deletions(-) create mode 100644 Credits.html diff --git a/Credits.html b/Credits.html new file mode 100644 index 0000000000..ba886f5bdb --- /dev/null +++ b/Credits.html @@ -0,0 +1,9 @@ + + +

Template:

+ + + diff --git a/org.adempiere.server-feature/build.properties b/org.adempiere.server-feature/build.properties index 72e01f8b25..42a1508b25 100644 --- a/org.adempiere.server-feature/build.properties +++ b/org.adempiere.server-feature/build.properties @@ -6,28 +6,28 @@ root.folder.jettyhome=jettyhome root.folder.migration=../migration #linux 64 bits -root.linux.gtk.x86_64=file:setup.sh,file:console-setup.sh,file:idempiere-server.sh,file:setup-alt.sh,file:console-setup-alt.sh,file:sign-database-build.sh,file:sign-database-build-alt.sh,file:idempiereEnvTemplate.properties +root.linux.gtk.x86_64=file:setup.sh,file:console-setup.sh,file:idempiere-server.sh,file:setup-alt.sh,file:console-setup-alt.sh,file:sign-database-build.sh,file:sign-database-build-alt.sh,file:idempiereEnvTemplate.properties,file:../Credits.html root.linux.gtk.x86_64.folder.utils=utils.unix root.linux.gtk.x86_64.permissions.755=*.sh,**/*.sh #linux -root.linux.gtk.x86=file:setup.sh,file:console-setup.sh,file:idempiere-server.sh,file:setup-alt.sh,file:console-setup-alt.sh,file:sign-database-build.sh,file:sign-database-build-alt.sh,file:idempiereEnvTemplate.properties +root.linux.gtk.x86=file:setup.sh,file:console-setup.sh,file:idempiere-server.sh,file:setup-alt.sh,file:console-setup-alt.sh,file:sign-database-build.sh,file:sign-database-build-alt.sh,file:idempiereEnvTemplate.properties,file:../Credits.html root.linux.gtk.x86.folder.utils=utils.unix root.linux.gtk.x86.permissions.755=*.sh,**/*.sh #mac -root.macosx.cocoa.x86=file:setup.sh,file:console-setup.sh,file:idempiere-server.sh,file:setup-alt.sh,file:console-setup-alt.sh,file:sign-database-build.sh,file:sign-database-build-alt.sh,file:idempiereEnvTemplate.properties +root.macosx.cocoa.x86=file:setup.sh,file:console-setup.sh,file:idempiere-server.sh,file:setup-alt.sh,file:console-setup-alt.sh,file:sign-database-build.sh,file:sign-database-build-alt.sh,file:idempiereEnvTemplate.properties,file:../Credits.html root.macosx.cocoa.x86.folder.utils=utils.unix root.macosx.cocoa.x86.permissions.755=*.sh,**/*.sh #mac 64 -root.macosx.cocoa.x86_64=file:setup.sh,file:console-setup.sh,file:idempiere-server.sh,file:setup-alt.sh,file:console-setup-alt.sh,file:sign-database-build.sh,file:sign-database-build-alt.sh,file:idempiereEnvTemplate.properties +root.macosx.cocoa.x86_64=file:setup.sh,file:console-setup.sh,file:idempiere-server.sh,file:setup-alt.sh,file:console-setup-alt.sh,file:sign-database-build.sh,file:sign-database-build-alt.sh,file:idempiereEnvTemplate.properties,file:../Credits.html root.macosx.cocoa.x86_64.folder.utils=utils.unix root.macosx.cocoa.x86_64.permissions.755=*.sh,**/*.sh #windows -root.win32.win32.x86=file:setup.bat,file:console-setup.bat,file:idempiere-server.bat,file:setup-alt.bat,file:console-setup-alt.bat,file:sign-database-build.bat,file:sign-database-build-alt.bat,file:idempiereEnvTemplate.properties +root.win32.win32.x86=file:setup.bat,file:console-setup.bat,file:idempiere-server.bat,file:setup-alt.bat,file:console-setup-alt.bat,file:sign-database-build.bat,file:sign-database-build-alt.bat,file:idempiereEnvTemplate.properties,file:../Credits.html root.win32.win32.x86.folder.utils=utils.windows #windows 64 -root.win32.win32.x86_64=file:setup.bat,file:console-setup.bat,file:idempiere-server.bat,file:setup-alt.bat,file:console-setup-alt.bat,file:sign-database-build.bat,file:sign-database-build-alt.bat,file:idempiereEnvTemplate.properties +root.win32.win32.x86_64=file:setup.bat,file:console-setup.bat,file:idempiere-server.bat,file:setup-alt.bat,file:console-setup-alt.bat,file:sign-database-build.bat,file:sign-database-build-alt.bat,file:idempiereEnvTemplate.properties,file:../Credits.html root.win32.win32.x86_64.folder.utils=utils.windows #solaris -root.solaris.gtk.x86=file:setup.sh,file:console-setup.sh,file:idempiere-server.sh,file:setup-alt.sh,file:console-setup-alt.sh,file:sign-database-build.sh,file:sign-database-build-alt.sh,file:idempiereEnvTemplate.properties +root.solaris.gtk.x86=file:setup.sh,file:console-setup.sh,file:idempiere-server.sh,file:setup-alt.sh,file:console-setup-alt.sh,file:sign-database-build.sh,file:sign-database-build-alt.sh,file:idempiereEnvTemplate.properties,file:../Credits.html root.solaris.gtk.x86.folder.utils=utils.unix root.solaris.gtk.x86.permissions.755=*.sh,**/*.sh diff --git a/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml b/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml index a8c417056e..883b4522e0 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml +++ b/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml @@ -56,5 +56,5 @@ Copyright (C) 2007 Ashley G Ramdass (ADempiere WebUI). - + diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/AboutWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/AboutWindow.java index 86e876bf91..48d8fafbd8 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/AboutWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/AboutWindow.java @@ -28,15 +28,12 @@ import org.adempiere.webui.component.Button; import org.adempiere.webui.component.Checkbox; import org.adempiere.webui.component.ConfirmPanel; import org.adempiere.webui.component.FolderBrowser; -import org.adempiere.webui.component.Grid; import org.adempiere.webui.component.Label; import org.adempiere.webui.component.ListHead; import org.adempiere.webui.component.ListHeader; import org.adempiere.webui.component.ListModelTable; import org.adempiere.webui.component.Listbox; import org.adempiere.webui.component.ListboxFactory; -import org.adempiere.webui.component.Row; -import org.adempiere.webui.component.Rows; import org.adempiere.webui.component.SimpleListModel; import org.adempiere.webui.component.Tab; import org.adempiere.webui.component.Tabbox; @@ -56,6 +53,7 @@ import org.compiere.minigrid.IDColumn; import org.compiere.model.MUser; import org.compiere.util.CLogErrorBuffer; import org.compiere.util.CLogMgt; +import org.compiere.util.CLogger; import org.compiere.util.Env; import org.compiere.util.Ini; import org.compiere.util.KeyNamePair; @@ -78,6 +76,7 @@ import org.zkoss.zul.Center; import org.zkoss.zul.Div; import org.zkoss.zul.Filedownload; import org.zkoss.zul.Hbox; +import org.zkoss.zul.Iframe; import org.zkoss.zul.Image; import org.zkoss.zul.Listitem; import org.zkoss.zul.Separator; @@ -94,7 +93,10 @@ public class AboutWindow extends Window implements EventListener { /** * */ - private static final long serialVersionUID = 7922577248288156723L; + private static final long serialVersionUID = -4235323239552159150L; + + /** Logger */ + private static final CLogger log = CLogger.getCLogger(AboutWindow.class); private Checkbox bErrorsOnly; private Listbox logTable; @@ -562,114 +564,28 @@ public class AboutWindow extends Window implements EventListener { } protected Tabpanel createCredit() { - Tabpanel tabPanel = new Tabpanel(); - Div div = new Div(); - LayoutUtils.addSclass("about-credit-panel", div); - div.setParent(tabPanel); - ZKUpdateUtil.setWidth(div, "100%"); - ZKUpdateUtil.setHeight(div, "100%"); - div.setStyle("overflow: auto;"); - Vbox vbox = new Vbox(); - LayoutUtils.addSclass("about-credit-panel-logo", vbox); - vbox.setParent(div); - Label caption = new Label("Top iDempiere sponsor"); - caption.setStyle("font-weight: bold;"); - caption.setParent(vbox); - ToolBarButton link = new ToolBarButton(); - ZKUpdateUtil.setHeight(link, "72px"); - link.setImage("images/TrekGlobal.jpg"); - link.setParent(vbox); - link.setHref("http://www.trekglobal.com"); - link.setTarget("_blank"); - - Separator separator = new Separator(); - separator.setParent(div); - - Div panel = new Div(); - LayoutUtils.addSclass("about-credit-panel-sponsors", panel); - panel.setParent(div); - ZKUpdateUtil.setWidth(panel, "100%"); - vbox = new Vbox(); - LayoutUtils.addSclass("about-credit-panel-sponsors-header", vbox); - ZKUpdateUtil.setWidth(vbox, "100%"); - vbox.setParent(panel); - caption = new Label("Sponsors"); - caption.setStyle("font-weight: bold;"); - caption.setParent(vbox); - Vbox content = new Vbox(); - LayoutUtils.addSclass("about-credit-panel-sponsors-links", content); - ZKUpdateUtil.setWidth(content, "100%"); - content.setParent(panel); - - Grid grid = new Grid(); - grid.setParent(content); - - Rows rows = new Rows(); - rows.setParent(grid); - - Row row = new Row(); - row.setParent(rows); - row.appendCellChild(addLink("GlobalQSS", "http://www.globalqss.com/")); - row.appendCellChild(addLink("Adaxa", "http://www.adaxa.com/")); - row.appendCellChild(addLink("Sysnova", "http://www.sysnova.com/")); - row = new Row(); - row.setParent(rows); - row.appendCellChild(addLink("See also ...", "http://www.idempiere.org/sponsors"), 3); - - panel = new Div(); - LayoutUtils.addSclass("about-credit-panel-contributors", panel); - panel.setParent(div); - ZKUpdateUtil.setWidth(panel, "100%"); - vbox = new Vbox(); - LayoutUtils.addSclass("about-credit-panel-contributors-header", vbox); - ZKUpdateUtil.setWidth(vbox, "100%"); - vbox.setParent(panel); - caption = new Label("Contributors"); - caption.setStyle("font-weight: bold;"); - caption.setParent(vbox); - content = new Vbox(); - LayoutUtils.addSclass("about-credit-panel-contributors-links", content); - ZKUpdateUtil.setWidth(content, "100%"); - content.setParent(panel); - - grid = new Grid(); - grid.setParent(content); - - rows = new Rows(); - rows.setParent(grid); - - row = new Row(); - row.setParent(rows); - row.appendCellChild(addLink("Low Heng Sin", "http://www.adempiere.com/User:Hengsin")); - row.appendCellChild(addLink("Carlos Ruiz", "http://wiki.idempiere.org/en/User:CarlosRuiz")); - row = new Row(); - row.setParent(rows); - row.appendCellChild(addLink("Hiep Lq", "http://wiki.idempiere.org/en/User:Hieplq")); - row.appendCellChild(addLink("Nicolas Micoud", "http://wiki.idempiere.org/en/User:Nmicoud")); - row = new Row(); - row.setParent(rows); - row.appendCellChild(addLink("Jan Thielemann", "http://wiki.idempiere.org/en/User:Jan.thielemann")); - row.appendCellChild(addLink("Redhuan D. Oon", "http://www.red1.org")); - row = new Row(); - row.setParent(rows); - row.appendCellChild(addLink("Thomas Bayen", "http://wiki.idempiere.org/en/User:TBayen")); - row.appendCellChild(addLink("Ashley G Ramdass", "http://www.adempiere.com/User:Agramdass")); - row = new Row(); - row.setParent(rows); - row.appendCellChild(addLink("Teo Sarca", "http://www.adempiere.com/User:Teo_sarca")); - row.appendCellChild(addLink("Trifon Trifonov", "http://www.adempiere.com/User:Trifonnt")); + Tabpanel tabPanel = new Tabpanel(); + String fileName = Adempiere.getAdempiereHome() + File.separator + "Credits.html"; + File file = new File(fileName); + AMedia media = null; + try { + media = new AMedia(file.getName(), "html", "text/html", file, false); + } catch (FileNotFoundException e) { + log.warning("File " + fileName + " not found"); + } + Iframe iframe = new Iframe(); + ZKUpdateUtil.setWidth(iframe, "100%"); + ZKUpdateUtil.setHeight(iframe, "100%"); + iframe.setStyle("overflow: auto;"); + iframe.setId("creditsFrame"); + iframe.setParent(tabPanel); + iframe.setSrc(null); + if (media != null) + iframe.setContent(media); return tabPanel; } - private ToolBarButton addLink(String label, String href) { - ToolBarButton link = new ToolBarButton(); - link.setLabel(label); - link.setHref(href); - link.setTarget("_blank"); - return link; - } - protected Tabpanel createAbout() { Tabpanel tabPanel = new Tabpanel(); diff --git a/org.adempiere.ui.zk/WEB-INF/src/web/theme/default/css/fragment/window-size.css.dsp b/org.adempiere.ui.zk/WEB-INF/src/web/theme/default/css/fragment/window-size.css.dsp index 236cf36090..d8f978615e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/web/theme/default/css/fragment/window-size.css.dsp +++ b/org.adempiere.ui.zk/WEB-INF/src/web/theme/default/css/fragment/window-size.css.dsp @@ -1,13 +1,13 @@ .about-window { - width: 600px; - height: 450px; + width: 375px; + height: 600px; } -@media screen and (max-width: 600px) { +@media screen and (max-width: 375px) { .about-window { width: 100%; } } -@media screen and (max-height: 450px) { +@media screen and (max-height: 600px) { .about-window { height: 100%; }