##// END OF EJS Templates
vcs: streaming will use now 100kb chunks readers for faster throughput
vcs: streaming will use now 100kb chunks readers for faster throughput

File last commit:

r2105:4ad1a937 default
r3327:ddd720d0 default
Show More
new.mako
86 lines | 2.8 KiB | application/x-mako | MakoHtmlLexer
templating: use .mako as extensions for template files.
r1282 ## -*- coding: utf-8 -*-
<%inherit file="/base/base.mako"/>
<%def name="title()">
${_('New Gist')}
%if c.rhodecode_name:
&middot; ${h.branding(c.rhodecode_name)}
%endif
</%def>
<%def name="breadcrumbs_links()">
${_('New Gist')}
</%def>
<%def name="menu_bar_nav()">
${self.menu_items(active='gists')}
</%def>
<%def name="main()">
<div class="box">
<!-- box / title -->
<div class="title">
${self.breadcrumbs()}
</div>
<div class="table">
<div id="files_data">
forms: unified usage of h.secure_form. Make sure we ALWAYS pass in...
r2105 ${h.secure_form(h.route_path('gists_create'), id='eform', request=request)}
templating: use .mako as extensions for template files.
r1282 <div>
<textarea id="description" name="description" placeholder="${_('Gist description ...')}"></textarea>
<span class="gist-gravatar">
${self.gravatar(c.rhodecode_user.email, 30)}
</span>
<label for='gistid'>${_('Gist id')}</label>
${h.text('gistid', placeholder=_('Auto generated'))}
<label for='lifetime'>${_('Gist lifetime')}</label>
${h.dropdownmenu('lifetime', '', c.lifetime_options)}
<label for='acl_level'>${_('Gist access level')}</label>
${h.dropdownmenu('gist_acl_level', '', c.acl_options)}
</div>
<div id="codeblock" class="codeblock">
<div class="code-header">
<div class="form">
<div class="fields">
${h.text('filename', size=30, placeholder=_('name this file...'))}
${h.dropdownmenu('mimetype','plain',[('plain',_('plain'))],enable_filter=True)}
</div>
</div>
</div>
<div id="editor_container">
<div id="editor_pre"></div>
<textarea id="editor" name="content" ></textarea>
</div>
</div>
<div class="pull-right">
${h.submit('private',_('Create Private Gist'),class_="btn")}
${h.submit('public',_('Create Public Gist'),class_="btn")}
${h.reset('reset',_('Reset'),class_="btn")}
</div>
${h.end_form()}
</div>
</div>
</div>
<script type="text/javascript">
var myCodeMirror = initCodeMirror('editor', '');
var modes_select = $('#mimetype');
fillCodeMirrorOptions(modes_select);
var filename_selector = '#filename';
// on change of select field set mode
setCodeMirrorModeFromSelect(
modes_select, filename_selector, myCodeMirror, null);
// on entering the new filename set mode, from given extension
setCodeMirrorModeFromInput(
modes_select, filename_selector, myCodeMirror, null);
</script>
</%def>