007d0a9b3f 2009-12-19 drh: /* 007d0a9b3f 2009-12-19 drh: ** Copyright (c) 2009 D. Richard Hipp 007d0a9b3f 2009-12-19 drh: ** 007d0a9b3f 2009-12-19 drh: ** This program is free software; you can redistribute it and/or 007d0a9b3f 2009-12-19 drh: ** modify it under the terms of the GNU General Public 007d0a9b3f 2009-12-19 drh: ** License as published by the Free Software Foundation; either 007d0a9b3f 2009-12-19 drh: ** version 2 of the License, or (at your option) any later version. 007d0a9b3f 2009-12-19 drh: ** 007d0a9b3f 2009-12-19 drh: ** This program is distributed in the hope that it will be useful, 007d0a9b3f 2009-12-19 drh: ** but WITHOUT ANY WARRANTY; without even the implied warranty of 007d0a9b3f 2009-12-19 drh: ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 007d0a9b3f 2009-12-19 drh: ** General Public License for more details. 007d0a9b3f 2009-12-19 drh: ** 007d0a9b3f 2009-12-19 drh: ** You should have received a copy of the GNU General Public 007d0a9b3f 2009-12-19 drh: ** License along with this library; if not, write to the 007d0a9b3f 2009-12-19 drh: ** Free Software Foundation, Inc., 59 Temple Place - Suite 330, 007d0a9b3f 2009-12-19 drh: ** Boston, MA 02111-1307, USA. 007d0a9b3f 2009-12-19 drh: ** 007d0a9b3f 2009-12-19 drh: ** Author contact information: 007d0a9b3f 2009-12-19 drh: ** drh@hwaci.com 007d0a9b3f 2009-12-19 drh: ** http://www.hwaci.com/drh/ 007d0a9b3f 2009-12-19 drh: ** 007d0a9b3f 2009-12-19 drh: ******************************************************************************* 007d0a9b3f 2009-12-19 drh: ** 007d0a9b3f 2009-12-19 drh: ** Implementation of the Setup page for "skins". 007d0a9b3f 2009-12-19 drh: */ 007d0a9b3f 2009-12-19 drh: #include <assert.h> 007d0a9b3f 2009-12-19 drh: #include "config.h" 007d0a9b3f 2009-12-19 drh: #include "skins.h" 007d0a9b3f 2009-12-19 drh: 4f24addea9 2009-12-20 drh: /* @-comment: // */ 007d0a9b3f 2009-12-19 drh: /* 007d0a9b3f 2009-12-19 drh: ** A black-and-white theme with the project title in a bar across the top 007d0a9b3f 2009-12-19 drh: ** and no logo image. 007d0a9b3f 2009-12-19 drh: */ 007d0a9b3f 2009-12-19 drh: static const char zBuiltinSkin1[] = 007d0a9b3f 2009-12-19 drh: @ REPLACE INTO config VALUES('css','/* General settings for the entire page */ 007d0a9b3f 2009-12-19 drh: @ body { 007d0a9b3f 2009-12-19 drh: @ margin: 0ex 1ex; 007d0a9b3f 2009-12-19 drh: @ padding: 0px; 007d0a9b3f 2009-12-19 drh: @ background-color: white; 007d0a9b3f 2009-12-19 drh: @ font-family: "sans serif"; 007d0a9b3f 2009-12-19 drh: @ } 007d0a9b3f 2009-12-19 drh: @ 007d0a9b3f 2009-12-19 drh: @ /* The project logo in the upper left-hand corner of each page */ 007d0a9b3f 2009-12-19 drh: @ div.logo { 007d0a9b3f 2009-12-19 drh: @ display: table-row; 007d0a9b3f 2009-12-19 drh: @ text-align: center; 007d0a9b3f 2009-12-19 drh: @ /* vertical-align: bottom;*/ 007d0a9b3f 2009-12-19 drh: @ font-size: 2em; 007d0a9b3f 2009-12-19 drh: @ font-weight: bold; 007d0a9b3f 2009-12-19 drh: @ background-color: #707070; 007d0a9b3f 2009-12-19 drh: @ color: #ffffff; 007d0a9b3f 2009-12-19 drh: @ } 007d0a9b3f 2009-12-19 drh: @ 007d0a9b3f 2009-12-19 drh: @ /* The page title centered at the top of each page */ 007d0a9b3f 2009-12-19 drh: @ div.title { 007d0a9b3f 2009-12-19 drh: @ display: table-cell; 007d0a9b3f 2009-12-19 drh: @ font-size: 1.5em; 007d0a9b3f 2009-12-19 drh: @ font-weight: bold; 007d0a9b3f 2009-12-19 drh: @ text-align: left; 007d0a9b3f 2009-12-19 drh: @ padding: 0 0 0 10px; 007d0a9b3f 2009-12-19 drh: @ color: #404040; 007d0a9b3f 2009-12-19 drh: @ vertical-align: bottom; 007d0a9b3f 2009-12-19 drh: @ width: 100%; 007d0a9b3f 2009-12-19 drh: @ } 007d0a9b3f 2009-12-19 drh: @ 007d0a9b3f 2009-12-19 drh: @ /* The login status message in the top right-hand corner */ 007d0a9b3f 2009-12-19 drh: @ div.status { 007d0a9b3f 2009-12-19 drh: @ display: table-cell; 007d0a9b3f 2009-12-19 drh: @ text-align: right; 007d0a9b3f 2009-12-19 drh: @ vertical-align: bottom; 007d0a9b3f 2009-12-19 drh: @ color: #404040; 007d0a9b3f 2009-12-19 drh: @ font-size: 0.8em; 007d0a9b3f 2009-12-19 drh: @ font-weight: bold; 007d0a9b3f 2009-12-19 drh: @ } 007d0a9b3f 2009-12-19 drh: @ 007d0a9b3f 2009-12-19 drh: @ /* The header across the top of the page */ 007d0a9b3f 2009-12-19 drh: @ div.header { 007d0a9b3f 2009-12-19 drh: @ display: table; 007d0a9b3f 2009-12-19 drh: @ width: 100%; 007d0a9b3f 2009-12-19 drh: @ } 007d0a9b3f 2009-12-19 drh: @ 007d0a9b3f 2009-12-19 drh: @ /* The main menu bar that appears at the top of the page beneath 007d0a9b3f 2009-12-19 drh: @ ** the header */ 007d0a9b3f 2009-12-19 drh: @ div.mainmenu { 007d0a9b3f 2009-12-19 drh: @ padding: 5px 10px 5px 10px; 007d0a9b3f 2009-12-19 drh: @ font-size: 0.9em; 007d0a9b3f 2009-12-19 drh: @ font-weight: bold; 007d0a9b3f 2009-12-19 drh: @ text-align: center; 007d0a9b3f 2009-12-19 drh: @ letter-spacing: 1px; 007d0a9b3f 2009-12-19 drh: @ background-color: #404040; 007d0a9b3f 2009-12-19 drh: @ color: white; 007d0a9b3f 2009-12-19 drh: @ } 007d0a9b3f 2009-12-19 drh: @ 007d0a9b3f 2009-12-19 drh: @ /* The submenu bar that *sometimes* appears below the main menu */ 007d0a9b3f 2009-12-19 drh: @ div.submenu { 007d0a9b3f 2009-12-19 drh: @ padding: 3px 10px 3px 0px; 007d0a9b3f 2009-12-19 drh: @ font-size: 0.9em; 007d0a9b3f 2009-12-19 drh: @ text-align: center; 007d0a9b3f 2009-12-19 drh: @ background-color: #606060; 007d0a9b3f 2009-12-19 drh: @ color: white; 007d0a9b3f 2009-12-19 drh: @ } 007d0a9b3f 2009-12-19 drh: @ div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited { 007d0a9b3f 2009-12-19 drh: @ padding: 3px 10px 3px 10px; 007d0a9b3f 2009-12-19 drh: @ color: white; 007d0a9b3f 2009-12-19 drh: @ text-decoration: none; 007d0a9b3f 2009-12-19 drh: @ } 007d0a9b3f 2009-12-19 drh: @ div.mainmenu a:hover, div.submenu a:hover { 007d0a9b3f 2009-12-19 drh: @ color: #404040; 007d0a9b3f 2009-12-19 drh: @ background-color: white; 007d0a9b3f 2009-12-19 drh: @ } 007d0a9b3f 2009-12-19 drh: @ 007d0a9b3f 2009-12-19 drh: @ /* All page content from the bottom of the menu or submenu down to 007d0a9b3f 2009-12-19 drh: @ ** the footer */ 007d0a9b3f 2009-12-19 drh: @ div.content { 007d0a9b3f 2009-12-19 drh: @ padding: 0ex 0ex 0ex 0ex; 007d0a9b3f 2009-12-19 drh: @ } 007d0a9b3f 2009-12-19 drh: @ /* Hyperlink colors */ 007d0a9b3f 2009-12-19 drh: @ div.content a { color: #604000; } 007d0a9b3f 2009-12-19 drh: @ div.content a:link { color: #604000;} 007d0a9b3f 2009-12-19 drh: @ div.content a:visited { color: #600000; } 007d0a9b3f 2009-12-19 drh: @ 007d0a9b3f 2009-12-19 drh: @ /* Some pages have section dividers */ 007d0a9b3f 2009-12-19 drh: @ div.section { 007d0a9b3f 2009-12-19 drh: @ margin-bottom: 0px; 007d0a9b3f 2009-12-19 drh: @ margin-top: 1em; 007d0a9b3f 2009-12-19 drh: @ padding: 1px 1px 1px 1px; 007d0a9b3f 2009-12-19 drh: @ font-size: 1.2em; 007d0a9b3f 2009-12-19 drh: @ font-weight: bold; 007d0a9b3f 2009-12-19 drh: @ background-color: #404040; 007d0a9b3f 2009-12-19 drh: @ color: white; 007d0a9b3f 2009-12-19 drh: @ } 007d0a9b3f 2009-12-19 drh: @ 007d0a9b3f 2009-12-19 drh: @ /* The "Date" that occurs on the left hand side of timelines */ 007d0a9b3f 2009-12-19 drh: @ div.divider { 007d0a9b3f 2009-12-19 drh: @ background: #a0a0a0; 007d0a9b3f 2009-12-19 drh: @ border: 2px #505050 solid; 007d0a9b3f 2009-12-19 drh: @ font-size: 1em; font-weight: normal; 007d0a9b3f 2009-12-19 drh: @ padding: .25em; 007d0a9b3f 2009-12-19 drh: @ margin: .2em 0 .2em 0; 007d0a9b3f 2009-12-19 drh: @ float: left; 007d0a9b3f 2009-12-19 drh: @ clear: left; 007d0a9b3f 2009-12-19 drh: @ } 007d0a9b3f 2009-12-19 drh: @ 007d0a9b3f 2009-12-19 drh: @ /* The footer at the very bottom of the page */ 007d0a9b3f 2009-12-19 drh: @ div.footer { 007d0a9b3f 2009-12-19 drh: @ font-size: 0.8em; 007d0a9b3f 2009-12-19 drh: @ margin-top: 12px; 007d0a9b3f 2009-12-19 drh: @ padding: 5px 10px 5px 10px; 007d0a9b3f 2009-12-19 drh: @ text-align: right; 007d0a9b3f 2009-12-19 drh: @ background-color: #404040; 007d0a9b3f 2009-12-19 drh: @ color: white; 007d0a9b3f 2009-12-19 drh: @ } 007d0a9b3f 2009-12-19 drh: @ 007d0a9b3f 2009-12-19 drh: @ /* The label/value pairs on (for example) the vinfo page */ 007d0a9b3f 2009-12-19 drh: @ table.label-value th { 007d0a9b3f 2009-12-19 drh: @ vertical-align: top; 007d0a9b3f 2009-12-19 drh: @ text-align: right; 007d0a9b3f 2009-12-19 drh: @ padding: 0.2ex 2ex; 007d0a9b3f 2009-12-19 drh: @ }'); 007d0a9b3f 2009-12-19 drh: @ REPLACE INTO config VALUES('header','<html> 007d0a9b3f 2009-12-19 drh: @ <head> 007d0a9b3f 2009-12-19 drh: @ <title>$<project_name>: $<title></title> 007d0a9b3f 2009-12-19 drh: @ <link rel="alternate" type="application/rss+xml" title="RSS Feed" 007d0a9b3f 2009-12-19 drh: @ href="$baseurl/timeline.rss"> 007d0a9b3f 2009-12-19 drh: @ <link rel="stylesheet" href="$baseurl/style.css" type="text/css" 007d0a9b3f 2009-12-19 drh: @ media="screen"> 007d0a9b3f 2009-12-19 drh: @ </head> 007d0a9b3f 2009-12-19 drh: @ <body> 007d0a9b3f 2009-12-19 drh: @ <div class="header"> 007d0a9b3f 2009-12-19 drh: @ <div class="logo"> 007d0a9b3f 2009-12-19 drh: @ <nobr>$<project_name></nobr> 007d0a9b3f 2009-12-19 drh: @ </div> 007d0a9b3f 2009-12-19 drh: @ </div> 007d0a9b3f 2009-12-19 drh: @ <div class="header"> 007d0a9b3f 2009-12-19 drh: @ <div class="title">$<title></div> 007d0a9b3f 2009-12-19 drh: @ <div class="status"><nobr><th1> 007d0a9b3f 2009-12-19 drh: @ if {[info exists login]} { 007d0a9b3f 2009-12-19 drh: @ puts "Logged in as $login" 007d0a9b3f 2009-12-19 drh: @ } else { 007d0a9b3f 2009-12-19 drh: @ puts "Not logged in" 007d0a9b3f 2009-12-19 drh: @ } 007d0a9b3f 2009-12-19 drh: @ </th1></nobr></div> 007d0a9b3f 2009-12-19 drh: @ </div> 007d0a9b3f 2009-12-19 drh: @ <div class="mainmenu"><th1> 007d0a9b3f 2009-12-19 drh: @ html "<a href=''$baseurl$index_page''>Home</a> " 007d0a9b3f 2009-12-19 drh: @ if {[hascap h]} { 007d0a9b3f 2009-12-19 drh: @ html "<a href=''$baseurl/dir''>Files</a> " 007d0a9b3f 2009-12-19 drh: @ } 007d0a9b3f 2009-12-19 drh: @ if {[hascap o]} { 007d0a9b3f 2009-12-19 drh: @ html "<a href=''$baseurl/leaves''>Leaves</a> " 007d0a9b3f 2009-12-19 drh: @ html "<a href=''$baseurl/timeline''>Timeline</a> " 007d0a9b3f 2009-12-19 drh: @ html "<a href=''$baseurl/brlist''>Branches</a> " 007d0a9b3f 2009-12-19 drh: @ html "<a href=''$baseurl/taglist''>Tags</a> " 007d0a9b3f 2009-12-19 drh: @ } 007d0a9b3f 2009-12-19 drh: @ if {[hascap r]} { 007d0a9b3f 2009-12-19 drh: @ html "<a href=''$baseurl/reportlist''>Tickets</a> " 007d0a9b3f 2009-12-19 drh: @ } 007d0a9b3f 2009-12-19 drh: @ if {[hascap j]} { 007d0a9b3f 2009-12-19 drh: @ html "<a href=''$baseurl/wiki''>Wiki</a> " 007d0a9b3f 2009-12-19 drh: @ } 007d0a9b3f 2009-12-19 drh: @ if {[hascap s]} { 007d0a9b3f 2009-12-19 drh: @ html "<a href=''$baseurl/setup''>Admin</a> " 007d0a9b3f 2009-12-19 drh: @ } elseif {[hascap a]} { 007d0a9b3f 2009-12-19 drh: @ html "<a href=''$baseurl/setup_ulist''>Users</a> " 007d0a9b3f 2009-12-19 drh: @ } 007d0a9b3f 2009-12-19 drh: @ if {[info exists login]} { 007d0a9b3f 2009-12-19 drh: @ html "<a href=''$baseurl/login''>Logout</a> " 007d0a9b3f 2009-12-19 drh: @ } else { 007d0a9b3f 2009-12-19 drh: @ html "<a href=''$baseurl/login''>Login</a> " 007d0a9b3f 2009-12-19 drh: @ } 007d0a9b3f 2009-12-19 drh: @ </th1></div> 007d0a9b3f 2009-12-19 drh: @ '); 007d0a9b3f 2009-12-19 drh: @ REPLACE INTO config VALUES('footer','<div class="footer"> 007d0a9b3f 2009-12-19 drh: @ Fossil version $manifest_version $manifest_date 007d0a9b3f 2009-12-19 drh: @ </div> 007d0a9b3f 2009-12-19 drh: @ </body></html> 007d0a9b3f 2009-12-19 drh: @ '); 007d0a9b3f 2009-12-19 drh: ; 007d0a9b3f 2009-12-19 drh: 007d0a9b3f 2009-12-19 drh: /* 91b9081425 2009-12-20 drh: ** A tan theme with the project title above the user identification 91b9081425 2009-12-20 drh: ** and no logo image. 91b9081425 2009-12-20 drh: */ 91b9081425 2009-12-20 drh: static const char zBuiltinSkin2[] = 91b9081425 2009-12-20 drh: @ REPLACE INTO config VALUES('css','/* General settings for the entire page */ 91b9081425 2009-12-20 drh: @ body { 91b9081425 2009-12-20 drh: @ margin: 0ex 0ex; 91b9081425 2009-12-20 drh: @ padding: 0px; 91b9081425 2009-12-20 drh: @ background-color: #fef3bc; 91b9081425 2009-12-20 drh: @ font-family: sans-serif; 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ 91b9081425 2009-12-20 drh: @ /* The project logo in the upper left-hand corner of each page */ 91b9081425 2009-12-20 drh: @ div.logo { 91b9081425 2009-12-20 drh: @ display: inline; 91b9081425 2009-12-20 drh: @ text-align: center; 91b9081425 2009-12-20 drh: @ vertical-align: bottom; 91b9081425 2009-12-20 drh: @ font-weight: bold; 91b9081425 2009-12-20 drh: @ font-size: 2.5em; 91b9081425 2009-12-20 drh: @ color: #a09048; 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ 91b9081425 2009-12-20 drh: @ /* The page title centered at the top of each page */ 91b9081425 2009-12-20 drh: @ div.title { 91b9081425 2009-12-20 drh: @ display: table-cell; 91b9081425 2009-12-20 drh: @ font-size: 2em; 91b9081425 2009-12-20 drh: @ font-weight: bold; 91b9081425 2009-12-20 drh: @ text-align: left; 91b9081425 2009-12-20 drh: @ padding: 0 0 0 5px; 91b9081425 2009-12-20 drh: @ color: #a09048; 91b9081425 2009-12-20 drh: @ vertical-align: bottom; 91b9081425 2009-12-20 drh: @ width: 100%; 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ 91b9081425 2009-12-20 drh: @ /* The login status message in the top right-hand corner */ 91b9081425 2009-12-20 drh: @ div.status { 91b9081425 2009-12-20 drh: @ display: table-cell; 91b9081425 2009-12-20 drh: @ text-align: right; 91b9081425 2009-12-20 drh: @ vertical-align: bottom; 91b9081425 2009-12-20 drh: @ color: #a09048; 91b9081425 2009-12-20 drh: @ padding: 5px 5px 0 0; 91b9081425 2009-12-20 drh: @ font-size: 0.8em; 91b9081425 2009-12-20 drh: @ font-weight: bold; 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ 91b9081425 2009-12-20 drh: @ /* The header across the top of the page */ 91b9081425 2009-12-20 drh: @ div.header { 91b9081425 2009-12-20 drh: @ display: table; 91b9081425 2009-12-20 drh: @ width: 100%; 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ 91b9081425 2009-12-20 drh: @ /* The main menu bar that appears at the top of the page beneath 91b9081425 2009-12-20 drh: @ ** the header */ 91b9081425 2009-12-20 drh: @ div.mainmenu { 91b9081425 2009-12-20 drh: @ padding: 5px 10px 5px 10px; 91b9081425 2009-12-20 drh: @ font-size: 0.9em; 91b9081425 2009-12-20 drh: @ font-weight: bold; 91b9081425 2009-12-20 drh: @ text-align: center; 91b9081425 2009-12-20 drh: @ letter-spacing: 1px; 91b9081425 2009-12-20 drh: @ background-color: #a09048; 91b9081425 2009-12-20 drh: @ color: black; 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ 91b9081425 2009-12-20 drh: @ /* The submenu bar that *sometimes* appears below the main menu */ 91b9081425 2009-12-20 drh: @ div.submenu { 91b9081425 2009-12-20 drh: @ padding: 3px 10px 3px 0px; 91b9081425 2009-12-20 drh: @ font-size: 0.9em; 91b9081425 2009-12-20 drh: @ text-align: center; 91b9081425 2009-12-20 drh: @ background-color: #c0af58; 91b9081425 2009-12-20 drh: @ color: white; 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited { 91b9081425 2009-12-20 drh: @ padding: 3px 10px 3px 10px; 91b9081425 2009-12-20 drh: @ color: white; 91b9081425 2009-12-20 drh: @ text-decoration: none; 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ div.mainmenu a:hover, div.submenu a:hover { 91b9081425 2009-12-20 drh: @ color: #a09048; 91b9081425 2009-12-20 drh: @ background-color: white; 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ 91b9081425 2009-12-20 drh: @ /* All page content from the bottom of the menu or submenu down to 91b9081425 2009-12-20 drh: @ ** the footer */ 91b9081425 2009-12-20 drh: @ div.content { 91b9081425 2009-12-20 drh: @ padding: 1ex 5px; 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ div.content a { color: #706532; } 91b9081425 2009-12-20 drh: @ div.content a:link { color: #706532; } 91b9081425 2009-12-20 drh: @ div.content a:visited { color: #704032; } 91b9081425 2009-12-20 drh: @ div.content a:hover { background-color: white; color: #706532; } 91b9081425 2009-12-20 drh: @ 91b9081425 2009-12-20 drh: @ /* Some pages have section dividers */ 91b9081425 2009-12-20 drh: @ div.section { 91b9081425 2009-12-20 drh: @ margin-bottom: 0px; 91b9081425 2009-12-20 drh: @ margin-top: 1em; 91b9081425 2009-12-20 drh: @ padding: 3px 3px 0 3px; 91b9081425 2009-12-20 drh: @ font-size: 1.2em; 91b9081425 2009-12-20 drh: @ font-weight: bold; 91b9081425 2009-12-20 drh: @ background-color: #a09048; 91b9081425 2009-12-20 drh: @ color: white; 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ 91b9081425 2009-12-20 drh: @ /* The "Date" that occurs on the left hand side of timelines */ 91b9081425 2009-12-20 drh: @ div.divider { 91b9081425 2009-12-20 drh: @ background: #e1d498; 91b9081425 2009-12-20 drh: @ border: 2px #a09048 solid; 91b9081425 2009-12-20 drh: @ font-size: 1em; font-weight: normal; 91b9081425 2009-12-20 drh: @ padding: .25em; 91b9081425 2009-12-20 drh: @ margin: .2em 0 .2em 0; 91b9081425 2009-12-20 drh: @ float: left; 91b9081425 2009-12-20 drh: @ clear: left; 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ 91b9081425 2009-12-20 drh: @ /* The footer at the very bottom of the page */ 91b9081425 2009-12-20 drh: @ div.footer { 91b9081425 2009-12-20 drh: @ font-size: 0.8em; 91b9081425 2009-12-20 drh: @ margin-top: 12px; 91b9081425 2009-12-20 drh: @ padding: 5px 10px 5px 10px; 91b9081425 2009-12-20 drh: @ text-align: right; 91b9081425 2009-12-20 drh: @ background-color: #a09048; 91b9081425 2009-12-20 drh: @ color: white; 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ 91b9081425 2009-12-20 drh: @ /* Hyperlink colors */ 91b9081425 2009-12-20 drh: @ div.footer a { color: white; } 91b9081425 2009-12-20 drh: @ div.footer a:link { color: white; } 91b9081425 2009-12-20 drh: @ div.footer a:visited { color: white; } 91b9081425 2009-12-20 drh: @ div.footer a:hover { background-color: white; color: #558195; } 91b9081425 2009-12-20 drh: @ 91b9081425 2009-12-20 drh: @ /* <verbatim> blocks */ 91b9081425 2009-12-20 drh: @ pre.verbatim { 91b9081425 2009-12-20 drh: @ background-color: #f5f5f5; 91b9081425 2009-12-20 drh: @ padding: 0.5em; 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ 91b9081425 2009-12-20 drh: @ /* The label/value pairs on (for example) the ci page */ 91b9081425 2009-12-20 drh: @ table.label-value th { 91b9081425 2009-12-20 drh: @ vertical-align: top; 91b9081425 2009-12-20 drh: @ text-align: right; 91b9081425 2009-12-20 drh: @ padding: 0.2ex 2ex; 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ '); 91b9081425 2009-12-20 drh: @ REPLACE INTO config VALUES('header','<html> 91b9081425 2009-12-20 drh: @ <head> 91b9081425 2009-12-20 drh: @ <title>$<project_name>: $<title></title> 91b9081425 2009-12-20 drh: @ <link rel="alternate" type="application/rss+xml" title="RSS Feed" 91b9081425 2009-12-20 drh: @ href="$baseurl/timeline.rss"> 91b9081425 2009-12-20 drh: @ <link rel="stylesheet" href="$baseurl/style.css" type="text/css" 91b9081425 2009-12-20 drh: @ media="screen"> 91b9081425 2009-12-20 drh: @ </head> 91b9081425 2009-12-20 drh: @ <body> 91b9081425 2009-12-20 drh: @ <div class="header"> 91b9081425 2009-12-20 drh: @ <div class="title">$<title></div> 91b9081425 2009-12-20 drh: @ <div class="status"> 5a5d7e1f90 2009-12-20 drh: @ <div class="logo"><nobr>$<project_name></nobr></div><br/> 91b9081425 2009-12-20 drh: @ <nobr><th1> 91b9081425 2009-12-20 drh: @ if {[info exists login]} { 91b9081425 2009-12-20 drh: @ puts "Logged in as $login" 91b9081425 2009-12-20 drh: @ } else { 91b9081425 2009-12-20 drh: @ puts "Not logged in" 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ </th1></nobr></div> 91b9081425 2009-12-20 drh: @ </div> 91b9081425 2009-12-20 drh: @ <div class="mainmenu"><th1> 91b9081425 2009-12-20 drh: @ html "<a href=''$baseurl$index_page''>Home</a> " 91b9081425 2009-12-20 drh: @ if {[hascap h]} { 91b9081425 2009-12-20 drh: @ html "<a href=''$baseurl/dir''>Files</a> " 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ if {[hascap o]} { 91b9081425 2009-12-20 drh: @ html "<a href=''$baseurl/leaves''>Leaves</a> " 91b9081425 2009-12-20 drh: @ html "<a href=''$baseurl/timeline''>Timeline</a> " 91b9081425 2009-12-20 drh: @ html "<a href=''$baseurl/brlist''>Branches</a> " 91b9081425 2009-12-20 drh: @ html "<a href=''$baseurl/taglist''>Tags</a> " 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ if {[hascap r]} { 91b9081425 2009-12-20 drh: @ html "<a href=''$baseurl/reportlist''>Tickets</a> " 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ if {[hascap j]} { 91b9081425 2009-12-20 drh: @ html "<a href=''$baseurl/wiki''>Wiki</a> " 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ if {[hascap s]} { 91b9081425 2009-12-20 drh: @ html "<a href=''$baseurl/setup''>Admin</a> " 91b9081425 2009-12-20 drh: @ } elseif {[hascap a]} { 91b9081425 2009-12-20 drh: @ html "<a href=''$baseurl/setup_ulist''>Users</a> " 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ if {[info exists login]} { 91b9081425 2009-12-20 drh: @ html "<a href=''$baseurl/login''>Logout</a> " 91b9081425 2009-12-20 drh: @ } else { 91b9081425 2009-12-20 drh: @ html "<a href=''$baseurl/login''>Login</a> " 91b9081425 2009-12-20 drh: @ } 91b9081425 2009-12-20 drh: @ </th1></div> 91b9081425 2009-12-20 drh: @ '); 91b9081425 2009-12-20 drh: @ REPLACE INTO config VALUES('footer','<div class="footer"> 91b9081425 2009-12-20 drh: @ Fossil version $manifest_version $manifest_date 91b9081425 2009-12-20 drh: @ </div> 91b9081425 2009-12-20 drh: @ </body></html> 91b9081425 2009-12-20 drh: @ '); 91b9081425 2009-12-20 drh: ; 91b9081425 2009-12-20 drh: 91b9081425 2009-12-20 drh: /* 5a5d7e1f90 2009-12-20 drh: ** Black letters on a white or cream background with the main menu 5a5d7e1f90 2009-12-20 drh: ** stuck on the left-hand side. 5a5d7e1f90 2009-12-20 drh: */ 5a5d7e1f90 2009-12-20 drh: static const char zBuiltinSkin3[] = 5a5d7e1f90 2009-12-20 drh: @ REPLACE INTO config VALUES('css','/* General settings for the entire page */ 5a5d7e1f90 2009-12-20 drh: @ body { 5a5d7e1f90 2009-12-20 drh: @ margin:0px 0px 0px 0px; 5a5d7e1f90 2009-12-20 drh: @ padding:0px; 5a5d7e1f90 2009-12-20 drh: @ font-family:verdana, arial, helvetica, "sans serif"; 5a5d7e1f90 2009-12-20 drh: @ color:#333; 5a5d7e1f90 2009-12-20 drh: @ background-color:white; 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ 5a5d7e1f90 2009-12-20 drh: @ /* consistent colours */ 5a5d7e1f90 2009-12-20 drh: @ h2 { 5a5d7e1f90 2009-12-20 drh: @ color: #333; 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ h3 { 5a5d7e1f90 2009-12-20 drh: @ color: #333; 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ 5a5d7e1f90 2009-12-20 drh: @ /* The project logo in the upper left-hand corner of each page */ 5a5d7e1f90 2009-12-20 drh: @ div.logo { 5a5d7e1f90 2009-12-20 drh: @ display: table-cell; 5a5d7e1f90 2009-12-20 drh: @ text-align: left; 5a5d7e1f90 2009-12-20 drh: @ vertical-align: bottom; 5a5d7e1f90 2009-12-20 drh: @ font-weight: bold; 5a5d7e1f90 2009-12-20 drh: @ color: #333; 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ 5a5d7e1f90 2009-12-20 drh: @ /* The page title centered at the top of each page */ 5a5d7e1f90 2009-12-20 drh: @ div.title { 5a5d7e1f90 2009-12-20 drh: @ display: table-cell; 5a5d7e1f90 2009-12-20 drh: @ font-size: 2em; 5a5d7e1f90 2009-12-20 drh: @ font-weight: bold; 5a5d7e1f90 2009-12-20 drh: @ text-align: center; 5a5d7e1f90 2009-12-20 drh: @ color: #333; 5a5d7e1f90 2009-12-20 drh: @ vertical-align: bottom; 5a5d7e1f90 2009-12-20 drh: @ width: 100%; 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ 5a5d7e1f90 2009-12-20 drh: @ /* The login status message in the top right-hand corner */ 5a5d7e1f90 2009-12-20 drh: @ div.status { 5a5d7e1f90 2009-12-20 drh: @ display: table-cell; 5a5d7e1f90 2009-12-20 drh: @ padding-right: 10px; 5a5d7e1f90 2009-12-20 drh: @ text-align: right; 5a5d7e1f90 2009-12-20 drh: @ vertical-align: bottom; 5a5d7e1f90 2009-12-20 drh: @ padding-bottom: 5px; 5a5d7e1f90 2009-12-20 drh: @ color: #333; 5a5d7e1f90 2009-12-20 drh: @ font-size: 0.8em; 5a5d7e1f90 2009-12-20 drh: @ font-weight: bold; 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ 5a5d7e1f90 2009-12-20 drh: @ /* The header across the top of the page */ 5a5d7e1f90 2009-12-20 drh: @ div.header { 5a5d7e1f90 2009-12-20 drh: @ margin:10px 0px 10px 0px; 5a5d7e1f90 2009-12-20 drh: @ padding:1px 0px 0px 20px; 5a5d7e1f90 2009-12-20 drh: @ border-style:solid; 5a5d7e1f90 2009-12-20 drh: @ border-color:black; 5a5d7e1f90 2009-12-20 drh: @ border-width:1px 0px; 5a5d7e1f90 2009-12-20 drh: @ background-color:#eee; 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ 5a5d7e1f90 2009-12-20 drh: @ /* The main menu bar that appears at the top left of the page beneath 5a5d7e1f90 2009-12-20 drh: @ ** the header. Width must be co-ordinated with the container below */ 5a5d7e1f90 2009-12-20 drh: @ div.mainmenu { 5a5d7e1f90 2009-12-20 drh: @ float: left; 5a5d7e1f90 2009-12-20 drh: @ margin-left: 10px; 5a5d7e1f90 2009-12-20 drh: @ margin-right: 10px; 5a5d7e1f90 2009-12-20 drh: @ font-size: 0.9em; 5a5d7e1f90 2009-12-20 drh: @ font-weight: bold; 5a5d7e1f90 2009-12-20 drh: @ padding:5px; 5a5d7e1f90 2009-12-20 drh: @ background-color:#eee; 5a5d7e1f90 2009-12-20 drh: @ border:1px solid #999; 5a5d7e1f90 2009-12-20 drh: @ width:8em; 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ 5a5d7e1f90 2009-12-20 drh: @ /* Main menu is now a list */ 5a5d7e1f90 2009-12-20 drh: @ div.mainmenu ul { 5a5d7e1f90 2009-12-20 drh: @ padding: 0; 5a5d7e1f90 2009-12-20 drh: @ list-style:none; 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ div.mainmenu a, div.mainmenu a:visited{ 5a5d7e1f90 2009-12-20 drh: @ padding: 1px 10px 1px 10px; 5a5d7e1f90 2009-12-20 drh: @ color: #333; 5a5d7e1f90 2009-12-20 drh: @ text-decoration: none; 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ div.mainmenu a:hover { 5a5d7e1f90 2009-12-20 drh: @ color: #eee; 5a5d7e1f90 2009-12-20 drh: @ background-color: #333; 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ 5a5d7e1f90 2009-12-20 drh: @ /* Container for the sub-menu and content so they don''t spread 5a5d7e1f90 2009-12-20 drh: @ ** out underneath the main menu */ 5a5d7e1f90 2009-12-20 drh: @ #container { 5a5d7e1f90 2009-12-20 drh: @ padding-left: 9em; 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ 5a5d7e1f90 2009-12-20 drh: @ /* The submenu bar that *sometimes* appears below the main menu */ 5a5d7e1f90 2009-12-20 drh: @ div.submenu { 5a5d7e1f90 2009-12-20 drh: @ padding: 3px 10px 3px 10px; 5a5d7e1f90 2009-12-20 drh: @ font-size: 0.9em; 5a5d7e1f90 2009-12-20 drh: @ text-align: center; 5a5d7e1f90 2009-12-20 drh: @ border:1px solid #999; 5a5d7e1f90 2009-12-20 drh: @ border-width:1px 0px; 5a5d7e1f90 2009-12-20 drh: @ background-color: #eee; 5a5d7e1f90 2009-12-20 drh: @ color: #333; 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ div.submenu a, div.submenu a:visited { 5a5d7e1f90 2009-12-20 drh: @ padding: 3px 10px 3px 10px; 5a5d7e1f90 2009-12-20 drh: @ color: #333; 5a5d7e1f90 2009-12-20 drh: @ text-decoration: none; 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ div.submenu a:hover { 5a5d7e1f90 2009-12-20 drh: @ color: #eee; 5a5d7e1f90 2009-12-20 drh: @ background-color: #333; 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ 5a5d7e1f90 2009-12-20 drh: @ /* All page content from the bottom of the menu or submenu down to 5a5d7e1f90 2009-12-20 drh: @ ** the footer */ 5a5d7e1f90 2009-12-20 drh: @ div.content { 5a5d7e1f90 2009-12-20 drh: @ float right; 5a5d7e1f90 2009-12-20 drh: @ padding: 2ex 1ex 0ex 2ex; 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ 5a5d7e1f90 2009-12-20 drh: @ /* Some pages have section dividers */ 5a5d7e1f90 2009-12-20 drh: @ div.section { 5a5d7e1f90 2009-12-20 drh: @ margin-bottom: 0px; 5a5d7e1f90 2009-12-20 drh: @ margin-top: 1em; 5a5d7e1f90 2009-12-20 drh: @ padding: 1px 1px 1px 1px; 5a5d7e1f90 2009-12-20 drh: @ font-size: 1.2em; 5a5d7e1f90 2009-12-20 drh: @ font-weight: bold; 5a5d7e1f90 2009-12-20 drh: @ border-style:solid; 5a5d7e1f90 2009-12-20 drh: @ border-color:#999; 5a5d7e1f90 2009-12-20 drh: @ border-width:1px 0px; 5a5d7e1f90 2009-12-20 drh: @ background-color: #eee; 5a5d7e1f90 2009-12-20 drh: @ color: #333; 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ 5a5d7e1f90 2009-12-20 drh: @ /* The "Date" that occurs on the left hand side of timelines */ 5a5d7e1f90 2009-12-20 drh: @ div.divider { 5a5d7e1f90 2009-12-20 drh: @ background: #eee; 5a5d7e1f90 2009-12-20 drh: @ border: 2px #999 solid; 5a5d7e1f90 2009-12-20 drh: @ font-size: 1em; font-weight: normal; 5a5d7e1f90 2009-12-20 drh: @ padding: .25em; 5a5d7e1f90 2009-12-20 drh: @ margin: .2em 0 .2em 0; 5a5d7e1f90 2009-12-20 drh: @ float: left; 5a5d7e1f90 2009-12-20 drh: @ clear: left; 5a5d7e1f90 2009-12-20 drh: @ color: #333 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ 5a5d7e1f90 2009-12-20 drh: @ /* The footer at the very bottom of the page */ 5a5d7e1f90 2009-12-20 drh: @ div.footer { 5a5d7e1f90 2009-12-20 drh: @ font-size: 0.8em; 5a5d7e1f90 2009-12-20 drh: @ margin-top: 12px; 5a5d7e1f90 2009-12-20 drh: @ padding: 5px 10px 5px 10px; 5a5d7e1f90 2009-12-20 drh: @ text-align: right; 5a5d7e1f90 2009-12-20 drh: @ background-color: #eee; 5a5d7e1f90 2009-12-20 drh: @ color: #555; 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ 5a5d7e1f90 2009-12-20 drh: @ /* <verbatim> blocks */ 5a5d7e1f90 2009-12-20 drh: @ pre.verbatim { 5a5d7e1f90 2009-12-20 drh: @ background-color: #f5f5f5; 5a5d7e1f90 2009-12-20 drh: @ padding: 0.5em; 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ 5a5d7e1f90 2009-12-20 drh: @ /* The label/value pairs on (for example) the ci page */ 5a5d7e1f90 2009-12-20 drh: @ table.label-value th { 5a5d7e1f90 2009-12-20 drh: @ vertical-align: top; 5a5d7e1f90 2009-12-20 drh: @ text-align: right; 5a5d7e1f90 2009-12-20 drh: @ padding: 0.2ex 2ex; 5a5d7e1f90 2009-12-20 drh: @ }'); 5a5d7e1f90 2009-12-20 drh: @ REPLACE INTO config VALUES('header','<html> 5a5d7e1f90 2009-12-20 drh: @ <head> 5a5d7e1f90 2009-12-20 drh: @ <title>$<project_name>: $<title></title> 5a5d7e1f90 2009-12-20 drh: @ <link rel="alternate" type="application/rss+xml" title="RSS Feed" 5a5d7e1f90 2009-12-20 drh: @ href="$baseurl/timeline.rss"> 5a5d7e1f90 2009-12-20 drh: @ <link rel="stylesheet" href="$baseurl/style.css" type="text/css" 5a5d7e1f90 2009-12-20 drh: @ media="screen"> 5a5d7e1f90 2009-12-20 drh: @ </head> 5a5d7e1f90 2009-12-20 drh: @ <body> 5a5d7e1f90 2009-12-20 drh: @ <div class="header"> 5a5d7e1f90 2009-12-20 drh: @ <div class="logo"> 5a5d7e1f90 2009-12-20 drh: @ <!-- <img src="$baseurl/logo" alt="logo"> --> 5a5d7e1f90 2009-12-20 drh: @ <br><nobr>$<project_name></nobr> 5a5d7e1f90 2009-12-20 drh: @ </div> 5a5d7e1f90 2009-12-20 drh: @ <div class="title">$<title></div> 5a5d7e1f90 2009-12-20 drh: @ <div class="status"><nobr><th1> 5a5d7e1f90 2009-12-20 drh: @ if {[info exists login]} { 5a5d7e1f90 2009-12-20 drh: @ puts "Logged in as $login" 5a5d7e1f90 2009-12-20 drh: @ } else { 5a5d7e1f90 2009-12-20 drh: @ puts "Not logged in" 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ </th1></nobr></div> 5a5d7e1f90 2009-12-20 drh: @ </div> 5a5d7e1f90 2009-12-20 drh: @ <div class="mainmenu"><ul><th1> 5a5d7e1f90 2009-12-20 drh: @ html "<li><a href=''$baseurl$index_page''>Home</a></li>" 5a5d7e1f90 2009-12-20 drh: @ if {[hascap h]} { 5a5d7e1f90 2009-12-20 drh: @ html "<li><a href=''$baseurl/dir''>Files</a></li>" 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ if {[hascap o]} { 5a5d7e1f90 2009-12-20 drh: @ html "<li><a href=''$baseurl/leaves''>Leaves</a></li>" 5a5d7e1f90 2009-12-20 drh: @ html "<li><a href=''$baseurl/timeline''>Timeline</a></li>" 5a5d7e1f90 2009-12-20 drh: @ html "<li><a href=''$baseurl/brlist''>Branches</a></li>" 5a5d7e1f90 2009-12-20 drh: @ html "<li><a href=''$baseurl/taglist''>Tags</a></li>" 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ if {[hascap r]} { 5a5d7e1f90 2009-12-20 drh: @ html "<li><a href=''$baseurl/reportlist''>Tickets</a></li>" 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ if {[hascap j]} { 5a5d7e1f90 2009-12-20 drh: @ html "<li><a href=''$baseurl/wiki''>Wiki</a></li>" 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ if {[hascap s]} { 5a5d7e1f90 2009-12-20 drh: @ html "<li><a href=''$baseurl/setup''>Admin</a></li>" 5a5d7e1f90 2009-12-20 drh: @ } elseif {[hascap a]} { 5a5d7e1f90 2009-12-20 drh: @ html "<li><a href=''$baseurl/setup_ulist''>Users</a></li>" 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ if {[info exists login]} { 5a5d7e1f90 2009-12-20 drh: @ html "<li><a href=''$baseurl/login''>Logout</a></li>" 5a5d7e1f90 2009-12-20 drh: @ } else { 5a5d7e1f90 2009-12-20 drh: @ html "<li><a href=''$baseurl/login''>Login</a></li>" 5a5d7e1f90 2009-12-20 drh: @ } 5a5d7e1f90 2009-12-20 drh: @ </th1></ul></div> 5a5d7e1f90 2009-12-20 drh: @ <div id="container"> 5a5d7e1f90 2009-12-20 drh: @ '); 5a5d7e1f90 2009-12-20 drh: @ REPLACE INTO config VALUES('footer','</div> 5a5d7e1f90 2009-12-20 drh: @ <div class="footer"> 5a5d7e1f90 2009-12-20 drh: @ Fossil version $manifest_version $manifest_date 5a5d7e1f90 2009-12-20 drh: @ </div> 5a5d7e1f90 2009-12-20 drh: @ </body></html> 5a5d7e1f90 2009-12-20 drh: @ '); 5a5d7e1f90 2009-12-20 drh: ; 5a5d7e1f90 2009-12-20 drh: /* 007d0a9b3f 2009-12-19 drh: ** An array of available built-in skins. 007d0a9b3f 2009-12-19 drh: */ 007d0a9b3f 2009-12-19 drh: static struct BuiltinSkin { 007d0a9b3f 2009-12-19 drh: const char *zName; 007d0a9b3f 2009-12-19 drh: const char *zValue; 007d0a9b3f 2009-12-19 drh: } aBuiltinSkin[] = { 5a5d7e1f90 2009-12-20 drh: { "Default", 0 /* Filled in at runtime */ }, 5a5d7e1f90 2009-12-20 drh: { "Plain Gray, No Logo", zBuiltinSkin1 }, 5a5d7e1f90 2009-12-20 drh: { "Khaki, No Logo", zBuiltinSkin2 }, 5a5d7e1f90 2009-12-20 drh: { "Black & White, Menu on Left", zBuiltinSkin3 }, 007d0a9b3f 2009-12-19 drh: }; 007d0a9b3f 2009-12-19 drh: 007d0a9b3f 2009-12-19 drh: /* 007d0a9b3f 2009-12-19 drh: ** For a skin named zSkinName, compute the name of the CONFIG table 007d0a9b3f 2009-12-19 drh: ** entry where that skin is stored and return it. 007d0a9b3f 2009-12-19 drh: ** 007d0a9b3f 2009-12-19 drh: ** Return NULL if zSkinName is NULL or an empty string. 007d0a9b3f 2009-12-19 drh: ** 007d0a9b3f 2009-12-19 drh: ** If ifExists is true, and the named skin does not exist, return NULL. 007d0a9b3f 2009-12-19 drh: */ 007d0a9b3f 2009-12-19 drh: static char *skinVarName(const char *zSkinName, int ifExists){ 007d0a9b3f 2009-12-19 drh: char *z; 007d0a9b3f 2009-12-19 drh: if( zSkinName==0 || zSkinName[0]==0 ) return 0; 007d0a9b3f 2009-12-19 drh: z = mprintf("skin:%s", zSkinName); 007d0a9b3f 2009-12-19 drh: if( ifExists && !db_exists("SELECT 1 FROM config WHERE name=%Q", z) ){ 007d0a9b3f 2009-12-19 drh: free(z); 007d0a9b3f 2009-12-19 drh: z = 0; 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: return z; 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: 007d0a9b3f 2009-12-19 drh: /* 007d0a9b3f 2009-12-19 drh: ** Construct and return a string that represents the current skin if 007d0a9b3f 2009-12-19 drh: ** useDefault==0 or a string for the default skin if useDefault==1. 007d0a9b3f 2009-12-19 drh: ** 007d0a9b3f 2009-12-19 drh: ** Memory to hold the returned string is obtained from malloc. 007d0a9b3f 2009-12-19 drh: */ 007d0a9b3f 2009-12-19 drh: static char *getSkin(int useDefault){ 007d0a9b3f 2009-12-19 drh: Blob val; 007d0a9b3f 2009-12-19 drh: blob_zero(&val); 007d0a9b3f 2009-12-19 drh: blob_appendf(&val, "REPLACE INTO config VALUES('css',%Q);\n", 007d0a9b3f 2009-12-19 drh: useDefault ? zDefaultCSS : db_get("css", (char*)zDefaultCSS) 007d0a9b3f 2009-12-19 drh: ); 007d0a9b3f 2009-12-19 drh: blob_appendf(&val, "REPLACE INTO config VALUES('header',%Q);\n", 007d0a9b3f 2009-12-19 drh: useDefault ? zDefaultHeader : db_get("header", (char*)zDefaultHeader) 007d0a9b3f 2009-12-19 drh: ); 007d0a9b3f 2009-12-19 drh: blob_appendf(&val, "REPLACE INTO config VALUES('footer',%Q);\n", 007d0a9b3f 2009-12-19 drh: useDefault ? zDefaultFooter : db_get("footer", (char*)zDefaultFooter) 007d0a9b3f 2009-12-19 drh: ); 007d0a9b3f 2009-12-19 drh: return blob_str(&val); 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: 007d0a9b3f 2009-12-19 drh: /* 007d0a9b3f 2009-12-19 drh: ** Construct the default skin string and fill in the corresponding 007d0a9b3f 2009-12-19 drh: ** entry in aBuildinSkin[] 007d0a9b3f 2009-12-19 drh: */ 007d0a9b3f 2009-12-19 drh: static void setDefaultSkin(void){ 007d0a9b3f 2009-12-19 drh: aBuiltinSkin[0].zValue = getSkin(1); 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: 007d0a9b3f 2009-12-19 drh: /* 007d0a9b3f 2009-12-19 drh: ** WEBPAGE: setup_skin 007d0a9b3f 2009-12-19 drh: */ 007d0a9b3f 2009-12-19 drh: void setup_skin(void){ 007d0a9b3f 2009-12-19 drh: const char *z; 007d0a9b3f 2009-12-19 drh: char *zName; 007d0a9b3f 2009-12-19 drh: char *zErr = 0; 007d0a9b3f 2009-12-19 drh: const char *zCurrent; /* Current skin */ 007d0a9b3f 2009-12-19 drh: int i; /* Loop counter */ 007d0a9b3f 2009-12-19 drh: Stmt q; 007d0a9b3f 2009-12-19 drh: 007d0a9b3f 2009-12-19 drh: login_check_credentials(); 007d0a9b3f 2009-12-19 drh: if( !g.okSetup ){ 007d0a9b3f 2009-12-19 drh: login_needed(); 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: db_begin_transaction(); 007d0a9b3f 2009-12-19 drh: 007d0a9b3f 2009-12-19 drh: /* Process requests to delete a user-defined skin */ 007d0a9b3f 2009-12-19 drh: if( P("del1") && (zName = skinVarName(P("sn"), 1))!=0 ){ 007d0a9b3f 2009-12-19 drh: style_header("Confirm Custom Skin Delete"); 007d0a9b3f 2009-12-19 drh: @ <form action="%s(g.zBaseURL)/setup_skin" method="POST"> 007d0a9b3f 2009-12-19 drh: @ <p>Deletion of a custom skin is a permanent action that cannot 007d0a9b3f 2009-12-19 drh: @ be undone. Please confirm that this is what you want to do:</p> 007d0a9b3f 2009-12-19 drh: @ <input type="hidden" name="sn" value="%h(P("sn"))"> 007d0a9b3f 2009-12-19 drh: @ <input type="submit" name="del2" value="Confirm - Delete The Skin"> 007d0a9b3f 2009-12-19 drh: @ <input type="submit" name="cancel" value="Cancel - Do Not Delete"> 007d0a9b3f 2009-12-19 drh: login_insert_csrf_secret(); 007d0a9b3f 2009-12-19 drh: @ </form> 007d0a9b3f 2009-12-19 drh: style_footer(); 007d0a9b3f 2009-12-19 drh: return; 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: if( P("del2")!=0 && (zName = skinVarName(P("sn"), 1))!=0 ){ 007d0a9b3f 2009-12-19 drh: db_multi_exec("DELETE FROM config WHERE name=%Q", zName); 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: 007d0a9b3f 2009-12-19 drh: setDefaultSkin(); 007d0a9b3f 2009-12-19 drh: zCurrent = getSkin(0); 007d0a9b3f 2009-12-19 drh: 007d0a9b3f 2009-12-19 drh: if( P("save")!=0 && (zName = skinVarName(P("save"),0))!=0 ){ 007d0a9b3f 2009-12-19 drh: if( db_exists("SELECT 1 FROM config WHERE name=%Q", zName) 007d0a9b3f 2009-12-19 drh: || strcmp(zName, "Default")==0 ){ 007d0a9b3f 2009-12-19 drh: zErr = mprintf("Skin name \"%h\" already exists. " 007d0a9b3f 2009-12-19 drh: "Choose a different name.", P("sn")); 007d0a9b3f 2009-12-19 drh: }else{ 007d0a9b3f 2009-12-19 drh: db_multi_exec("INSERT INTO config VALUES(%Q,%Q)", 007d0a9b3f 2009-12-19 drh: zName, zCurrent 007d0a9b3f 2009-12-19 drh: ); 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: 007d0a9b3f 2009-12-19 drh: /* The user pressed the "Use This Skin" button. */ 007d0a9b3f 2009-12-19 drh: if( P("load") && (z = P("sn"))!=0 && z[0] ){ 007d0a9b3f 2009-12-19 drh: int seen = 0; 007d0a9b3f 2009-12-19 drh: for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ 007d0a9b3f 2009-12-19 drh: if( strcmp(aBuiltinSkin[i].zValue, zCurrent)==0 ){ 007d0a9b3f 2009-12-19 drh: seen = 1; 007d0a9b3f 2009-12-19 drh: break; 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: if( !seen ){ 007d0a9b3f 2009-12-19 drh: seen = db_exists("SELECT 1 FROM config WHERE name GLOB 'skin:*'" 007d0a9b3f 2009-12-19 drh: " AND value=%Q", zCurrent); 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: if( !seen ){ 007d0a9b3f 2009-12-19 drh: db_multi_exec( 007d0a9b3f 2009-12-19 drh: "INSERT INTO config VALUES(" 007d0a9b3f 2009-12-19 drh: " strftime('skin:Backup On %%Y-%%m-%%d %%H:%%M:%%S')," 007d0a9b3f 2009-12-19 drh: " %Q)", zCurrent 007d0a9b3f 2009-12-19 drh: ); 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: seen = 0; 007d0a9b3f 2009-12-19 drh: for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ 007d0a9b3f 2009-12-19 drh: if( strcmp(aBuiltinSkin[i].zName, z)==0 ){ 007d0a9b3f 2009-12-19 drh: seen = 1; 007d0a9b3f 2009-12-19 drh: zCurrent = aBuiltinSkin[i].zValue; 007d0a9b3f 2009-12-19 drh: db_multi_exec("%s", zCurrent); 007d0a9b3f 2009-12-19 drh: break; 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: if( !seen ){ 007d0a9b3f 2009-12-19 drh: zName = skinVarName(z,0); 007d0a9b3f 2009-12-19 drh: zCurrent = db_get(zName, 0); 007d0a9b3f 2009-12-19 drh: db_multi_exec("%s", zCurrent); 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: 007d0a9b3f 2009-12-19 drh: style_header("Skins"); 007d0a9b3f 2009-12-19 drh: @ <p>A "skin" is a combination of 007d0a9b3f 2009-12-19 drh: @ <a href="setup_editcss">CSS</a>, 007d0a9b3f 2009-12-19 drh: @ <a href="setup_header">Header</a>, and 007d0a9b3f 2009-12-19 drh: @ <a href="setup_footer">Footer</a> that determines the look and feel 007d0a9b3f 2009-12-19 drh: @ of the web interface.</p> 007d0a9b3f 2009-12-19 drh: @ 007d0a9b3f 2009-12-19 drh: @ <h2>Available Skins:</h2> 007d0a9b3f 2009-12-19 drh: @ <ol> 007d0a9b3f 2009-12-19 drh: for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ 007d0a9b3f 2009-12-19 drh: z = aBuiltinSkin[i].zName; 007d0a9b3f 2009-12-19 drh: if( strcmp(aBuiltinSkin[i].zValue, zCurrent)==0 ){ 007d0a9b3f 2009-12-19 drh: @ <li><p>%h(z). <b>Currently In Use</b></p> 007d0a9b3f 2009-12-19 drh: }else{ 007d0a9b3f 2009-12-19 drh: @ <li><form action="%s(g.zBaseURL)/setup_skin" method="POST"> 007d0a9b3f 2009-12-19 drh: @ %h(z). 007d0a9b3f 2009-12-19 drh: @ <input type="hidden" name="sn" value="%h(z)"> 007d0a9b3f 2009-12-19 drh: @ <input type="submit" name="load" value="Use This Skin"> 007d0a9b3f 2009-12-19 drh: @ </form></li> 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: db_prepare(&q, 007d0a9b3f 2009-12-19 drh: "SELECT substr(name, 6), value FROM config" 007d0a9b3f 2009-12-19 drh: " WHERE name GLOB 'skin:*'" 007d0a9b3f 2009-12-19 drh: " ORDER BY name" 007d0a9b3f 2009-12-19 drh: ); 007d0a9b3f 2009-12-19 drh: while( db_step(&q)==SQLITE_ROW ){ 007d0a9b3f 2009-12-19 drh: const char *zN = db_column_text(&q, 0); 007d0a9b3f 2009-12-19 drh: const char *zV = db_column_text(&q, 1); 007d0a9b3f 2009-12-19 drh: if( strcmp(zV, zCurrent)==0 ){ 91b9081425 2009-12-20 drh: @ <li><p>%h(zN). <b>Currently In Use</b></p> 007d0a9b3f 2009-12-19 drh: }else{ 007d0a9b3f 2009-12-19 drh: @ <li><form action="%s(g.zBaseURL)/setup_skin" method="POST"> 007d0a9b3f 2009-12-19 drh: @ %h(zN). 007d0a9b3f 2009-12-19 drh: @ <input type="hidden" name="sn" value="%h(zN)"> 007d0a9b3f 2009-12-19 drh: @ <input type="submit" name="load" value="Use This Skin"> 007d0a9b3f 2009-12-19 drh: @ <input type="submit" name="del1" value="Delete This Skin"> 007d0a9b3f 2009-12-19 drh: @ </form></li> 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: } 007d0a9b3f 2009-12-19 drh: db_finalize(&q); 007d0a9b3f 2009-12-19 drh: @ </ol> 007d0a9b3f 2009-12-19 drh: style_footer(); 007d0a9b3f 2009-12-19 drh: db_end_transaction(0); 007d0a9b3f 2009-12-19 drh: }