Skip to content

Commit

Permalink
Added classes to creation types
Browse files Browse the repository at this point in the history
  • Loading branch information
bisht-richa committed Oct 15, 2024
1 parent 73ce1c7 commit e4b1330
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19595,7 +19595,7 @@ the <a href="/rhn/kickstart/ActivationKeysList.do?ksid={0}">Activation Key
<context context-type="sourcefile">/rhn/kickstart/ViewTrees.do</context>
</context-group>
</trans-unit>
<trans-unit id="kickstart.kickstartable_distro_create_new.jsp">
<trans-unit id="toolbar.create.distro">
<source>Create Distribution</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/kickstart/ViewTrees.do</context>
Expand Down
25 changes: 13 additions & 12 deletions java/code/src/com/redhat/rhn/frontend/taglibs/ToolbarTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import com.redhat.rhn.frontend.html.HtmlTag;
import com.redhat.rhn.manager.acl.AclManager;

import org.apache.commons.lang3.StringUtils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
Expand Down Expand Up @@ -505,11 +507,11 @@ public int doStartTag() throws JspException {
buf.append(baseTag.renderOpenTag());
buf.append(toolbarDivTag.renderOpenTag());

buf.append(renderCreationLink());
buf.append(renderCloneLink());
buf.append(renderUploadLink());
buf.append(renderDeletionLink());
buf.append(renderMiscLink());
buf.append(renderCreationLink());
buf.append(toolbarDivTag.renderCloseTag());


Expand Down Expand Up @@ -593,8 +595,7 @@ private String renderCreationLink() {
assertNotEmpty(getCreationUrl())) {

String create = "toolbar.create." + getCreationType();
String className = "btn btn-primary";
return renderActionLink(getCreationUrl(), create, className,
return renderActionLink(getCreationUrl(), create, "btn btn-primary",
create, "item-add", null, false);
}
return "";
Expand All @@ -605,8 +606,7 @@ private String renderCloneLink() {
assertNotEmpty(getCloneUrl())) {

String clone = "toolbar.clone." + getCloneType();
String className = "btn btn-default";
return renderActionLink(getCloneUrl(), clone, className,
return renderActionLink(getCloneUrl(), clone, "btn btn-default",
clone, "item-clone", null, false);
}
return "";
Expand All @@ -617,8 +617,7 @@ private String renderDeletionLink() {
assertNotEmpty(getDeletionUrl())) {

String del = "toolbar.delete." + getDeletionType();
String className = "btn btn-danger";
return renderActionLink(getDeletionUrl(), del, className, del, "item-del", null, false);
return renderActionLink(getDeletionUrl(), del, "btn btn-danger", del, "item-del", null, false);
}
return "";
}
Expand All @@ -628,8 +627,7 @@ private String renderUploadLink() {
assertNotEmpty(getUploadUrl())) {

String del = "toolbar.upload." + getUploadType();
String className = "btn btn-default";
return renderActionLink(getUploadUrl(), del, className, del, "item-upload", null, false);
return renderActionLink(getUploadUrl(), del, "btn btn-default", del, "item-upload", null, false);
}
return "";
}
Expand All @@ -646,8 +644,7 @@ private String renderMiscLink() {
return "";
}

String className = "btn btn-default";
return renderActionLink(getMiscUrl(), getMiscText(), className,
return renderActionLink(getMiscUrl(), getMiscText(), "btn btn-default",
getMiscAlt(), getMiscIcon(), getMiscImg(), isMiscSpaOff());
}

Expand All @@ -662,11 +659,15 @@ private String renderActionLink(String url, String text, String className,

HtmlTag a = new HtmlTag("a");
a.setAttribute("href", url);
a.setAttribute("class", className);

if (isSpaOff) {
a.setAttribute("data-senna-off", "true");
}

if (StringUtils.isNotBlank(className)) {
a.setAttribute("class", className);
}

if (assertNotEmpty(imgName)) {
alt = LocalizationService.getInstance().getMessage(alt);
HtmlTag imgTag = new HtmlTag("img");
Expand Down
4 changes: 2 additions & 2 deletions java/code/webapp/WEB-INF/pages/kickstart/kstrees.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<body>

<rhn:toolbar base="h1" miscIcon="item-add"
miscText="kickstart.kickstartable_distro_create_new.jsp"
miscUrl="TreeCreate.do"
creationType="distro"
creationUrl="TreeCreate.do"
icon="header-kickstart"
iconAlt="kickstarts.alt.img"
helpUrl="/docs/${rhn:getDocsLocale(pageContext)}/reference/systems/autoinst-distributions.html">
Expand Down
2 changes: 1 addition & 1 deletion java/code/webapp/WEB-INF/pages/ssm/systems/migrate.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</html:select>
</div>
<div class="form-group">
<button class="btn btn-primary" type="submit" name="dispatch" value="${rhn:localize('ssm.migrate.systems.confirmbutton')}">
<button class="btn btn-default" type="submit" name="dispatch" value="${rhn:localize('ssm.migrate.systems.confirmbutton')}">
${rhn:localize('ssm.migrate.systems.confirmbutton')}
</button>
</div>
Expand Down

0 comments on commit e4b1330

Please sign in to comment.