Fossil SCM

Add a skin with enhanced handling of hyperlinks in the header and footer.

mistachkin 2012-09-18 05:08 UTC trunk
Commit 59fb15865c112d20cd3b69684fe763b63db3b8b8
1 file changed +305 -1
+305 -1
--- src/skins.c
+++ src/skins.c
@@ -19,11 +19,11 @@
1919
*/
2020
#include <assert.h>
2121
#include "config.h"
2222
#include "skins.h"
2323
24
-/* @-comment: // */
24
+/* @-comment: ## */
2525
/*
2626
** A black-and-white theme with the project title in a bar across the top
2727
** and no logo image.
2828
*/
2929
static const char zBuiltinSkin1[] =
@@ -920,10 +920,313 @@
920920
@ </div>
921921
@ </body></html>
922922
@ ');
923923
;
924924
925
+
926
+/*
927
+** This skin is intended to be almost identical to the default one, with the
928
+** following changes to the header and footer:
929
+**
930
+** 1. The logo image in the header is a hyperlink to the root of the web
931
+** site containing the repository using the same scheme (i.e. HTTP or
932
+** HTTPS) as the base URL for the repository. The header contains a TH1
933
+** script block to help accomplish this task.
934
+**
935
+** 2. The Fossil version information in the footer has been augmented with
936
+** hyperlinks to the corresponding points on the timeline in the official
937
+** Fossil repository. Additionally, if the Tcl integration feature is
938
+** enabled, the loaded version of Tcl is included, with a hyperlink to the
939
+** official Tcl/Tk web site.
940
+*/
941
+static const char zBuiltinSkin5[] =
942
+@ REPLACE INTO config(name,mtime,value)
943
+@ VALUES('css',now(),'/* General settings for the entire page */
944
+@ body {
945
+@ margin: 0ex 1ex;
946
+@ padding: 0px;
947
+@ background-color: white;
948
+@ font-family: sans-serif;
949
+@ }
950
+@
951
+@ /* The project logo in the upper left-hand corner of each page */
952
+@ div.logo {
953
+@ display: table-cell;
954
+@ text-align: center;
955
+@ vertical-align: bottom;
956
+@ font-weight: bold;
957
+@ color: #558195;
958
+@ min-width: 200px;
959
+@ }
960
+@
961
+@ /* The page title centered at the top of each page */
962
+@ div.title {
963
+@ display: table-cell;
964
+@ font-size: 2em;
965
+@ font-weight: bold;
966
+@ text-align: center;
967
+@ padding: 0 0 0 1em;
968
+@ color: #558195;
969
+@ vertical-align: bottom;
970
+@ width: 100% ;
971
+@ }
972
+@
973
+@ /* The login status message in the top right-hand corner */
974
+@ div.status {
975
+@ display: table-cell;
976
+@ text-align: right;
977
+@ vertical-align: bottom;
978
+@ color: #558195;
979
+@ font-size: 0.8em;
980
+@ font-weight: bold;
981
+@ min-width: 200px;
982
+@ white-space: nowrap;
983
+@ }
984
+@
985
+@ /* The header across the top of the page */
986
+@ div.header {
987
+@ display: table;
988
+@ width: 100% ;
989
+@ }
990
+@
991
+@ /* The main menu bar that appears at the top of the page beneath
992
+@ ** the header */
993
+@ div.mainmenu {
994
+@ padding: 5px 10px 5px 10px;
995
+@ font-size: 0.9em;
996
+@ font-weight: bold;
997
+@ text-align: center;
998
+@ letter-spacing: 1px;
999
+@ background-color: #558195;
1000
+@ border-top-left-radius: 8px;
1001
+@ border-top-right-radius: 8px;
1002
+@ color: white;
1003
+@ }
1004
+@
1005
+@ /* The submenu bar that *sometimes* appears below the main menu */
1006
+@ div.submenu, div.sectionmenu {
1007
+@ padding: 3px 10px 3px 0px;
1008
+@ font-size: 0.9em;
1009
+@ text-align: center;
1010
+@ background-color: #456878;
1011
+@ color: white;
1012
+@ }
1013
+@ div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited,
1014
+@ div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited {
1015
+@ padding: 3px 10px 3px 10px;
1016
+@ color: white;
1017
+@ text-decoration: none;
1018
+@ }
1019
+@ div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover {
1020
+@ color: #558195;
1021
+@ background-color: white;
1022
+@ }
1023
+@
1024
+@ /* All page content from the bottom of the menu or submenu down to
1025
+@ ** the footer */
1026
+@ div.content {
1027
+@ padding: 0ex 1ex 1ex 1ex;
1028
+@ border: solid #aaa;
1029
+@ border-width: 1px;
1030
+@ }
1031
+@
1032
+@ /* Some pages have section dividers */
1033
+@ div.section {
1034
+@ margin-bottom: 0px;
1035
+@ margin-top: 1em;
1036
+@ padding: 1px 1px 1px 1px;
1037
+@ font-size: 1.2em;
1038
+@ font-weight: bold;
1039
+@ background-color: #558195;
1040
+@ color: white;
1041
+@ white-space: nowrap;
1042
+@ }
1043
+@
1044
+@ /* The "Date" that occurs on the left hand side of timelines */
1045
+@ div.divider {
1046
+@ background: #a1c4d4;
1047
+@ border: 2px #558195 solid;
1048
+@ font-size: 1em; font-weight: normal;
1049
+@ padding: .25em;
1050
+@ margin: .2em 0 .2em 0;
1051
+@ float: left;
1052
+@ clear: left;
1053
+@ white-space: nowrap;
1054
+@ }
1055
+@
1056
+@ /* The footer at the very bottom of the page */
1057
+@ div.footer {
1058
+@ clear: both;
1059
+@ font-size: 0.8em;
1060
+@ padding: 5px 10px 5px 10px;
1061
+@ text-align: right;
1062
+@ background-color: #558195;
1063
+@ border-bottom-left-radius: 8px;
1064
+@ border-bottom-right-radius: 8px;
1065
+@ color: white;
1066
+@ }
1067
+@
1068
+@ /* Hyperlink colors in the footer */
1069
+@ div.footer a { color: white; }
1070
+@ div.footer a:link { color: white; }
1071
+@ div.footer a:visited { color: white; }
1072
+@ div.footer a:hover { background-color: white; color: #558195; }
1073
+@
1074
+@ /* verbatim blocks */
1075
+@ pre.verbatim {
1076
+@ background-color: #f5f5f5;
1077
+@ padding: 0.5em;
1078
+@}
1079
+@
1080
+@ /* The label/value pairs on (for example) the ci page */
1081
+@ table.label-value th {
1082
+@ vertical-align: top;
1083
+@ text-align: right;
1084
+@ padding: 0.2ex 2ex;
1085
+@ }');
1086
+@ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
1087
+@ <head>
1088
+@ <base href="$baseurl/$current_page" />
1089
+@ <title>$<project_name>: $<title></title>
1090
+@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
1091
+@ href="$home/timeline.rss" />
1092
+@ <link rel="stylesheet" href="$home/style.css?enhanced" type="text/css"
1093
+@ media="screen" />
1094
+@ </head>
1095
+@ <body>
1096
+@ <div class="header">
1097
+@ <div class="logo">
1098
+@ <th1>
1099
+@ ##
1100
+@ ## NOTE: The purpose of this procedure is to take the base URL of the
1101
+@ ## Fossil project and return the root of the entire web site using
1102
+@ ## the same URI scheme as the base URL (e.g. http or https).
1103
+@ ##
1104
+@ proc getLogoUrl { baseurl } {
1105
+@ set idx(first) [string first // $baseurl]
1106
+@ if {$idx(first) != -1} {
1107
+@ ##
1108
+@ ## NOTE: Skip second slash.
1109
+@ ##
1110
+@ set idx(first+1) [expr {$idx(first) + 2}]
1111
+@ ##
1112
+@ ## NOTE: (part 1) The [string first] command does NOT actually
1113
+@ ## the optional startIndex argument as specified in the
1114
+@ ## TH1 support manual; therefore, we fake it by using the
1115
+@ ## [string range] command and then adding the necessary
1116
+@ ## offset to the resulting index manually (below). In Tcl,
1117
+@ ## we could use the following instead:
1118
+@ ##
1119
+@ ## set idx(next) [string first / $baseurl $idx(first+1)]
1120
+@ ##
1121
+@ set idx(nextRange) [string range $baseurl $idx(first+1) end]
1122
+@ set idx(next) [string first / $idx(nextRange)]
1123
+@ if {$idx(next) != -1} {
1124
+@ ##
1125
+@ ## NOTE: (part 2) Add the necessary offset to the result of the
1126
+@ ## search for the next slash (i.e. the one after the initial
1127
+@ ## search for the two slashes).
1128
+@ ##
1129
+@ set idx(next) [expr {$idx(next) + $idx(first+1)}]
1130
+@ ##
1131
+@ ## NOTE: Back up one character from the next slash.
1132
+@ ##
1133
+@ set idx(next-1) [expr {$idx(next) - 1}]
1134
+@ ##
1135
+@ ## NOTE: Extract the URI scheme and host from the base URL.
1136
+@ ##
1137
+@ set scheme [string range $baseurl 0 $idx(first)]
1138
+@ set host [string range $baseurl $idx(first+1) $idx(next-1)]
1139
+@ ##
1140
+@ ## NOTE: Try to stay in SSL mode if we are there now.
1141
+@ ##
1142
+@ if {[string compare $scheme http:/] == 0} {
1143
+@ set scheme http://
1144
+@ } else {
1145
+@ set scheme https://
1146
+@ }
1147
+@ set logourl $scheme$host/
1148
+@ } else {
1149
+@ set logourl $baseurl
1150
+@ }
1151
+@ } else {
1152
+@ set logourl $baseurl
1153
+@ }
1154
+@ return $logourl
1155
+@ }
1156
+@ set logourl [getLogoUrl $baseurl]
1157
+@ </th1>
1158
+@ <a href="$logourl">
1159
+@ <img src="$baseurl/logo" border="0" alt="$project_name">
1160
+@ </a>
1161
+@ </div>
1162
+@ <div class="title"><small>$<project_name></small><br />$<title></div>
1163
+@ <div class="status"><nobr><th1>
1164
+@ if {[info exists login]} {
1165
+@ puts "Logged in as $login"
1166
+@ } else {
1167
+@ puts "Not logged in"
1168
+@ }
1169
+@ </th1></nobr></div>
1170
+@ </div>
1171
+@ <div class="mainmenu">
1172
+@ <th1>
1173
+@ html "<a href=''$home$index_page''>Home</a>\n"
1174
+@ if {[anycap jor]} {
1175
+@ html "<a href=''timeline''>Timeline</a>\n"
1176
+@ }
1177
+@ if {[hascap oh]} {
1178
+@ html "<a href=''dir?ci=tip''>Files</a>\n"
1179
+@ }
1180
+@ if {[hascap o]} {
1181
+@ html "<a href=''brlist''>Branches</a>\n"
1182
+@ html "<a href=''taglist''>Tags</a>\n"
1183
+@ }
1184
+@ if {[hascap r]} {
1185
+@ html "<a href=''reportlist''>Tickets</a>\n"
1186
+@ }
1187
+@ if {[hascap j]} {
1188
+@ html "<a href=''wiki''>Wiki</a>\n"
1189
+@ }
1190
+@ if {[hascap s]} {
1191
+@ html "<a href=''setup''>Admin</a>\n"
1192
+@ } elseif {[hascap a]} {
1193
+@ html "<a href=''setup_ulist''>Users</a>\n"
1194
+@ }
1195
+@ if {[info exists login]} {
1196
+@ html "<a href=''login''>Logout</a>\n"
1197
+@ } else {
1198
+@ html "<a href=''login''>Login</a>\n"
1199
+@ }
1200
+@ </th1></div>
1201
+@ ');
1202
+@ REPLACE INTO config(name,mtime,value)
1203
+@ VALUES('footer',now(),'<div class="footer">
1204
+@ <th1>
1205
+@ proc getTclVersion {} {
1206
+@ if {[catch {tclEval info patchlevel} tclVersion] == 0} {
1207
+@ return "<a href=\"http://www.tcl.tk/\">Tcl</a> version $tclVersion"
1208
+@ }
1209
+@ return ""
1210
+@ }
1211
+@ proc getVersion { version } {
1212
+@ set length [string length $version]
1213
+@ return [string range $version 1 [expr {$length - 2}]]
1214
+@ }
1215
+@ set version [getVersion $manifest_version]
1216
+@ set tclVersion [getTclVersion]
1217
+@ set fossilUrl http://www.fossil-scm.org
1218
+@ </th1>
1219
+@ <a href="$fossilUrl/">Fossil</a>
1220
+@ version $release_version $tclVersion
1221
+@ <a href="$fossilUrl/index.html/info/$version">$manifest_version</a>
1222
+@ <a href="$fossilUrl/fossil/timeline?c=$manifest_date&y=ci">$manifest_date</a>
1223
+@ </div>
1224
+@ </body></html>
1225
+@ ');
1226
+;
1227
+
9251228
/*
9261229
** An array of available built-in skins.
9271230
*/
9281231
static struct BuiltinSkin {
9291232
const char *zName;
@@ -932,10 +1235,11 @@
9321235
{ "Default", 0 /* Filled in at runtime */ },
9331236
{ "Plain Gray, No Logo", zBuiltinSkin1 },
9341237
{ "Khaki, No Logo", zBuiltinSkin2 },
9351238
{ "Black & White, Menu on Left", zBuiltinSkin3 },
9361239
{ "Shadow boxes & Rounded Corners", zBuiltinSkin4 },
1240
+ { "Enhanced Default", zBuiltinSkin5 },
9371241
};
9381242
9391243
/*
9401244
** For a skin named zSkinName, compute the name of the CONFIG table
9411245
** entry where that skin is stored and return it.
9421246
--- src/skins.c
+++ src/skins.c
@@ -19,11 +19,11 @@
19 */
20 #include <assert.h>
21 #include "config.h"
22 #include "skins.h"
23
24 /* @-comment: // */
25 /*
26 ** A black-and-white theme with the project title in a bar across the top
27 ** and no logo image.
28 */
29 static const char zBuiltinSkin1[] =
@@ -920,10 +920,313 @@
920 @ </div>
921 @ </body></html>
922 @ ');
923 ;
924
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
925 /*
926 ** An array of available built-in skins.
927 */
928 static struct BuiltinSkin {
929 const char *zName;
@@ -932,10 +1235,11 @@
932 { "Default", 0 /* Filled in at runtime */ },
933 { "Plain Gray, No Logo", zBuiltinSkin1 },
934 { "Khaki, No Logo", zBuiltinSkin2 },
935 { "Black & White, Menu on Left", zBuiltinSkin3 },
936 { "Shadow boxes & Rounded Corners", zBuiltinSkin4 },
 
937 };
938
939 /*
940 ** For a skin named zSkinName, compute the name of the CONFIG table
941 ** entry where that skin is stored and return it.
942
--- src/skins.c
+++ src/skins.c
@@ -19,11 +19,11 @@
19 */
20 #include <assert.h>
21 #include "config.h"
22 #include "skins.h"
23
24 /* @-comment: ## */
25 /*
26 ** A black-and-white theme with the project title in a bar across the top
27 ** and no logo image.
28 */
29 static const char zBuiltinSkin1[] =
@@ -920,10 +920,313 @@
920 @ </div>
921 @ </body></html>
922 @ ');
923 ;
924
925
926 /*
927 ** This skin is intended to be almost identical to the default one, with the
928 ** following changes to the header and footer:
929 **
930 ** 1. The logo image in the header is a hyperlink to the root of the web
931 ** site containing the repository using the same scheme (i.e. HTTP or
932 ** HTTPS) as the base URL for the repository. The header contains a TH1
933 ** script block to help accomplish this task.
934 **
935 ** 2. The Fossil version information in the footer has been augmented with
936 ** hyperlinks to the corresponding points on the timeline in the official
937 ** Fossil repository. Additionally, if the Tcl integration feature is
938 ** enabled, the loaded version of Tcl is included, with a hyperlink to the
939 ** official Tcl/Tk web site.
940 */
941 static const char zBuiltinSkin5[] =
942 @ REPLACE INTO config(name,mtime,value)
943 @ VALUES('css',now(),'/* General settings for the entire page */
944 @ body {
945 @ margin: 0ex 1ex;
946 @ padding: 0px;
947 @ background-color: white;
948 @ font-family: sans-serif;
949 @ }
950 @
951 @ /* The project logo in the upper left-hand corner of each page */
952 @ div.logo {
953 @ display: table-cell;
954 @ text-align: center;
955 @ vertical-align: bottom;
956 @ font-weight: bold;
957 @ color: #558195;
958 @ min-width: 200px;
959 @ }
960 @
961 @ /* The page title centered at the top of each page */
962 @ div.title {
963 @ display: table-cell;
964 @ font-size: 2em;
965 @ font-weight: bold;
966 @ text-align: center;
967 @ padding: 0 0 0 1em;
968 @ color: #558195;
969 @ vertical-align: bottom;
970 @ width: 100% ;
971 @ }
972 @
973 @ /* The login status message in the top right-hand corner */
974 @ div.status {
975 @ display: table-cell;
976 @ text-align: right;
977 @ vertical-align: bottom;
978 @ color: #558195;
979 @ font-size: 0.8em;
980 @ font-weight: bold;
981 @ min-width: 200px;
982 @ white-space: nowrap;
983 @ }
984 @
985 @ /* The header across the top of the page */
986 @ div.header {
987 @ display: table;
988 @ width: 100% ;
989 @ }
990 @
991 @ /* The main menu bar that appears at the top of the page beneath
992 @ ** the header */
993 @ div.mainmenu {
994 @ padding: 5px 10px 5px 10px;
995 @ font-size: 0.9em;
996 @ font-weight: bold;
997 @ text-align: center;
998 @ letter-spacing: 1px;
999 @ background-color: #558195;
1000 @ border-top-left-radius: 8px;
1001 @ border-top-right-radius: 8px;
1002 @ color: white;
1003 @ }
1004 @
1005 @ /* The submenu bar that *sometimes* appears below the main menu */
1006 @ div.submenu, div.sectionmenu {
1007 @ padding: 3px 10px 3px 0px;
1008 @ font-size: 0.9em;
1009 @ text-align: center;
1010 @ background-color: #456878;
1011 @ color: white;
1012 @ }
1013 @ div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited,
1014 @ div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited {
1015 @ padding: 3px 10px 3px 10px;
1016 @ color: white;
1017 @ text-decoration: none;
1018 @ }
1019 @ div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover {
1020 @ color: #558195;
1021 @ background-color: white;
1022 @ }
1023 @
1024 @ /* All page content from the bottom of the menu or submenu down to
1025 @ ** the footer */
1026 @ div.content {
1027 @ padding: 0ex 1ex 1ex 1ex;
1028 @ border: solid #aaa;
1029 @ border-width: 1px;
1030 @ }
1031 @
1032 @ /* Some pages have section dividers */
1033 @ div.section {
1034 @ margin-bottom: 0px;
1035 @ margin-top: 1em;
1036 @ padding: 1px 1px 1px 1px;
1037 @ font-size: 1.2em;
1038 @ font-weight: bold;
1039 @ background-color: #558195;
1040 @ color: white;
1041 @ white-space: nowrap;
1042 @ }
1043 @
1044 @ /* The "Date" that occurs on the left hand side of timelines */
1045 @ div.divider {
1046 @ background: #a1c4d4;
1047 @ border: 2px #558195 solid;
1048 @ font-size: 1em; font-weight: normal;
1049 @ padding: .25em;
1050 @ margin: .2em 0 .2em 0;
1051 @ float: left;
1052 @ clear: left;
1053 @ white-space: nowrap;
1054 @ }
1055 @
1056 @ /* The footer at the very bottom of the page */
1057 @ div.footer {
1058 @ clear: both;
1059 @ font-size: 0.8em;
1060 @ padding: 5px 10px 5px 10px;
1061 @ text-align: right;
1062 @ background-color: #558195;
1063 @ border-bottom-left-radius: 8px;
1064 @ border-bottom-right-radius: 8px;
1065 @ color: white;
1066 @ }
1067 @
1068 @ /* Hyperlink colors in the footer */
1069 @ div.footer a { color: white; }
1070 @ div.footer a:link { color: white; }
1071 @ div.footer a:visited { color: white; }
1072 @ div.footer a:hover { background-color: white; color: #558195; }
1073 @
1074 @ /* verbatim blocks */
1075 @ pre.verbatim {
1076 @ background-color: #f5f5f5;
1077 @ padding: 0.5em;
1078 @}
1079 @
1080 @ /* The label/value pairs on (for example) the ci page */
1081 @ table.label-value th {
1082 @ vertical-align: top;
1083 @ text-align: right;
1084 @ padding: 0.2ex 2ex;
1085 @ }');
1086 @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
1087 @ <head>
1088 @ <base href="$baseurl/$current_page" />
1089 @ <title>$<project_name>: $<title></title>
1090 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
1091 @ href="$home/timeline.rss" />
1092 @ <link rel="stylesheet" href="$home/style.css?enhanced" type="text/css"
1093 @ media="screen" />
1094 @ </head>
1095 @ <body>
1096 @ <div class="header">
1097 @ <div class="logo">
1098 @ <th1>
1099 @ ##
1100 @ ## NOTE: The purpose of this procedure is to take the base URL of the
1101 @ ## Fossil project and return the root of the entire web site using
1102 @ ## the same URI scheme as the base URL (e.g. http or https).
1103 @ ##
1104 @ proc getLogoUrl { baseurl } {
1105 @ set idx(first) [string first // $baseurl]
1106 @ if {$idx(first) != -1} {
1107 @ ##
1108 @ ## NOTE: Skip second slash.
1109 @ ##
1110 @ set idx(first+1) [expr {$idx(first) + 2}]
1111 @ ##
1112 @ ## NOTE: (part 1) The [string first] command does NOT actually
1113 @ ## the optional startIndex argument as specified in the
1114 @ ## TH1 support manual; therefore, we fake it by using the
1115 @ ## [string range] command and then adding the necessary
1116 @ ## offset to the resulting index manually (below). In Tcl,
1117 @ ## we could use the following instead:
1118 @ ##
1119 @ ## set idx(next) [string first / $baseurl $idx(first+1)]
1120 @ ##
1121 @ set idx(nextRange) [string range $baseurl $idx(first+1) end]
1122 @ set idx(next) [string first / $idx(nextRange)]
1123 @ if {$idx(next) != -1} {
1124 @ ##
1125 @ ## NOTE: (part 2) Add the necessary offset to the result of the
1126 @ ## search for the next slash (i.e. the one after the initial
1127 @ ## search for the two slashes).
1128 @ ##
1129 @ set idx(next) [expr {$idx(next) + $idx(first+1)}]
1130 @ ##
1131 @ ## NOTE: Back up one character from the next slash.
1132 @ ##
1133 @ set idx(next-1) [expr {$idx(next) - 1}]
1134 @ ##
1135 @ ## NOTE: Extract the URI scheme and host from the base URL.
1136 @ ##
1137 @ set scheme [string range $baseurl 0 $idx(first)]
1138 @ set host [string range $baseurl $idx(first+1) $idx(next-1)]
1139 @ ##
1140 @ ## NOTE: Try to stay in SSL mode if we are there now.
1141 @ ##
1142 @ if {[string compare $scheme http:/] == 0} {
1143 @ set scheme http://
1144 @ } else {
1145 @ set scheme https://
1146 @ }
1147 @ set logourl $scheme$host/
1148 @ } else {
1149 @ set logourl $baseurl
1150 @ }
1151 @ } else {
1152 @ set logourl $baseurl
1153 @ }
1154 @ return $logourl
1155 @ }
1156 @ set logourl [getLogoUrl $baseurl]
1157 @ </th1>
1158 @ <a href="$logourl">
1159 @ <img src="$baseurl/logo" border="0" alt="$project_name">
1160 @ </a>
1161 @ </div>
1162 @ <div class="title"><small>$<project_name></small><br />$<title></div>
1163 @ <div class="status"><nobr><th1>
1164 @ if {[info exists login]} {
1165 @ puts "Logged in as $login"
1166 @ } else {
1167 @ puts "Not logged in"
1168 @ }
1169 @ </th1></nobr></div>
1170 @ </div>
1171 @ <div class="mainmenu">
1172 @ <th1>
1173 @ html "<a href=''$home$index_page''>Home</a>\n"
1174 @ if {[anycap jor]} {
1175 @ html "<a href=''timeline''>Timeline</a>\n"
1176 @ }
1177 @ if {[hascap oh]} {
1178 @ html "<a href=''dir?ci=tip''>Files</a>\n"
1179 @ }
1180 @ if {[hascap o]} {
1181 @ html "<a href=''brlist''>Branches</a>\n"
1182 @ html "<a href=''taglist''>Tags</a>\n"
1183 @ }
1184 @ if {[hascap r]} {
1185 @ html "<a href=''reportlist''>Tickets</a>\n"
1186 @ }
1187 @ if {[hascap j]} {
1188 @ html "<a href=''wiki''>Wiki</a>\n"
1189 @ }
1190 @ if {[hascap s]} {
1191 @ html "<a href=''setup''>Admin</a>\n"
1192 @ } elseif {[hascap a]} {
1193 @ html "<a href=''setup_ulist''>Users</a>\n"
1194 @ }
1195 @ if {[info exists login]} {
1196 @ html "<a href=''login''>Logout</a>\n"
1197 @ } else {
1198 @ html "<a href=''login''>Login</a>\n"
1199 @ }
1200 @ </th1></div>
1201 @ ');
1202 @ REPLACE INTO config(name,mtime,value)
1203 @ VALUES('footer',now(),'<div class="footer">
1204 @ <th1>
1205 @ proc getTclVersion {} {
1206 @ if {[catch {tclEval info patchlevel} tclVersion] == 0} {
1207 @ return "<a href=\"http://www.tcl.tk/\">Tcl</a> version $tclVersion"
1208 @ }
1209 @ return ""
1210 @ }
1211 @ proc getVersion { version } {
1212 @ set length [string length $version]
1213 @ return [string range $version 1 [expr {$length - 2}]]
1214 @ }
1215 @ set version [getVersion $manifest_version]
1216 @ set tclVersion [getTclVersion]
1217 @ set fossilUrl http://www.fossil-scm.org
1218 @ </th1>
1219 @ <a href="$fossilUrl/">Fossil</a>
1220 @ version $release_version $tclVersion
1221 @ <a href="$fossilUrl/index.html/info/$version">$manifest_version</a>
1222 @ <a href="$fossilUrl/fossil/timeline?c=$manifest_date&y=ci">$manifest_date</a>
1223 @ </div>
1224 @ </body></html>
1225 @ ');
1226 ;
1227
1228 /*
1229 ** An array of available built-in skins.
1230 */
1231 static struct BuiltinSkin {
1232 const char *zName;
@@ -932,10 +1235,11 @@
1235 { "Default", 0 /* Filled in at runtime */ },
1236 { "Plain Gray, No Logo", zBuiltinSkin1 },
1237 { "Khaki, No Logo", zBuiltinSkin2 },
1238 { "Black & White, Menu on Left", zBuiltinSkin3 },
1239 { "Shadow boxes & Rounded Corners", zBuiltinSkin4 },
1240 { "Enhanced Default", zBuiltinSkin5 },
1241 };
1242
1243 /*
1244 ** For a skin named zSkinName, compute the name of the CONFIG table
1245 ** entry where that skin is stored and return it.
1246

Keyboard Shortcuts

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