Fossil SCM

show the project description on the repository list

jkosche 2025-04-04 19:58 trunk merge
Commit 2771beab20d5411559885c4b2b8a49ffd8335d3171083269a85ccfff3468aa08
+19 -1
--- src/repolist.c
+++ src/repolist.c
@@ -31,10 +31,11 @@
3131
int isValid; /* True if zRepoName is a valid Fossil repository */
3232
int isRepolistSkin; /* 1 or 2 if this repository wants to be the skin
3333
** for the repository list. 2 means do use this
3434
** repository but do not display it in the list. */
3535
char *zProjName; /* Project Name. Memory from fossil_malloc() */
36
+ char *zProjDesc; /* Project Description. Memory from fossil_malloc() */
3637
char *zLoginGroup; /* Name of login group, or NULL. Malloced() */
3738
double rMTime; /* Last update. Julian day number */
3839
};
3940
#endif
4041
@@ -49,10 +50,11 @@
4950
int rc;
5051
5152
pRepo->isRepolistSkin = 0;
5253
pRepo->isValid = 0;
5354
pRepo->zProjName = 0;
55
+ pRepo->zProjDesc = 0;
5456
pRepo->zLoginGroup = 0;
5557
pRepo->rMTime = 0.0;
5658
5759
g.dbIgnoreErrors++;
5860
rc = sqlite3_open_v2(pRepo->zRepoName, &db, SQLITE_OPEN_READWRITE, 0);
@@ -71,10 +73,19 @@
7173
-1, &pStmt, 0);
7274
if( rc ) goto finish_repo_list;
7375
if( sqlite3_step(pStmt)==SQLITE_ROW ){
7476
pRepo->zProjName = fossil_strdup((char*)sqlite3_column_text(pStmt,0));
7577
}
78
+ sqlite3_finalize(pStmt);
79
+ if( rc ) goto finish_repo_list;
80
+ rc = sqlite3_prepare_v2(db, "SELECT value FROM config"
81
+ " WHERE name='project-description'",
82
+ -1, &pStmt, 0);
83
+ if( rc ) goto finish_repo_list;
84
+ if( sqlite3_step(pStmt)==SQLITE_ROW ){
85
+ pRepo->zProjDesc = fossil_strdup((char*)sqlite3_column_text(pStmt,0));
86
+ }
7687
sqlite3_finalize(pStmt);
7788
rc = sqlite3_prepare_v2(db, "SELECT value FROM config"
7889
" WHERE name='login-group-name'",
7990
-1, &pStmt, 0);
8091
if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
@@ -162,13 +173,14 @@
162173
}else{
163174
Stmt q;
164175
double rNow;
165176
blob_append_sql(&html,
166177
"<table border='0' class='sortable' data-init-sort='1'"
167
- " data-column-types='txtxkxt'><thead>\n"
178
+ " data-column-types='txtxtxkxt'><thead>\n"
168179
"<tr><th>Filename<th width='20'>"
169180
"<th>Project Name<th width='20'>"
181
+ "<th>Project Description<th width='20'>"
170182
"<th>Last Modified<th width='20'>"
171183
"<th>Login Group</tr>\n"
172184
"</thead><tbody>\n");
173185
db_prepare(&q, "SELECT pathname"
174186
" FROM sfile ORDER BY pathname COLLATE nocase;");
@@ -278,10 +290,16 @@
278290
zUrl, zName);
279291
}
280292
if( x.zProjName ){
281293
blob_append_sql(&html, "<td></td><td>%h</td>\n", x.zProjName);
282294
fossil_free(x.zProjName);
295
+ }else{
296
+ blob_append_sql(&html, "<td></td><td></td>\n");
297
+ }
298
+ if( x.zProjDesc ){
299
+ blob_append_sql(&html, "<td></td><td>%h</td>\n", x.zProjDesc);
300
+ fossil_free(x.zProjDesc);
283301
}else{
284302
blob_append_sql(&html, "<td></td><td></td>\n");
285303
}
286304
blob_append_sql(&html,
287305
"<td></td><td data-sortkey='%08x'>%h</td>\n",
288306
--- src/repolist.c
+++ src/repolist.c
@@ -31,10 +31,11 @@
31 int isValid; /* True if zRepoName is a valid Fossil repository */
32 int isRepolistSkin; /* 1 or 2 if this repository wants to be the skin
33 ** for the repository list. 2 means do use this
34 ** repository but do not display it in the list. */
35 char *zProjName; /* Project Name. Memory from fossil_malloc() */
 
36 char *zLoginGroup; /* Name of login group, or NULL. Malloced() */
37 double rMTime; /* Last update. Julian day number */
38 };
39 #endif
40
@@ -49,10 +50,11 @@
49 int rc;
50
51 pRepo->isRepolistSkin = 0;
52 pRepo->isValid = 0;
53 pRepo->zProjName = 0;
 
