Skip to content

Commit

Permalink
Reposition action and csv download buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
bisht-richa committed Dec 6, 2024
1 parent 0b72505 commit 105acf8
Show file tree
Hide file tree
Showing 27 changed files with 215 additions and 245 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@
</context-group>
</trans-unit>
<trans-unit id="Edit this address" xml:space="preserve">
<source>Edit Address</source>
<source>Edit</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/users/Addresses</context>
</context-group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14761,7 +14761,7 @@ a file or files, or copy the latest version into a set of local overrides or int
</context-group>
</trans-unit>
<trans-unit id="channelfiles.jsp.removeselected" xml:space="preserve">
<source>Remove Selected Files</source>
<source>Remove Files</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/configuration/ChannelFiles.do</context>
</context-group>
Expand Down Expand Up @@ -15674,7 +15674,7 @@ centrally-managed configuration channel, {2}; below is a list of systems you may
</context-group>
</trans-unit>
<trans-unit id="toolbar.delete.configfile" xml:space="preserve">
<source>Delete This File Revision</source>
<source>Delete</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/configuration/file/FileDetails.do</context>
</context-group>
Expand All @@ -15686,7 +15686,7 @@ centrally-managed configuration channel, {2}; below is a list of systems you may
</context-group>
</trans-unit>
<trans-unit id="toolbar.delete.deletefile" xml:space="preserve">
<source>Delete This File</source>
<source>Delete</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/configuration/file/FileDetails.do</context>
</context-group>
Expand Down Expand Up @@ -24422,13 +24422,13 @@ given channel.</source>
<source>Add new slave</source>
</trans-unit>
<trans-unit id="iss.slave.remove" xml:space="preserve">
<source>Remove selected slaves</source>
<source>Remove slaves</source>
</trans-unit>
<trans-unit id="toolbar.create.master" xml:space="preserve">
<source>Add new master</source>
</trans-unit>
<trans-unit id="iss.master.remove" xml:space="preserve">
<source>Remove selected masters</source>
<source>Remove masters</source>
</trans-unit>
<trans-unit id="toolbar.delete.slave" xml:space="preserve">
<source>Delete slave</source>
Expand Down
48 changes: 20 additions & 28 deletions java/code/src/com/redhat/rhn/frontend/taglibs/ListDisplayTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -463,15 +463,6 @@ private void renderSetButtons(Writer out) throws IOException {
buf.append("<span class=\"spacewalk-list-selection-btns\">");
buf.append(addButtonTo(buf, RequestContext.DISPATCH, UPDATE_LIST_KEY,
"update_list_key_id").render());
buf.append(" ");
buf.append(addButtonTo(buf,
RequestContext.DISPATCH, SELECT_ALL_KEY).render());

if (numItemsChecked > 0) {
buf.append(" ");
buf.append(addButtonTo(buf, RequestContext.DISPATCH, UNSELECT_ALL_KEY)
.render());
}
buf.append("</span>");
}
}
Expand Down Expand Up @@ -772,6 +763,26 @@ public int doStartTag() throws JspException {
doSort(sortedColumn);
}

StringWriter alphaBarContent = new StringWriter();
StringWriter paginationContent = new StringWriter();

int topAddonsContentLen = alphaBarContent.getBuffer().length() +
paginationContent.getBuffer().length();

if (topAddonsContentLen > 0) {
out.println("<div class=\"spacewalk-list-top-addons\">");
out.println("<div class=\"spacewalk-list-alphabar\">");
out.print(alphaBarContent.getBuffer().toString());
out.println("</div>");
out.print(paginationContent.getBuffer().toString());
out.println("</div>");
}
if (isPaging()) {
out.print("<div class=\"row-0\">\n");
renderActionButtons(out);
out.println("</div>");
}

