Fossil SCM
More enhancements to the button on the transfer setup page.
Commit
dcc8236e9795b5942928d768087f9280cd8f2c2e
Parent
bfcdc23b7232e84…
1 file changed
+8
-7
+8
-7
| --- src/xfersetup.c | ||
| +++ src/xfersetup.c | ||
| @@ -46,40 +46,41 @@ | ||
| 46 | 46 | @ </table> |
| 47 | 47 | |
| 48 | 48 | url_parse(0, 0); |
| 49 | 49 | if( g.urlProtocol ){ |
| 50 | 50 | unsigned syncFlags; |
| 51 | - const char *zSync; | |
| 51 | + const char *zButton; | |
| 52 | 52 | char *zWarning; |
| 53 | 53 | |
| 54 | 54 | if( db_get_boolean("dont-push", 0) ){ |
| 55 | 55 | syncFlags = SYNC_PULL; |
| 56 | - zSync = "Pull"; | |
| 56 | + zButton = "Pull"; | |
| 57 | 57 | zWarning = 0; |
| 58 | 58 | }else{ |
| 59 | 59 | syncFlags = SYNC_PUSH | SYNC_PULL; |
| 60 | - zSync = "Synchronize"; | |
| 60 | + zButton = "Synchronize"; | |
| 61 | 61 | zWarning = mprintf("WARNING: Pushing to \"%s\" is enabled.", |
| 62 | 62 | g.urlCanonical); |
| 63 | 63 | } |
| 64 | 64 | if( P("sync") ){ |
| 65 | 65 | user_select(); |
| 66 | 66 | url_enable_proxy(0); |
| 67 | 67 | client_sync(syncFlags, 0, 0); |
| 68 | 68 | } |
| 69 | - @ <p>Press the %h(zSync) button below to synchronize the local repository | |
| 70 | - @ now. This may be useful when testing the various transfer scripts.</p> | |
| 71 | - @ | |
| 69 | + @ <p>Press the %h(zButton) button below to synchronize with the | |
| 70 | + @ "%h(g.urlCanonical)" repository now. This may be useful when | |
| 71 | + @ testing the various transfer scripts.</p> | |
| 72 | 72 | if( zWarning ){ |
| 73 | + @ | |
| 73 | 74 | @ <big><b>%h(zWarning)</b></big> |
| 74 | 75 | free(zWarning); |
| 75 | 76 | } |
| 76 | 77 | @ |
| 77 | 78 | @ <blockquote> |
| 78 | 79 | @ <form method="post" action="%s(g.zTop)/%s(g.zPath)"><div> |
| 79 | 80 | login_insert_csrf_secret(); |
| 80 | - @ <input type="submit" name="sync" value="%h(zSync)" /> | |
| 81 | + @ <input type="submit" name="sync" value="%h(zButton)" /> | |
| 81 | 82 | @ </div></form> |
| 82 | 83 | @ </blockquote> |
| 83 | 84 | @ |
| 84 | 85 | } |
| 85 | 86 | |
| 86 | 87 |
| --- src/xfersetup.c | |
| +++ src/xfersetup.c | |
| @@ -46,40 +46,41 @@ | |
| 46 | @ </table> |
| 47 | |
| 48 | url_parse(0, 0); |
| 49 | if( g.urlProtocol ){ |
| 50 | unsigned syncFlags; |
| 51 | const char *zSync; |
| 52 | char *zWarning; |
| 53 | |
| 54 | if( db_get_boolean("dont-push", 0) ){ |
| 55 | syncFlags = SYNC_PULL; |
| 56 | zSync = "Pull"; |
| 57 | zWarning = 0; |
| 58 | }else{ |
| 59 | syncFlags = SYNC_PUSH | SYNC_PULL; |
| 60 | zSync = "Synchronize"; |
| 61 | zWarning = mprintf("WARNING: Pushing to \"%s\" is enabled.", |
| 62 | g.urlCanonical); |
| 63 | } |
| 64 | if( P("sync") ){ |
| 65 | user_select(); |
| 66 | url_enable_proxy(0); |
| 67 | client_sync(syncFlags, 0, 0); |
| 68 | } |
| 69 | @ <p>Press the %h(zSync) button below to synchronize the local repository |
| 70 | @ now. This may be useful when testing the various transfer scripts.</p> |
| 71 | @ |
| 72 | if( zWarning ){ |
| 73 | @ <big><b>%h(zWarning)</b></big> |
| 74 | free(zWarning); |
| 75 | } |
| 76 | @ |
| 77 | @ <blockquote> |
| 78 | @ <form method="post" action="%s(g.zTop)/%s(g.zPath)"><div> |
| 79 | login_insert_csrf_secret(); |
| 80 | @ <input type="submit" name="sync" value="%h(zSync)" /> |
| 81 | @ </div></form> |
| 82 | @ </blockquote> |
| 83 | @ |
| 84 | } |
| 85 | |
| 86 |
| --- src/xfersetup.c | |
| +++ src/xfersetup.c | |
| @@ -46,40 +46,41 @@ | |
| 46 | @ </table> |
| 47 | |
| 48 | url_parse(0, 0); |
| 49 | if( g.urlProtocol ){ |
| 50 | unsigned syncFlags; |
| 51 | const char *zButton; |
| 52 | char *zWarning; |
| 53 | |
| 54 | if( db_get_boolean("dont-push", 0) ){ |
| 55 | syncFlags = SYNC_PULL; |
| 56 | zButton = "Pull"; |
| 57 | zWarning = 0; |
| 58 | }else{ |
| 59 | syncFlags = SYNC_PUSH | SYNC_PULL; |
| 60 | zButton = "Synchronize"; |
| 61 | zWarning = mprintf("WARNING: Pushing to \"%s\" is enabled.", |
| 62 | g.urlCanonical); |
| 63 | } |
| 64 | if( P("sync") ){ |
| 65 | user_select(); |
| 66 | url_enable_proxy(0); |
| 67 | client_sync(syncFlags, 0, 0); |
| 68 | } |
| 69 | @ <p>Press the %h(zButton) button below to synchronize with the |
| 70 | @ "%h(g.urlCanonical)" repository now. This may be useful when |
| 71 | @ testing the various transfer scripts.</p> |
| 72 | if( zWarning ){ |
| 73 | @ |
| 74 | @ <big><b>%h(zWarning)</b></big> |
| 75 | free(zWarning); |
| 76 | } |
| 77 | @ |
| 78 | @ <blockquote> |
| 79 | @ <form method="post" action="%s(g.zTop)/%s(g.zPath)"><div> |
| 80 | login_insert_csrf_secret(); |
| 81 | @ <input type="submit" name="sync" value="%h(zButton)" /> |
| 82 | @ </div></form> |
| 83 | @ </blockquote> |
| 84 | @ |
| 85 | } |
| 86 | |
| 87 |