Check-in [ae5c4a2dbb]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:index.cgi: Fix saving projects. index.cgi: Move search function further down in routing. styles/default/header.cgi: Fix encoding. styles/default/footer.cgi: Remove submit section.
Timelines: family | ancestors | descendants | both | develop
Files: files | file ages | folders
SHA1:ae5c4a2dbba492bc3013164c418ad56d24f2f7ca
User & Date: tux 2014-09-14 20:01:37
Context
2014-09-15
10:15
Merge hotfix back to develop. check-in: 6bbe724313 user: tux tags: develop
2014-09-14
20:05
Merge changes from develop. check-in: 2072520a1c user: tux tags: trunk
20:01
index.cgi: Fix saving projects. index.cgi: Move search function further down in routing. styles/default/header.cgi: Fix encoding. styles/default/footer.cgi: Remove submit section. check-in: ae5c4a2dbb user: tux tags: develop
18:25
Complete search function. check-in: 2085f4dd1c user: tux tags: develop
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to index.cgi.

261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
...
343
344
345
346
347
348
349

350
351
352
353
354
355
356
...
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
...
679
680
681
682
683
684
685




























686
687
688
689
690
691
692
			proj_participants=$(sqlite3 $db "SELECT participants FROM projects WHERE id == $proj")
		fi
		header
		html_tmpl 'header'
		html_tmpl 'dashboard'
		cat << EOT
		<div id="sidebar">
			<a href="javascript:projectSave();">Gem</a>
		</div>
		<form method="post" action="${script}">
			<input type="hidden" name="save" value="project"/>
			<table>
				<tbody>
					<tr>
						<td>Projekt Navn:</td>
................................................................................
					</tr>
					<tr>
						<td>Aktuel længde: (TT:MM:SS)</td>
						<td><input type="text" name="real_length" value="${proj_real_length}" /></td>
					</tr>
				</tbody>
			</table>

		</form>
EOT
		html_tmpl 'footer'
		exit 0
		;;
	*\ delete\ *)
		p="$(GET p)"
................................................................................
			</tr>
		</table>
EOT

		html_tmpl 'footer'
		exit 0
		;;
	*\ search\ *)
		terms="$(GET search)"
		TITLE="$TITLE - Søg: $terms"
		header
		html_tmpl 'header'
		html_tmpl 'dashboard'
		cat << EOT
		<table>
EOT

		sqlite3 $db "SELECT id,title FROM projects WHERE id LIKE \"%$terms%\" OR title LIKE \"%$terms%\" OR desc LIKE \"%$terms%\" OR music LIKE \"%$terms%\" OR participants LIKE \"%$terms%\" ORDER BY id DESC" | while read result
		do
			result_id="$(echo $result | cut -d '|' -f 1)"
			result_title="$(echo $result | cut -d '|' -f 2)"
			cat << EOT
			<tr>
				<td><a href="${script}?view&amp;p=$result_id">$result_id</a></td>
				<td><a href="${script}?view&amp;p=$result_id">$result_title</a></td>
			</tr>

EOT
		done
		cat << EOT
	</table>
EOT
		html_tmpl 'footer'
		;;
	*\ browse\ *)
		category="$(GET cat)"
		startid="$(GET startid)"
		maxid=$(sqlite3 $db "SELECT MAX(id) FROM projects")
		minid=$(sqlite3 $db "SELECT MIN(id) FROM projects")
		LIMIT=20
		[ -z "$startid" ] && startid=$maxid
................................................................................
		cat << EOT
		</tbody>
	</table>
		<a href="${script}?browse&amp;startid=$nextid">Ældre</a> | <a href="${script}?browse&amp;startid=$previd">Nyere</a>
EOT
		html_tmpl 'footer'
		;;




























	*)
		# "Dashboard" screen
		TITLE="$TITLE - Database"
		header
		html_tmpl 'header'
		html_tmpl 'dashboard'
		html_sidebar $projects







|







 







>







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
...
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
...
578
579
580
581
582
583
584



























585
586
587
588
589
590
591
...
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
			proj_participants=$(sqlite3 $db "SELECT participants FROM projects WHERE id == $proj")
		fi
		header
		html_tmpl 'header'
		html_tmpl 'dashboard'
		cat << EOT
		<div id="sidebar">
		<a href="#" onClick="projectSave();">Gem</a>
		</div>
		<form method="post" action="${script}">
			<input type="hidden" name="save" value="project"/>
			<table>
				<tbody>
					<tr>
						<td>Projekt Navn:</td>
