Fossil SCM

Provide a "Revert to Default" button for editing CSS. Grammar fix on login page.

eric 2008-11-26 22:24 trunk
Commit adefb6c8dba43644c5fce844f4afbb19e4f4268f
2 files changed +1 -1 +9
+1 -1
--- src/login.c
+++ src/login.c
@@ -194,11 +194,11 @@
194194
@ </tr>
195195
@ </table>
196196
if( g.zLogin==0 ){
197197
@ <p>To login
198198
}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>
200200
@ <p>To change your login to a different user
201201
}
202202
@ enter the user-id and password at the left and press the
203203
@ "Login" button. Your user name will be stored in a browser cookie.
204204
@ You must configure your web browser to accept cookies in order for
205205
--- 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
--- src/setup.c
+++ src/setup.c
@@ -814,24 +814,33 @@
814814
void setup_editcss(void){
815815
login_check_credentials();
816816
if( !g.okSetup ){
817817
login_needed();
818818
}
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
+ }
819826
style_header("Edit CSS");
820827
@ <form action="%s(g.zBaseURL)/setup_editcss" method="POST">
821828
login_insert_csrf_secret();
822829
@ Edit the CSS:<br />
823830
textarea_attribute("", 40, 80, "css", "css", zDefaultCSS);
824831
@ <br />
825832
@ <input type="submit" name="submit" value="Apply Changes">
833
+ @ <input type="submit" name="clear" value="Revert To Default">
826834
@ </form>
827835
@ <hr>
828836
@ Here is the default CSS:
829837
@ <blockquote><pre>
830838
@ %h(zDefaultCSS)
831839
@ </pre></blockquote>
832840
style_footer();
841
+ db_end_transaction(0);
833842
}
834843
835844
/*
836845
** WEBPAGE: setup_header
837846
*/
838847
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button