Fossil SCM

Add the ability to edit the CSS for all pages in the Setup menu. Other miscellaneous changes toward getting ticketing to work.

drh 2007-10-28 20:52 trunk
Commit 8ffd32c2b7ff83e4d4071d0ad785c67311433d1c
4 files changed +20 -5 +81 -77 +24 -3 +41 -5
+20 -5
--- src/setup.c
+++ src/setup.c
@@ -67,10 +67,12 @@
6767
"Control access settings.");
6868
setup_menu_entry("Configuration", "setup_config",
6969
"Configure the WWW components of the repository");
7070
setup_menu_entry("Tickets", "tktsetup",
7171
"Configure the trouble-ticketing system for this repository");
72
+ setup_menu_entry("CSS", "editcss",
73
+ "Edit the Cascading Style Sheet used by all pages of this repository");
7274
@ </dl>
7375
7476
style_footer();
7577
}
7678
@@ -538,24 +540,37 @@
538540
}
539541
540542
style_header("WWW Configuration");
541543
db_begin_transaction();
542544
@ <form action="%s(g.zBaseURL)/setup_config" method="POST">
543
-
544545
@ <hr />
545
-
546546
entry_attribute("Project Name", 60, "project-name", "pn", "");
547547
@ <p>Give your project a name so visitors know what this site is about.
548548
@ The project name will also be used as the RSS feed title.</p>
549
-
550549
@ <hr />
551
-
552550
textarea_attribute("Project Description", 5, 60, "project-description", "pd", "");
553551
@ <p>Describe your project. This will be used in page headers for search
554552
@ engines as well as a short RSS description.</p>
555
-
556553
@ <hr />
557554
@ <p><input type="submit" name="submit" value="Apply Changes"></p>
558555
@ </form>
559556
db_end_transaction(0);
560557
style_footer();
561558
}
559
+
560
+/*
561
+** WEBPAGE: editcss
562
+*/
563
+void setup_editcss(void){
564
+ login_check_credentials();
565
+ if( !g.okSetup ){
566
+ login_needed();
567
+ }
568
+ style_header("Edit CSS");
569
+ @ <form action="%s(g.zBaseURL)/editcss" method="POST">
570
+ @ Edit the CSS:<br />
571
+ textarea_attribute("", 40, 80, "css", "css", zDefaultCSS);
572
+ @ <br />
573
+ @ <input type="submit" name="submit" value="Apply Changes">
574
+ @ </form>
575
+ style_footer();
576
+}
562577
--- src/setup.c
+++ src/setup.c
@@ -67,10 +67,12 @@
67 "Control access settings.");
68 setup_menu_entry("Configuration", "setup_config",
69 "Configure the WWW components of the repository");
70 setup_menu_entry("Tickets", "tktsetup",
71 "Configure the trouble-ticketing system for this repository");
 
 
72 @ </dl>
73
74 style_footer();
75 }
76
@@ -538,24 +540,37 @@
538 }
539
540 style_header("WWW Configuration");
541 db_begin_transaction();
542 @ <form action="%s(g.zBaseURL)/setup_config" method="POST">
543
544 @ <hr />
545
546 entry_attribute("Project Name", 60, "project-name", "pn", "");
547 @ <p>Give your project a name so visitors know what this site is about.
548 @ The project name will also be used as the RSS feed title.</p>
549
550 @ <hr />
551
552 textarea_attribute("Project Description", 5, 60, "project-description", "pd", "");
553 @ <p>Describe your project. This will be used in page headers for search
554 @ engines as well as a short RSS description.</p>
555
556 @ <hr />
557 @ <p><input type="submit" name="submit" value="Apply Changes"></p>
558 @ </form>
559 db_end_transaction(0);
560 style_footer();
561 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
562
--- src/setup.c
+++ src/setup.c
@@ -67,10 +67,12 @@
67 "Control access settings.");
68 setup_menu_entry("Configuration", "setup_config",
69 "Configure the WWW components of the repository");
70 setup_menu_entry("Tickets", "tktsetup",
71 "Configure the trouble-ticketing system for this repository");
72 setup_menu_entry("CSS", "editcss",
73 "Edit the Cascading Style Sheet used by all pages of this repository");
74 @ </dl>
75
76 style_footer();
77 }
78
@@ -538,24 +540,37 @@
540 }
541
542 style_header("WWW Configuration");
543 db_begin_transaction();
544 @ <form action="%s(g.zBaseURL)/setup_config" method="POST">
 
