1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
|
char **azItem; /* Decomposed elements of zTarlistCfg */
int *anItem; /* Bytes in each term of azItem[] */
int nItem; /* Number of terms in azItem[] */
int i; /* Loop counter */
int tmFlags; /* Timeline display flags */
int n; /* Number of suggested downloads */
double rNow; /* Current time. Julian day number */
login_check_credentials();
if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; }
style_set_current_feature("timeline");
style_header("Suggested Downloads");
zTarlistCfg = db_get("suggested-downloads","off");
db_multi_exec(
"CREATE TEMP TABLE tarlist(rid INTEGER PRIMARY KEY, com TEXT);"
);
rNow = db_double(0.0,"SELECT julianday()");
if( !g.interp ) Th_FossilInit(0);
Th_SplitList(g.interp, zTarlistCfg, (int)strlen(zTarlistCfg),
&azItem, &anItem, &nItem);
for(i=0; i<nItem-3; i+=4){
int cnt; /* The number of instances of zLabel to use */
char *zLabel; /* The label to match */
double rStart; /* Starting time, julian day number */
char *zComment = 0; /* Comment to apply */
if( anItem[i]==1 && azItem[i][0]=='*' ){
cnt = -1;
|
>
>
|
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
|
char **azItem; /* Decomposed elements of zTarlistCfg */
int *anItem; /* Bytes in each term of azItem[] */
int nItem; /* Number of terms in azItem[] */
int i; /* Loop counter */
int tmFlags; /* Timeline display flags */
int n; /* Number of suggested downloads */
double rNow; /* Current time. Julian day number */
int bPlainTextCom; /* Use plain-text comments */
login_check_credentials();
if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; }
style_set_current_feature("timeline");
style_header("Suggested Downloads");
zTarlistCfg = db_get("suggested-downloads","off");
db_multi_exec(
"CREATE TEMP TABLE tarlist(rid INTEGER PRIMARY KEY, com TEXT);"
);
rNow = db_double(0.0,"SELECT julianday()");
if( !g.interp ) Th_FossilInit(0);
Th_SplitList(g.interp, zTarlistCfg, (int)strlen(zTarlistCfg),
&azItem, &anItem, &nItem);
bPlainTextCom = db_get_boolean("timeline-plaintext",0);
for(i=0; i<nItem-3; i+=4){
int cnt; /* The number of instances of zLabel to use */
char *zLabel; /* The label to match */
double rStart; /* Starting time, julian day number */
char *zComment = 0; /* Comment to apply */
if( anItem[i]==1 && azItem[i][0]=='*' ){
cnt = -1;
|
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
|
}else
{ /* Default to seconds */
rStart = rNow - r/86400.0;
}
}
if( anItem[i+3]==0 ){
zComment = fossil_strdup("");
}else{
zComment = fossil_strndup(azItem[i+3],anItem[i+3]);
}
if( fossil_strcmp("OPEN-LEAF",zLabel)==0 ){
db_multi_exec(
"INSERT OR IGNORE INTO tarlist(rid,com)"
" SELECT leaf.rid, %Q FROM leaf, event"
" WHERE event.objid=leaf.rid"
" AND event.mtime>=%.6f"
|
>
>
|
|
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
|
}else
{ /* Default to seconds */
rStart = rNow - r/86400.0;
}
}
if( anItem[i+3]==0 ){
zComment = fossil_strdup("");
}else if( bPlainTextCom ){
zComment = mprintf("** %.*s ** ", anItem[i+3], azItem[i+3]);
}else{
zComment = mprintf("<b>%.*s</b>\n<p>", anItem[i+3], azItem[i+3]);
}
if( fossil_strcmp("OPEN-LEAF",zLabel)==0 ){
db_multi_exec(
"INSERT OR IGNORE INTO tarlist(rid,com)"
" SELECT leaf.rid, %Q FROM leaf, event"
" WHERE event.objid=leaf.rid"
" AND event.mtime>=%.6f"
|
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
|
if( n==0 ){
@ <h2>No tarball/ZIP suggestions are available at this time</h2>
}else{
@ <h2>%d(n) Tarball/ZIP Download Suggestion%s(n>1?"s":""):</h2>
db_prepare(&q,
"WITH matches AS (%s AND blob.rid IN (SELECT rid FROM tarlist))\n"
"SELECT blobRid, uuid, timestamp,"
" if(length(com)>0,'<b>'||com||'</b><p>','')||comment,"
" user, leaf, bgColor, eventType, tags, tagid, brief, mtime"
" FROM matches JOIN tarlist ON tarlist.rid=blobRid"
" ORDER BY matches.mtime DESC",
timeline_query_for_www()
);
tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL | TIMELINE_COLUMNAR
|
|
|
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
|
if( n==0 ){
@ <h2>No tarball/ZIP suggestions are available at this time</h2>
}else{
@ <h2>%d(n) Tarball/ZIP Download Suggestion%s(n>1?"s":""):</h2>
db_prepare(&q,
"WITH matches AS (%s AND blob.rid IN (SELECT rid FROM tarlist))\n"
"SELECT blobRid, uuid, timestamp,"
" com||comment,"
" user, leaf, bgColor, eventType, tags, tagid, brief, mtime"
" FROM matches JOIN tarlist ON tarlist.rid=blobRid"
" ORDER BY matches.mtime DESC",
timeline_query_for_www()
);
tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL | TIMELINE_COLUMNAR
|