Fossil SCM
When using "oldestfirst" query parameter on /timeline, swap the Older/Newer buttons at the beginning and end of the timeline so the direction is consistent with the order of the timeline.
Commit
c09483437c38fe16e132faf2f1a27c39c3f4299e6bf6dfe59715a6a95e581b20
Parent
a456dcbbac25366…
1 file changed
+10
+10
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -3142,10 +3142,20 @@ | ||
| 3142 | 3142 | |
| 3143 | 3143 | /* Report any errors. */ |
| 3144 | 3144 | if( zError ){ |
| 3145 | 3145 | @ <p class="generalError">%h(zError)</p> |
| 3146 | 3146 | } |
| 3147 | + | |
| 3148 | + // Swap zNewer and zOlder buttons if we display oldestfirst | |
| 3149 | + if( PB("oldestfirst") ){ | |
| 3150 | + char *zSwap = zNewerButton; | |
| 3151 | + char *zSwapLabel = zNewerButtonLabel; | |
| 3152 | + zNewerButton = zOlderButton; | |
| 3153 | + zNewerButtonLabel = zOlderButtonLabel; | |
| 3154 | + zOlderButton = zSwap; | |
| 3155 | + zOlderButtonLabel = zSwapLabel; | |
| 3156 | + } | |
| 3147 | 3157 | |
| 3148 | 3158 | if( zNewerButton ){ |
| 3149 | 3159 | @ %z(chref("button","%s",zNewerButton))%h(zNewerButtonLabel)\ |
| 3150 | 3160 | @ ↑</a> |
| 3151 | 3161 | } |
| 3152 | 3162 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -3142,10 +3142,20 @@ | |
| 3142 | |
| 3143 | /* Report any errors. */ |
| 3144 | if( zError ){ |
| 3145 | @ <p class="generalError">%h(zError)</p> |
| 3146 | } |
| 3147 | |
| 3148 | if( zNewerButton ){ |
| 3149 | @ %z(chref("button","%s",zNewerButton))%h(zNewerButtonLabel)\ |
| 3150 | @ ↑</a> |
| 3151 | } |
| 3152 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -3142,10 +3142,20 @@ | |
| 3142 | |
| 3143 | /* Report any errors. */ |
| 3144 | if( zError ){ |
| 3145 | @ <p class="generalError">%h(zError)</p> |
| 3146 | } |
| 3147 | |
| 3148 | // Swap zNewer and zOlder buttons if we display oldestfirst |
| 3149 | if( PB("oldestfirst") ){ |
| 3150 | char *zSwap = zNewerButton; |
| 3151 | char *zSwapLabel = zNewerButtonLabel; |
| 3152 | zNewerButton = zOlderButton; |
| 3153 | zNewerButtonLabel = zOlderButtonLabel; |
| 3154 | zOlderButton = zSwap; |
| 3155 | zOlderButtonLabel = zSwapLabel; |
| 3156 | } |
| 3157 | |
| 3158 | if( zNewerButton ){ |
| 3159 | @ %z(chref("button","%s",zNewerButton))%h(zNewerButtonLabel)\ |
| 3160 | @ ↑</a> |
| 3161 | } |
| 3162 |