Fossil SCM
Fixes to the default header, footer, and css access in the setup screens.
Commit
6115de1504137b91c610a364a4bcbb6398548449
Parent
128e95e017b3e2d…
1 file changed
+11
-11
+11
-11
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -1521,26 +1521,26 @@ | ||
| 1521 | 1521 | login_needed(); |
| 1522 | 1522 | } |
| 1523 | 1523 | db_begin_transaction(); |
| 1524 | 1524 | if( P("clear")!=0 ){ |
| 1525 | 1525 | db_multi_exec("DELETE FROM config WHERE name='css'"); |
| 1526 | - cgi_replace_parameter("css", builtin_text("skins/default.css")); | |
| 1526 | + cgi_replace_parameter("css", builtin_text("skins/default/css.txt")); | |
| 1527 | 1527 | db_end_transaction(0); |
| 1528 | 1528 | cgi_redirect("setup_editcss"); |
| 1529 | 1529 | } |
| 1530 | 1530 | if( P("submit")!=0 ){ |
| 1531 | 1531 | textarea_attribute(0, 0, 0, "css", "css", |
| 1532 | - builtin_text("skins/default.css"), 0); | |
| 1532 | + builtin_text("skins/default/css.txt"), 0); | |
| 1533 | 1533 | db_end_transaction(0); |
| 1534 | 1534 | cgi_redirect("setup_editcss"); |
| 1535 | 1535 | } |
| 1536 | 1536 | style_header("Edit CSS"); |
| 1537 | 1537 | @ <form action="%s(g.zTop)/setup_editcss" method="post"><div> |
| 1538 | 1538 | login_insert_csrf_secret(); |
| 1539 | 1539 | @ Edit the CSS below:<br /> |
| 1540 | 1540 | textarea_attribute("", 35, 80, "css", "css", |
| 1541 | - builtin_text("skins/default.css"), 0); | |
| 1541 | + builtin_text("skins/default/css.txt"), 0); | |
| 1542 | 1542 | @ <br /> |
| 1543 | 1543 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 1544 | 1544 | @ <input type="submit" name="clear" value="Revert To Default" /> |
| 1545 | 1545 | @ </div></form> |
| 1546 | 1546 | @ <p><span class="note">Note:</span> Press your browser Reload button after |
| @@ -1566,17 +1566,17 @@ | ||
| 1566 | 1566 | login_needed(); |
| 1567 | 1567 | } |
| 1568 | 1568 | db_begin_transaction(); |
| 1569 | 1569 | if( P("clear")!=0 ){ |
| 1570 | 1570 | db_multi_exec("DELETE FROM config WHERE name='header'"); |
| 1571 | - cgi_replace_parameter("header", builtin_text("skins/default.header")); | |
| 1571 | + cgi_replace_parameter("header", builtin_text("skins/default/header.txt")); | |
| 1572 | 1572 | }else if( P("submit")!=0 ){ |
| 1573 | 1573 | textarea_attribute(0, 0, 0, "header", "header", |
| 1574 | - builtin_text("skins/default.header"), 0); | |
| 1574 | + builtin_text("skins/default/header.txt"), 0); | |
| 1575 | 1575 | }else if( P("fixbase")!=0 ){ |
| 1576 | 1576 | const char *z = db_get("header", |
| 1577 | - (char*)builtin_text("skins/default.header")); | |
| 1577 | + (char*)builtin_text("skins/default/header.txt")); | |
| 1578 | 1578 | char *zHead = strstr(z, "<head>"); |
| 1579 | 1579 | if( strstr(z, "<base href=")==0 && zHead!=0 ){ |
| 1580 | 1580 | char *zNew; |
| 1581 | 1581 | char *zTail = &zHead[6]; |
| 1582 | 1582 | while( fossil_isspace(zTail[0]) ) zTail++; |
| @@ -1602,11 +1602,11 @@ | ||
| 1602 | 1602 | login_insert_csrf_secret(); |
| 1603 | 1603 | @ <p>Edit HTML text with embedded TH1 (a Tcl dialect) that will be used to |
| 1604 | 1604 | @ generate the beginning of every page through start of the main |
| 1605 | 1605 | @ menu.</p> |
| 1606 | 1606 | textarea_attribute("", 35, 80, "header", "header", |
| 1607 | - builtin_text("skins/default.header"), 0); | |
| 1607 | + builtin_text("skins/default/header.txt"), 0); | |
| 1608 | 1608 | @ <br /> |
| 1609 | 1609 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 1610 | 1610 | @ <input type="submit" name="clear" value="Revert To Default" /> |
| 1611 | 1611 | @ </div></form> |
| 1612 | 1612 | @ <hr /> |
| @@ -1613,11 +1613,11 @@ | ||
| 1613 | 1613 | @ The default header is shown below for reference. Other examples |
| 1614 | 1614 | @ of headers can be seen on the <a href="setup_skin">skins page</a>. |
| 1615 | 1615 | @ See also the <a href="setup_editcss">CSS</a> and |
| 1616 | 1616 | @ <a href="setup_footer">footer</a> editing screens. |
| 1617 | 1617 | @ <blockquote><pre> |
| 1618 | - @ %h(builtin_text("skins/default.header")) | |
| 1618 | + @ %h(builtin_text("skins/default/header.txt")) | |
| 1619 | 1619 | @ </pre></blockquote> |
| 1620 | 1620 | style_footer(); |
| 1621 | 1621 | db_end_transaction(0); |
| 1622 | 1622 | } |
| 1623 | 1623 | |
| @@ -1630,20 +1630,20 @@ | ||
| 1630 | 1630 | login_needed(); |
| 1631 | 1631 | } |
| 1632 | 1632 | db_begin_transaction(); |
| 1633 | 1633 | if( P("clear")!=0 ){ |
| 1634 | 1634 | db_multi_exec("DELETE FROM config WHERE name='footer'"); |
| 1635 | - cgi_replace_parameter("footer", builtin_text("skins/default.footer")); | |
| 1635 | + cgi_replace_parameter("footer", builtin_text("skins/default/footer.txt")); | |
| 1636 | 1636 | } |
| 1637 | 1637 | |
| 1638 | 1638 | style_header("Edit Page Footer"); |
| 1639 | 1639 | @ <form action="%s(g.zTop)/setup_footer" method="post"><div> |
| 1640 | 1640 | login_insert_csrf_secret(); |
| 1641 | 1641 | @ <p>Edit HTML text with embedded TH1 (a Tcl dialect) that will be used to |
| 1642 | 1642 | @ generate the end of every page.</p> |
| 1643 | 1643 | textarea_attribute("", 20, 80, "footer", "footer", |
| 1644 | - builtin_text("skins/default.footer"), 0); | |
| 1644 | + builtin_text("skins/default/footer.txt"), 0); | |
| 1645 | 1645 | @ <br /> |
| 1646 | 1646 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 1647 | 1647 | @ <input type="submit" name="clear" value="Revert To Default" /> |
| 1648 | 1648 | @ </div></form> |
| 1649 | 1649 | @ <hr /> |
| @@ -1650,11 +1650,11 @@ | ||
| 1650 | 1650 | @ The default footer is shown below for reference. Other examples |
| 1651 | 1651 | @ of footers can be seen on the <a href="setup_skin">skins page</a>. |
| 1652 | 1652 | @ See also the <a href="setup_editcss">CSS</a> and |
| 1653 | 1653 | @ <a href="setup_header">header</a> editing screens. |
| 1654 | 1654 | @ <blockquote><pre> |
| 1655 | - @ %h(builtin_text("skins/default.footer")) | |
| 1655 | + @ %h(builtin_text("skins/default/footer.txt")) | |
| 1656 | 1656 | @ </pre></blockquote> |
| 1657 | 1657 | style_footer(); |
| 1658 | 1658 | db_end_transaction(0); |
| 1659 | 1659 | } |
| 1660 | 1660 | |
| 1661 | 1661 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1521,26 +1521,26 @@ | |
| 1521 | login_needed(); |
| 1522 | } |
| 1523 | db_begin_transaction(); |
| 1524 | if( P("clear")!=0 ){ |
| 1525 | db_multi_exec("DELETE FROM config WHERE name='css'"); |
| 1526 | cgi_replace_parameter("css", builtin_text("skins/default.css")); |
| 1527 | db_end_transaction(0); |
| 1528 | cgi_redirect("setup_editcss"); |
| 1529 | } |
| 1530 | if( P("submit")!=0 ){ |
| 1531 | textarea_attribute(0, 0, 0, "css", "css", |
| 1532 | builtin_text("skins/default.css"), 0); |
| 1533 | db_end_transaction(0); |
| 1534 | cgi_redirect("setup_editcss"); |
| 1535 | } |
| 1536 | style_header("Edit CSS"); |
| 1537 | @ <form action="%s(g.zTop)/setup_editcss" method="post"><div> |
| 1538 | login_insert_csrf_secret(); |
| 1539 | @ Edit the CSS below:<br /> |
| 1540 | textarea_attribute("", 35, 80, "css", "css", |
| 1541 | builtin_text("skins/default.css"), 0); |
| 1542 | @ <br /> |
| 1543 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 1544 | @ <input type="submit" name="clear" value="Revert To Default" /> |
| 1545 | @ </div></form> |
| 1546 | @ <p><span class="note">Note:</span> Press your browser Reload button after |
| @@ -1566,17 +1566,17 @@ | |
| 1566 | login_needed(); |
| 1567 | } |
| 1568 | db_begin_transaction(); |
| 1569 | if( P("clear")!=0 ){ |
| 1570 | db_multi_exec("DELETE FROM config WHERE name='header'"); |
| 1571 | cgi_replace_parameter("header", builtin_text("skins/default.header")); |
| 1572 | }else if( P("submit")!=0 ){ |
| 1573 | textarea_attribute(0, 0, 0, "header", "header", |
| 1574 | builtin_text("skins/default.header"), 0); |
| 1575 | }else if( P("fixbase")!=0 ){ |
| 1576 | const char *z = db_get("header", |
| 1577 | (char*)builtin_text("skins/default.header")); |
| 1578 | char *zHead = strstr(z, "<head>"); |
| 1579 | if( strstr(z, "<base href=")==0 && zHead!=0 ){ |
| 1580 | char *zNew; |
| 1581 | char *zTail = &zHead[6]; |
| 1582 | while( fossil_isspace(zTail[0]) ) zTail++; |
| @@ -1602,11 +1602,11 @@ | |
| 1602 | login_insert_csrf_secret(); |
| 1603 | @ <p>Edit HTML text with embedded TH1 (a Tcl dialect) that will be used to |
| 1604 | @ generate the beginning of every page through start of the main |
| 1605 | @ menu.</p> |
| 1606 | textarea_attribute("", 35, 80, "header", "header", |
| 1607 | builtin_text("skins/default.header"), 0); |
| 1608 | @ <br /> |
| 1609 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 1610 | @ <input type="submit" name="clear" value="Revert To Default" /> |
| 1611 | @ </div></form> |
| 1612 | @ <hr /> |
| @@ -1613,11 +1613,11 @@ | |
| 1613 | @ The default header is shown below for reference. Other examples |
| 1614 | @ of headers can be seen on the <a href="setup_skin">skins page</a>. |
| 1615 | @ See also the <a href="setup_editcss">CSS</a> and |
| 1616 | @ <a href="setup_footer">footer</a> editing screens. |
| 1617 | @ <blockquote><pre> |
| 1618 | @ %h(builtin_text("skins/default.header")) |
| 1619 | @ </pre></blockquote> |
| 1620 | style_footer(); |
| 1621 | db_end_transaction(0); |
| 1622 | } |
| 1623 | |
| @@ -1630,20 +1630,20 @@ | |
| 1630 | login_needed(); |
| 1631 | } |
| 1632 | db_begin_transaction(); |
| 1633 | if( P("clear")!=0 ){ |
| 1634 | db_multi_exec("DELETE FROM config WHERE name='footer'"); |
| 1635 | cgi_replace_parameter("footer", builtin_text("skins/default.footer")); |
| 1636 | } |
| 1637 | |
| 1638 | style_header("Edit Page Footer"); |
| 1639 | @ <form action="%s(g.zTop)/setup_footer" method="post"><div> |
| 1640 | login_insert_csrf_secret(); |
| 1641 | @ <p>Edit HTML text with embedded TH1 (a Tcl dialect) that will be used to |
| 1642 | @ generate the end of every page.</p> |
| 1643 | textarea_attribute("", 20, 80, "footer", "footer", |
| 1644 | builtin_text("skins/default.footer"), 0); |
| 1645 | @ <br /> |
| 1646 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 1647 | @ <input type="submit" name="clear" value="Revert To Default" /> |
| 1648 | @ </div></form> |
| 1649 | @ <hr /> |
| @@ -1650,11 +1650,11 @@ | |
| 1650 | @ The default footer is shown below for reference. Other examples |
| 1651 | @ of footers can be seen on the <a href="setup_skin">skins page</a>. |
| 1652 | @ See also the <a href="setup_editcss">CSS</a> and |
| 1653 | @ <a href="setup_header">header</a> editing screens. |
| 1654 | @ <blockquote><pre> |
| 1655 | @ %h(builtin_text("skins/default.footer")) |
| 1656 | @ </pre></blockquote> |
| 1657 | style_footer(); |
| 1658 | db_end_transaction(0); |
| 1659 | } |
| 1660 | |
| 1661 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1521,26 +1521,26 @@ | |
| 1521 | login_needed(); |
| 1522 | } |
| 1523 | db_begin_transaction(); |
| 1524 | if( P("clear")!=0 ){ |
| 1525 | db_multi_exec("DELETE FROM config WHERE name='css'"); |
| 1526 | cgi_replace_parameter("css", builtin_text("skins/default/css.txt")); |
| 1527 | db_end_transaction(0); |
| 1528 | cgi_redirect("setup_editcss"); |
| 1529 | } |
| 1530 | if( P("submit")!=0 ){ |
| 1531 | textarea_attribute(0, 0, 0, "css", "css", |
| 1532 | builtin_text("skins/default/css.txt"), 0); |
| 1533 | db_end_transaction(0); |
| 1534 | cgi_redirect("setup_editcss"); |
| 1535 | } |
| 1536 | style_header("Edit CSS"); |
| 1537 | @ <form action="%s(g.zTop)/setup_editcss" method="post"><div> |
| 1538 | login_insert_csrf_secret(); |
| 1539 | @ Edit the CSS below:<br /> |
| 1540 | textarea_attribute("", 35, 80, "css", "css", |
| 1541 | builtin_text("skins/default/css.txt"), 0); |
| 1542 | @ <br /> |
| 1543 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 1544 | @ <input type="submit" name="clear" value="Revert To Default" /> |
| 1545 | @ </div></form> |
| 1546 | @ <p><span class="note">Note:</span> Press your browser Reload button after |
| @@ -1566,17 +1566,17 @@ | |
| 1566 | login_needed(); |
| 1567 | } |
| 1568 | db_begin_transaction(); |
| 1569 | if( P("clear")!=0 ){ |
| 1570 | db_multi_exec("DELETE FROM config WHERE name='header'"); |
| 1571 | cgi_replace_parameter("header", builtin_text("skins/default/header.txt")); |
| 1572 | }else if( P("submit")!=0 ){ |
| 1573 | textarea_attribute(0, 0, 0, "header", "header", |
| 1574 | builtin_text("skins/default/header.txt"), 0); |
| 1575 | }else if( P("fixbase")!=0 ){ |
| 1576 | const char *z = db_get("header", |
| 1577 | (char*)builtin_text("skins/default/header.txt")); |
| 1578 | char *zHead = strstr(z, "<head>"); |
| 1579 | if( strstr(z, "<base href=")==0 && zHead!=0 ){ |
| 1580 | char *zNew; |
| 1581 | char *zTail = &zHead[6]; |
| 1582 | while( fossil_isspace(zTail[0]) ) zTail++; |
| @@ -1602,11 +1602,11 @@ | |
| 1602 | login_insert_csrf_secret(); |
| 1603 | @ <p>Edit HTML text with embedded TH1 (a Tcl dialect) that will be used to |
| 1604 | @ generate the beginning of every page through start of the main |
| 1605 | @ menu.</p> |
| 1606 | textarea_attribute("", 35, 80, "header", "header", |
| 1607 | builtin_text("skins/default/header.txt"), 0); |
| 1608 | @ <br /> |
| 1609 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 1610 | @ <input type="submit" name="clear" value="Revert To Default" /> |
| 1611 | @ </div></form> |
| 1612 | @ <hr /> |
| @@ -1613,11 +1613,11 @@ | |
| 1613 | @ The default header is shown below for reference. Other examples |
| 1614 | @ of headers can be seen on the <a href="setup_skin">skins page</a>. |
| 1615 | @ See also the <a href="setup_editcss">CSS</a> and |
| 1616 | @ <a href="setup_footer">footer</a> editing screens. |
| 1617 | @ <blockquote><pre> |
| 1618 | @ %h(builtin_text("skins/default/header.txt")) |
| 1619 | @ </pre></blockquote> |
| 1620 | style_footer(); |
| 1621 | db_end_transaction(0); |
| 1622 | } |
| 1623 | |
| @@ -1630,20 +1630,20 @@ | |
| 1630 | login_needed(); |
| 1631 | } |
| 1632 | db_begin_transaction(); |
| 1633 | if( P("clear")!=0 ){ |
| 1634 | db_multi_exec("DELETE FROM config WHERE name='footer'"); |
| 1635 | cgi_replace_parameter("footer", builtin_text("skins/default/footer.txt")); |
| 1636 | } |
| 1637 | |
| 1638 | style_header("Edit Page Footer"); |
| 1639 | @ <form action="%s(g.zTop)/setup_footer" method="post"><div> |
| 1640 | login_insert_csrf_secret(); |
| 1641 | @ <p>Edit HTML text with embedded TH1 (a Tcl dialect) that will be used to |
| 1642 | @ generate the end of every page.</p> |
| 1643 | textarea_attribute("", 20, 80, "footer", "footer", |
| 1644 | builtin_text("skins/default/footer.txt"), 0); |
| 1645 | @ <br /> |
| 1646 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 1647 | @ <input type="submit" name="clear" value="Revert To Default" /> |
| 1648 | @ </div></form> |
| 1649 | @ <hr /> |
| @@ -1650,11 +1650,11 @@ | |
| 1650 | @ The default footer is shown below for reference. Other examples |
| 1651 | @ of footers can be seen on the <a href="setup_skin">skins page</a>. |
| 1652 | @ See also the <a href="setup_editcss">CSS</a> and |
| 1653 | @ <a href="setup_header">header</a> editing screens. |
| 1654 | @ <blockquote><pre> |
| 1655 | @ %h(builtin_text("skins/default/footer.txt")) |
| 1656 | @ </pre></blockquote> |
| 1657 | style_footer(); |
| 1658 | db_end_transaction(0); |
| 1659 | } |
| 1660 | |
| 1661 |