comparison src/nabble/view/naml/create_sub_app.naml @ 0:7ecd1a4ef557

add content
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 21 Mar 2019 19:15:52 -0600
parents
children 18cf4872fd7f
comparison
equal deleted inserted replaced
-1:000000000000 0:7ecd1a4ef557
1 <macro name="create_sub_app" requires="servlet">
2 <n.node_page.>
3 <n.if.not.visitor.can_create_sub_apps_under.page_node>
4 <then>
5 <n.login.><t>Only authorized users can proceed in this area.</t></n.login.>
6 </then>
7 </n.if.not.visitor.can_create_sub_apps_under.page_node>
8 <n.if.not.is_submitted_form>
9 <then>
10 <n.type_field.set_value value="[n.page_node.sub_app_type/]" />
11 </then>
12 <else>
13 <n.catch_exception. id="save-block">
14 <n.handle_anonymous_submit/>
15 <n.create_child_of_page_node>
16 <subject><n.subject_field.value/></subject>
17 <message><n.message_field.value/></message>
18 <is_html><n.html_format_field.value/></is_html>
19 <type><n.type_field.value/></type>
20 <kind>app</kind>
21 <do>
22 <n.remember_new_node/>
23 <n.save_node/>
24 </do>
25 </n.create_child_of_page_node>
26 <n.if.visitor.can_edit.page_node>
27 <then.new_node.pin/>
28 </n.if.visitor.can_edit.page_node>
29 <n.if.equal value1="[n.is_mailing_list_field.value/]" value2="[n.true/]">
30 <then><n.redirect_to.new_node.mailing_list_archive_settings_path/></then>
31 <else><n.redirect_to.new_node.path/></else>
32 </n.if.equal>
33 </n.catch_exception.>
34 </else>
35 </n.if.not.is_submitted_form>
36 <n.html>
37 <head>
38 <META NAME="robots" CONTENT="noindex,nofollow"/>
39 <n.title.><t>Create <t.element.page_node.child_name/></t></n.title.>
40 <n.subject_field.focus/>
41 <style type="text/css">
42 div.field-title {
43 margin-top: 0;
44 }
45 </style>
46 </head>
47 <body>
48 <n.edit_header first_text="[n.page_node.get_app_node.subject/]" second_text="[t]Create new [t.element.page_node.child_name/][/t]" />
49 <n.if.is_submitted_form>
50 <then>
51 <n.if.has_exception for="save-block">
52 <then.show_new_node_error/>
53 </n.if.has_exception>
54 </then>
55 </n.if.is_submitted_form>
56 <n.form.>
57 <n.type_field.hidden/>
58
59 <n.if.not.visitor.is_registered>
60 <then>
61 <div class="field-box light-border-color">
62 <div class="second-font field-title"><t>Your Name</t></div>
63 <div class="weak-color">
64 <n.if.is_null.visitor.name>
65 <then.anonymous_name_field.input size="30" />
66 <else.visitor.name/>
67 </n.if.is_null.visitor.name>
68 </div>
69 </div>
70 </then>
71 </n.if.not.visitor.is_registered>
72
73 <div class="field-box light-border-color">
74 <div class="second-font field-title"><t>Name</t></div>
75 <div class="weak-color">
76 <n.subject_field.input size="40" />
77 (<t>max. 80 characters</t>)
78 </div>
79 </div>
80
81 <div class="field-box light-border-color">
82 <div class="second-font field-title"><t>Description</t></div>
83 <div class="weak-color">
84 <n.if.visitor.is_registered>
85 <then>
86 <n.html_format_field.checkbox />
87 <label for="[n.html_format_field.name/]"><t>Description is in HTML Format</t></label><br/>
88 <div style="margin:.1em 0">
89 <n.editor_toolbar textarea_id="[n.message_field.name/]"/>
90 </div>
91 </then>
92 </n.if.visitor.is_registered>
93 <n.message_field.textarea wrap="SOFT" style="min-width:30em;max-width:55em;width:100%;height:12em;" />
94 </div>
95 </div>
96
97 <n.if.not.visitor.is_registered>
98 <then>
99 <div class="weak-color field-box light-border-color" style="padding-top:0">
100 <div>
101 <div style="padding-bottom:.4em">
102 <t>Since you are not a registered user, we must check that you are a human.</t>
103 </div>
104 <n.captcha_control/>
105 </div>
106 </div>
107 </then>
108 <else>
109 <n.if.not.page_node.is_associated_with_mailing_list_archive>
110 <then>
111 <div style="margin:.5em 0 1em">
112 <n.is_mailing_list_field.checkbox />
113 <label for="[n.is_mailing_list_field.name/]"><t>This is a mailing list archive</t></label>
114 </div>
115 </then>
116 </n.if.not.page_node.is_associated_with_mailing_list_archive>
117 </else>
118 </n.if.not.visitor.is_registered>
119
120 <input type="submit" class="toolbar action-button" value="[t]Create [t.element.page_node.child_name/][/t]"/>
121 <t>or</t> <a href="[n.page_node.path /]"><t>Cancel</t></a>
122 </n.form.>
123
124 <div class="light-bg-color" style="padding: .5em;margin:1.5em 0 0">
125 <div class="second-font field-title"><t>Related Help Article</t></div>
126 <n.help.cataloging.link/>
127 </div>
128 </body>
129 </n.html>
130 </n.node_page.>
131 </macro>
132
133 <macro name="is_mailing_list_field" dot_parameter="do">
134 <n.field. name="is_mailing_list"><n.do/></n.field.>
135 </macro>
136
137 <macro name="sub_app_type" requires="node">
138 <n.if.regex_matches text="[n.type/]" pattern="forum|category|mixed">
139 <then>forum</then>
140 <else>
141 <n.if.type equals="board">
142 <then>category</then>
143 <else><n.type/></else>
144 </n.if.type>
145 </else>
146 </n.if.regex_matches>
147 </macro>