#5 -- Fix layout
All checks were successful
CI fuzzy controller / container-test-job (push) Successful in 1m45s
All checks were successful
CI fuzzy controller / container-test-job (push) Successful in 1m45s
This commit is contained in:
parent
202d8cd0d3
commit
df451f01ce
@ -25,7 +25,7 @@ public class VariableController {
|
|||||||
public String edit(@PathVariable(value = "projectId") Integer projectId,
|
public String edit(@PathVariable(value = "projectId") Integer projectId,
|
||||||
@PathVariable(value = "varId") Integer id, Model model) {
|
@PathVariable(value = "varId") Integer id, Model model) {
|
||||||
model.addAttribute("projectId", projectId);
|
model.addAttribute("projectId", projectId);
|
||||||
model.addAttribute("variableForm",
|
model.addAttribute("variableForm",
|
||||||
(id != null && id != 0)
|
(id != null && id != 0)
|
||||||
? new VariableForm(id, variableService.getById(id))
|
? new VariableForm(id, variableService.getById(id))
|
||||||
: new VariableForm(id, projectId));
|
: new VariableForm(id, projectId));
|
||||||
|
@ -23,7 +23,7 @@ public class Variable extends BaseEntity {
|
|||||||
@NotNull
|
@NotNull
|
||||||
private Project project;
|
private Project project;
|
||||||
|
|
||||||
private boolean isInput = true;
|
private boolean input = true;
|
||||||
|
|
||||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "variable_id", unique = true)
|
@JoinColumn(name = "variable_id", unique = true)
|
||||||
@ -66,10 +66,10 @@ public class Variable extends BaseEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInput() {
|
public boolean isInput() {
|
||||||
return isInput;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInput(boolean isInput) {
|
public void setInput(boolean input) {
|
||||||
this.isInput = isInput;
|
this.input = input;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ public class VariableForm {
|
|||||||
@Size(min = 3, max = 250, message = "Длина должна быть от 3 до 250")
|
@Size(min = 3, max = 250, message = "Длина должна быть от 3 до 250")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
private boolean isInput = true;
|
private boolean input = true;
|
||||||
|
|
||||||
public VariableForm() {
|
public VariableForm() {
|
||||||
}
|
}
|
||||||
@ -24,7 +24,7 @@ public class VariableForm {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
this.projectId = variable.getProject().getId();
|
this.projectId = variable.getProject().getId();
|
||||||
this.name = variable.getName();
|
this.name = variable.getName();
|
||||||
this.isInput = variable.isInput();
|
this.input = variable.isInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getProjectId() {
|
public Integer getProjectId() {
|
||||||
@ -52,10 +52,10 @@ public class VariableForm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInput() {
|
public boolean isInput() {
|
||||||
return isInput;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInput(boolean isInput) {
|
public void setInput(boolean input) {
|
||||||
this.isInput = isInput;
|
this.input = input;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,7 @@ public class VariableService {
|
|||||||
}
|
}
|
||||||
variable.setProject(projectService.getById(variableForm.getProjectId()));
|
variable.setProject(projectService.getById(variableForm.getProjectId()));
|
||||||
variable.setName(variableForm.getName());
|
variable.setName(variableForm.getName());
|
||||||
|
variable.setInput(variableForm.isInput());
|
||||||
return variableRepository.save(variable);
|
return variableRepository.save(variable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,22 +31,26 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col col-md-6">
|
<div class="col col-md-6">
|
||||||
<h4> Список переменных</h4>
|
<h4> Список переменных</h4>
|
||||||
<div class="row" th:each="v, iter : ${variables}">
|
<div class="form-group">
|
||||||
<div class="col col-md-12">
|
<div class="row" th:each="v, iter : ${variables}">
|
||||||
<a th:href="@{'/var/edit/' + ${projectId}+'/'+${v.id}}">
|
<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}}">
|
||||||
</a>
|
<span class="badge badge-light" th:text="${iter.index+1} + '. ' + ${v.name}"></span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</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>
|
||||||
</div>
|
</div>
|
||||||
<div class="col col-md-6">
|
<div class="col col-md-6">
|
||||||
<h4> Список правил</h4>
|
<h4> Список правил</h4>
|
||||||
<div class="row" th:each="r, iter : ${rules}">
|
<div class="form-group">
|
||||||
<div class="col col-md-12">
|
<div class="row" th:each="r, iter : ${rules}">
|
||||||
<a th:href="@{'/rule/edit/' + ${projectId}+'/'+${r.id}}">
|
<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}}">
|
||||||
</a>
|
<span class="badge badge-light" th:text="${iter.index+1} + '. ' + ${r.content}"></span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</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>
|
||||||
|
@ -24,11 +24,19 @@
|
|||||||
Не может быть пустым
|
Не может быть пустым
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<input th:field="*{input}"
|
||||||
|
id="input"
|
||||||
|
type="checkbox">
|
||||||
|
<label for="input">Является входной переменной</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<button name="save" type="submit" class="btn btn-outline-dark">Сохранить</button>
|
<button name="save" type="submit" class="btn btn-outline-dark">Сохранить</button>
|
||||||
<button name="delete"
|
<button name="delete"
|
||||||
type="submit"
|
type="submit"
|
||||||
class="btn btn-outline-dark"
|
class="btn btn-outline-dark"
|
||||||
|
th:if="*{id != 0}"
|
||||||
onclick="return confirm('Удалить запись?')">
|
onclick="return confirm('Удалить запись?')">
|
||||||
Удалить
|
Удалить
|
||||||
</button>
|
</button>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user