#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) {
|
@PathVariable(value = "ruleId") Integer id, Model model) {
|
||||||
model.addAttribute("projectId", projectId);
|
model.addAttribute("projectId", projectId);
|
||||||
model.addAttribute("fuzzyRuleForm",
|
model.addAttribute("fuzzyRuleForm",
|
||||||
new FuzzyRuleForm(id, (id != null && id != 0)
|
(id != null && id != 0)
|
||||||
? ruleService.getById(id).getProject().getId()
|
? new FuzzyRuleForm(id, ruleService.getById(id))
|
||||||
: projectId));
|
: new FuzzyRuleForm(id, projectId));
|
||||||
|
|
||||||
return "rule/edit";
|
return "rule/edit";
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ import org.springframework.stereotype.Controller;
|
|||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.validation.BindingResult;
|
import org.springframework.validation.BindingResult;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
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.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
@ -19,6 +19,12 @@ public class FuzzyRuleForm {
|
|||||||
this.projectId = projectId;
|
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() {
|
public Integer getProjectId() {
|
||||||
return projectId;
|
return projectId;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,9 @@
|
|||||||
<h4> Список переменных</h4>
|
<h4> Список переменных</h4>
|
||||||
<div class="row" th:each="v, iter : ${variables}">
|
<div class="row" th:each="v, iter : ${variables}">
|
||||||
<div class="col col-md-12">
|
<div class="col col-md-12">
|
||||||
|
<a th:href="@{'/var/edit/' + ${projectId}+'/'+${v.id}}">
|
||||||
<span class="badge badge-light" th:text="${iter.index+1} + '. ' + ${v.name}"></span>
|
<span class="badge badge-light" th:text="${iter.index+1} + '. ' + ${v.name}"></span>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a th:href="@{'/var/edit/' + ${projectId}+'/0'}" class="btn btn-outline-dark">Добавить преременную</a>
|
<a th:href="@{'/var/edit/' + ${projectId}+'/0'}" class="btn btn-outline-dark">Добавить преременную</a>
|
||||||
@ -42,7 +44,9 @@
|
|||||||
<h4> Список правил</h4>
|
<h4> Список правил</h4>
|
||||||
<div class="row" th:each="r, iter : ${rules}">
|
<div class="row" th:each="r, iter : ${rules}">
|
||||||
<div class="col col-md-12">
|
<div class="col col-md-12">
|
||||||
|
<a th:href="@{'/rule/edit/' + ${projectId}+'/'+${r.id}}">
|
||||||
<span class="badge badge-light" th:text="${iter.index+1} + '. ' + ${r.content}"></span>
|
<span class="badge badge-light" th:text="${iter.index+1} + '. ' + ${r.content}"></span>
|
||||||
|
</a>
|
||||||
</div>
|
</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>
|
<span class="badge badge-primary">Переменная</span>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user