##// END OF EJS Templates
vcs: do an early detection of vcs-type request....
vcs: do an early detection of vcs-type request. We we to know to detect vcs type request as early as possible. IF we know we're handling an VCS request, we can skip some of the pylons stack initialization. - This fixes issues with leaking sessions and other object from pylons into a purely VCS type request.

File last commit:

r1282:90601d74 default
r1297:de699d5e default
Show More
new.mako
86 lines | 2.8 KiB | application/x-mako | MakoHtmlLexer
## -*- 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">
${h.secure_form(h.url('gists'), method='post',id='eform')}
<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>