Fossil

Diff
Login

Differences From Artifact [efdb67a174]:

To Artifact [da3e8aee87]:


70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
70
71
72
73
74
75
76

77
78
79
80
81
82
83
84
85
86
87
88
89

90
91



























92
93
94
95
96
97
98







-













-


-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-







  return strcmp(A->zLabel, B->zLabel);
}

/*
** Draw the header.
*/
void style_header(const char *zTitle){
  const char *zLogInOut = "Login";
  const char *zHeader = db_get("header", (char*)zDefaultHeader);  
  login_check_credentials();
  
  cgi_destination(CGI_HEADER);

  /* Generate the header up through the main menu */
  Th_InitVar("project_name", db_get("project-name","Unnamed Fossil Project"));
  Th_InitVar("title", zTitle);
  Th_InitVar("baseurl", g.zBaseURL);
  Th_InitVar("manifest_version", MANIFEST_VERSION);
  Th_InitVar("manifest_date", MANIFEST_DATE);
  if( g.zLogin ){
    Th_InitVar("login", g.zLogin);
    zLogInOut = "Logout";
  }
  Th_Render(zHeader);

  /* Generate the main menu */
  @ <div class="mainmenu">
  @ <a href="%s(g.zBaseURL)/home">Home</a>
  if( g.okHistory ){
    @ <a href="%s(g.zBaseURL)/dir">Files</a>
  }
  if( g.okRead ){
    @ <a href="%s(g.zBaseURL)/leaves">Leaves</a>
    @ <a href="%s(g.zBaseURL)/timeline">Timeline</a>
    @ <a href="%s(g.zBaseURL)/tagview">Tags</a>
  }
  if( g.okRdWiki ){
    @ <a href="%s(g.zBaseURL)/wiki">Wiki</a>
  }
#if 0
  @ <font color="#888888">Search</font>
  @ <font color="#888888">Ticket</font>
  @ <font color="#888888">Reports</font>
#endif
  if( g.okSetup ){
    @ <a href="%s(g.zBaseURL)/setup">Setup</a>
  }
  if( !g.noPswd ){
    @ <a href="%s(g.zBaseURL)/login">%s(zLogInOut)</a>
  }
  @ </div>
  cgi_destination(CGI_BODY);
  g.cgiPanic = 1;
}

/*
** Draw the footer at the bottom of the page.
*/
160
161
162
163
164
165
166
167

168
169
170
171
172
173
174
175
176
177

178
179

180
181
182
183
184
185
186
187






















188
189
190
191
192
193
194
131
132
133
134
135
136
137

138
139
140
141
142
143
144
145
146
147

148
149

150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187







-
+









-
+

-
+








+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







/* @-comment: // */
/*
** The default page header.
*/
const char zDefaultHeader[] = 
@ <html>
@ <head>
@ <title><th1>puts "$project_name: $title"</th1></title>
@ <title>$<project_name>: $<title></title>
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@       href="$baseurl/timeline.rss">
@ <link rel="stylesheet" href="$baseurl/style.css" type="text/css"
@       media="screen">
@ </head>
@ <body>
@ <div class="header">
@   <div class="logo">
@     <!-- <img src="logo.gif" alt="logo"><br></br> -->
@     <nobr><th1>puts $project_name</th1></nobr>
@     <nobr>$<project_name></nobr>
@   </div>
@   <div class="title"><th1>puts $title</th1></div>
@   <div class="title">$<title></div>
@   <div class="status"><nobr><th1>
@      if {[info exists login]} {
@        html "Logged in as <a href='$baseurl/my'>$login</a>"
@      } else {
@        puts "Not logged in"
@      }
@   </th1></nobr></div>
@ </div>
@ <div class="mainmenu"><th1>
@ html "<a href='$baseurl/home'>Home</a>"
@ if {[hascap h]} {
@   html "<a href='$baseurl/dir'>Files</a>"
@ }
@ if {[hascap i]} {
@   html "<a href='$baseurl/leaves'>Leaves</a>"
@   html "<a href='$baseurl/timeline'>Timeline</a>"
@   html "<a href='$baseurl/tagview'>Tags</a>"
@ }
@ if {[hascap j]} {
@   html "<a href='$baseurl/wiki'>Wiki</a>"
@ }
@ if {[hascap s]} {
@   html "<a href='$baseurl/setup'>Setup</a>"
@ }
@ if {[info exists login]} {
@   html "<a href='$baseurl/login'>Login</a>"
@ } else {
@   html "<a href='$baseurl/login'>Logout</a>"
@ }
@ </th1></div>
;

/*
** The default page footer
*/
const char zDefaultFooter[] = 
@ <div class="footer">