Fossil SCM

Removed unnecessary items from WWW Configuration, also made RSS Title and Description into generic Project Name and Project Description settings, which will be used elsewhere in the web site.

jnc 2007-10-10 02:49 trunk
Commit f3807dbd88a8d65b85ca39489611268b5ea3a962
4 files changed +22 -18 +19 -35 +13 -12 +2 -2
+22 -18
--- src/rss.c
+++ src/rss.c
@@ -7,11 +7,11 @@
77
**
88
** This program is distributed in the hope that it will be useful,
99
** but WITHOUT ANY WARRANTY; without even the implied warranty of
1010
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1111
** General Public License for more details.
12
-**
12
+**
1313
** You should have received a copy of the GNU General Public
1414
** License along with this library; if not, write to the
1515
** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
1616
** Boston, MA 02111-1307, USA.
1717
**
@@ -28,18 +28,18 @@
2828
#include <assert.h>
2929
#include <time.h>
3030
3131
time_t rss_datetime_to_time_t(const char *dt){
3232
struct tm the_tm;
33
-
33
+
3434
the_tm.tm_year = atoi(dt)-1900;
3535
the_tm.tm_mon = atoi(&dt[5])-1;
3636
the_tm.tm_mday = atoi(&dt[8]);
3737
the_tm.tm_hour = atoi(&dt[11]);
3838
the_tm.tm_min = atoi(&dt[14]);
3939
the_tm.tm_sec = atoi(&dt[17]);
40
-
40
+
4141
return mktime(&the_tm);
4242
}
4343
4444
/*
4545
** WEBPAGE: timeline.rss
@@ -46,11 +46,11 @@
4646
*/
4747
4848
void page_timeline_rss(void){
4949
Stmt q;
5050
int nLine=0;
51
- char *zPubDate, *zRSSTitle, *zRSSDescr, *zFreeRSSTitle=0;
51
+ char *zPubDate, *zProjectName, *zProjectDescr, *zFreeProjectName=0;
5252
const char zSQL[] =
5353
@ SELECT
5454
@ blob.rid,
5555
@ uuid,
5656
@ datetime(event.mtime),
@@ -60,31 +60,31 @@
6060
@ (SELECT count(*) FROM plink WHERE cid=blob.rid)
6161
@ FROM event, blob
6262
@ WHERE blob.rid=event.objid
6363
@ ORDER BY event.mtime DESC
6464
;
65
-
65
+
6666
cgi_set_content_type("application/rss+xml");
67
-
68
- zRSSTitle = db_get("rss-title", 0);
69
- if( zRSSTitle==0 ){
70
- zFreeRSSTitle = zRSSTitle = mprintf("Fossil source repository for: %s",
67
+
68
+ zProjectName = db_get("project-name", 0);
69
+ if( zProjectName==0 ){
70
+ zFreeProjectName = zProjectName = mprintf("Fossil source repository for: %s",
7171
g.zBaseURL);
7272
}
73
- zRSSDescr = db_get("rss-description", 0);
74
- if( zRSSDescr==0 ){
75
- zRSSDescr = zRSSTitle;
73
+ zProjectDescr = db_get("project-description", 0);
74
+ if( zProjectDescr==0 ){
75
+ zProjectDescr = zProjectName;
7676
}
77
-
77
+
7878
zPubDate = cgi_rfc822_datestamp(time(NULL));
79
-
79
+
8080
@ <?xml version="1.0"?>
8181
@ <rss version="2.0">
8282
@ <channel>
83
- @ <title>%s(zRSSTitle)</title>
83
+ @ <title>%s(zProjectName)</title>
8484
@ <link>%s(g.zBaseURL)</link>
85
- @ <description>%s(zRSSDescr)</description>
85
+ @ <description>%s(zProjectDescr)</description>
8686
@ <pubDate>%s(zPubDate)</pubDate>
8787
@ <generator>Fossil version %s(MANIFEST_VERSION) %s(MANIFEST_DATE)</generator>
8888
db_prepare(&q, zSQL);
8989
while( db_step(&q)==SQLITE_ROW && nLine<=20 ){
9090
const char *zId = db_column_text(&q, 1);
@@ -92,13 +92,13 @@
9292
const char *zCom = db_column_text(&q, 3);
9393
const char *zAuthor = db_column_text(&q, 4);
9494
char *zPrefix = "";
9595
int nChild = db_column_int(&q, 5);
9696
int nParent = db_column_int(&q, 6);
97
-
97
+
9898
zDate = cgi_rfc822_datestamp(rss_datetime_to_time_t(zDate));
99
-
99
+
100100
if( nParent>1 && nChild>1 ){
101101
zPrefix = "*MERGE/FORK* ";
102102
}else if( nParent>1 ){
103103
zPrefix = "*MERGE* ";
104104
}else if( nChild>1 ){
@@ -117,6 +117,10 @@
117117
}
118118
119119
db_finalize(&q);
120120
@ </channel>
121121
@ </rss>
122
+
123
+ if( zFreeProjectName != 0 ){
124
+ free( zFreeProjectName );
125
+ }
122126
}
123127
--- src/rss.c
+++ src/rss.c
@@ -7,11 +7,11 @@
7 **
8 ** This program is distributed in the hope that it will be useful,
9 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 ** General Public License for more details.
12 **
13 ** You should have received a copy of the GNU General Public
14 ** License along with this library; if not, write to the
15 ** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 ** Boston, MA 02111-1307, USA.
17 **
@@ -28,18 +28,18 @@
28 #include <assert.h>
29 #include <time.h>
30
31 time_t rss_datetime_to_time_t(const char *dt){
32 struct tm the_tm;
33
34 the_tm.tm_year = atoi(dt)-1900;
35 the_tm.tm_mon = atoi(&dt[5])-1;
36 the_tm.tm_mday = atoi(&dt[8]);
37 the_tm.tm_hour = atoi(&dt[11]);
38 the_tm.tm_min = atoi(&dt[14]);
39 the_tm.tm_sec = atoi(&dt[17]);
40
41 return mktime(&the_tm);
42 }
43
44 /*
45 ** WEBPAGE: timeline.rss
@@ -46,11 +46,11 @@
46 */
47
48 void page_timeline_rss(void){
49 Stmt q;
50 int nLine=0;
51 char *zPubDate, *zRSSTitle, *zRSSDescr, *zFreeRSSTitle=0;
52 const char zSQL[] =
53 @ SELECT
54 @ blob.rid,
55 @ uuid,
56 @ datetime(event.mtime),
@@ -60,31 +60,31 @@
60 @ (SELECT count(*) FROM plink WHERE cid=blob.rid)
61 @ FROM event, blob
62 @ WHERE blob.rid=event.objid
63 @ ORDER BY event.mtime DESC
64 ;
65
66 cgi_set_content_type("application/rss+xml");
67
68 zRSSTitle = db_get("rss-title", 0);
69 if( zRSSTitle==0 ){
70 zFreeRSSTitle = zRSSTitle = mprintf("Fossil source repository for: %s",
71 g.zBaseURL);
72 }
73 zRSSDescr = db_get("rss-description", 0);
74 if( zRSSDescr==0 ){
75 zRSSDescr = zRSSTitle;
76 }
77
78 zPubDate = cgi_rfc822_datestamp(time(NULL));
79
80 @ <?xml version="1.0"?>
81 @ <rss version="2.0">
82 @ <channel>
83 @ <title>%s(zRSSTitle)</title>
84 @ <link>%s(g.zBaseURL)</link>
85 @ <description>%s(zRSSDescr)</description>
86 @ <pubDate>%s(zPubDate)</pubDate>
87 @ <generator>Fossil version %s(MANIFEST_VERSION) %s(MANIFEST_DATE)</generator>
88 db_prepare(&q, zSQL);
89 while( db_step(&q)==SQLITE_ROW && nLine<=20 ){
90 const char *zId = db_column_text(&q, 1);
@@ -92,13 +92,13 @@
92 const char *zCom = db_column_text(&q, 3);
93 const char *zAuthor = db_column_text(&q, 4);
94 char *zPrefix = "";
95 int nChild = db_column_int(&q, 5);
96 int nParent = db_column_int(&q, 6);
97
98 zDate = cgi_rfc822_datestamp(rss_datetime_to_time_t(zDate));
99
100 if( nParent>1 && nChild>1 ){
101 zPrefix = "*MERGE/FORK* ";
102 }else if( nParent>1 ){
103 zPrefix = "*MERGE* ";
104 }else if( nChild>1 ){
@@ -117,6 +117,10 @@
117 }
118
119 db_finalize(&q);
120 @ </channel>
121 @ </rss>
 
 
 
 
122 }
123
--- src/rss.c
+++ src/rss.c
@@ -7,11 +7,11 @@
7 **
8 ** This program is distributed in the hope that it will be useful,
9 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 ** General Public License for more details.
12 **
13 ** You should have received a copy of the GNU General Public
14 ** License along with this library; if not, write to the
15 ** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 ** Boston, MA 02111-1307, USA.
17 **
@@ -28,18 +28,18 @@
28 #include <assert.h>
29 #include <time.h>
30
31 time_t rss_datetime_to_time_t(const char *dt){
32 struct tm the_tm;
33
34 the_tm.tm_year = atoi(dt)-1900;
35 the_tm.tm_mon = atoi(&dt[5])-1;
36 the_tm.tm_mday = atoi(&dt[8]);
37 the_tm.tm_hour = atoi(&dt[11]);
38 the_tm.tm_min = atoi(&dt[14]);
39 the_tm.tm_sec = atoi(&dt[17]);
40
41 return mktime(&the_tm);
42 }
43
44 /*
45 ** WEBPAGE: timeline.rss
@@ -46,11 +46,11 @@
46 */
47
48 void page_timeline_rss(void){
49 Stmt q;
50 int nLine=0;
51 char *zPubDate, *zProjectName, *zProjectDescr, *zFreeProjectName=0;
52 const char zSQL[] =
53 @ SELECT
54 @ blob.rid,
55 @ uuid,
56 @ datetime(event.mtime),
@@ -60,31 +60,31 @@
60 @ (SELECT count(*) FROM plink WHERE cid=blob.rid)
61 @ FROM event, blob
62 @ WHERE blob.rid=event.objid
63 @ ORDER BY event.mtime DESC
64 ;
65
66 cgi_set_content_type("application/rss+xml");
67
68 zProjectName = db_get("project-name", 0);
69 if( zProjectName==0 ){
70 zFreeProjectName = zProjectName = mprintf("Fossil source repository for: %s",
71 g.zBaseURL);
72 }
73 zProjectDescr = db_get("project-description", 0);
74 if( zProjectDescr==0 ){
75 zProjectDescr = zProjectName;
76 }
77
78 zPubDate = cgi_rfc822_datestamp(time(NULL));
79
80 @ <?xml version="1.0"?>
81 @ <rss version="2.0">
82 @ <channel>
83 @ <title>%s(zProjectName)</title>
84 @ <link>%s(g.zBaseURL)</link>
85 @ <description>%s(zProjectDescr)</description>
86 @ <pubDate>%s(zPubDate)</pubDate>
87 @ <generator>Fossil version %s(MANIFEST_VERSION) %s(MANIFEST_DATE)</generator>
88 db_prepare(&q, zSQL);
89 while( db_step(&q)==SQLITE_ROW && nLine<=20 ){
90 const char *zId = db_column_text(&q, 1);
@@ -92,13 +92,13 @@
92 const char *zCom = db_column_text(&q, 3);
93 const char *zAuthor = db_column_text(&q, 4);
94 char *zPrefix = "";
95 int nChild = db_column_int(&q, 5);
96 int nParent = db_column_int(&q, 6);
97
98 zDate = cgi_rfc822_datestamp(rss_datetime_to_time_t(zDate));
99
100 if( nParent>1 && nChild>1 ){
101 zPrefix = "*MERGE/FORK* ";
102 }else if( nParent>1 ){
103 zPrefix = "*MERGE* ";
104 }else if( nChild>1 ){
@@ -117,6 +117,10 @@
117 }
118
119 db_finalize(&q);
120 @ </channel>
121 @ </rss>
122
123 if( zFreeProjectName != 0 ){
124 free( zFreeProjectName );
125 }
126 }
127
+19 -35
--- src/setup.c
+++ src/setup.c
@@ -8,11 +8,11 @@
88
**
99
** This program is distributed in the hope that it will be useful,
1010
** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1212
** General Public License for more details.
13
-**
13
+**
1414
** You should have received a copy of the GNU General Public
1515
** License along with this library; if not, write to the
1616
** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
1717
** Boston, MA 02111-1307, USA.
1818
**
@@ -80,11 +80,11 @@
8080
** Show a list of users. Clicking on any user jumps to the edit
8181
** screen for that user.
8282
*/
8383
void setup_ulist(void){
8484
Stmt s;
85
-
85
+
8686
login_check_credentials();
8787
if( !g.okSetup ){
8888
login_needed();
8989
return;
9090
}
@@ -237,11 +237,11 @@
237237
zPw = P("pw");
238238
if( zPw==0 || zPw[0]==0 ){
239239
zPw = db_text(0, "SELECT pw FROM user WHERE uid=%d", uid);
240240
}
241241
zLogin = P("login");
242
- if( uid>0 &&
242
+ if( uid>0 &&
243243
db_exists("SELECT 1 FROM user WHERE login=%Q AND uid!=%d", zLogin, uid)
244244
){
245245
style_header("User Creation Error");
246246
@ <font color="red">Login "%h(zLogin)" is already used by a different
247247
@ user.</font>
@@ -367,11 +367,11 @@
367367
@ users. This capability is intended for deletion of spam.
368368
@ </p></li>
369369
@
370370
@ <li><p>
371371
@ The <b>Query</b> privilege allows the user to create or edit
372
- @ report formats by specifying appropriate SQL. Users can run
372
+ @ report formats by specifying appropriate SQL. Users can run
373373
@ existing reports without the Query privilege.
374374
@ </p></li>
375375
@
376376
@ <li><p>
377377
@ An <b>Admin</b> user can add other users, create new ticket report
@@ -512,15 +512,15 @@
512512
@ <hr>
513513
entry_attribute("Login expiration time", 6, "cookie-expire", "cex", "8766");
514514
@ <p>The number of hours for which a login is valid. This must be a
515515
@ positive number. The default is 8760 hours which is approximately equal
516516
@ to a year.</p>
517
-
517
+
518518
@ <hr>
519519
onoff_attribute("Allow anonymous signup", "anon-signup", "asu", 0);
520520
@ <p>Allow users to create their own accounts</p>
521
-
521
+
522522
@ <hr>
523523
@ <p><input type="submit" name="submit" value="Apply Changes"></p>
524524
@ </form>
525525
db_end_transaction(0);
526526
style_footer();
@@ -537,39 +537,23 @@
537537
538538
style_header("WWW Configuration");
539539
db_begin_transaction();
540540
@ <form action="%s(g.zBaseURL)/setup_config" method="POST">
541541
542
- @ <hr>
543
- entry_attribute("Home page", 60, "homepage", "hp", "");
544
- @ <p>The name of a wiki file that is the homepage for the website.
545
- @ The home page is the page that is displayed by the "Home" link
546
- @ at the top of this screen. Omit the path and the ".wiki"
547
- @ suffix. </p>
548
-
549
- entry_attribute("Ticket subdirectory", 60, "ticket-subdir", "tsd", "");
550
- @ <p>A subdirectory in the file hierarchy that contains all trouble
551
- @ tickets. Leave this blank to disable ticketing. Tickets text
552
- @ files within this subdirectory containing a particular format
553
- @ (documented separately) and with the ".tkt" suffix.</p>
554
-
555
- entry_attribute("Wiki subdirectory", 60, "wiki-subdir", "wsd", "");
556
- @ <p>A subdirectory in the file hierarchy that contains wiki pages.
557
- @ Leave this blank to disable wiki. Wiki pages are
558
- @ files within this subdirectory whose name is he wiki page title
559
- @ and with the suffix ".wiki".</p>
560
-
561
- entry_attribute("RSS Feed Title", 60, "rss-title", "rst", "");
562
- @ <p>The title of the RSS feed that publishes the changes to the
563
- @ repository. If left blank, the system will generate a generic
564
- @ title that, unfortunantly, not very helpful.</p>
565
-
566
- textarea_attribute("RSS Feed Description", 5, 60, "rss-description", "rsd", "");
567
- @ <p>The description of the RSS feed that publishes the changes to
568
- @ the repository. If left blank, the system will use the RSS Feed Title.
569
-
570
- @ <hr>
542
+ @ <hr />
543
+
544
+ entry_attribute("Project Name", 60, "project-name", "pn", "");
545
+ @ <p>Give your project a name so visitors know what this site is about.
546
+ @ The project name will also be used as the RSS feed title.</p>
547
+
548
+ @ <hr />
549
+
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
+
554
+ @ <hr />
571555
@ <p><input type="submit" name="submit" value="Apply Changes"></p>
572556
@ </form>
573557
db_end_transaction(0);
574558
style_footer();
575559
}
576560
--- src/setup.c
+++ src/setup.c
@@ -8,11 +8,11 @@
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ** General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public
15 ** License along with this library; if not, write to the
16 ** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 ** Boston, MA 02111-1307, USA.
18 **
@@ -80,11 +80,11 @@
80 ** Show a list of users. Clicking on any user jumps to the edit
81 ** screen for that user.
82 */
83 void setup_ulist(void){
84 Stmt s;
85
86 login_check_credentials();
87 if( !g.okSetup ){
88 login_needed();
89 return;
90 }
@@ -237,11 +237,11 @@
237 zPw = P("pw");
238 if( zPw==0 || zPw[0]==0 ){
239 zPw = db_text(0, "SELECT pw FROM user WHERE uid=%d", uid);
240 }
241 zLogin = P("login");
242 if( uid>0 &&
243 db_exists("SELECT 1 FROM user WHERE login=%Q AND uid!=%d", zLogin, uid)
244 ){
245 style_header("User Creation Error");
246 @ <font color="red">Login "%h(zLogin)" is already used by a different
247 @ user.</font>
@@ -367,11 +367,11 @@
367 @ users. This capability is intended for deletion of spam.
368 @ </p></li>
369 @
370 @ <li><p>
371 @ The <b>Query</b> privilege allows the user to create or edit
372 @ report formats by specifying appropriate SQL. Users can run
373 @ existing reports without the Query privilege.
374 @ </p></li>
375 @
376 @ <li><p>
377 @ An <b>Admin</b> user can add other users, create new ticket report
@@ -512,15 +512,15 @@
512 @ <hr>
513 entry_attribute("Login expiration time", 6, "cookie-expire", "cex", "8766");
514 @ <p>The number of hours for which a login is valid. This must be a
515 @ positive number. The default is 8760 hours which is approximately equal
516 @ to a year.</p>
517
518 @ <hr>
519 onoff_attribute("Allow anonymous signup", "anon-signup", "asu", 0);
520 @ <p>Allow users to create their own accounts</p>
521
522 @ <hr>
523 @ <p><input type="submit" name="submit" value="Apply Changes"></p>
524 @ </form>
525 db_end_transaction(0);
526 style_footer();
@@ -537,39 +537,23 @@
537
538 style_header("WWW Configuration");
539 db_begin_transaction();
540 @ <form action="%s(g.zBaseURL)/setup_config" method="POST">
541
542 @ <hr>
543 entry_attribute("Home page", 60, "homepage", "hp", "");
544 @ <p>The name of a wiki file that is the homepage for the website.
545 @ The home page is the page that is displayed by the "Home" link
546 @ at the top of this screen. Omit the path and the ".wiki"
547 @ suffix. </p>
548
549 entry_attribute("Ticket subdirectory", 60, "ticket-subdir", "tsd", "");
550 @ <p>A subdirectory in the file hierarchy that contains all trouble
551 @ tickets. Leave this blank to disable ticketing. Tickets text
552 @ files within this subdirectory containing a particular format
553 @ (documented separately) and with the ".tkt" suffix.</p>
554
555 entry_attribute("Wiki subdirectory", 60, "wiki-subdir", "wsd", "");
556 @ <p>A subdirectory in the file hierarchy that contains wiki pages.
557 @ Leave this blank to disable wiki. Wiki pages are
558 @ files within this subdirectory whose name is he wiki page title
559 @ and with the suffix ".wiki".</p>
560
561 entry_attribute("RSS Feed Title", 60, "rss-title", "rst", "");
562 @ <p>The title of the RSS feed that publishes the changes to the
563 @ repository. If left blank, the system will generate a generic
564 @ title that, unfortunantly, not very helpful.</p>
565
566 textarea_attribute("RSS Feed Description", 5, 60, "rss-description", "rsd", "");
567 @ <p>The description of the RSS feed that publishes the changes to
568 @ the repository. If left blank, the system will use the RSS Feed Title.
569
570 @ <hr>
571 @ <p><input type="submit" name="submit" value="Apply Changes"></p>
572 @ </form>
573 db_end_transaction(0);
574 style_footer();
575 }
576
--- src/setup.c
+++ src/setup.c
@@ -8,11 +8,11 @@
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ** General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public
15 ** License along with this library; if not, write to the
16 ** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 ** Boston, MA 02111-1307, USA.
18 **
@@ -80,11 +80,11 @@
80 ** Show a list of users. Clicking on any user jumps to the edit
81 ** screen for that user.
82 */
83 void setup_ulist(void){
84 Stmt s;
85
86 login_check_credentials();
87 if( !g.okSetup ){
88 login_needed();
89 return;
90 }
@@ -237,11 +237,11 @@
237 zPw = P("pw");
238 if( zPw==0 || zPw[0]==0 ){
239 zPw = db_text(0, "SELECT pw FROM user WHERE uid=%d", uid);
240 }
241 zLogin = P("login");
242 if( uid>0 &&
243 db_exists("SELECT 1 FROM user WHERE login=%Q AND uid!=%d", zLogin, uid)
244 ){
245 style_header("User Creation Error");
246 @ <font color="red">Login "%h(zLogin)" is already used by a different
247 @ user.</font>
@@ -367,11 +367,11 @@
367 @ users. This capability is intended for deletion of spam.
368 @ </p></li>
369 @
370 @ <li><p>
371 @ The <b>Query</b> privilege allows the user to create or edit
372 @ report formats by specifying appropriate SQL. Users can run
373 @ existing reports without the Query privilege.
374 @ </p></li>
375 @
376 @ <li><p>
377 @ An <b>Admin</b> user can add other users, create new ticket report
@@ -512,15 +512,15 @@
512 @ <hr>
513 entry_attribute("Login expiration time", 6, "cookie-expire", "cex", "8766");
514 @ <p>The number of hours for which a login is valid. This must be a
515 @ positive number. The default is 8760 hours which is approximately equal
516 @ to a year.</p>
517
518 @ <hr>
519 onoff_attribute("Allow anonymous signup", "anon-signup", "asu", 0);
520 @ <p>Allow users to create their own accounts</p>
521
522 @ <hr>
523 @ <p><input type="submit" name="submit" value="Apply Changes"></p>
524 @ </form>
525 db_end_transaction(0);
526 style_footer();
@@ -537,39 +537,23 @@
537
538 style_header("WWW Configuration");
539 db_begin_transaction();
540 @ <form action="%s(g.zBaseURL)/setup_config" method="POST">
541
542 @ <hr />
543
544 entry_attribute("Project Name", 60, "project-name", "pn", "");
545 @ <p>Give your project a name so visitors know what this site is about.
546 @ The project name will also be used as the RSS feed title.</p>
547
548 @ <hr />
549
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
554 @ <hr />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
555 @ <p><input type="submit" name="submit" value="Apply Changes"></p>
556 @ </form>
557 db_end_transaction(0);
558 style_footer();
559 }
560
+13 -12
--- src/style.c
+++ src/style.c
@@ -7,11 +7,11 @@
77
**
88
** This program is distributed in the hope that it will be useful,
99
** but WITHOUT ANY WARRANTY; without even the implied warranty of
1010
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1111
** General Public License for more details.
12
-**
12
+**
1313
** You should have received a copy of the GNU General Public
1414
** License along with this library; if not, write to the
1515
** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
1616
** Boston, MA 02111-1307, USA.
1717
**
@@ -69,16 +69,20 @@
6969
/*
7070
** Draw the header.
7171
*/
7272
void style_header(const char *zTitle){
7373
const char *zLogInOut = "Logout";
74
+ char *zProjectDescr = db_get("project-description", 0);
7475
login_check_credentials();
7576
@ <html>
7677
@ <head>
7778
@ <title>%s(zTitle)</title>
7879
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="%s(g.zBaseURL)/timeline.rss">
7980
@ <link rel="stylesheet" href="%s(g.zBaseURL)/style.css" type="text/css" media="screen">
81
+ if( zProjectDescr != 0 ){
82
+ @ <meta name="description" content="%s(zProjectDescr)">
83
+ }
8084
@ </head>
8185
@ <body>
8286
@ <div id="page-title">%s(zTitle)</div>
8387
@ <div id="login-status">
8488
if( g.zLogin==0 ){
@@ -92,13 +96,10 @@
9296
@ <a href="%s(g.zBaseURL)/index">Home</a>
9397
if( g.okRead ){
9498
@ | <a href="%s(g.zBaseURL)/leaves">Leaves</a>
9599
@ | <a href="%s(g.zBaseURL)/timeline">Timeline</a>
96100
}
97
- if( g.okRdWiki ){
98
- @ | <a href="%s(g.zBaseURL)/wiki">Wiki</a>
99
- }
100101
#if 0
101102
@ | <font color="#888888">Search</font>
102103
@ | <font color="#888888">Ticket</font>
103104
@ | <font color="#888888">Reports</font>
104105
#endif
@@ -145,11 +146,11 @@
145146
** WEBPAGE: index
146147
** WEBPAGE: home
147148
** WEBPAGE: not_found
148149
*/
149150
void page_index(void){
150
- char *zHome = (char*)db_get("homepage", 0);
151
+ char *zHome = "Home";
151152
if( zHome ){
152153
g.zExtra = zHome;
153154
g.okRdWiki = 1;
154155
wiki_page();
155156
}else{
@@ -165,16 +166,16 @@
165166
/*
166167
** Create a fake replicate of the "vfile" table as a TEMP table
167168
** using the manifest identified by manid.
168169
*/
169170
static void style_create_fake_vfile(int manid){
170
- static const char zVfileDef[] =
171
+ static const char zVfileDef[] =
171172
@ CREATE TEMP TABLE vfile(
172173
@ id INTEGER PRIMARY KEY, -- ID of the checked out file
173174
@ vid INTEGER REFERENCES blob, -- The version this file is part of.
174175
@ chnged INT DEFAULT 0, -- 0:unchnged 1:edited 2:m-chng 3:m-add
175
- @ deleted BOOLEAN DEFAULT 0, -- True if deleted
176
+ @ deleted BOOLEAN DEFAULT 0, -- True if deleted
176177
@ rid INTEGER, -- Originally from this repository record
177178
@ mrid INTEGER, -- Based on this record due to a merge
178179
@ pathname TEXT, -- Full pathname
179180
@ UNIQUE(pathname,vid)
180181
@ );
@@ -192,21 +193,21 @@
192193
int id = 0;
193194
int rid = 0;
194195
int chnged = 0;
195196
char *zPathname = 0;
196197
char *z;
197
-
198
+
198199
cgi_set_content_type("text/css");
199200
200201
login_check_credentials();
201202
if( !g.localOpen ){
202203
int headid = db_int(0,
203204
"SELECT cid FROM plink ORDER BY mtime DESC LIMIT 1"
204205
);
205206
style_create_fake_vfile(headid);
206207
}
207
-
208
+
208209
db_prepare(&q,
209210
"SELECT id, rid, chnged, pathname FROM vfile"
210211
" WHERE (pathname='style.css' OR pathname LIKE '%%/style.css')"
211212
" AND NOT deleted"
212213
);
@@ -234,11 +235,11 @@
234235
@ %s(z)
235236
}else{
236237
/* No CSS file found, use our own */
237238
/*
238239
** Selector order: tags, ids, classes, other
239
- ** Content order: margin, borders, padding, fonts, colors, other
240
+ ** Content order: margin, borders, padding, fonts, colors, other
240241
** Note: Once things are finialize a bit we can collapse this and
241242
** make it much smaller, if necessary. Right now, it's verbose
242243
** but easy to edit.
243244
*/
244245
@ body {
@@ -288,12 +289,12 @@
288289
@ background-color: white;
289290
@ }
290291
@ #page {
291292
@ padding: 10px 20px 10px 20px;
292293
@ }
293
- @ #style-footer {
294
- @ font-size: 0.8em;
294
+ @ #style-footer {
295
+ @ font-size: 0.8em;
295296
@ margin-top: 12px;
296297
@ padding: 5px 10px 5px 10px;
297298
@ text-align: right;
298299
@ background-color: #414f84;
299300
@ color: white;
300301
--- src/style.c
+++ src/style.c
@@ -7,11 +7,11 @@
7 **
8 ** This program is distributed in the hope that it will be useful,
9 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 ** General Public License for more details.
12 **
13 ** You should have received a copy of the GNU General Public
14 ** License along with this library; if not, write to the
15 ** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 ** Boston, MA 02111-1307, USA.
17 **
@@ -69,16 +69,20 @@
69 /*
70 ** Draw the header.
71 */
72 void style_header(const char *zTitle){
73 const char *zLogInOut = "Logout";
 
74 login_check_credentials();
75 @ <html>
76 @ <head>
77 @ <title>%s(zTitle)</title>
78 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="%s(g.zBaseURL)/timeline.rss">
79 @ <link rel="stylesheet" href="%s(g.zBaseURL)/style.css" type="text/css" media="screen">
 
 
 
80 @ </head>
81 @ <body>
82 @ <div id="page-title">%s(zTitle)</div>
83 @ <div id="login-status">
84 if( g.zLogin==0 ){
@@ -92,13 +96,10 @@
92 @ <a href="%s(g.zBaseURL)/index">Home</a>
93 if( g.okRead ){
94 @ | <a href="%s(g.zBaseURL)/leaves">Leaves</a>
95 @ | <a href="%s(g.zBaseURL)/timeline">Timeline</a>
96 }
97 if( g.okRdWiki ){
98 @ | <a href="%s(g.zBaseURL)/wiki">Wiki</a>
99 }
100 #if 0
101 @ | <font color="#888888">Search</font>
102 @ | <font color="#888888">Ticket</font>
103 @ | <font color="#888888">Reports</font>
104 #endif
@@ -145,11 +146,11 @@
145 ** WEBPAGE: index
146 ** WEBPAGE: home
147 ** WEBPAGE: not_found
148 */
149 void page_index(void){
150 char *zHome = (char*)db_get("homepage", 0);
151 if( zHome ){
152 g.zExtra = zHome;
153 g.okRdWiki = 1;
154 wiki_page();
155 }else{
@@ -165,16 +166,16 @@
165 /*
166 ** Create a fake replicate of the "vfile" table as a TEMP table
167 ** using the manifest identified by manid.
168 */
169 static void style_create_fake_vfile(int manid){
170 static const char zVfileDef[] =
171 @ CREATE TEMP TABLE vfile(
172 @ id INTEGER PRIMARY KEY, -- ID of the checked out file
173 @ vid INTEGER REFERENCES blob, -- The version this file is part of.
174 @ chnged INT DEFAULT 0, -- 0:unchnged 1:edited 2:m-chng 3:m-add
175 @ deleted BOOLEAN DEFAULT 0, -- True if deleted
176 @ rid INTEGER, -- Originally from this repository record
177 @ mrid INTEGER, -- Based on this record due to a merge
178 @ pathname TEXT, -- Full pathname
179 @ UNIQUE(pathname,vid)
180 @ );
@@ -192,21 +193,21 @@
192 int id = 0;
193 int rid = 0;
194 int chnged = 0;
195 char *zPathname = 0;
196 char *z;
197
198 cgi_set_content_type("text/css");
199
200 login_check_credentials();
201 if( !g.localOpen ){
202 int headid = db_int(0,
203 "SELECT cid FROM plink ORDER BY mtime DESC LIMIT 1"
204 );
205 style_create_fake_vfile(headid);
206 }
207
208 db_prepare(&q,
209 "SELECT id, rid, chnged, pathname FROM vfile"
210 " WHERE (pathname='style.css' OR pathname LIKE '%%/style.css')"
211 " AND NOT deleted"
212 );
@@ -234,11 +235,11 @@
234 @ %s(z)
235 }else{
236 /* No CSS file found, use our own */
237 /*
238 ** Selector order: tags, ids, classes, other
239 ** Content order: margin, borders, padding, fonts, colors, other
240 ** Note: Once things are finialize a bit we can collapse this and
241 ** make it much smaller, if necessary. Right now, it's verbose
242 ** but easy to edit.
243 */
244 @ body {
@@ -288,12 +289,12 @@
288 @ background-color: white;
289 @ }
290 @ #page {
291 @ padding: 10px 20px 10px 20px;
292 @ }
293 @ #style-footer {
294 @ font-size: 0.8em;
295 @ margin-top: 12px;
296 @ padding: 5px 10px 5px 10px;
297 @ text-align: right;
298 @ background-color: #414f84;
299 @ color: white;
300
--- src/style.c
+++ src/style.c
@@ -7,11 +7,11 @@
7 **
8 ** This program is distributed in the hope that it will be useful,
9 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 ** General Public License for more details.
12 **
13 ** You should have received a copy of the GNU General Public
14 ** License along with this library; if not, write to the
15 ** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 ** Boston, MA 02111-1307, USA.
17 **
@@ -69,16 +69,20 @@
69 /*
70 ** Draw the header.
71 */
72 void style_header(const char *zTitle){
73 const char *zLogInOut = "Logout";
74 char *zProjectDescr = db_get("project-description", 0);
75 login_check_credentials();
76 @ <html>
77 @ <head>
78 @ <title>%s(zTitle)</title>
79 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="%s(g.zBaseURL)/timeline.rss">
80 @ <link rel="stylesheet" href="%s(g.zBaseURL)/style.css" type="text/css" media="screen">
81 if( zProjectDescr != 0 ){
82 @ <meta name="description" content="%s(zProjectDescr)">
83 }
84 @ </head>
85 @ <body>
86 @ <div id="page-title">%s(zTitle)</div>
87 @ <div id="login-status">
88 if( g.zLogin==0 ){
@@ -92,13 +96,10 @@
96 @ <a href="%s(g.zBaseURL)/index">Home</a>
97 if( g.okRead ){
98 @ | <a href="%s(g.zBaseURL)/leaves">Leaves</a>
99 @ | <a href="%s(g.zBaseURL)/timeline">Timeline</a>
100 }
 
 
 
101 #if 0
102 @ | <font color="#888888">Search</font>
103 @ | <font color="#888888">Ticket</font>
104 @ | <font color="#888888">Reports</font>
105 #endif
@@ -145,11 +146,11 @@
146 ** WEBPAGE: index
147 ** WEBPAGE: home
148 ** WEBPAGE: not_found
149 */
150 void page_index(void){
151 char *zHome = "Home";
152 if( zHome ){
153 g.zExtra = zHome;
154 g.okRdWiki = 1;
155 wiki_page();
156 }else{
@@ -165,16 +166,16 @@
166 /*
167 ** Create a fake replicate of the "vfile" table as a TEMP table
168 ** using the manifest identified by manid.
169 */
170 static void style_create_fake_vfile(int manid){
171 static const char zVfileDef[] =
172 @ CREATE TEMP TABLE vfile(
173 @ id INTEGER PRIMARY KEY, -- ID of the checked out file
174 @ vid INTEGER REFERENCES blob, -- The version this file is part of.
175 @ chnged INT DEFAULT 0, -- 0:unchnged 1:edited 2:m-chng 3:m-add
176 @ deleted BOOLEAN DEFAULT 0, -- True if deleted
177 @ rid INTEGER, -- Originally from this repository record
178 @ mrid INTEGER, -- Based on this record due to a merge
179 @ pathname TEXT, -- Full pathname
180 @ UNIQUE(pathname,vid)
181 @ );
@@ -192,21 +193,21 @@
193 int id = 0;
194 int rid = 0;
195 int chnged = 0;
196 char *zPathname = 0;
197 char *z;
198
199 cgi_set_content_type("text/css");
200
201 login_check_credentials();
202 if( !g.localOpen ){
203 int headid = db_int(0,
204 "SELECT cid FROM plink ORDER BY mtime DESC LIMIT 1"
205 );
206 style_create_fake_vfile(headid);
207 }
208
209 db_prepare(&q,
210 "SELECT id, rid, chnged, pathname FROM vfile"
211 " WHERE (pathname='style.css' OR pathname LIKE '%%/style.css')"
212 " AND NOT deleted"
213 );
@@ -234,11 +235,11 @@
235 @ %s(z)
236 }else{
237 /* No CSS file found, use our own */
238 /*
239 ** Selector order: tags, ids, classes, other
240 ** Content order: margin, borders, padding, fonts, colors, other
241 ** Note: Once things are finialize a bit we can collapse this and
242 ** make it much smaller, if necessary. Right now, it's verbose
243 ** but easy to edit.
244 */
245 @ body {
@@ -288,12 +289,12 @@
289 @ background-color: white;
290 @ }
291 @ #page {
292 @ padding: 10px 20px 10px 20px;
293 @ }
294 @ #style-footer {
295 @ font-size: 0.8em;
296 @ margin-top: 12px;
297 @ padding: 5px 10px 5px 10px;
298 @ text-align: right;
299 @ background-color: #414f84;
300 @ color: white;
301
+2 -2
--- src/user.c
+++ src/user.c
@@ -7,11 +7,11 @@
77
**
88
** This program is distributed in the hope that it will be useful,
99
** but WITHOUT ANY WARRANTY; without even the implied warranty of
1010
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1111
** General Public License for more details.
12
-**
12
+**
1313
** You should have received a copy of the GNU General Public
1414
** License along with this library; if not, write to the
1515
** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
1616
** Boston, MA 02111-1307, USA.
1717
**
@@ -52,11 +52,11 @@
5252
** getpass for Windows
5353
*/
5454
static char *getpass(const char *prompt){
5555
static char pwd[64];
5656
size_t i;
57
-
57
+
5858
fputs(prompt,stderr);
5959
fflush(stderr);
6060
for(i=0; i<sizeof(pwd)-1; ++i){
6161
pwd[i] = _getch();
6262
if(pwd[i]=='\r' || pwd[i]=='\n'){
6363
--- src/user.c
+++ src/user.c
@@ -7,11 +7,11 @@
7 **
8 ** This program is distributed in the hope that it will be useful,
9 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 ** General Public License for more details.
12 **
13 ** You should have received a copy of the GNU General Public
14 ** License along with this library; if not, write to the
15 ** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 ** Boston, MA 02111-1307, USA.
17 **
@@ -52,11 +52,11 @@
52 ** getpass for Windows
53 */
54 static char *getpass(const char *prompt){
55 static char pwd[64];
56 size_t i;
57
58 fputs(prompt,stderr);
59 fflush(stderr);
60 for(i=0; i<sizeof(pwd)-1; ++i){
61 pwd[i] = _getch();
62 if(pwd[i]=='\r' || pwd[i]=='\n'){
63
--- src/user.c
+++ src/user.c
@@ -7,11 +7,11 @@
7 **
8 ** This program is distributed in the hope that it will be useful,
9 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 ** General Public License for more details.
12 **
13 ** You should have received a copy of the GNU General Public
14 ** License along with this library; if not, write to the
15 ** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 ** Boston, MA 02111-1307, USA.
17 **
@@ -52,11 +52,11 @@
52 ** getpass for Windows
53 */
54 static char *getpass(const char *prompt){
55 static char pwd[64];
56 size_t i;
57
58 fputs(prompt,stderr);
59 fflush(stderr);
60 for(i=0; i<sizeof(pwd)-1; ++i){
61 pwd[i] = _getch();
62 if(pwd[i]=='\r' || pwd[i]=='\n'){
63

Keyboard Shortcuts

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