#5 -- Add rule edit link
All checks were successful
CI fuzzy controller / container-test-job (push) Successful in 1m4s
All checks were successful
CI fuzzy controller / container-test-job (push) Successful in 1m4s
This commit is contained in:
parent
4449902185
commit
47059bc2de
@ -26,9 +26,9 @@ public class RuleController {
|
||||
@PathVariable(value = "ruleId") Integer id, Model model) {
|
||||
model.addAttribute("projectId", projectId);
|
||||
model.addAttribute("fuzzyRuleForm",
|
||||
new FuzzyRuleForm(id, (id != null && id != 0)
|
||||
? ruleService.getById(id).getProject().getId()
|
||||
: projectId));
|
||||
(id != null && id != 0)
|
||||
? new FuzzyRuleForm(id, ruleService.getById(id))
|
||||
: new FuzzyRuleForm(id, projectId));
|
||||
|
||||
return "rule/edit";
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
@ -19,6 +19,12 @@ public class FuzzyRuleForm {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public FuzzyRuleForm(Integer id, FuzzyRule fuzzyRule) {
|
||||
this.id = fuzzyRule.getId();
|
||||
this.projectId = fuzzyRule.getProject().getId();
|
||||
this.content = fuzzyRule.getContent();
|
||||
}
|
||||
|
||||
public Integer getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
@ -33,7 +33,9 @@
|
||||
<h4> Список переменных</h4>
|
||||
<div class="row" th:each="v, iter : ${variables}">
|
||||
<div class="col col-md-12">
|
||||
<span class="badge badge-light" th:text="${iter.index+1} + '. ' + ${v.name}"></span>
|
||||
<a th:href="@{'/var/edit/' + ${projectId}+'/'+${v.id}}">
|
||||
<span class="badge badge-light" th:text="${iter.index+1} + '. ' + ${v.name}"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<a th:href="@{'/var/edit/' + ${projectId}+'/0'}" class="btn btn-outline-dark">Добавить преременную</a>
|
||||
@ -42,9 +44,11 @@
|
||||
<h4> Список правил</h4>
|
||||
<div class="row" th:each="r, iter : ${rules}">
|
||||
<div class="col col-md-12">
|
||||
<span class="badge badge-light" th:text="${iter.index+1} + '. ' + ${r.content}"></span>
|
||||
<a th:href="@{'/rule/edit/' + ${projectId}+'/'+${r.id}}">
|
||||
<span class="badge badge-light" th:text="${iter.index+1} + '. ' + ${r.content}"></span>
|
||||
</a>
|
||||
</div>
|
||||
<!-- <div class="col col-md-2 offset-md-3">
|
||||
<!-- <div class="col col-md-2 offset-md-3">
|
||||
<span class="badge badge-primary">Переменная</span>
|
||||
</div>
|
||||
<div class="col col-md-2">
|
||||
|
Loading…
x
Reference in New Issue
Block a user