CMS for the late garbage.fm
1<?= $html->error_messages_for($episode); ?>
2
3<div class="boxline">
4<?= $f->label("episode", "Episode Number:", array("class" => "required")); ?>
5<?= $f->text_field("episode", array("style" => "width: 2em;")); ?>
6</div>
7
8<div class="boxline">
9<?= $f->label("is_pending", "Pending:", array("class" => "required")); ?>
10<?= $f->check_box("is_pending") ?> (Will not show up on the website or RSS
11feeds)
12</div>
13
14<div class="boxline">
15<?= $f->label("air_date", "Date:", array("class" => "required")); ?>
16<?= $f->text_field("air_date", array("style" => "width: 300px;",
17 "value" => $f->form_object->air_date->format("Y-m-d H:i"))); ?>
18</div>
19
20<div class="boxline">
21<?= $f->label("title", "Title:", array("class" => "required")); ?>
22<?= $f->text_field("title", array("style" => "width: 300px;")); ?>
23</div>
24
25<!--
26<div class="boxline">
27<?= $f->label("summary", "Summary:", array("class" => "required")); ?>
28<?= $f->text_field("summary", array("style" => "width: 500px;")); ?>
29</div>
30-->
31
32<div class="boxline">
33<?= $f->label("custom_artwork_url", "Custom Artwork URL:",
34 array("class" => "required")); ?>
35<?= $f->text_field("custom_artwork_url", array("style" => "width: 500px;",
36 "placeholder" => "Usually blank, otherwise must be absolute URL")) ?>
37</div>
38
39<div class="boxline">
40<?= $f->label("custom_author", "Custom Author:",
41 array("class" => "required")); ?>
42<?= $f->text_field("custom_author", array("style" => "width: 500px;",
43 "placeholder" => "Usually blank, can be used for solo or guest shows")) ?>
44</div>
45
46<div class="boxline">
47<?= $f->label("is_explicit", "Explicit Content:", array("class" => "required")); ?>
48<?= $f->check_box("is_explicit") ?>
49</div>
50
51<div class="boxline">
52<?= $f->label("duration", "Duration:", array("class" => "required")); ?>
53<?= $f->text_field("duration", array("style" => "width: 5em;")) ?>
54 <span class="na">((h:)?m?m:ss)</span>
55</div>
56
57<? if ($f->form_object->id) { ?>
58 <div class="boxline">
59 <?= $f->label("filesize", "File size:", array("class" => "required")); ?>
60 <span class="d">
61 <?= $helper->bytes_h($f->form_object->filesize) ?> bytes
62 </span>
63 </div>
64<? } ?>
65
66<div class="boxline">
67<?= $f->label("new_mp3", ($f->form_object->id ? "Replace " : "")
68 . "MP3 file:", array("class" => "required")); ?>
69<?= $f->file_field("new_mp3") ?>
70</div>
71
72<div class="boxline">
73<?= $f->label("notes", "Show Notes:", array("class" => "required")); ?>
74</div>
75<div class="boxline">
76<?= $f->text_area("notes", array("class" => "fixed",
77 "style" => "width: 400px; height: 350px; font-size: 9pt;")); ?>
78<div id="previews" style="display: inline-block; width: 400px; height: 350px;
79margin-left: 10px;">
80</div>
81
82<script>
83var update_running = false;
84function update_preview() {
85 if (update_running)
86 return;
87 else
88 update_running = true;
89
90 new Ajax.Updater("previews", "<?= ADMIN_ROOT_URL ?>episodes/md_preview", {
91 method: "post",
92 parameters: {
93 "preview_text": $("episode_notes").value,
94 "authenticity_token" : "<?= $C->form_authenticity_token() ?>",
95 },
96 onComplete: function() { update_running = false; },
97 });
98}
99
100new Form.Element.Observer("episode_notes", 0.5, function(el, value) {
101 update_preview();
102});
103
104update_preview();
105
106</script>