Fossil SCM
Provide a "Revert to Default" button for editing CSS. Grammar fix on login page.
Commit
adefb6c8dba43644c5fce844f4afbb19e4f4268f
Parent
8d529a7ae9b00d3…
2 files changed
+1
-1
+9
+1
-1
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -194,11 +194,11 @@ | ||
| 194 | 194 | @ </tr> |
| 195 | 195 | @ </table> |
| 196 | 196 | if( g.zLogin==0 ){ |
| 197 | 197 | @ <p>To login |
| 198 | 198 | }else{ |
| 199 | - @ <p>You are current logged in as <b>%h(g.zLogin)</b></p> | |
| 199 | + @ <p>You are currently logged in as <b>%h(g.zLogin)</b></p> | |
| 200 | 200 | @ <p>To change your login to a different user |
| 201 | 201 | } |
| 202 | 202 | @ enter the user-id and password at the left and press the |
| 203 | 203 | @ "Login" button. Your user name will be stored in a browser cookie. |
| 204 | 204 | @ You must configure your web browser to accept cookies in order for |
| 205 | 205 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -194,11 +194,11 @@ | |
| 194 | @ </tr> |
| 195 | @ </table> |
| 196 | if( g.zLogin==0 ){ |
| 197 | @ <p>To login |
| 198 | }else{ |
| 199 | @ <p>You are current logged in as <b>%h(g.zLogin)</b></p> |
| 200 | @ <p>To change your login to a different user |
| 201 | } |
| 202 | @ enter the user-id and password at the left and press the |
| 203 | @ "Login" button. Your user name will be stored in a browser cookie. |
| 204 | @ You must configure your web browser to accept cookies in order for |
| 205 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -194,11 +194,11 @@ | |
| 194 | @ </tr> |
| 195 | @ </table> |
| 196 | if( g.zLogin==0 ){ |
| 197 | @ <p>To login |
| 198 | }else{ |
| 199 | @ <p>You are currently logged in as <b>%h(g.zLogin)</b></p> |
| 200 | @ <p>To change your login to a different user |
| 201 | } |
| 202 | @ enter the user-id and password at the left and press the |
| 203 | @ "Login" button. Your user name will be stored in a browser cookie. |
| 204 | @ You must configure your web browser to accept cookies in order for |
| 205 |
+9
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -814,24 +814,33 @@ | ||
| 814 | 814 | void setup_editcss(void){ |
| 815 | 815 | login_check_credentials(); |
| 816 | 816 | if( !g.okSetup ){ |
| 817 | 817 | login_needed(); |
| 818 | 818 | } |
| 819 | + db_begin_transaction(); | |
| 820 | + if( P("clear")!=0 ){ | |
| 821 | + db_multi_exec("DELETE FROM config WHERE name='css'"); | |
| 822 | + cgi_replace_parameter("css", zDefaultCSS); | |
| 823 | + }else{ | |
| 824 | + textarea_attribute(0, 0, 0, "css", "css", zDefaultCSS); | |
| 825 | + } | |
| 819 | 826 | style_header("Edit CSS"); |
| 820 | 827 | @ <form action="%s(g.zBaseURL)/setup_editcss" method="POST"> |
| 821 | 828 | login_insert_csrf_secret(); |
| 822 | 829 | @ Edit the CSS:<br /> |
| 823 | 830 | textarea_attribute("", 40, 80, "css", "css", zDefaultCSS); |
| 824 | 831 | @ <br /> |
| 825 | 832 | @ <input type="submit" name="submit" value="Apply Changes"> |
| 833 | + @ <input type="submit" name="clear" value="Revert To Default"> | |
| 826 | 834 | @ </form> |
| 827 | 835 | @ <hr> |
| 828 | 836 | @ Here is the default CSS: |
| 829 | 837 | @ <blockquote><pre> |
| 830 | 838 | @ %h(zDefaultCSS) |
| 831 | 839 | @ </pre></blockquote> |
| 832 | 840 | style_footer(); |
| 841 | + db_end_transaction(0); | |
| 833 | 842 | } |
| 834 | 843 | |
| 835 | 844 | /* |
| 836 | 845 | ** WEBPAGE: setup_header |
| 837 | 846 | */ |
| 838 | 847 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -814,24 +814,33 @@ | |
| 814 | void setup_editcss(void){ |
| 815 | login_check_credentials(); |
| 816 | if( !g.okSetup ){ |
| 817 | login_needed(); |
| 818 | } |
| 819 | style_header("Edit CSS"); |
| 820 | @ <form action="%s(g.zBaseURL)/setup_editcss" method="POST"> |
| 821 | login_insert_csrf_secret(); |
| 822 | @ Edit the CSS:<br /> |
| 823 | textarea_attribute("", 40, 80, "css", "css", zDefaultCSS); |
| 824 | @ <br /> |
| 825 | @ <input type="submit" name="submit" value="Apply Changes"> |
| 826 | @ </form> |
| 827 | @ <hr> |
| 828 | @ Here is the default CSS: |
| 829 | @ <blockquote><pre> |
| 830 | @ %h(zDefaultCSS) |
| 831 | @ </pre></blockquote> |
| 832 | style_footer(); |
| 833 | } |
| 834 | |
| 835 | /* |
| 836 | ** WEBPAGE: setup_header |
| 837 | */ |
| 838 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -814,24 +814,33 @@ | |
| 814 | void setup_editcss(void){ |
| 815 | login_check_credentials(); |
| 816 | if( !g.okSetup ){ |
| 817 | login_needed(); |
| 818 | } |
| 819 | db_begin_transaction(); |
| 820 | if( P("clear")!=0 ){ |
| 821 | db_multi_exec("DELETE FROM config WHERE name='css'"); |
| 822 | cgi_replace_parameter("css", zDefaultCSS); |
| 823 | }else{ |
| 824 | textarea_attribute(0, 0, 0, "css", "css", zDefaultCSS); |
| 825 | } |
| 826 | style_header("Edit CSS"); |
| 827 | @ <form action="%s(g.zBaseURL)/setup_editcss" method="POST"> |
| 828 | login_insert_csrf_secret(); |
| 829 | @ Edit the CSS:<br /> |
| 830 | textarea_attribute("", 40, 80, "css", "css", zDefaultCSS); |
| 831 | @ <br /> |
| 832 | @ <input type="submit" name="submit" value="Apply Changes"> |
| 833 | @ <input type="submit" name="clear" value="Revert To Default"> |
| 834 | @ </form> |
| 835 | @ <hr> |
| 836 | @ Here is the default CSS: |
| 837 | @ <blockquote><pre> |
| 838 | @ %h(zDefaultCSS) |
| 839 | @ </pre></blockquote> |
| 840 | style_footer(); |
| 841 | db_end_transaction(0); |
| 842 | } |
| 843 | |
| 844 | /* |
| 845 | ** WEBPAGE: setup_header |
| 846 | */ |
| 847 |