out.print("<div class=\"spacewalk-list ");
out.println(type + "\"");
if (tableId != null) {
Expand All @@ -787,8 +798,6 @@ public int doStartTag() throws JspException {
* the entries on a single page and is similar to how the perl code
* behaves.
*/
StringWriter alphaBarContent = new StringWriter();
StringWriter paginationContent = new StringWriter();

pageContext.pushBody(alphaBarContent);
if (!getPageList().getIndex().isEmpty() &&
Expand All @@ -806,18 +815,6 @@ public int doStartTag() throws JspException {
}
pageContext.popBody();

int topAddonsContentLen = alphaBarContent.getBuffer().length() +
paginationContent.getBuffer().length();

if (topAddonsContentLen > 0) {
out.println("<div class=\"spacewalk-list-top-addons\">");
out.println("<div class=\"spacewalk-list-alphabar\">");
out.print(alphaBarContent.getBuffer().toString());
out.println("</div>");
out.print(paginationContent.getBuffer().toString());
out.println("</div>");
}

out.print("<div class=\"panel panel-default\">");

renderPanelHeading(out);
Expand Down Expand Up @@ -943,11 +940,6 @@ else if (type.equals("list")) {
out.println("</span>");
}
out.println("</div>");
if (isPaging()) {
out.print("<div class=\"row-0\">\n");
renderActionButtons(out);
out.println("</div>");
}
out.println("</div>");

// close list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public void release() {
*/
private void renderExport() throws JspException {
IconTag i = new IconTag("item-download-csv");
String exportLink = "<div class=\"spacewalk-csv-download\">" +
String exportLink = "<div class=\"spacewalk-csv-download test\">" +
"<a class=\"btn btn-default\" data-senna-off=\"true\" href=\"" + CSV_DOWNLOAD_URI + "?" +
makeCSVRequestParams() + "\">" + i.render() + LocalizationService.getInstance().getMessage(
"listdisplay.csv") + "</a></div>";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,21 +128,9 @@ private void renderSelectButtons() throws JspException {
ls.getMessage(ListDisplayTag.UPDATE_LIST_KEY));
tag.setAttribute("id", "update_list_key_id");
tag.setBody(ls.getMessage(ListDisplayTag.UPDATE_LIST_KEY));
buf.append(tag.render()).append("&nbsp;");

tag.setAttribute("value",
ls.getMessage(ListDisplayTag.SELECT_ALL_KEY));
tag.setBody(ls.getMessage(ListDisplayTag.SELECT_ALL_KEY));
buf.append(tag.render()).append("&nbsp;");

String selectedName = ListTagUtil.makeSelectedAmountName(listName);
String selected = (String) pageContext.getRequest().getAttribute(selectedName);
if (!NULL_SELECTION.equals(selected) && selected != null) {
tag.setAttribute("value",
ls.getMessage(ListDisplayTag.UNSELECT_ALL_KEY));
tag.setBody(ls.getMessage(ListDisplayTag.UNSELECT_ALL_KEY));
buf.append(tag.render()).append("\n");
}
buf.append("</span>");
ListTagUtil.write(pageContext, buf.toString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private String getEmptyReturnValue(HttpServletRequest req, Long uid) {
return "<strong>Mailing Address</strong>" +
"<div class=\"alert alert-info\">Address not filled in</div>" +
"<a class=\"btn btn-default\" href=\"/EditAddress.do?type=M&amp;uid=" +
uid + "\">Fill in this address</a>";
uid + "\">Add address</a>";
}

}
16 changes: 9 additions & 7 deletions java/code/webapp/WEB-INF/pages/admin/iss/master.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
<rl:listset name="issSlaveListSet">
<rhn:csrf />
<rhn:submitted />
<c:if test="${not empty requestScope.all}">
<div class="spacewalk-section-toolbar">
<div class="action-button-wrapper">
<rhn:submitted />
<input type="submit" name="dispatch" class="btn btn-default"
value='<bean:message key="iss.slave.remove"/>' />
</div>
</div>
</c:if>
<rl:list dataset="pageList" name="issSlaveList"
emptykey="iss.master.jsp.noslaves">
<rl:decorator name="SelectableDecorator" />
Expand Down Expand Up @@ -69,13 +78,6 @@
</rl:column>

</rl:list>
<c:if test="${not empty requestScope.all}">
<div class="text-right">
<rhn:submitted />
<input type="submit" name="dispatch" class="btn btn-default"
value='<bean:message key="iss.slave.remove"/>' />
</div>
</c:if>
</rl:listset>
</body>
</html:html>
16 changes: 9 additions & 7 deletions java/code/webapp/WEB-INF/pages/admin/iss/slave.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
<rl:listset name="issMasterListSet">
<rhn:csrf />
<rhn:submitted />
<c:if test="${not empty requestScope.all}">
<div class="spacewalk-section-toolbar">
<div class="action-button-wrapper">
<rhn:submitted />
<input type="submit" name="dispatch" class="btn btn-default"
value='<bean:message key="iss.master.remove"/>' />
</div>
</div>
</c:if>
<rl:list dataset="pageList" name="issMasterList"
emptykey="iss.slave.jsp.nomasters">
<rl:decorator name="SelectableDecorator" />
Expand All @@ -46,13 +55,6 @@
<c:out value="${current.numMasterOrgs - current.numMappedMasterOrgs}" />
</rl:column>
</rl:list>
<c:if test="${not empty requestScope.all}">
<div class="text-right">
<rhn:submitted />
<input type="submit" name="dispatch" class="btn btn-default"
value='<bean:message key="iss.master.remove"/>' />
</div>
</c:if>
</rl:listset>
</body>
</html:html>
6 changes: 6 additions & 0 deletions java/code/webapp/WEB-INF/pages/admin/multiorg/orgtrust.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
<div class="page-summary" style="padding-top: 10px;">
<p><bean:message key="org.trust.summary" arg0="${fn:escapeXml(org.name)}"/></p>
</div>
<div class="spacewalk-section-toolbar">
<div class="action-button-wrapper">
<rhn:submitted/>
<input class="btn btn-default" type="submit" name ="confirm" value="${rhn:localize('org.trust.modify')}" />
</div>
</div>
<rl:listset name="trustedOrgs">
<rhn:csrf />
<rl:list
Expand Down
24 changes: 12 additions & 12 deletions java/code/webapp/WEB-INF/pages/audit/auditsearch.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@
<html:form action="/audit/Search.do">
<rhn:csrf />
<rhn:submitted />
<div class="text-right mb-4">
<button type="submit" class="btn btn-primary">
<rhn:icon type="header-search" />
<bean:message key="button.search"/>
</button>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4>Machine / Time range</h4>
Expand Down Expand Up @@ -121,6 +115,12 @@
<html:hidden property="endMilli" />
</div>
</div>
<div class="panel-footer">
<button type="submit" class="btn btn-primary">
<rhn:icon type="header-search" />
<bean:message key="button.search"/>
</button>
</div>
</div>

<div class="panel panel-default">
Expand Down Expand Up @@ -169,12 +169,12 @@
</tr>
</table>
</div>
</div>
<div class="text-right">
<button type="submit" class="btn btn-primary">
<rhn:icon type="header-search" />
<bean:message key="button.search"/>
</button>
<div class="panel-footer">
<button type="submit" class="btn btn-primary">
<rhn:icon type="header-search" />
<bean:message key="button.search"/>
</button>
</div>
</div>
</html:form>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,35 @@
<%@ taglib uri="http://rhn.redhat.com/tags/config-managment" prefix="cfg"%>

<!-- Import file from another channel -->
<div class="panel panel-default">
<div class="panel-heading">
<h4><bean:message key="addfiles.jsp.import.jspf.title" /> </h4>
</div>
<div class="panel-body">
<html:form action="/configuration/ChannelImportFilesSubmit.do?ccid=${ccid}">
<rhn:csrf />
<html:hidden property="submitted" value="true"/>
<rhn:list
pageList="${requestScope.pageList}"
noDataText="channelfiles.jsp.noFiles">
<h4><bean:message key="addfiles.jsp.import.jspf.title" /> </h4>

<rhn:listdisplay filterBy="channelfiles.jsp.path" set="${requestScope.set}">
<rhn:set value="${current.id}"/>
<rhn:column header="channelfiles.jsp.path">
<cfg:file id="${current.id}" path="${current.path}" type="${current.type}" />
</rhn:column>
<div class="text-right">
<html:submit property="dispatch" styleClass="btn btn-default">
<bean:message key="addfiles.jsp.import.jspf.submit" />
</html:submit>
</div>

<rhn:column header="channelfiles.jsp.channel">
<cfg:channel id="${current.configChannelId}" name="${current.configChannelName}" type="${current.configChannelType}" />
</rhn:column>
<html:form action="/configuration/ChannelImportFilesSubmit.do?ccid=${ccid}">
<rhn:csrf />
<html:hidden property="submitted" value="true"/>
<rhn:list
pageList="${requestScope.pageList}"
noDataText="channelfiles.jsp.noFiles">

<rhn:column header="channelfiles.jsp.lastmod"
url="/rhn/configuration/file/FileDetails.do?cfid=${current.id}">
${current.modifiedDisplay}
</rhn:column>
</rhn:listdisplay>
</rhn:list>
<hr />
<div class="text-right">
<html:submit property="dispatch" styleClass="btn btn-default">
<bean:message key="addfiles.jsp.import.jspf.submit" />
</html:submit>
</div>
</html:form>
</div>
</div>
<rhn:listdisplay filterBy="channelfiles.jsp.path" set="${requestScope.set}">
<rhn:set value="${current.id}"/>
<rhn:column header="channelfiles.jsp.path">
<cfg:file id="${current.id}" path="${current.path}" type="${current.type}" />
</rhn:column>

<rhn:column header="channelfiles.jsp.channel">
<cfg:channel id="${current.configChannelId}" name="${current.configChannelName}" type="${current.configChannelType}" />
</rhn:column>

<rhn:column header="channelfiles.jsp.lastmod"
url="/rhn/configuration/file/FileDetails.do?cfid=${current.id}">
${current.modifiedDisplay}
</rhn:column>
</rhn:listdisplay>
</rhn:list>
</html:form>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@

<rl:listset name="channelSet">
<rhn:csrf />
<c:if test = "${not empty requestScope.pageList}">
<div class="text-right">
<input type="submit" class="btn btn-default"
name="dispatch"
value="${rhn:localize('copy2channels.jsp.doCopy')}"
/>
</div>
</c:if>
<!-- Start of Channels list -->
<rl:list dataset="pageList"
name="channels"
Expand Down Expand Up @@ -41,15 +49,6 @@
attr="filesAndDirsDisplayString"
/>
</rl:list>
<c:if test = "${not empty requestScope.pageList}">
<hr />
<div class="text-right">
<input type="submit" class="btn btn-default"
name="dispatch"
value="${rhn:localize('copy2channels.jsp.doCopy')}"
/>
</div>
</c:if>
<rhn:submitted/>
</rl:listset>
</c:when>
Expand Down
Loading

0 comments on commit 105acf8

Please sign in to comment.