54 pRepo->zLoginGroup = 0;
55 pRepo->rMTime = 0.0;
56
57 g.dbIgnoreErrors++;
58 rc = sqlite3_open_v2(pRepo->zRepoName, &db, SQLITE_OPEN_READWRITE, 0);
@@ -71,10 +73,19 @@
71 -1, &pStmt, 0);
72 if( rc ) goto finish_repo_list;
73 if( sqlite3_step(pStmt)==SQLITE_ROW ){
74 pRepo->zProjName = fossil_strdup((char*)sqlite3_column_text(pStmt,0));
75 }
 
 
 
 
 
 
 
 
 
76 sqlite3_finalize(pStmt);
77 rc = sqlite3_prepare_v2(db, "SELECT value FROM config"
78 " WHERE name='login-group-name'",
79 -1, &pStmt, 0);
80 if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
@@ -162,13 +173,14 @@
162 }else{
163 Stmt q;
164 double rNow;
165 blob_append_sql(&html,
166 "<table border='0' class='sortable' data-init-sort='1'"
167 " data-column-types='txtxkxt'><thead>\n"
168 "<tr><th>Filename<th width='20'>"
169 "<th>Project Name<th width='20'>"
 
170 "<th>Last Modified<th width='20'>"
171 "<th>Login Group</tr>\n"
172 "</thead><tbody>\n");
173 db_prepare(&q, "SELECT pathname"
174 " FROM sfile ORDER BY pathname COLLATE nocase;");
@@ -278,10 +290,16 @@
278 zUrl, zName);
279 }
280 if( x.zProjName ){
281 blob_append_sql(&html, "<td></td><td>%h</td>\n", x.zProjName);
282 fossil_free(x.zProjName);
 
 
 
 
 
 
283 }else{
284 blob_append_sql(&html, "<td></td><td></td>\n");
285 }
286 blob_append_sql(&html,
287 "<td></td><td data-sortkey='%08x'>%h</td>\n",
288
--- src/repolist.c
+++ src/repolist.c
@@ -31,10 +31,11 @@
31 int isValid; /* True if zRepoName is a valid Fossil repository */
32 int isRepolistSkin; /* 1 or 2 if this repository wants to be the skin
33 ** for the repository list. 2 means do use this
34 ** repository but do not display it in the list. */
35 char *zProjName; /* Project Name. Memory from fossil_malloc() */
36 char *zProjDesc; /* Project Description. Memory from fossil_malloc() */
37 char *zLoginGroup; /* Name of login group, or NULL. Malloced() */
38 double rMTime; /* Last update. Julian day number */
39 };
40 #endif
41
@@ -49,10 +50,11 @@
50 int rc;
51
52 pRepo->isRepolistSkin = 0;
53 pRepo->isValid = 0;
54 pRepo->zProjName = 0;
55 pRepo->zProjDesc = 0;
56 pRepo->zLoginGroup = 0;
57 pRepo->rMTime = 0.0;
58
59 g.dbIgnoreErrors++;
60 rc = sqlite3_open_v2(pRepo->zRepoName, &db, SQLITE_OPEN_READWRITE, 0);
@@ -71,10 +73,19 @@
73 -1, &pStmt, 0);
74 if( rc ) goto finish_repo_list;
75 if( sqlite3_step(pStmt)==SQLITE_ROW ){
76 pRepo->zProjName = fossil_strdup((char*)sqlite3_column_text(pStmt,0));
77 }
78 sqlite3_finalize(pStmt);
79 if( rc ) goto finish_repo_list;
80 rc = sqlite3_prepare_v2(db, "SELECT value FROM config"
81 " WHERE name='project-description'",
82 -1, &pStmt, 0);
83 if( rc ) goto finish_repo_list;
84 if( sqlite3_step(pStmt)==SQLITE_ROW ){
85 pRepo->zProjDesc = fossil_strdup((char*)sqlite3_column_text(pStmt,0));
86 }
87 sqlite3_finalize(pStmt);
88 rc = sqlite3_prepare_v2(db, "SELECT value FROM config"
89 " WHERE name='login-group-name'",
90 -1, &pStmt, 0);
91 if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
@@ -162,13 +173,14 @@
173 }else{
174 Stmt q;
175 double rNow;
176 blob_append_sql(&html,
177 "<table border='0' class='sortable' data-init-sort='1'"
178 " data-column-types='txtxtxkxt'><thead>\n"
179 "<tr><th>Filename<th width='20'>"
180 "<th>Project Name<th width='20'>"
181 "<th>Project Description<th width='20'>"
182 "<th>Last Modified<th width='20'>"
183 "<th>Login Group</tr>\n"
184 "</thead><tbody>\n");
185 db_prepare(&q, "SELECT pathname"
186 " FROM sfile ORDER BY pathname COLLATE nocase;");
@@ -278,10 +290,16 @@
290 zUrl, zName);
291 }
292 if( x.zProjName ){
293 blob_append_sql(&html, "<td></td><td>%h</td>\n", x.zProjName);
294 fossil_free(x.zProjName);
295 }else{
296 blob_append_sql(&html, "<td></td><td></td>\n");
297 }
298 if( x.zProjDesc ){
299 blob_append_sql(&html, "<td></td><td>%h</td>\n", x.zProjDesc);
300 fossil_free(x.zProjDesc);
301 }else{
302 blob_append_sql(&html, "<td></td><td></td>\n");
303 }
304 blob_append_sql(&html,
305 "<td></td><td data-sortkey='%08x'>%h</td>\n",
306
+2 -2
--- src/setup.c
+++ src/setup.c
@@ -201,11 +201,11 @@
201201
login_needed(0);
202202
return;
203203
}
204204
style_header("Log Menu");
205205
@ <table border="0" cellspacing="3">
206
-
206
+
207207
if( db_get_boolean("admin-log",1)==0 ){
208208
blob_appendf(&desc,
209209
"The admin log records configuration changes to the repository.\n"
210210
"<b>Disabled</b>: Turn on the "
211211
" <a href='%R/setup_settings'>admin-log setting</a> to enable."
@@ -1296,11 +1296,11 @@
12961296
@ </p>
12971297
@ <hr>
12981298
textarea_attribute("Project Description", 3, 80,
12991299
"project-description", "pd", "", 0);
13001300
@ <p>Describe your project. This will be used in page headers for search
1301
- @ engines as well as a short RSS description.
1301
+ @ engines, the repository listing and a short RSS description.
13021302
@ (Property: "project-description")</p>
13031303
@ <hr>
13041304
entry_attribute("Canonical Server URL", 40, "email-url",
13051305
"eurl", "", 0);
13061306
@ <p>This is the URL used to access this repository as a server.
13071307
--- src/setup.c
+++ src/setup.c
@@ -201,11 +201,11 @@
201 login_needed(0);
202 return;
203 }
204 style_header("Log Menu");
205 @ <table border="0" cellspacing="3">
206
207 if( db_get_boolean("admin-log",1)==0 ){
208 blob_appendf(&desc,
209 "The admin log records configuration changes to the repository.\n"
210 "<b>Disabled</b>: Turn on the "
211 " <a href='%R/setup_settings'>admin-log setting</a> to enable."
@@ -1296,11 +1296,11 @@
1296 @ </p>
1297 @ <hr>
1298 textarea_attribute("Project Description", 3, 80,
1299 "project-description", "pd", "", 0);
1300 @ <p>Describe your project. This will be used in page headers for search
1301 @ engines as well as a short RSS description.
1302 @ (Property: "project-description")</p>
1303 @ <hr>
1304 entry_attribute("Canonical Server URL", 40, "email-url",
1305 "eurl", "", 0);
1306 @ <p>This is the URL used to access this repository as a server.
1307
--- src/setup.c
+++ src/setup.c
@@ -201,11 +201,11 @@
201 login_needed(0);
202 return;
203 }
204 style_header("Log Menu");
205 @ <table border="0" cellspacing="3">
206
207 if( db_get_boolean("admin-log",1)==0 ){
208 blob_appendf(&desc,
209 "The admin log records configuration changes to the repository.\n"
210 "<b>Disabled</b>: Turn on the "
211 " <a href='%R/setup_settings'>admin-log setting</a> to enable."
@@ -1296,11 +1296,11 @@
1296 @ </p>
1297 @ <hr>
1298 textarea_attribute("Project Description", 3, 80,
1299 "project-description", "pd", "", 0);
1300 @ <p>Describe your project. This will be used in page headers for search
1301 @ engines, the repository listing and a short RSS description.
1302 @ (Property: "project-description")</p>
1303 @ <hr>
1304 entry_attribute("Canonical Server URL", 40, "email-url",
1305 "eurl", "", 0);
1306 @ <p>This is the URL used to access this repository as a server.
1307
--- www/changes.wiki
+++ www/changes.wiki
@@ -130,10 +130,11 @@
130130
* Added the "hash" query parameter to the
131131
[/help?cmd=/whatis|/whatis webpage].
132132
* Add a "user elevation" [/doc/trunk/www/alerts.md|subscription]
133133
which alerts subscribers when an admin creates a new user or
134134
adds new permissions to one.
135
+ * Show project description on repository list.
135136
* Diverse minor fixes and additions.
136137
137138
138139
<h2 id='v2_25'>Changes for version 2.25 (2024-11-06)</h2>
139140
140141
--- www/changes.wiki
+++ www/changes.wiki
@@ -130,10 +130,11 @@
130 * Added the "hash" query parameter to the
131 [/help?cmd=/whatis|/whatis webpage].
132 * Add a "user elevation" [/doc/trunk/www/alerts.md|subscription]
133 which alerts subscribers when an admin creates a new user or
134 adds new permissions to one.
 
135 * Diverse minor fixes and additions.
136
137
138 <h2 id='v2_25'>Changes for version 2.25 (2024-11-06)</h2>
139
140
--- www/changes.wiki
+++ www/changes.wiki
@@ -130,10 +130,11 @@
130 * Added the "hash" query parameter to the
131 [/help?cmd=/whatis|/whatis webpage].
132 * Add a "user elevation" [/doc/trunk/www/alerts.md|subscription]
133 which alerts subscribers when an admin creates a new user or
134 adds new permissions to one.
135 * Show project description on repository list.
136 * Diverse minor fixes and additions.
137
138
139 <h2 id='v2_25'>Changes for version 2.25 (2024-11-06)</h2>
140
141
--- www/changes.wiki
+++ www/changes.wiki
@@ -130,10 +130,11 @@
130130
* Added the "hash" query parameter to the
131131
[/help?cmd=/whatis|/whatis webpage].
132132
* Add a "user elevation" [/doc/trunk/www/alerts.md|subscription]
133133
which alerts subscribers when an admin creates a new user or
134134
adds new permissions to one.
135
+ * Show project description on repository list.
135136
* Diverse minor fixes and additions.
136137
137138
138139
<h2 id='v2_25'>Changes for version 2.25 (2024-11-06)</h2>
139140
140141
--- www/changes.wiki
+++ www/changes.wiki
@@ -130,10 +130,11 @@
130 * Added the "hash" query parameter to the
131 [/help?cmd=/whatis|/whatis webpage].
132 * Add a "user elevation" [/doc/trunk/www/alerts.md|subscription]
133 which alerts subscribers when an admin creates a new user or
134 adds new permissions to one.
 
135 * Diverse minor fixes and additions.
136
137
138 <h2 id='v2_25'>Changes for version 2.25 (2024-11-06)</h2>
139
140
--- www/changes.wiki
+++ www/changes.wiki
@@ -130,10 +130,11 @@
130 * Added the "hash" query parameter to the
131 [/help?cmd=/whatis|/whatis webpage].
132 * Add a "user elevation" [/doc/trunk/www/alerts.md|subscription]
133 which alerts subscribers when an admin creates a new user or
134 adds new permissions to one.
135 * Show project description on repository list.
136 * Diverse minor fixes and additions.
137
138
139 <h2 id='v2_25'>Changes for version 2.25 (2024-11-06)</h2>
140
141

Keyboard Shortcuts

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