mirror of
https://gitee.com/dcren/initializr.git
synced 2025-09-18 09:44:47 +08:00
Show version requirements for disabled starters
This commit writes the version range information in human readable format and adds it to the starter list when starters are disabled. Closes gh-293
This commit is contained in:

committed by
Stephane Nicoll

parent
26dd9eb082
commit
8ee8d72e62
@@ -69,6 +69,13 @@ input[type=text] {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.version-requirement {
|
||||
display: none;
|
||||
}
|
||||
.disabled .version-requirement {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* autocomplete */
|
||||
|
||||
#autocomplete, .twitter-typeahead, .tt-hint {
|
||||
|
@@ -125,12 +125,12 @@ $(function () {
|
||||
var refreshDependencies = function (versionRange) {
|
||||
var versions = new Versions();
|
||||
$("#dependencies div.checkbox").each(function (idx, item) {
|
||||
if ($(item).attr('data-range') === 'null' || versions.matchRange($(item).attr('data-range'))(versionRange)) {
|
||||
if (!$(item).attr('data-range') || versions.matchRange($(item).attr('data-range'))(versionRange)) {
|
||||
$("input", item).removeAttr("disabled");
|
||||
$(item).removeClass("disabled");
|
||||
$(item).removeClass("disabled has-error");
|
||||
} else {
|
||||
$("input", item).prop('checked', false);
|
||||
$(item).addClass("disabled");
|
||||
$(item).addClass("disabled has-error");
|
||||
$("input", item).attr("disabled", true);
|
||||
removeTag($("input", item).val());
|
||||
}
|
||||
|
@@ -139,11 +139,13 @@
|
||||
<div class="form-group col-sm-6">
|
||||
<h3>${it.name}</h3>
|
||||
<% it.content.each { %>
|
||||
<div class="checkbox" data-range="${it.versionRange}">
|
||||
<div class="checkbox" data-range="${it.versionRange?:''}">
|
||||
<label>
|
||||
<input tabindex="13" type="checkbox" name="style" value="${it.id}">
|
||||
${it.name}
|
||||
<input tabindex="13" type="checkbox" name="style" value="${it.id}">${it.name}
|
||||
<p class="help-block">${it.description}</p>
|
||||
<% if (it.versionRequirement) { %>
|
||||
<p class="help-block version-requirement">requires Spring Boot ${it.versionRequirement}</p>
|
||||
<% } %>
|
||||
</label>
|
||||
</div>
|
||||
<% } %>
|
||||
|
Reference in New Issue
Block a user