-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPreview.tid
125 lines (119 loc) · 3.6 KB
/
Preview.tid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
caption: Preview
tags: $:/tags/SideBar
title: $:/plugins/OokTech/InvoiceCreator/Preview
type: text/vnd.tiddlywiki
\define listUnusedSections()
Unused sections:
<br>
<br>
<$set
filter='[list[$:/data/Invoice/$(ThisInvoice)$##section_order]]'
name=UsedSections
>
<$list
filter='[all[tiddlers+shadows]removeprefix[$:/plugins/OokTech/InvoiceCreator/settings/tabs]addprefix[$:/plugins/OokTech/InvoiceCreator/display]]+[remove<UsedSections>]'
variable=ThisSection
>
<$button>
Add Section
<$action-listops
$tiddler=<<InvoiceDataTiddler>>
$index=section_order
$subfilter='+[append<ThisSection>]'
/>
</$button>
<$view
tiddler=<<ThisSection>>
field='section_name'
>
<$view
tiddler=<<ThisSection>>
field='title'
/>
</$view>
<br>
</$list>
</$set>
\end
\define thisMakePreview()
<$list
filter="""[list[$:/data/Invoice/$(ThisInvoice)$##section_order]]"""
variable=ThisSection
>
<div
class=preview-div-reorder
>
<div
class=preview-div-reorder-inner
>
<$tiddler
tiddler=<<InvoiceDataTiddler>>
>
<$button
class="tc-btn-invisible tc-btn-mini"
tooltip='Move Section Up'
>
{{$:/core/images/chevron-up}}
<$list
filter='[list[$:/data/Invoice/$(ThisInvoice)$##section_order]first[]!field:title<ThisSection>]'
variable=dummy
>
<$action-listops
$tiddler=<<InvoiceDataTiddler>>
$index=section_order
$subfilter='[list[##section_order]move:-1<ThisSection>]'
/>
</$list>
</$button>
<$button
class="tc-btn-invisible tc-btn-mini"
tooltip='Move Section Down'
>
{{$:/core/images/chevron-down}}
<$action-listops
$tiddler=<<InvoiceDataTiddler>>
$index=section_order
$subfilter='[list[##section_order]move<ThisSection>]'
/>
</$button>
<$button
class="tc-btn-invisible tc-btn-mini"
tooltip='Remove Section'
>
{{$:/core/images/close-button}}
<$action-listops
$tiddler=<<InvoiceDataTiddler>>
$index=section_order
$filter='[list[##section_order]remove<ThisSection>]'
/>
</$button>
Order:''
<$count
filter='[list[##section_order]allbefore<ThisSection>][[dummy]]'
/>''
</$tiddler>
Section Name:
''__
<$view
tiddler=<<ThisSection>>
field='section_name'
/>
__''
</div>
<$transclude
tiddler=<<ThisSection>>
mode=block
/>
</div>
</$list>
\end
<$vars
ThisInvoice={{$:/settings/Global!!selected_invoice}}
>
<div
style='margin-left:20px;background-color:white;color:black'
>
<<thisMakePreview>>
</div>
<<listUnusedSections>>
</$vars>