change_post_date

NAML documentation   Watch a video
   Usages of this macro
The source code below doesn't have navigation links because no usage has been compiled yet. Navigation links depend on how and where the macro is used, so first you may try finding all usages of "change_post_date".
... in change_post_date.naml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<macro name="change_post_date" requires="servlet">
    <n.node_page.>
        <n.if.not.visitor.can_change_post_date_of.page_node>
            <then>
                <n.login.><t>Only authorized users can proceed in this area.</t></n.login.>
            </then>
        </n.if.not.visitor.can_change_post_date_of.page_node>
 
        <n.if.is_submitted_form>
            <then>
                <n.edit_page_node.>
                    <n.set_when_created date="[n.when_created_field.value/]"/>
                    <n.save_node/>
                </n.edit_page_node.>
                <n.redirect_to.page_node.url/>
            </then>
        </n.if.is_submitted_form>
 
        <n.when_created_field.set_value value="0"/>
        <n.html>
            <head>
                <META NAME="robots" CONTENT="noindex,nofollow"/>
                <n.title.><t>Change Post Date</t></n.title.>
                <style type="text/css">
                    table.calendar { text-align:center; border-collapse: collapse; margin-top: .3em; }
                    table.calendar td.week-header { color:black; background: #eeeeee; }
                    table.calendar td.day { padding:.2em .4em; }
                    table.calendar td.current { background: #eeeeee; color:blue; }
                </style>
                <script type="text/javascript">
                    $(document).ready(function() {
                        var date = new Date(<n.page_node.when_created.raw_time/>);
                        $('#hour').val(date.getHours());
                        $('#minute').val(date.getMinutes());
                    });
                    function updateHiddenField() {
                        var date = new Date(
                            nabbleCalendar.getYear(),
                            nabbleCalendar.getMonth(),
                            nabbleCalendar.getDay(),
                            parseInt($('#hour').val()),
                            parseInt($('#minute').val()),
                            0,
                            0);
                        $('#when_created').val(date.getTime());
                    };
                </script>
            </head>
            <body>
                <n.edit_header first_text="Change Post Date" second_text="[n.page_node.subject/]" />
                <div style="padding:1em">
                    <div style="float:left">
                        <n.calendar
                            date_time="[n.page_node.when_created.raw_time/]"
                            months="[t]January[/t]|[t]February[/t]|[t]March[/t]|[t]April[/t]|[t]May[/t]|[t]June[/t]|[t]July[/t]|[t]August[/t]|[t]September[/t]|[t]October[/t]|[t]November[/t]|[t]December[/t]"
                            week_days="[t]S|M|T|W|T|F|S[/t]"
                            min_year="2000"
                        />
                    </div>
                    <div style="float:left;margin-left:1em">
                        <div class="second-font field-title" style="margin-top:0">
                            <t>Time</t>
                        </div>
                        <n.hour_editor/> : <n.minute_editor/>
                    </div>
                    <div style="clear:both;padding-top:1em">
                        <n.form. onsubmit="return updateHiddenField()">
                            <n.when_created_field.hidden/>
                            <input type="submit" value="[t]Save Changes[/t]" />
                            <t>or</t> <a href="[n.page_node.url/]"><t>Cancel</t></a>
                        </n.form.>
                    </div>
                </div>
            </body>
        </n.html>
    </n.node_page.>
</macro>