create_sub_app

NAML documentation   Watch a video
   Usages of this macro
... in create_sub_app.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<macro name="create_sub_app" 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_create_sub_apps_under
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_create_sub_apps_under.page_node>
        <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.not
Binary
Namespace: BasicNamespace
Parameters: condition
.is_submitted_form
Macro
Requires: servlet
>
            <then>
                <n.type_field
Macro
Parameters: do
.set_value
Binary
Namespace: FieldNamespace
Parameters: value
 value="[n.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.sub_app_type
Macro
Requires: node
/]" />
            </then>
            <else>
                <n.catch_exception
Binary
Namespace: BasicNamespace
Parameters: id, do
. id="save-block">
                    <n.create_child_of_page_node
Binary
Namespace: NodePageNamespace
Parameters: subject, kind, is_html, commit, do, message, type
>
                        <subject><n.subject_field
Macro
Parameters: do
.value
Binary
Namespace: FieldNamespace
/></subject>
                        <message><n.message_field
Macro
Parameters: do
.value
Binary
Namespace: FieldNamespace
/></message>
                        <is_html><n.html_format_field
Macro
Parameters: do
.value
Binary
Namespace: FieldNamespace
/></is_html>
                        <type><n.type_field
Macro
Parameters: do
.value
Binary
Namespace: FieldNamespace
/></type>
                        <kind>app</kind>
                        <do>
                            <n.remember_new_node
Macro
Requires: node_editor
/>
                            <n.save_node
Binary
Namespace: NodeEditorNamespace
/>
                        </do>
                    </n.create_child_of_page_node>
                    <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.visitor
Binary
Namespace: ServletNamespace
Parameters: do
.can_edit
Macro
Requires: user
Parameters: node_attr
.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
>
                        <then.new_node
Macro
Requires: node_page
Parameters: do
.pin
Binary
Namespace: NodeNamespace
/>
                    </n.if.visitor.can_edit.page_node>
                    <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.equal
Binary
Namespace: BasicNamespace
Parameters: value2, value1
 value1="[n.is_mailing_list_field
Macro
Parameters: do
.value
Binary
Namespace: FieldNamespace
/]" value2="[n.true
Binary
Namespace: BasicNamespace
/]">
                        <then><n.redirect_to
Binary
Namespace: ServletNamespace
Parameters: url
.new_node
Macro
Requires: node_page
Parameters: do
.mailing_list_archive_settings_path
Macro
Requires: node
/></then>
                        <else><n.redirect_to
Binary
Namespace: ServletNamespace
Parameters: url
.new_node
Macro
Requires: node_page
Parameters: do
.path
Macro
Requires: node
Parameters: template, date, index_record
/></else>
                    </n.if.equal>
                </n.catch_exception.>
            </else>
        </n.if.not.is_submitted_form>
        <n.html
Macro
Parameters: head, body
>
            <head>
                <META NAME="robots" CONTENT="noindex,nofollow"/>
                <n.title
Macro
Parameters: text
.><t>Create <t.element.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.child_name
Macro
Requires: node
/></t></n.title.>
                <n.subject_field
Macro
Parameters: do
.focus
Macro
Requires: field
/>
                <style type="text/css">
                    div.field-title {
                        margin-top: 0;
                    }
                </style>
            </head>
            <body>
                <n.edit_header
Macro
Parameters: first_text, second_text
 first_text="[n.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.get_app_node
Binary
Namespace: NodeNamespace
Parameters: do
.subject
Macro
Requires: node
/]" second_text="[t]Create new [t.element.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.child_name
Macro
Requires: node
/][/t]" />
                <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.is_submitted_form
Macro
Requires: servlet
>
                    <then>
                        <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.has_exception
Binary
Namespace: BasicNamespace
Parameters: for
 for="save-block">
                            <then.show_new_node_error
Macro
/>
                        </n.if.has_exception>
                    </then>
                </n.if.is_submitted_form>
                <n.form
