change_post_date

   Usages of this macro
... 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
Macro
Requires: servlet
Parameters: do
.>
        <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.not
Binary
Namespace: BasicNamespace
Parameters: condition
.visitor
Binary
Namespace: ServletNamespace
Parameters: do
.can_change_post_date_of
Macro
Requires: user
Parameters: node_attr
.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
>
            <then>
                <n.login
Macro
Requires: servlet
Parameters: message
.><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
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.is_submitted_form
Macro
Requires: servlet
>
            <then>
                <n.edit_page_node
Binary
Namespace: NodePageNamespace
Parameters: commit, do
.>
                    <n.set_when_created
Binary
Namespace: NodeEditorNamespace
Parameters: date
 date="[n.when_created_field
Macro
Parameters: do
.value
Binary
Namespace: FieldNamespace
/]"/>
                    <n.save_node
Binary
Namespace: NodeEditorNamespace
/>
                </n.edit_page_node.>
                <n.redirect_to
Binary
Namespace: ServletNamespace
Parameters: url
.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.url
Macro
Requires: node
Parameters: template, date, index_record
/>
            </then>
        </n.if.is_submitted_form>
 
        <n.when_created_field
Macro
Parameters: do
.set_value
Binary
Namespace: FieldNamespace
Parameters: value
 value="0"/>
        <n.html
Macro
Parameters: head, body
>
            <head>
                <META NAME="robots" CONTENT="noindex,nofollow"/>
                <n.title
Macro
Parameters: text
.><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
Binary
Namespace: NodePageNamespace
Parameters: do
.when_created
Binary
Namespace: NodeNamespace
Parameters: do
.raw_time
Binary
Namespace: DateNamespace
/>);
                        $('#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
Macro
Parameters: first_text, second_text
 first_text="Change Post Date" second_text="[n.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.subject
Macro
Requires: node
/]" />
                <div style="padding:1em">
                    <div style="float:left">
                        <n.calendar
Binary
Namespace: HtmlNamespace
Parameters: months, date_time, week_days, min_year
                            date_time="[n.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.when_created
Binary
Namespace: NodeNamespace
Parameters: do
.raw_time
Binary
Namespace: DateNamespace
/]"
                            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
Macro
/> : <n.minute_editor
Macro
/>
                    </div>
                    <div style="clear:both;padding-top:1em">
                        <n.form
Macro
Requires: servlet
Parameters: macro, method, onsubmit, content
. onsubmit="return updateHiddenField()">
                            <n.when_created_field
Macro
Parameters: do
.hidden
Macro
Requires: field
/>
                            <input type="submit" value="[t]Save Changes[/t]" />
                            <t>or</t> <a href="[n.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.url
Macro
Requires: node
Parameters: template, date, index_record
/]"><t>Cancel</t></a>
                        </n.form.>
                    </div>
                </div>
            </body>
        </n.html>
    </n.node_page.>
</macro>