diff --git a/SkylineToolsStore/src/org/labkey/skylinetoolsstore/view/SkylineToolsStoreWebPart.jsp b/SkylineToolsStore/src/org/labkey/skylinetoolsstore/view/SkylineToolsStoreWebPart.jsp index d5e980b6..1890ce89 100644 --- a/SkylineToolsStore/src/org/labkey/skylinetoolsstore/view/SkylineToolsStoreWebPart.jsp +++ b/SkylineToolsStore/src/org/labkey/skylinetoolsstore/view/SkylineToolsStoreWebPart.jsp @@ -58,6 +58,8 @@ .content {margin: 8px 12px 0 0; padding:0; text-align:justify;} .toolButtons {margin-top: 12px;} .styled-button{ + display:inline-flex; + align-items:center; box-shadow:rgba(0,0,0,0.0.1) 0 1px 0 0; background-color:#5B74A8; border:1px solid #29447E; @@ -72,6 +74,8 @@ cursor:pointer; } .styled-button:hover{background-color:#1e90ff; color:#f5f5dc;} + a.styled-button{text-decoration:none; color:#fff;} + a.styled-button:visited{color:#fff;} .toolOwners {width: 80%; min-width: 300px;} .ui-menu {width:240px;} .dropMenu {position: absolute;} @@ -153,6 +157,8 @@ // Get supporting files in map HashMap suppFiles = SkylineToolsStoreController.getSupplementaryFiles(tool); Iterator suppIter = suppFiles.entrySet().iterator(); + boolean hasDocs = tool.hasDocumentation(); + int docCount = suppFiles.size() + (hasDocs ? 1 : 0); final String curToolOwners = StringUtils.join(SkylineToolsStoreController.getToolOwners(tool), ", "); toolOwners.put(tool.getRowId(), curToolOwners); @@ -200,17 +206,23 @@
- - <% addHandler("download-tool-btn-" + tool.getRowId(), "click", "window.location.href = " + q(urlFor(SkylineToolsStoreController.DownloadToolAction.class).addParameter("id", tool.getRowId()))); %> + <%=link(unsafe("Download " + h(tool.getName()) + "")).href(urlFor(SkylineToolsStoreController.DownloadToolAction.class).addParameter("id", tool.getRowId()).toString()).clearClasses().addClass("styled-button")%> <% - if (suppFiles.size() == 1) { + if (docCount == 1 && hasDocs) { +%> + <%=link(unsafe("Documentation " + h(tool.getName()) + "")).href(tool.getDocsUrl()).clearClasses().addClass("styled-button").target("_blank").rel("noopener noreferrer")%> +<% + } else if (docCount == 1) { Map.Entry suppPair = (Map.Entry)suppIter.next(); %> - -<% } else if (suppFiles.size() > 1) { %> + <%=link(unsafe("Documentation " + h(tool.getName()) + "")).href(suppPair.getKey().toString()).clearClasses().addClass("styled-button")%> +<% } else if (docCount > 1) { %>