lukaszlenart commented on code in PR #1793:
URL: https://github.com/apache/struts/pull/1793#discussion_r3611202504
##########
apps/showcase/src/main/webapp/WEB-INF/decorators/main.jsp:
##########
@@ -61,20 +61,20 @@
<title><sitemesh:write property="title"/></title>
- <s:url var="bootstrapCss" value='/styles/bootstrap.css' encode='false'
includeParams='none'/>
- <s:link href="%{bootstrapCss}" rel="stylesheet" type="text/css"
media="all"/>
+ <link rel="stylesheet" type="text/css" media="all" href="<s:webjar
path='bootstrap/css/bootstrap.min.css'/>"/>
+ <link rel="stylesheet" type="text/css" href="<s:webjar
path='bootstrap-icons/font/bootstrap-icons.min.css'/>"/>
<s:url var="mainCss" value='/styles/main.css' encode='false'
includeParams='none'/>
<s:link href="%{mainCss}" rel="stylesheet" type="text/css" media="all"/>
- <s:url var="jqueryJs" value='/js/jquery-2.1.4.min.js' encode='false'
includeParams='none'/>
- <s:script src="%{jqueryJs}"/>
- <s:url var="bootstrapJs" value='/js/bootstrap.min.js' encode='false'
includeParams='none'/>
- <s:script src="%{bootstrapJs}"/>
+ <script src="<s:webjar path='jquery/jquery.min.js'/>"></script>
+ <script defer src="<s:webjar
path='bootstrap/js/bootstrap.bundle.min.js'/>"></script>
<s:script>
$(function () {
- var alerts = $('ul.alert').wrap('<div />');
- alerts.prepend('<a class="close" data-dismiss="alert"
href="#">×</a>');
- alerts.alert();
+ $('ul.alert').each(function () {
+ var wrapper = $('<div class="alert alert-dismissible" />');
+ $(this).before(wrapper);
+ wrapper.append('<button type="button" class="btn-close"
data-bs-dismiss="alert" aria-label="Close"></button>').append(this);
+ });
Review Comment:
Fixed in ecdb70492. The dismissible wrapper was a second `.alert` with no
variant, while the variant class stayed on the inner `<ul>` — a nested,
uncoloured box. Now the `alert*` classes are moved onto the wrapper and
stripped from the `<ul>`, so the wrapper is the single alert container.
##########
apps/rest-showcase/src/main/webapp/WEB-INF/content/orders-edit.jsp:
##########
@@ -44,47 +45,47 @@
<div class="row">
<div class="col-md-12">
- <div class="page-header">
+ <div class="border-bottom pb-2">
<h1>Order <s:property value="id" /></h1>
</div>
<s:actionmessage cssClass="alert alert-danger"/>
- <s:form method="post"
action="%{#request.contextPath}/orders/%{id}" cssClass="form-horizontal"
theme="simple">
+ <s:form method="post"
action="%{#request.contextPath}/orders/%{id}" theme="simple">
<s:hidden name="_method" value="put" />
- <div class="form-group">
- <label class="col-sm-2 control-label" for="id">ID</label>
+ <div class="row mb-3">
+ <label class="col-sm-2 col-form-label" for="id">ID</label>
<div class="col-sm-4">
<s:textfield id="id" name="id" disabled="true"
cssClass="form-control"/>
</div>
</div>
- <div class="form-group">
- <label class="col-sm-2 control-label"
for="clientName">Client</label>
+ <div class="row mb-3">
+ <label class="col-sm-2 col-form-label"
for="clientName">Client</label>
<div class="col-sm-4">
<s:textfield id="clientName" name="clientName"
cssClass="form-control"/>
</div>
<div class="col-sm-4">
<s:fielderror fieldName="clientName" />
</div>
</div>
- <div class="form-group">
- <label class="col-sm-2 control-label"
for="amount">Amount</label>
+ <div class="row mb-3">
+ <label class="col-sm-2 col-form-label"
for="amount">Amount</label>
<div class="col-sm-4">
<s:textfield id="amount" name="amount"
cssClass="form-control" />
</div>
<div class="col-sm-4">
<s:fielderror fieldName="amount" />
</div>
</div>
- <div class="form-group">
- <div class="col-sm-offset-2 col-sm-4">
+ <div class="row mb-3">
+ <div class="offset-sm-2 col-sm-4">
<s:submit cssClass="btn btn-primary"/>
</div>
</div>
<table>
</s:form>
Review Comment:
Fixed in ecdb70492. Removed the stray unclosed `<table>` start tag before
`</s:form>` — it was pre-existing invalid markup carried over during the
migration.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]