................................................................................
					</tr>
					<tr>
						<td>Aktuel længde: (TT:MM:SS)</td>
						<td><input type="text" name="real_length" value="${proj_real_length}" /></td>
					</tr>
				</tbody>
			</table>
			<input type="submit" name="submit" style="display: none;" />
		</form>
EOT
		html_tmpl 'footer'
		exit 0
		;;
	*\ delete\ *)
		p="$(GET p)"
................................................................................
			</tr>
		</table>
EOT

		html_tmpl 'footer'
		exit 0
		;;



























	*\ browse\ *)
		category="$(GET cat)"
		startid="$(GET startid)"
		maxid=$(sqlite3 $db "SELECT MAX(id) FROM projects")
		minid=$(sqlite3 $db "SELECT MIN(id) FROM projects")
		LIMIT=20
		[ -z "$startid" ] && startid=$maxid
................................................................................
		cat << EOT
		</tbody>
	</table>
		<a href="${script}?browse&amp;startid=$nextid">Ældre</a> | <a href="${script}?browse&amp;startid=$previd">Nyere</a>
EOT
		html_tmpl 'footer'
		;;
	*\ search\ *)
		terms="$(GET search)"
		TITLE="$TITLE - Søg: $terms"
		header
		html_tmpl 'header'
		html_tmpl 'dashboard'
		cat << EOT
		<table>
EOT

		sqlite3 $db "SELECT id,title FROM projects WHERE id LIKE \"%$terms%\" OR title LIKE \"%$terms%\" OR desc LIKE \"%$terms%\" OR music LIKE \"%$terms%\" OR participants LIKE \"%$terms%\" ORDER BY id DESC" | while read result
		do
			result_id="$(echo $result | cut -d '|' -f 1)"
			result_title="$(echo $result | cut -d '|' -f 2)"
			cat << EOT
			<tr>
				<td><a href="${script}?view&amp;p=$result_id">$result_id</a></td>
				<td><a href="${script}?view&amp;p=$result_id">$result_title</a></td>
			</tr>

EOT
		done
		cat << EOT
	</table>
EOT
		html_tmpl 'footer'
		;;

	*)
		# "Dashboard" screen
		TITLE="$TITLE - Database"
		header
		html_tmpl 'header'
		html_tmpl 'dashboard'
		html_sidebar $projects

Changes to styles/default/footer.cgi.

6
7
8
9
10
11
12
13
14
15
16
17
18
19
			<p>System og design af <a href="http://necrophcodr.github.io">Steffen Rytter Postas</a>
			Copyright &copy; $(date +%Y) <a href="http://www.middelfart.tv">Middelfart Lokal TV</a></p>
			<small><a href="${script_url}">MLTV-DB</a> revision: <a href="${script_url}/info/${script_rev}">${script_rev}</a></small>
		</div>
		<script src="zepto.min.js"></script>
		<script>
		function projectSave() {
			\$("form").submit();
		}
		</script>
	</body>
</html>

EOT







|






6
7
8
9
10
11
12
13
14
15
16
17
18
19
			<p>System og design af <a href="http://necrophcodr.github.io">Steffen Rytter Postas</a>
			Copyright &copy; $(date +%Y) <a href="http://www.middelfart.tv">Middelfart Lokal TV</a></p>
			<small><a href="${script_url}">MLTV-DB</a> revision: <a href="${script_url}/info/${script_rev}">${script_rev}</a></small>
		</div>
		<script src="zepto.min.js"></script>
		<script>
		function projectSave() {
			document.getElementsByTagName("form")[1].submit.click();
		}
		</script>
	</body>
</html>

EOT

Changes to styles/default/header.cgi.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
cat << EOT
<!doctype html>
<html>
	<head>
		<meta charset="utf8">
		<link rel="icon" type="image/png"
			href="logo_traced.png" />
		<title>$TITLE</title>
		<style>
		$(cat ${styles}/${STYLE}/style.css)
		</style>
	</head>
	<body>
		<div id="wrapper">
		<!-- content starts here -->
EOT





|











1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
cat << EOT
<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<link rel="icon" type="image/png"
			href="logo_traced.png" />
		<title>$TITLE</title>
		<style>
		$(cat ${styles}/${STYLE}/style.css)
		</style>
	</head>
	<body>
		<div id="wrapper">
		<!-- content starts here -->
EOT