##// END OF EJS Templates
gists: use left-sided action button
marcink -
r4123:54164c4e default
parent child Browse files
Show More
@@ -1,105 +1,103 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
2 <%inherit file="/base/base.mako"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${_('New Gist')}
5 ${_('New Gist')}
6 %if c.rhodecode_name:
6 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
7 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
8 %endif
9 </%def>
9 </%def>
10
10
11 <%def name="breadcrumbs_links()"></%def>
11 <%def name="breadcrumbs_links()"></%def>
12
12
13 <%def name="menu_bar_nav()">
13 <%def name="menu_bar_nav()">
14 ${self.menu_items(active='gists')}
14 ${self.menu_items(active='gists')}
15 </%def>
15 </%def>
16
16
17 <%def name="main()">
17 <%def name="main()">
18 <div class="box">
18 <div class="box">
19 <!-- box / title -->
19 <!-- box / title -->
20 <div class="title">
20 <div class="title">
21
21
22 </div>
22 </div>
23
23
24 <div class="table">
24 <div class="table">
25 <div id="files_data">
25 <div id="files_data">
26 ${h.secure_form(h.route_path('gists_create'), id='eform', request=request)}
26 ${h.secure_form(h.route_path('gists_create'), id='eform', request=request)}
27 <div>
27 <div>
28 <span class="gist-gravatar">
28 <span class="gist-gravatar">
29 ${self.gravatar(c.rhodecode_user.email, 30)}
29 ${self.gravatar(c.rhodecode_user.email, 30)}
30 </span>
30 </span>
31 <label for='gistid'>${_('Gist id')}</label>
31 <label for='gistid'>${_('Gist id')}</label>
32 ${h.text('gistid', placeholder=_('Auto generated'))}
32 ${h.text('gistid', placeholder=_('Auto generated'))}
33
33
34 <label for='lifetime'>${_('Gist lifetime')}</label>
34 <label for='lifetime'>${_('Gist lifetime')}</label>
35 ${h.dropdownmenu('lifetime', '', c.lifetime_options)}
35 ${h.dropdownmenu('lifetime', '', c.lifetime_options)}
36
36
37 <label for='acl_level'>${_('Private Gist access level')}</label>
37 <label for='acl_level'>${_('Private Gist access level')}</label>
38 ${h.dropdownmenu('gist_acl_level', '', c.acl_options)}
38 ${h.dropdownmenu('gist_acl_level', '', c.acl_options)}
39
39
40 <textarea style="margin-top: 5px; border-color: #dbd9da" id="description" name="description" placeholder="${_('Gist description ...')}"></textarea>
40 <textarea style="margin-top: 5px; border-color: #dbd9da" id="description" name="description" placeholder="${_('Gist description ...')}"></textarea>
41 </div>
41 </div>
42
42
43 <div id="codeblock" class="codeblock">
43 <div id="codeblock" class="codeblock">
44 <div class="code-header">
44 <div class="code-header">
45 <div class="form">
45 <div class="form">
46 <div class="fields">
46 <div class="fields">
47 ${h.text('filename', size=30, placeholder=_('name gist file...'))}
47 ${h.text('filename', size=30, placeholder=_('name gist file...'))}
48 ${h.dropdownmenu('mimetype','plain',[('plain',_('plain'))],enable_filter=True)}
48 ${h.dropdownmenu('mimetype','plain',[('plain',_('plain'))],enable_filter=True)}
49 </div>
49 </div>
50 </div>
50 </div>
51 </div>
51 </div>
52
52
53 <div id="editor_container">
53 <div id="editor_container">
54 <div id="editor_pre"></div>
54 <div id="editor_pre"></div>
55 <textarea id="editor" name="content" ></textarea>
55 <textarea id="editor" name="content" ></textarea>
56 </div>
56 </div>
57 </div>
57 </div>
58
58
59 <div class="pull-right">
59 <div class="pull-left">
60 ##<i class="tooltip icon-info" title="${_('Secret gists are hidden from listing, but accessible to anyone who knows the url.')}"></i>
61
62 <div class="pull-right">
60 <div class="pull-right">
63 ${h.submit('create',_('Create Gist'),class_="btn")}
61 ${h.submit('create',_('Create Gist'),class_="btn")}
64 </div>
62 </div>
65 <div class="rcform-element pull-right">
63 <div class="rcform-element pull-right">
66 <div class="fields gist-type-fields">
64 <div class="fields gist-type-fields">
67 <fieldset>
65 <fieldset>
68 <div class="gist-type-fields-wrapper">
66 <div class="gist-type-fields-wrapper">
69
67
70 <input type="radio" id="private_gist" checked="" name="gist_type" value="private">
68 <input type="radio" id="private_gist" checked="" name="gist_type" value="private">
71 <label for="private_gist">${_('Private Gist')}</label>
69 <label for="private_gist">${_('Private Gist')}</label>
72 <span class="tooltip label" title="${_('Private Gists are not listed and only accessible through their secret url.')}">${_('Private Gist')}</span>
70 <span class="tooltip label" title="${_('Private Gists are not listed and only accessible through their secret url.')}">${_('Private Gist')}</span>
73
71
74 <input type="radio" id="public_gist" name="gist_type" value="public">
72 <input type="radio" id="public_gist" name="gist_type" value="public">
75 <label for="public_gist">${_('Public Gist')}</label>
73 <label for="public_gist">${_('Public Gist')}</label>
76 <span class="tooltip label" title="${_('Public Gists are accessible to anyone and listed in Gists page.')}">${_('Public Gist')}</span>
74 <span class="tooltip label" title="${_('Public Gists are accessible to anyone and listed in Gists page.')}">${_('Public Gist')}</span>
77 </div>
75 </div>
78 </fieldset>
76 </fieldset>
79 </div>
77 </div>
80 </div>
78 </div>
81
79
82 </div>
80 </div>
83 ${h.end_form()}
81 ${h.end_form()}
84 </div>
82 </div>
85 </div>
83 </div>
86
84
87 </div>
85 </div>
88
86
89 <script type="text/javascript">
87 <script type="text/javascript">
90 var myCodeMirror = initCodeMirror('editor', '');
88 var myCodeMirror = initCodeMirror('editor', '');
91
89
92 var modes_select = $('#mimetype');
90 var modes_select = $('#mimetype');
93 fillCodeMirrorOptions(modes_select);
91 fillCodeMirrorOptions(modes_select);
94
92
95 var filename_selector = '#filename';
93 var filename_selector = '#filename';
96 // on change of select field set mode
94 // on change of select field set mode
97 setCodeMirrorModeFromSelect(
95 setCodeMirrorModeFromSelect(
98 modes_select, filename_selector, myCodeMirror, null);
96 modes_select, filename_selector, myCodeMirror, null);
99
97
100 // on entering the new filename set mode, from given extension
98 // on entering the new filename set mode, from given extension
101 setCodeMirrorModeFromInput(
99 setCodeMirrorModeFromInput(
102 modes_select, filename_selector, myCodeMirror, null);
100 modes_select, filename_selector, myCodeMirror, null);
103
101
104 </script>
102 </script>
105 </%def>
103 </%def>
General Comments 0
You need to be logged in to leave comments. Login now