root/trunk/Vanilla/templates/vanilla+create-entry/create-entry.mtml @ 919

Revision 919, 2.3 kB (checked in by bsmith, 16 months ago)

various updates

Line 
1<mt:IncludeBlock module="wrapper">
2
3    <mt:SetVarBlock name="html_head">
4    <script type="text/javascript">
5    <!--
6    function entry_create_loggedin() {
7        var u = mtGetUser();
8        var loggedin = u && u.is_authenticated && u.is_author ? true : false;
9        var eid = 'logged_in';
10        conditional_block(loggedin, eid);
11        if (!loggedin) {
12            var p = document.getElementById('login_message');
13            if (!p) return;
14            if (u && !u.is_author)
15                p.innerHTML = "<__trans phrase="In order to create an entry on this blog you must first register.">";
16            else
17                if (u && !u.can_post)
18                    p.innerHTML = "<__trans phrase="You do not have permission to post.">";
19                else
20                    p.innerHTML = '<a href="javascript:void(0)" onclick="return mtSignInOnClick(\'login_message\')"><__trans phrase="Sign in to create an entry." escape="js"></a>';
21        } else {
22            var mt = document.getElementById('magic_token');
23            if (mt) mt.value = u.sid;
24        }
25    }
26    //-->
27    </script>
28    </mt:SetVarBlock>
29
30    <h1><__trans phrase="Create Entry"></h1>
31
32    <mt:IfLoggedIn script="entry_create_loggedin" class="foo">
33        <form method="post" action="<$mt:CGIPath$><$mt:CommunityScript$>" name="entry_form" id="create-entry-form" enctype="multipart/form-data">
34            <input type="hidden" name="__mode" value="post" />
35            <input type="hidden" name="blog_id" value="<$mt:BlogID$>" />
36            <input type="hidden" id="magic_token" name="magic_token" value="" />
37            <div>
38                <label for="entry-title"><__trans phrase="Title"></label>
39                <input id="entry-title" class="ti" name="title" />
40            </div>
41            <div>
42                <label for="entry-title"><__trans phrase="Body"></label>
43                <textarea id="entry-body" class="ta" name="text" rows="15" cols="50"></textarea>
44            </div>
45            <input type="submit" accesskey="s" name="post" id="entry-submit" value="<__trans phrase="Submit">" />
46        </form>
47    <mt:Else>
48        <p id="login_message"></p>
49    </mt:IfLoggedIn>
50    <script type="text/javascript">
51    <!--
52    mtAttachEvent('usersignin', entry_create_loggedin);
53    //-->
54    </script>
55
56</mt:IncludeBlock>
Note: See TracBrowser for help on using the browser.