#5 -- Fix layout
All checks were successful
CI fuzzy controller / container-test-job (push) Successful in 1m45s

This commit is contained in:
Anton Romanov 2025-02-21 11:40:49 +04:00
parent 202d8cd0d3
commit df451f01ce
6 changed files with 33 additions and 20 deletions

View File

@ -23,7 +23,7 @@ public class Variable extends BaseEntity {
@NotNull
private Project project;
private boolean isInput = true;
private boolean input = true;
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "variable_id", unique = true)
@ -66,10 +66,10 @@ public class Variable extends BaseEntity {
}
public boolean isInput() {
return isInput;
return input;
}
public void setInput(boolean isInput) {
this.isInput = isInput;
public void setInput(boolean input) {
this.input = input;
}
}

View File

@ -10,7 +10,7 @@ public class VariableForm {
@Size(min = 3, max = 250, message = "Длина должна быть от 3 до 250")
private String name;
private boolean isInput = true;
private boolean input = true;
public VariableForm() {
}
@ -24,7 +24,7 @@ public class VariableForm {
this.id = id;
this.projectId = variable.getProject().getId();
this.name = variable.getName();
this.isInput = variable.isInput();
this.input = variable.isInput();
}
public Integer getProjectId() {
@ -52,10 +52,10 @@ public class VariableForm {
}
public boolean isInput() {
return isInput;
return input;
}
public void setInput(boolean isInput) {
this.isInput = isInput;
public void setInput(boolean input) {
this.input = input;
}
}

View File

@ -32,6 +32,7 @@ public class VariableService {
}
variable.setProject(projectService.getById(variableForm.getProjectId()));
variable.setName(variableForm.getName());
variable.setInput(variableForm.isInput());
return variableRepository.save(variable);
}

View File

@ -31,6 +31,7 @@
<div class="row">
<div class="col col-md-6">
<h4> Список переменных</h4>
<div class="form-group">
<div class="row" th:each="v, iter : ${variables}">
<div class="col col-md-12">
<a th:href="@{'/var/edit/' + ${projectId}+'/'+${v.id}}">
@ -38,16 +39,19 @@
</a>
</div>
</div>
</div>
<a th:href="@{'/var/edit/' + ${projectId}+'/0'}" class="btn btn-outline-dark">Добавить преременную</a>
</div>
<div class="col col-md-6">
<h4> Список правил</h4>
<div class="form-group">
<div class="row" th:each="r, iter : ${rules}">
<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>
</a>
</div>
</div>
<!-- <div class="col col-md-2 offset-md-3">
<span class="badge badge-primary">Переменная</span>
</div>

View File

@ -25,10 +25,18 @@
</p>
</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="delete"
type="submit"
class="btn btn-outline-dark"
th:if="*{id != 0}"
onclick="return confirm('Удалить запись?')">
Удалить
</button>