545 @ <hr />
 
546 entry_attribute("Project Name", 60, "project-name", "pn", "");
547 @ <p>Give your project a name so visitors know what this site is about.
548 @ The project name will also be used as the RSS feed title.</p>
 
549 @ <hr />
 
550 textarea_attribute("Project Description", 5, 60, "project-description", "pd", "");
551 @ <p>Describe your project. This will be used in page headers for search
552 @ engines as well as a short RSS description.</p>
 
553 @ <hr />
554 @ <p><input type="submit" name="submit" value="Apply Changes"></p>
555 @ </form>
556 db_end_transaction(0);
557 style_footer();
558 }
559
560 /*
561 ** WEBPAGE: editcss
562 */
563 void setup_editcss(void){
564 login_check_credentials();
565 if( !g.okSetup ){
566 login_needed();
567 }
568 style_header("Edit CSS");
569 @ <form action="%s(g.zBaseURL)/editcss" method="POST">
570 @ Edit the CSS:<br />
571 textarea_attribute("", 40, 80, "css", "css", zDefaultCSS);
572 @ <br />
573 @ <input type="submit" name="submit" value="Apply Changes">
574 @ </form>
575 style_footer();
576 }
577
+81 -77
--- src/style.c
+++ src/style.c
@@ -140,10 +140,90 @@
140140
@ <div id="style-footer">
141141
@ Fossil version %s(MANIFEST_VERSION) %s(MANIFEST_DATE)
142142
@ </div>
143143
}
144144
145
+/*
146
+** The default Cascading Style Sheet.
147
+**
148
+** Selector order: tags, ids, classes, other
149
+** Content order: margin, borders, padding, fonts, colors, other
150
+** Note: Once things are finialize a bit we can collapse this and
151
+** make it much smaller, if necessary. Right now, it's verbose
152
+** but easy to edit.
153
+*/
154
+const char zDefaultCSS[] =
155
+@ body {
156
+@ margin: 0px;
157
+@ padding: 0px;
158
+@ background-color: white;
159
+@ }
160
+@ #page-title {
161
+@ padding: 10px 10px 10px 10px;
162
+@ font-size: 1.8em;
163
+@ font-weight: bold;
164
+@ background-color: #6a7ec7;
165
+@ color: #0a1e67;
166
+@ }
167
+@ #login-status {
168
+@ padding: 0px 10px 10px 0px;
169
+@ font-size: 0.9em;
170
+@ text-align: right;
171
+@ background-color: #6a7ec7;
172
+@ color: white;
173
+@ position: absolute;
174
+@ top: 10;
175
+@ right: 0;
176
+@ }
177
+@ #main-menu {
178
+@ padding: 5px 10px 5px 10px;
179
+@ font-size: 0.9em;
180
+@ font-weight: bold;
181
+@ text-align: center;
182
+@ letter-spacing: 1px;
183
+@ background-color: #414f84;
184
+@ color: white;
185
+@ }
186
+@ #sub-menu {
187
+@ padding: 3px 10px 3px 0px;
188
+@ font-size: 0.9em;
189
+@ text-align: center;
190
+@ background-color: #414f84;
191
+@ color: white;
192
+@ }
193
+@ #main-menu a, #main-menu a:visited, #sub-menu a, #sub-menu a:visited {
194
+@ padding: 3px 10px 3px 10px;
195
+@ color: white;
196
+@ }
197
+@ #main-menu a:hover, #sub-menu a:hover {
198
+@ color: #414f84;
199
+@ background-color: white;
200
+@ }
201
+@ #page {
202
+@ padding: 10px 20px 10px 20px;
203
+@ }
204
+@ #style-footer {
205
+@ font-size: 0.8em;
206
+@ margin-top: 12px;
207
+@ padding: 5px 10px 5px 10px;
208
+@ text-align: right;
209
+@ background-color: #414f84;
210
+@ color: white;
211
+@ }
212
+@ table.label-value th {
213
+@ text-align: right;
214
+@ vertical-align: top;
215
+@ }
216
+@ div.section-title {
217
+@ margin-bottom: 0px;
218
+@ padding: 1px 1px 1px 1px;
219
+@ font-size: 1.2em;
220
+@ font-weight: bold;
221
+@ background-color: #6a7ec7;
222
+@ color: #0a1e67;
223
+@ }
224
+;
145225
146226
/*
147227
** WEBPAGE: style.css
148228
*/
149229
void page_style_css(void){
@@ -152,87 +232,11 @@
152232
cgi_set_content_type("text/css");
153233
zCSS = db_get("css",0);
154234
if( zCSS ){
155235
cgi_append_content(zCSS, -1);
156236
}else{
157
- /* No CSS file found, use our own */
158
- /*
159
- ** Selector order: tags, ids, classes, other
160
- ** Content order: margin, borders, padding, fonts, colors, other
161
- ** Note: Once things are finialize a bit we can collapse this and
162
- ** make it much smaller, if necessary. Right now, it's verbose
163
- ** but easy to edit.
164
- */
165
- @ body {
166
- @ margin: 0px;
167
- @ padding: 0px;
168
- @ background-color: white;
169
- @ }
170
- @ #page-title {
171
- @ padding: 10px 10px 10px 10px;
172
- @ font-size: 1.8em;
173
- @ font-weight: bold;
174
- @ background-color: #6a7ec7;
175
- @ color: #0a1e67;
176
- @ }
177
- @ #login-status {
178
- @ padding: 0px 10px 10px 0px;
179
- @ font-size: 0.9em;
180
- @ text-align: right;
181
- @ background-color: #6a7ec7;
182
- @ color: white;
183
- @ position: absolute;
184
- @ top: 10;
185
- @ right: 0;
186
- @ }
187
- @ #main-menu {
188
- @ padding: 5px 10px 5px 10px;
189
- @ font-size: 0.9em;
190
- @ font-weight: bold;
191
- @ text-align: center;
192
- @ letter-spacing: 1px;
193
- @ background-color: #414f84;
194
- @ color: white;
195
- @ }
196
- @ #sub-menu {
197
- @ padding: 3px 10px 3px 0px;
198
- @ font-size: 0.9em;
199
- @ text-align: center;
200
- @ background-color: #414f84;
201
- @ color: white;
202
- @ }
203
- @ #main-menu a, #main-menu a:visited, #sub-menu a, #sub-menu a:visited {
204
- @ padding: 3px 10px 3px 10px;
205
- @ color: white;
206
- @ }
207
- @ #main-menu a:hover, #sub-menu a:hover {
208
- @ color: #414f84;
209
- @ background-color: white;
210
- @ }
211
- @ #page {
212
- @ padding: 10px 20px 10px 20px;
213
- @ }
214
- @ #style-footer {
215
- @ font-size: 0.8em;
216
- @ margin-top: 12px;
217
- @ padding: 5px 10px 5px 10px;
218
- @ text-align: right;
219
- @ background-color: #414f84;
220
- @ color: white;
221
- @ }
222
- @ table.label-value th {
223
- @ text-align: right;
224
- @ vertical-align: top;
225
- @ }
226
- @ div.section-title {
227
- @ margin-bottom: 0px;
228
- @ padding: 1px 1px 1px 1px;
229
- @ font-size: 1.2em;
230
- @ font-weight: bold;
231
- @ background-color: #6a7ec7;
232
- @ color: #0a1e67;
233
- @ }
237
+ cgi_append_content(zDefaultCSS, -1);
234238
}
235239
}
236240
237241
/*
238242
** WEBPAGE: test_env
239243
--- src/style.c
+++ src/style.c
@@ -140,10 +140,90 @@
140 @ <div id="style-footer">
141 @ Fossil version %s(MANIFEST_VERSION) %s(MANIFEST_DATE)
142 @ </div>
143 }
144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
146 /*
147 ** WEBPAGE: style.css
148 */
149 void page_style_css(void){
@@ -152,87 +232,11 @@
152 cgi_set_content_type("text/css");
153 zCSS = db_get("css",0);
154 if( zCSS ){
155 cgi_append_content(zCSS, -1);
156 }else{
157 /* No CSS file found, use our own */
158 /*
159 ** Selector order: tags, ids, classes, other
160 ** Content order: margin, borders, padding, fonts, colors, other
161 ** Note: Once things are finialize a bit we can collapse this and
162 ** make it much smaller, if necessary. Right now, it's verbose
163 ** but easy to edit.
164 */
165 @ body {
166 @ margin: 0px;
167 @ padding: 0px;
168 @ background-color: white;
169 @ }
170 @ #page-title {
171 @ padding: 10px 10px 10px 10px;
172 @ font-size: 1.8em;
173 @ font-weight: bold;
174 @ background-color: #6a7ec7;
175 @ color: #0a1e67;
176 @ }
177 @ #login-status {
178 @ padding: 0px 10px 10px 0px;
179 @ font-size: 0.9em;
180 @ text-align: right;
181 @ background-color: #6a7ec7;
182 @ color: white;
183 @ position: absolute;
184 @ top: 10;
185 @ right: 0;
186 @ }
187 @ #main-menu {
188 @ padding: 5px 10px 5px 10px;
189 @ font-size: 0.9em;
190 @ font-weight: bold;
191 @ text-align: center;
192 @ letter-spacing: 1px;
193 @ background-color: #414f84;
194 @ color: white;
195 @ }
196 @ #sub-menu {
197 @ padding: 3px 10px 3px 0px;
198 @ font-size: 0.9em;
199 @ text-align: center;
200 @ background-color: #414f84;
201 @ color: white;
202 @ }
203 @ #main-menu a, #main-menu a:visited, #sub-menu a, #sub-menu a:visited {
204 @ padding: 3px 10px 3px 10px;
205 @ color: white;
206 @ }
207 @ #main-menu a:hover, #sub-menu a:hover {
208 @ color: #414f84;
209 @ background-color: white;
210 @ }
211 @ #page {
212 @ padding: 10px 20px 10px 20px;
213 @ }
214 @ #style-footer {
215 @ font-size: 0.8em;
216 @ margin-top: 12px;
217 @ padding: 5px 10px 5px 10px;
218 @ text-align: right;
219 @ background-color: #414f84;
220 @ color: white;
221 @ }
222 @ table.label-value th {
223 @ text-align: right;
224 @ vertical-align: top;
225 @ }
226 @ div.section-title {
227 @ margin-bottom: 0px;
228 @ padding: 1px 1px 1px 1px;
229 @ font-size: 1.2em;
230 @ font-weight: bold;
231 @ background-color: #6a7ec7;
232 @ color: #0a1e67;
233 @ }
234 }
235 }
236
237 /*
238 ** WEBPAGE: test_env
239
--- src/style.c
+++ src/style.c
@@ -140,10 +140,90 @@
140 @ <div id="style-footer">
141 @ Fossil version %s(MANIFEST_VERSION) %s(MANIFEST_DATE)
142 @ </div>
143 }
144
145 /*
146 ** The default Cascading Style Sheet.
147 **
148 ** Selector order: tags, ids, classes, other
149 ** Content order: margin, borders, padding, fonts, colors, other
150 ** Note: Once things are finialize a bit we can collapse this and
151 ** make it much smaller, if necessary. Right now, it's verbose
152 ** but easy to edit.
153 */
154 const char zDefaultCSS[] =
155 @ body {
156 @ margin: 0px;
157 @ padding: 0px;
158 @ background-color: white;
159 @ }
160 @ #page-title {
161 @ padding: 10px 10px 10px 10px;
162 @ font-size: 1.8em;
163 @ font-weight: bold;
164 @ background-color: #6a7ec7;
165 @ color: #0a1e67;
166 @ }
167 @ #login-status {
168 @ padding: 0px 10px 10px 0px;
169 @ font-size: 0.9em;
170 @ text-align: right;
171 @ background-color: #6a7ec7;
172 @ color: white;
173 @ position: absolute;
174 @ top: 10;
175 @ right: 0;
176 @ }
177 @ #main-menu {
178 @ padding: 5px 10px 5px 10px;
179 @ font-size: 0.9em;
180 @ font-weight: bold;
181 @ text-align: center;
182 @ letter-spacing: 1px;
183 @ background-color: #414f84;
184 @ color: white;
185 @ }
186 @ #sub-menu {
187 @ padding: 3px 10px 3px 0px;
188 @ font-size: 0.9em;
189 @ text-align: center;
190 @ background-color: #414f84;
191 @ color: white;
192 @ }
193 @ #main-menu a, #main-menu a:visited, #sub-menu a, #sub-menu a:visited {
194 @ padding: 3px 10px 3px 10px;
195 @ color: white;
196 @ }
197 @ #main-menu a:hover, #sub-menu a:hover {
198 @ color: #414f84;
199 @ background-color: white;
200 @ }
201 @ #page {
202 @ padding: 10px 20px 10px 20px;
203 @ }
204 @ #style-footer {
205 @ font-size: 0.8em;
206 @ margin-top: 12px;
207 @ padding: 5px 10px 5px 10px;
208 @ text-align: right;
209 @ background-color: #414f84;
210 @ color: white;
211 @ }
212 @ table.label-value th {
213 @ text-align: right;
214 @ vertical-align: top;
215 @ }
216 @ div.section-title {
217 @ margin-bottom: 0px;
218 @ padding: 1px 1px 1px 1px;
219 @ font-size: 1.2em;
220 @ font-weight: bold;
221 @ background-color: #6a7ec7;
222 @ color: #0a1e67;
223 @ }
224 ;
225
226 /*
227 ** WEBPAGE: style.css
228 */
229 void page_style_css(void){
@@ -152,87 +232,11 @@
232 cgi_set_content_type("text/css");
233 zCSS = db_get("css",0);
234 if( zCSS ){
235 cgi_append_content(zCSS, -1);
236 }else{
237 cgi_append_content(zDefaultCSS, -1);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238 }
239 }
240
241 /*
242 ** WEBPAGE: test_env
243
+24 -3
--- src/subscript.c
+++ src/subscript.c
@@ -25,13 +25,34 @@
2525
**
2626
** Subscript attempts to be an extremely light-weight scripting
2727
** language. It contains the barest of bare essentials. It is
2828
** stack-based and forth-like. Everything is in a single global
2929
** namespace. There is only a single datatype of zero-terminated
30
-** string. The stack is of fixed, limited depth. The hash table
30
+** string. The stack is of fixed, limited depth. The symbal table
3131
** is of a limited and fixed size.
3232
**
33
+** TOKENS:
34
+**
35
+** * All tokens are separated from each other by whitespace.
36
+** * Leading and trailing whitespace is ignored.
37
+** * Text within nested {...} is a single string token. The outermost
38
+** curly braces are not part of the token.
39
+** * An identifier with a leading "/" is a string token.
40
+** * A token that looks like a number is a string token.
41
+** * An identifier token is called a "verb".
42
+**
43
+** PROCESSING:
44
+**
45
+** * The input is divided into tokens. Whitespace is discarded.
46
+** String and verb tokens are passed into the engine.
47
+** * String tokens are pushed onto the stack.
48
+** * If a verb token corresponds to a procedure, that procedure is
49
+** run. The procedure might use, pop, or pull elements from
50
+** the stack.
51
+** * If a verb token corresponds to a variable, the value of that
52
+** variable is pushed onto the stack.
53
+**
3354
** This module attempts to be completely self-contained so that it can
3455
** be portable to other projects.
3556
*/
3657
#include "config.h"
3758
#include "subscript.h"
@@ -290,11 +311,11 @@
290311
p->aStack[p->nStack++] = *pVal;
291312
return SBS_OK;
292313
}
293314
294315
/*
295
-** Destroy an underscore interpreter
316
+** Destroy an subscript interpreter
296317
*/
297318
void SbS_Destroy(struct Subscript *p){
298319
int i;
299320
sbs_hash_reset(&p->symTab);
300321
for(i=0; i<p->nStack; i++){
@@ -514,11 +535,11 @@
514535
return 0;
515536
}
516537
517538
518539
/*
519
-** Create a new underscore interpreter
540
+** Create a new subscript interpreter
520541
*/
521542
struct Subscript *SbS_Create(void){
522543
Subscript *p;
523544
524545
p = malloc( sizeof(*p) );
525546
--- src/subscript.c
+++ src/subscript.c
@@ -25,13 +25,34 @@
25 **
26 ** Subscript attempts to be an extremely light-weight scripting
27 ** language. It contains the barest of bare essentials. It is
28 ** stack-based and forth-like. Everything is in a single global
29 ** namespace. There is only a single datatype of zero-terminated
30 ** string. The stack is of fixed, limited depth. The hash table
31 ** is of a limited and fixed size.
32 **
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33 ** This module attempts to be completely self-contained so that it can
34 ** be portable to other projects.
35 */
36 #include "config.h"
37 #include "subscript.h"
@@ -290,11 +311,11 @@
290 p->aStack[p->nStack++] = *pVal;
291 return SBS_OK;
292 }
293
294 /*
295 ** Destroy an underscore interpreter
296 */
297 void SbS_Destroy(struct Subscript *p){
298 int i;
299 sbs_hash_reset(&p->symTab);
300 for(i=0; i<p->nStack; i++){
@@ -514,11 +535,11 @@
514 return 0;
515 }
516
517
518 /*
519 ** Create a new underscore interpreter
520 */
521 struct Subscript *SbS_Create(void){
522 Subscript *p;
523
524 p = malloc( sizeof(*p) );
525
--- src/subscript.c
+++ src/subscript.c
@@ -25,13 +25,34 @@
25 **
26 ** Subscript attempts to be an extremely light-weight scripting
27 ** language. It contains the barest of bare essentials. It is
28 ** stack-based and forth-like. Everything is in a single global
29 ** namespace. There is only a single datatype of zero-terminated
30 ** string. The stack is of fixed, limited depth. The symbal table
31 ** is of a limited and fixed size.
32 **
33 ** TOKENS:
34 **
35 ** * All tokens are separated from each other by whitespace.
36 ** * Leading and trailing whitespace is ignored.
37 ** * Text within nested {...} is a single string token. The outermost
38 ** curly braces are not part of the token.
39 ** * An identifier with a leading "/" is a string token.
40 ** * A token that looks like a number is a string token.
41 ** * An identifier token is called a "verb".
42 **
43 ** PROCESSING:
44 **
45 ** * The input is divided into tokens. Whitespace is discarded.
46 ** String and verb tokens are passed into the engine.
47 ** * String tokens are pushed onto the stack.
48 ** * If a verb token corresponds to a procedure, that procedure is
49 ** run. The procedure might use, pop, or pull elements from
50 ** the stack.
51 ** * If a verb token corresponds to a variable, the value of that
52 ** variable is pushed onto the stack.
53 **
54 ** This module attempts to be completely self-contained so that it can
55 ** be portable to other projects.
56 */
57 #include "config.h"
58 #include "subscript.h"
@@ -290,11 +311,11 @@
311 p->aStack[p->nStack++] = *pVal;
312 return SBS_OK;
313 }
314
315 /*
316 ** Destroy an subscript interpreter
317 */
318 void SbS_Destroy(struct Subscript *p){
319 int i;
320 sbs_hash_reset(&p->symTab);
321 for(i=0; i<p->nStack; i++){
@@ -514,11 +535,11 @@
535 return 0;
536 }
537
538
539 /*
540 ** Create a new subscript interpreter
541 */
542 struct Subscript *SbS_Create(void){
543 Subscript *p;
544
545 p = malloc( sizeof(*p) );
546
+41 -5
--- src/tkt.c
+++ src/tkt.c
@@ -141,11 +141,11 @@
141141
Stmt q;
142142
int i;
143143
char *zSep = "SELECT ";
144144
blob_zero(&sql);
145145
for(i=0; i<nField; i++){
146
- blob_appendf(&sql, "%s%s", zSep, azField[i]);
146
+ blob_appendf(&sql, "%stkt_%s", zSep, azField[i]);
147147
zSep = ", ";
148148
}
149149
blob_appendf(" FROM ticket WHERE uuid=%Q", PD("name",""));
150150
db_prepare(&q, "%b", &sql);
151151
if( db_step(&q)==SQLITE_ROW ){
@@ -239,11 +239,13 @@
239239
pInterp = SbS_Create();
240240
SbS_AddVerb(pInterp, "setfields", setFieldsCmd, 0);
241241
zConfig = db_get("ticket-config","");
242242
SbS_Eval(pInter, zConfig, -1);
243243
for(i=0; i<sizeof(aVerb)/sizeof(aVerb[0]); i++){
244
- SbS_AddVerb(pInterp, aVerb[i].zName, aVerb[i].xVerb, 0);
244
+ if( flags & aVerb[i].mask ){
245
+ SbS_AddVerb(pInterp, aVerb[i].zName, aVerb[i].xVerb, 0);
246
+ }
245247
}
246248
/* Extract appropriate template */
247249
return pInterp;
248250
}
249251
@@ -254,10 +256,19 @@
254256
struct Subscript *pInterp;
255257
const char *zPage;
256258
int nPage;
257259
258260
tkt_screen_init(M_NEW);
261
+ if( P("submit")!=0 ){
262
+ // * Construct the ticket artifact
263
+ // + Prefix
264
+ // + Field/Value pairs in sorted order
265
+ // + Suffix
266
+ // * Register the artifact
267
+ // * Update the ticket table
268
+ // * redirect to the ticket viewer
269
+ }
259270
style_header("New Ticket");
260271
@ This will become a page for entering new tickets.
261272
style_footer();
262273
}
263274
@@ -264,16 +275,41 @@
264275
/*
265276
** PAGE: tktview
266277
** URL: tktview?name=UUID
267278
**
268279
*/
269
-void tktnew_page(void){
280
+void tktedit_page(void){
281
+ struct Subscript *pInterp;
282
+ const char *zPage;
283
+ int nPage;
284
+
285
+ tkt_screen_init(M_VIEW);
286
+ style_header("View Ticket");
287
+ @ This will become a page for entering new tickets.
288
+ style_footer();
289
+}
290
+
291
+/*
292
+** PAGE: tktedit
293
+** URL: tktedit?name=UUID
294
+**
295
+*/
296
+void tktedit_page(void){
270297
struct Subscript *pInterp;
271298
const char *zPage;
272299
int nPage;
273300
274
- tkt_screen_init(M_NEW);
275
- style_header("New Ticket");
301
+ tkt_screen_init(M_EDIT);
302
+ if( P("submit") ){
303
+ // * Construct ticket change artifact
304
+ // + Prefix
305
+ // + Modified field/value pairs in sorted order
306
+ // + Suffix
307
+ // * Register the artifact
308
+ // * Update the ticket table
309
+ // * redirect to the ticket viewer
310
+ }
311
+ style_header("Edit Ticket");
276312
@ This will become a page for entering new tickets.
277313
style_footer();
278314
}
279315
#endif
280316
--- src/tkt.c
+++ src/tkt.c
@@ -141,11 +141,11 @@
141 Stmt q;
142 int i;
143 char *zSep = "SELECT ";
144 blob_zero(&sql);
145 for(i=0; i<nField; i++){
146 blob_appendf(&sql, "%s%s", zSep, azField[i]);
147 zSep = ", ";
148 }
149 blob_appendf(" FROM ticket WHERE uuid=%Q", PD("name",""));
150 db_prepare(&q, "%b", &sql);
151 if( db_step(&q)==SQLITE_ROW ){
@@ -239,11 +239,13 @@
239 pInterp = SbS_Create();
240 SbS_AddVerb(pInterp, "setfields", setFieldsCmd, 0);
241 zConfig = db_get("ticket-config","");
242 SbS_Eval(pInter, zConfig, -1);
243 for(i=0; i<sizeof(aVerb)/sizeof(aVerb[0]); i++){
244 SbS_AddVerb(pInterp, aVerb[i].zName, aVerb[i].xVerb, 0);
 
 
245 }
246 /* Extract appropriate template */
247 return pInterp;
248 }
249
@@ -254,10 +256,19 @@
254 struct Subscript *pInterp;
255 const char *zPage;
256 int nPage;
257
258 tkt_screen_init(M_NEW);
 
 
 
 
 
 
 
 
 
259 style_header("New Ticket");
260 @ This will become a page for entering new tickets.
261 style_footer();
262 }
263
@@ -264,16 +275,41 @@
264 /*
265 ** PAGE: tktview
266 ** URL: tktview?name=UUID
267 **
268 */
269 void tktnew_page(void){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270 struct Subscript *pInterp;
271 const char *zPage;
272 int nPage;
273
274 tkt_screen_init(M_NEW);
275 style_header("New Ticket");
 
 
 
 
 
 
 
 
 
276 @ This will become a page for entering new tickets.
277 style_footer();
278 }
279 #endif
280
--- src/tkt.c
+++ src/tkt.c
@@ -141,11 +141,11 @@
141 Stmt q;
142 int i;
143 char *zSep = "SELECT ";
144 blob_zero(&sql);
145 for(i=0; i<nField; i++){
146 blob_appendf(&sql, "%stkt_%s", zSep, azField[i]);
147 zSep = ", ";
148 }
149 blob_appendf(" FROM ticket WHERE uuid=%Q", PD("name",""));
150 db_prepare(&q, "%b", &sql);
151 if( db_step(&q)==SQLITE_ROW ){
@@ -239,11 +239,13 @@
239 pInterp = SbS_Create();
240 SbS_AddVerb(pInterp, "setfields", setFieldsCmd, 0);
241 zConfig = db_get("ticket-config","");
242 SbS_Eval(pInter, zConfig, -1);
243 for(i=0; i<sizeof(aVerb)/sizeof(aVerb[0]); i++){
244 if( flags & aVerb[i].mask ){
245 SbS_AddVerb(pInterp, aVerb[i].zName, aVerb[i].xVerb, 0);
246 }
247 }
248 /* Extract appropriate template */
249 return pInterp;
250 }
251
@@ -254,10 +256,19 @@
256 struct Subscript *pInterp;
257 const char *zPage;
258 int nPage;
259
260 tkt_screen_init(M_NEW);
261 if( P("submit")!=0 ){
262 // * Construct the ticket artifact
263 // + Prefix
264 // + Field/Value pairs in sorted order
265 // + Suffix
266 // * Register the artifact
267 // * Update the ticket table
268 // * redirect to the ticket viewer
269 }
270 style_header("New Ticket");
271 @ This will become a page for entering new tickets.
272 style_footer();
273 }
274
@@ -264,16 +275,41 @@
275 /*
276 ** PAGE: tktview
277 ** URL: tktview?name=UUID
278 **
279 */
280 void tktedit_page(void){
281 struct Subscript *pInterp;
282 const char *zPage;
283 int nPage;
284
285 tkt_screen_init(M_VIEW);
286 style_header("View Ticket");
287 @ This will become a page for entering new tickets.
288 style_footer();
289 }
290
291 /*
292 ** PAGE: tktedit
293 ** URL: tktedit?name=UUID
294 **
295 */
296 void tktedit_page(void){
297 struct Subscript *pInterp;
298 const char *zPage;
299 int nPage;
300
301 tkt_screen_init(M_EDIT);
302 if( P("submit") ){
303 // * Construct ticket change artifact
304 // + Prefix
305 // + Modified field/value pairs in sorted order
306 // + Suffix
307 // * Register the artifact
308 // * Update the ticket table
309 // * redirect to the ticket viewer
310 }
311 style_header("Edit Ticket");
312 @ This will become a page for entering new tickets.
313 style_footer();
314 }
315 #endif
316

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button