| | @@ -850,10 +850,37 @@ |
| 850 | 850 | @ <span class="textareaLabel">%s(zLabel)</span> |
| 851 | 851 | } |
| 852 | 852 | } |
| 853 | 853 | } |
| 854 | 854 | |
| 855 | +/* |
| 856 | +** Generate a text box for an attribute. |
| 857 | +*/ |
| 858 | +static void multiple_choice_attribute( |
| 859 | + const char *zLabel, /* The text label on the menu */ |
| 860 | + const char *zVar, /* The corresponding row in the VAR table */ |
| 861 | + const char *zQP, /* The query parameter */ |
| 862 | + const char *zDflt, /* Default value if VAR table entry does not exist */ |
| 863 | + int nChoice, /* Number of choices */ |
| 864 | + const char **azChoice /* Choices. 2 per choice: (VAR value, Display) */ |
| 865 | +){ |
| 866 | + const char *z = db_get(zVar, (char*)zDflt); |
| 867 | + const char *zQ = P(zQP); |
| 868 | + int i; |
| 869 | + if( zQ && fossil_strcmp(zQ,z)!=0){ |
| 870 | + login_verify_csrf_secret(); |
| 871 | + db_set(zVar, zQ, 0); |
| 872 | + z = zQ; |
| 873 | + } |
| 874 | + @ <select size="1" name="%s(zQP)" id="id%s(zQP)"> |
| 875 | + for(i=0; i<nChoice*2; i+=2){ |
| 876 | + const char *zSel = fossil_strcmp(azChoice[i],z)==0 ? " selected" : ""; |
| 877 | + @ <option value="%h(azChoice[i])"%s(zSel)>%h(azChoice[i+1])</option> |
| 878 | + } |
| 879 | + @ </select> |
| 880 | +} |
| 881 | + |
| 855 | 882 | |
| 856 | 883 | /* |
| 857 | 884 | ** WEBPAGE: setup_access |
| 858 | 885 | */ |
| 859 | 886 | void setup_access(void){ |
| | @@ -1124,10 +1151,15 @@ |
| 1124 | 1151 | ** WEBPAGE: setup_timeline |
| 1125 | 1152 | */ |
| 1126 | 1153 | void setup_timeline(void){ |
| 1127 | 1154 | double tmDiff; |
| 1128 | 1155 | char zTmDiff[20]; |
| 1156 | + static const char *azTimeFormats[] = { |
| 1157 | + "0", "HH:MM", |
| 1158 | + "1", "HH:MM:SS", |
| 1159 | + "2", "YYYY-MM-DD HH:MM" |
| 1160 | + }; |
| 1129 | 1161 | login_check_credentials(); |
| 1130 | 1162 | if( !g.perm.Setup ){ |
| 1131 | 1163 | login_needed(); |
| 1132 | 1164 | } |
| 1133 | 1165 | |
| | @@ -1167,10 +1199,18 @@ |
| 1167 | 1199 | @ %s(zTmDiff) hours behind UTC.</p> |
| 1168 | 1200 | }else{ |
| 1169 | 1201 | @ %s(zTmDiff) hours ahead of UTC.</p> |
| 1170 | 1202 | } |
| 1171 | 1203 | |
| 1204 | + @ <hr /> |
| 1205 | + multiple_choice_attribute("Per-Item Time Format", "timeline-date-format", "tdf", "0", |
| 1206 | + 3, azTimeFormats); |
| 1207 | + @ <p>If the "HH:MM" or "HH:MM:SS" format is selected, then the date is shown |
| 1208 | + @ in a separate box (using CSS class "timelineDate") whenever the date changes. |
| 1209 | + @ With the "YYYY-MM-DD HH:MM" format, the complete date and time is shown on |
| 1210 | + @ every timeline entry (using the CSS class "timelineTime").</p> |
| 1211 | + |
| 1172 | 1212 | @ <hr /> |
| 1173 | 1213 | onoff_attribute("Show version differences by default", |
| 1174 | 1214 | "show-version-diffs", "vdiff", 0, 0); |
| 1175 | 1215 | @ <p>On the version-information pages linked from the timeline can either |
| 1176 | 1216 | @ show complete diffs of all file changes, or can just list the names of |
| 1177 | 1217 | |