Blob


1 /*
2 * Copyright (c) 2019 Tracey Emery <tracey@traceyemery.net>
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
17 /*
18 * header nav
19 *
20 * ***index
21 * search
22 * Projects
23 * Project|Description|Owner|Last Commit
24 * DIV (summary|shortlog|log|tree)
25 * ***summary
26 * repo navs | search
27 * repo description
28 * description
29 * owner
30 * last commit
31 * URL
32 * shortlog
33 * Date|committer|commit description (commit|commitdiff|tree|snapshot)
34 * heads
35 * create date | head (shortlog|log|tree)
36 *
37 *
38 *
39 * footer
40 */
42 #ifndef GOTWEB_UI_H
43 #define GOTWEB_UI_H
45 /* general html */
47 char *head =
48 "<meta name='viewport' content='initial-scale=1.0," \
49 " user-scalable=no' />" \
50 "<meta charset='utf-8' />" \
51 "<meta name='msapplication-TileColor' content='#da532c' />" \
52 "<meta name='theme-color' content='#ffffff' />" \
53 "<link rel='apple-touch-icon' sizes='180x180'" \
54 " href='/apple-touch-icon.png' />" \
55 "<link rel='icon' type='image/png' sizes='32x32'" \
56 " href='/favicon-32x32.png' />" \
57 "<link rel='icon' type='image/png' sizes='16x16'" \
58 " href='/favicon-16x16.png' />" \
59 "<link rel='manifest' href='/site.webmanifest' />" \
60 "<link rel='mask-icon' href='/safari-pinned-tab.svg'" \
61 " color='#5bbad5' />" \
62 "<link rel='stylesheet' type='text/css' href='/gotweb.css' />";
64 char *got_link =
65 "<div id='got_link'>" \
66 "<a href='%s' target='_sotd'><img src='/%s' alt='logo' /></a>" \
67 "</div>";
69 char *site_link =
70 "<div id='site_link'>" \
71 "<a href='%s'>%s</a> %s %s" \
72 "</div>";
74 char *site_owner =
75 "<div id='site_owner_wrapper'><div id='site_owner'>%s</div></div>";
77 char *search =
78 "<div id='search'>" \
79 "<form method='POST'>" \
80 "<input type='search' id='got-search' name='got-search' size='15'" \
81 " maxlength='50' />" \
82 "<button>Search</button>" \
83 "</form>" \
84 "</div>";
86 char *np_wrapper_start =
87 "<div id='np_wrapper'>" \
88 "<div id='nav_prev'>";
90 char *div_end =
91 "</div>";
93 char *nav_next =
94 "<div id='nav_next'>" \
95 "<a href='?page=%d'>Next<a/>" \
96 "</div>";
98 char *nav_prev =
99 "<a href='?page=%d'>Previous<a/>";
101 char *description =
102 "<div id='description_title'>Description: </div>" \
103 "<div id='description'>%s</div>";
105 char *repo_owner =
106 "<div id='repo_owner_title'>Owner: </div>" \
107 "<div id='repo_owner'>%s</div>";
109 char *last_change =
110 "<div id='last_change_title'>Last Change: </div>" \
111 "<div id='last_change'>%s</div>";
113 char *cloneurl =
114 "<div id='cloneurl_title'>Clone URL: </div>" \
115 "<div id='cloneurl'>%s</div>";
117 char *shortlog_row =
118 "<div id='shortlog_wrapper'>" \
119 "<div id='shortlog_age'>%s</div>" \
120 "<div id='shortlog_author'>%s</div>" \
121 "<div id='shortlog_log'>%s</div>" \
122 "</div>" \
123 "<div id='navs_wrapper'>" \
124 "<div id='navs'>%s</div>" \
125 "</div>" \
126 "</div>" \
127 "<div id='dotted_line'></div>";
129 char *shortlog_navs =
130 "<a href='?path=%s&action=commit&commit=%s'>commit</a> | " \
131 "<a href='?path=%s&action=commitdiff&commit=%s'>commit diff</a> | " \
132 "<a href='?path=%s&action=tree&commit=%s'>tree</a> | " \
133 "<a href='?path=%s&action=snapshot&commit=%s'>snapshot</a>";
135 char *tags_row =
136 "<div id='tags_wrapper'>" \
137 "<div id='tags_age'>%s</div>" \
138 "<div id='tag'>%s</div>" \
139 "<div id='tag_name'>%s</div>" \
140 "</div>" \
141 "<div id='navs_wrapper'>" \
142 "<div id='navs'>%s</div>" \
143 "</div>" \
144 "</div>" \
145 "<div id='dotted_line'></div>";
147 char *tags_navs =
148 "<a href='?path=%s&action=tagt&commit=%s'>tag</a> | " \
149 "<a href='?path=%s&action=commit&commit=%s'>commit</a> | " \
150 "<a href='?path=%s&action=shortlog&commit=%s'>shortlog</a> | " \
151 "<a href='?path=%s&action=log&commit=%s'>log</a>";
153 char *heads_row =
154 "<div id='heads_wrapper'>" \
155 "<div id='heads_age'>%s</div>" \
156 "<div id='head'>%s</div>" \
157 "</div>" \
158 "<div id='navs_wrapper'>" \
159 "<div id='navs'>%s</div>" \
160 "</div>" \
161 "</div>" \
162 "<div id='dotted_line'></div>";
164 char *heads_navs =
165 "<a href='?path=%s&action=shortlog&headref=%s'>shortlog</a> | " \
166 "<a href='?path=%s&action=log&headref=%s'>log</a> | " \
167 "<a href='?path=%s&action=tree&headref=%s'>commit</a>";
169 /* index.tmpl */
171 char *index_projects_header =
172 "<div id='index_header'>" \
173 "<div id='index_header_project'>Project</div>" \
174 "<div id='index_header_description'>Description</div>" \
175 "<div id='index_header_owner'>Owner</div>" \
176 "<div id='index_header_age'>Last Change</div>" \
177 "</div>";
179 char *index_projects =
180 "<div id='index_wrapper'>" \
181 "<div id='index_project'>" \
182 "<a href='?path=%s&action=summary'>%s</a>" \
183 "</div>" \
184 "<div id='index_project_description'>%s</div>" \
185 "<div id='index_project_owner'>%s</div>" \
186 "<div id='index_project_age'>%s</div>" \
187 "<div id='navs_wrapper'>" \
188 "<div id='navs'>%s</div>" \
189 "</div>" \
190 "</div>" \
191 "<div id='dotted_line'></div>";
193 char *index_navs =
194 "<a href='?path=%s&action=summary'>summary</a> | " \
195 "<a href='?path=%s&action=shortlog'>shortlog</a> | " \
196 "<a href='?path=%s&action=log'>log</a> | " \
197 "<a href='?path=%s&action=tree'>tree</a>";
199 /* summary.tmpl */
201 char *summary_wrapper =
202 "<div id='summary_wrapper'>";
204 char *summary_shortlog =
205 "<div id='summary_shortlog_title_wrapper'>" \
206 "<div id='summary_shortlog_title'>Shortlog</div></div>" \
207 "<div id='summary_shortlog_content'>%s</div>";
209 char *summary_tags =
210 "<div id='summary_tags_title_wrapper'>" \
211 "<div id='summary_tags_title'>Tags</div></div>" \
212 "<div id='summary_tags_content'>%s</div>";
214 char *summary_heads =
215 "<div id='summary_heads_title_wrapper'>" \
216 "<div id='summary_heads_title'>Heads</div></div>" \
217 "<div id='summary_heads_content'>%s</div>";
219 #endif /* GOTWEB_UI_H */