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
This commit is contained in:
Carlos Ruiz 2020-12-15 15:54:51 +01:00 committed by GitHub
parent 1df6f63341
commit 03b4a1e878
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 45 additions and 120 deletions

9
Credits.html Normal file
View File

@ -0,0 +1,9 @@
<html>
<body>
<h2 style="color: #2e6c80;">Template:</h2>
<ul>
<li>Name 1
<li>Name 2
</ul>
</body>
</html>

View File

@ -6,28 +6,28 @@ root.folder.jettyhome=jettyhome
root.folder.migration=../migration root.folder.migration=../migration
#linux 64 bits #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.folder.utils=utils.unix
root.linux.gtk.x86_64.permissions.755=*.sh,**/*.sh root.linux.gtk.x86_64.permissions.755=*.sh,**/*.sh
#linux #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.folder.utils=utils.unix
root.linux.gtk.x86.permissions.755=*.sh,**/*.sh root.linux.gtk.x86.permissions.755=*.sh,**/*.sh
#mac #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.folder.utils=utils.unix
root.macosx.cocoa.x86.permissions.755=*.sh,**/*.sh root.macosx.cocoa.x86.permissions.755=*.sh,**/*.sh
#mac 64 #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.folder.utils=utils.unix
root.macosx.cocoa.x86_64.permissions.755=*.sh,**/*.sh root.macosx.cocoa.x86_64.permissions.755=*.sh,**/*.sh
#windows #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 root.win32.win32.x86.folder.utils=utils.windows
#windows 64 #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 root.win32.win32.x86_64.folder.utils=utils.windows
#solaris #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.folder.utils=utils.unix
root.solaris.gtk.x86.permissions.755=*.sh,**/*.sh root.solaris.gtk.x86.permissions.755=*.sh,**/*.sh

View File

@ -56,5 +56,5 @@ Copyright (C) 2007 Ashley G Ramdass (ADempiere WebUI).
<!-- this js module doesn't actually exists and it is here for default theme version --> <!-- this js module doesn't actually exists and it is here for default theme version -->
<!-- since loading of js module is on demand, it doesn't cause any error as long as you don't try to load it --> <!-- since loading of js module is on demand, it doesn't cause any error as long as you don't try to load it -->
<javascript-module name="idempiere.theme.default" version="202011282132" /> <javascript-module name="idempiere.theme.default" version="202012151533" />
</language> </language>

View File

@ -28,15 +28,12 @@ import org.adempiere.webui.component.Button;
import org.adempiere.webui.component.Checkbox; import org.adempiere.webui.component.Checkbox;
import org.adempiere.webui.component.ConfirmPanel; import org.adempiere.webui.component.ConfirmPanel;
import org.adempiere.webui.component.FolderBrowser; import org.adempiere.webui.component.FolderBrowser;
import org.adempiere.webui.component.Grid;
import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.ListHead; import org.adempiere.webui.component.ListHead;
import org.adempiere.webui.component.ListHeader; import org.adempiere.webui.component.ListHeader;
import org.adempiere.webui.component.ListModelTable; import org.adempiere.webui.component.ListModelTable;
import org.adempiere.webui.component.Listbox; import org.adempiere.webui.component.Listbox;
import org.adempiere.webui.component.ListboxFactory; 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.SimpleListModel;
import org.adempiere.webui.component.Tab; import org.adempiere.webui.component.Tab;
import org.adempiere.webui.component.Tabbox; import org.adempiere.webui.component.Tabbox;
@ -56,6 +53,7 @@ import org.compiere.minigrid.IDColumn;
import org.compiere.model.MUser; import org.compiere.model.MUser;
import org.compiere.util.CLogErrorBuffer; import org.compiere.util.CLogErrorBuffer;
import org.compiere.util.CLogMgt; import org.compiere.util.CLogMgt;
import org.compiere.util.CLogger;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Ini; import org.compiere.util.Ini;
import org.compiere.util.KeyNamePair; import org.compiere.util.KeyNamePair;
@ -78,6 +76,7 @@ import org.zkoss.zul.Center;
import org.zkoss.zul.Div; import org.zkoss.zul.Div;
import org.zkoss.zul.Filedownload; import org.zkoss.zul.Filedownload;
import org.zkoss.zul.Hbox; import org.zkoss.zul.Hbox;
import org.zkoss.zul.Iframe;
import org.zkoss.zul.Image; import org.zkoss.zul.Image;
import org.zkoss.zul.Listitem; import org.zkoss.zul.Listitem;
import org.zkoss.zul.Separator; import org.zkoss.zul.Separator;
@ -94,7 +93,10 @@ public class AboutWindow extends Window implements EventListener<Event> {
/** /**
* *
*/ */
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 Checkbox bErrorsOnly;
private Listbox logTable; private Listbox logTable;
@ -563,113 +565,27 @@ public class AboutWindow extends Window implements EventListener<Event> {
protected Tabpanel createCredit() { protected Tabpanel createCredit() {
Tabpanel tabPanel = new Tabpanel(); Tabpanel tabPanel = new Tabpanel();
Div div = new Div(); String fileName = Adempiere.getAdempiereHome() + File.separator + "Credits.html";
LayoutUtils.addSclass("about-credit-panel", div); File file = new File(fileName);
div.setParent(tabPanel); AMedia media = null;
ZKUpdateUtil.setWidth(div, "100%"); try {
ZKUpdateUtil.setHeight(div, "100%"); media = new AMedia(file.getName(), "html", "text/html", file, false);
div.setStyle("overflow: auto;"); } catch (FileNotFoundException e) {
Vbox vbox = new Vbox(); log.warning("File " + fileName + " not found");
LayoutUtils.addSclass("about-credit-panel-logo", vbox); }
vbox.setParent(div); Iframe iframe = new Iframe();
Label caption = new Label("Top iDempiere sponsor"); ZKUpdateUtil.setWidth(iframe, "100%");
caption.setStyle("font-weight: bold;"); ZKUpdateUtil.setHeight(iframe, "100%");
caption.setParent(vbox); iframe.setStyle("overflow: auto;");
ToolBarButton link = new ToolBarButton(); iframe.setId("creditsFrame");
ZKUpdateUtil.setHeight(link, "72px"); iframe.setParent(tabPanel);
link.setImage("images/TrekGlobal.jpg"); iframe.setSrc(null);
link.setParent(vbox); if (media != null)
link.setHref("http://www.trekglobal.com"); iframe.setContent(media);
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"));
return tabPanel; 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() { protected Tabpanel createAbout() {
Tabpanel tabPanel = new Tabpanel(); Tabpanel tabPanel = new Tabpanel();

View File

@ -1,13 +1,13 @@
.about-window { .about-window {
width: 600px; width: 375px;
height: 450px; height: 600px;
} }
@media screen and (max-width: 600px) { @media screen and (max-width: 375px) {
.about-window { .about-window {
width: 100%; width: 100%;
} }
} }
@media screen and (max-height: 450px) { @media screen and (max-height: 600px) {
.about-window { .about-window {
height: 100%; height: 100%;
} }