67
68
69
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
67
68
69
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
128
129
130
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
|
-
+
+
-
-
-
-
-
-
-
-
-
+
+
+
-
-
+
-
-
+
+
-
-
-
-
+
+
+
-
+
+
-
-
+
+
-
+
-
-
-
+
+
+
-
+
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
}
/*
** Draw the header.
*/
void style_header(const char *zTitle){
const char *zLogInOut = "Logout";
char *zProjectDescr = db_get("project-description", 0);
const char *zHeader = db_get("header", zDefaultHeader);
struct Subscript *p;
login_check_credentials();
@ <html>
@ <head>
@ <title>%s(zTitle)</title>
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="%s(g.zBaseURL)/timeline.rss">
@ <link rel="stylesheet" href="%s(g.zBaseURL)/style.css" type="text/css" media="screen">
if( zProjectDescr != 0 ){
@ <meta name="description" content="%s(zProjectDescr)">
}
@ </head>
/* Generate the header up through the main menu */
p = SbS_Create();
@ <body>
@ <div id="page-title">%s(zTitle)</div>
SbS_Store(p, "title", zTitle, 0);
@ <div id="login-status">
if( g.zLogin==0 ){
SbS_Store(p, "baseurl", g.zBaseURL, 0);
if( g.zLogin ){
@ not logged in
zLogInOut = "Login";
}else{
@ logged in as %h(g.zLogin)
SbS_Store(p, "login", g.zLogin, 0);
}
SbS_Render(p, zHeader);
SbS_Destroy(p);
@ </div>
/* Generate the main menu and the submenu (if any) */
@ <div id="main-menu">
@ <a href="%s(g.zBaseURL)/home">Home</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)/leaves">Leaves</a>
@ <a href="%s(g.zBaseURL)/timeline">Timeline</a>
}
if( g.okRdWiki ){
@ | <a href="%s(g.zBaseURL)/wiki">Wiki</a>
@ <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>
@ <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>
@ <a href="%s(g.zBaseURL)/setup">Setup</a>
}
if( !g.noPswd ){
@ | <a href="%s(g.zBaseURL)/login">%s(zLogInOut)</a>
@ <a href="%s(g.zBaseURL)/login">%s(zLogInOut)</a>
}
@ </div>
if( nSubmenu>0 ){
int i;
@ <div id="sub-menu">
qsort(aSubmenu, nSubmenu, sizeof(aSubmenu[0]), submenuCompare);
for(i=0; i<nSubmenu; i++){
struct Submenu *p = &aSubmenu[i];
char *zTail = i<nSubmenu-1 ? " | " : "";
if( p->zLink==0 ){
@ <span class="label">%h(p->zLabel)</span>
@ <span class="tail">%s(zTail)</span>
}else{
@ <a class="label" href="%s(p->zLink)">%h(p->zLabel)</a>
@ <span class="tail">%s(zTail)</span>
}
}
@ </div>
}
@ <div id="page">
g.cgiPanic = 1;
}
/*
** Draw the footer at the bottom of the page.
*/
void style_footer(void){
/* end the <div id="page"> from style_header() */
@ </div>
@ <div id="style-footer">
@ Fossil version %s(MANIFEST_VERSION) %s(MANIFEST_DATE)
@ </div>
}
/*
** The default page header.
*/
const char zDefaultHeader[] =
@ <html>
@ <head>
@ <title>Edit CSS</title>
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@ href="[baseurl puts]/timeline.rss">
@ <link rel="stylesheet" href="[baseurl puts]/style.css" type="text/css"
@ media="screen">
@ </head>
@ <body>
@ <div id="page-title">[title html]</div>
@ <div id="login-status">
@ [/login exists enable_output]
@ logged in as [0 /login get html]
@ [/login exists not enable_output]
@ not logged in
@ [1 enable_output]
@ </div>
;
/*
** The default Cascading Style Sheet.
**
** Selector order: tags, ids, classes, other
** Content order: margin, borders, padding, fonts, colors, other
** Note: Once things are finialize a bit we can collapse this and
|