Macro
Requires: servlet
Parameters: macro, method, onsubmit, content
.>
                    <n.type_field
Macro
Parameters: do
.hidden
Macro
Requires: field
/>
 
                    <div class="field-box light-border-color">
                        <div class="second-font field-title"><t>Name</t></div>
                        <div class="weak-color">
                            <n.subject_field
Macro
Parameters: do
.input
Macro
Requires: field
Parameters: size, maxlength, tabindex, type
 size="40" />
                            (<t>max. 80 characters</t>)
                        </div>
                    </div>
 
                    <div class="field-box light-border-color">
                        <div class="second-font field-title"><t>Description</t></div>
                        <div class="weak-color">
                            <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.visitor
Binary
Namespace: ServletNamespace
Parameters: do
.is_registered
Binary
Namespace: UserNamespace
>
                                <then>
                                    <n.html_format_field
Macro
Parameters: do
.checkbox
Macro
Requires: field
Parameters: style
 />
                                    <label for="[n.html_format_field
Macro
Parameters: do
.name
Binary
Namespace: FieldNamespace
/]"><t>Description is in HTML Format</t></label><br/>
                                    <div style="margin:.1em 0">
                                        <n.editor_toolbar
Macro
Parameters: textarea_id, original_text, node_id
 textarea_id="[n.message_field
Macro
Parameters: do
.name
Binary
Namespace: FieldNamespace
/]"/>
                                    </div>
                                </then>
                            </n.if.visitor.is_registered>
                            <n.message_field
Macro
Parameters: do
.textarea
Macro
Requires: field
Parameters: maxlength, tabindex, style, wrap
 wrap="SOFT" style="min-width:30em;max-width:55em;width:100%;height:12em;" />
                        </div>
                    </div>
 
                    <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.not
Binary
Namespace: BasicNamespace
Parameters: condition
.visitor
Binary
Namespace: ServletNamespace
Parameters: do
.is_registered
Binary
Namespace: UserNamespace
>
                        <then>
                            <div class="weak-color field-box light-border-color" style="padding-top:0">
                                <div>
                                    <div style="padding-bottom:.4em">
                                        <t
Macro
>Since you are not a registered user, we must check that you are a human.</t>
                                    </div>
                                    <n.captcha_control
Macro
/>
                                </div>
                            </div>
                        </then>
                        <else>
                            <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.not
Binary
Namespace: BasicNamespace
Parameters: condition
.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.is_associated_with_mailing_list_archive
Binary
Namespace: NodeNamespace
>
                                <then>
                                    <div style="margin:.5em 0 1em">
                                        <n.is_mailing_list_field
Macro
Parameters: do
.checkbox
Macro
Requires: field
Parameters: style
 />
                                        <label for="[n.is_mailing_list_field
Macro
Parameters: do
.name
Binary
Namespace: FieldNamespace
/]"><t>This is a mailing list archive</t></label>
                                    </div>
                                </then>
                            </n.if.not.page_node.is_associated_with_mailing_list_archive>
                        </else>
                    </n.if.not.visitor.is_registered>
 
                    <input type="submit" class="toolbar action-button" value="[t]Create [t.element.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.child_name
Macro
Requires: node
/][/t]"/>
                    <t>or</t> <a href="[n.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.path
Macro
Requires: node
Parameters: template, date, index_record
 /]"><t>Cancel</t></a>
                </n.form.>
 
                <div class="light-bg-color" style="padding: .5em;margin:1.5em 0 0">
                    <div class="second-font field-title"><t>Related Help Article</t></div>
                    <n.help
Binary
Namespace: NabbleNamespace
Parameters: do
.cataloging
Binary
Namespace: HelpsNs
Parameters: do
.link
Binary
Namespace: HelpNs
/>
                </div>
            </body>
        </n.html>
    </n.node_page.>
</macro>