mirror of
https://github.com/wekan/wekan.git
synced 2026-03-04 04:40:16 +01:00
UI for rules list
This commit is contained in:
parent
d5870472fb
commit
f63482b587
19 changed files with 256 additions and 2 deletions
27
client/components/rules/rules.jade
Normal file
27
client/components/rules/rules.jade
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
template(name="rules")
|
||||
.rules
|
||||
h2
|
||||
i.fa.fa-cutlery
|
||||
| Project rules
|
||||
|
||||
ul.rules-lists
|
||||
each triggers
|
||||
li.rules-lists-item
|
||||
p
|
||||
= toId
|
||||
div.rules-btns-group
|
||||
button
|
||||
i.fa.fa-eye
|
||||
| View rule
|
||||
button
|
||||
i.fa.fa-trash-o
|
||||
| Delete rule
|
||||
else
|
||||
li.no-items-message No rules
|
||||
div.rules-add
|
||||
button
|
||||
i.fa.fa-plus
|
||||
| Add rule
|
||||
input(type=text)
|
||||
|
||||
|
||||
25
client/components/rules/rules.js
Normal file
25
client/components/rules/rules.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
BlazeComponent.extendComponent({
|
||||
onCreated() {
|
||||
this.subscribe('allTriggers');
|
||||
},
|
||||
|
||||
triggers() {
|
||||
return Triggers.find({});
|
||||
},
|
||||
events() {
|
||||
return [{'click .js-add-trigger'(event) {
|
||||
|
||||
event.preventDefault();
|
||||
const toName = this.find('#toName').value;
|
||||
const fromName = this.find('#fromName').value;
|
||||
const toId = Triggers.findOne().findList(toName)._id;
|
||||
const fromId = Triggers.findOne().findList(fromName)._id;
|
||||
console.log(toId);
|
||||
console.log(fromId);
|
||||
Triggers.insert({group: "cards", activityType: "moveCard","fromId":fromId,"toId":toId });
|
||||
|
||||
|
||||
},}];
|
||||
},
|
||||
}).register('rules');
|
||||
34
client/components/rules/rules.styl
Normal file
34
client/components/rules/rules.styl
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
.rules-list
|
||||
overflow-y: scroll
|
||||
.rules-lists-item
|
||||
display: block
|
||||
position: relative
|
||||
overflow: auto
|
||||
p
|
||||
display: inline-block
|
||||
float: left
|
||||
margin: revert
|
||||
|
||||
.rules-btns-group
|
||||
position: absolute
|
||||
right: 0
|
||||
top: 50%
|
||||
transform: translateY(-50%)
|
||||
button
|
||||
margin: auto
|
||||
.rules-add
|
||||
display: block
|
||||
overflow: auto
|
||||
margin-top: 25px
|
||||
margin-bottom: 5px
|
||||
input
|
||||
display: inline-block
|
||||
float: right
|
||||
margin: auto
|
||||
margin-right: 10px
|
||||
button
|
||||
display: inline-block
|
||||
float: right
|
||||
margin: auto
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue