Files
@ 9dd726706178
Branch filter:
Location: kallithea/rhodecode/templates/admin/gists/new.html
9dd726706178
4.3 KiB
text/html
Complete copyright notices for web interface; change footer to link to them.
The original copyright notice found in the footer was not accurate as it
included only one of the many copyright holders in this project. This change
creates an "about" page, which currently contains just the copyright and
license information. It links to repository for additional potential copyright
holders not listed on the about page.
Unlisted contributors are mentioned in template comments.
Html links for Kallithea is fixed and we link to Conservancy.
Display of version information in the footer is improved.
The original copyright notice found in the footer was not accurate as it
included only one of the many copyright holders in this project. This change
creates an "about" page, which currently contains just the copyright and
license information. It links to repository for additional potential copyright
holders not listed on the about page.
Unlisted contributors are mentioned in template comments.
Html links for Kallithea is fixed and we link to Conservancy.
Display of version information in the footer is improved.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | ## -*- coding: utf-8 -*-
<%inherit file="/base/base.html"/>
<%def name="title()">
${_('New Gist')}
%if c.rhodecode_name:
· ${c.rhodecode_name}
%endif
</%def>
<%def name="js_extra()">
<script type="text/javascript" src="${h.url('/js/codemirror.js')}"></script>
<script type="text/javascript" src="${h.url('/js/codemirror_loadmode.js')}"></script>
<script type="text/javascript" src="${h.url('/js/mode/meta.js')}"></script>
<script type="text/javascript" src="${h.url('/js/mode/meta_ext.js')}"></script>
</%def>
<%def name="css_extra()">
<link rel="stylesheet" type="text/css" href="${h.url('/css/codemirror.css')}"/>
</%def>
<%def name="breadcrumbs_links()">
${_('New Gist')}
</%def>
<%def name="page_nav()">
${self.menu('gists')}
</%def>
<%def name="main()">
<div class="box">
<!-- box / title -->
<div class="title">
${self.breadcrumbs()}
</div>
<div class="table">
<div id="files_data">
${h.form(h.url('gists'), method='post',id='eform')}
<div>
<div class="gravatar">
<img alt="gravatar" src="${h.gravatar_url(h.email_or_none(c.rhodecode_user.full_contact),32)}"/>
</div>
<textarea style="resize:vertical; width:400px;border: 1px solid #ccc;border-radius: 3px;" id="description" name="description" placeholder="${_('Gist description ...')}"></textarea>
<div style="padding:0px 0px 0px 42px">
<label for='lifetime'>${_('Gist lifetime')}</label>
${h.select('lifetime', '', c.lifetime_options)}
</div>
</div>
<div id="body" class="codeblock">
<div style="padding: 10px 10px 10px 26px;color:#666666">
${h.text('filename', size=30, placeholder=_('name this file...'))}
${h.select('mimetype','plain',[('plain',_('plain'))])}
</div>
<div id="editor_container">
<pre id="editor_pre"></pre>
<textarea id="editor" name="content" style="display:none"></textarea>
</div>
</div>
<div style="padding-top: 5px">
${h.submit('private',_('Create Private Gist'),class_="btn btn-mini btn-success")}
${h.submit('public',_('Create Public Gist'),class_="btn btn-mini")}
${h.reset('reset',_('Reset'),class_="btn btn-mini")}
</div>
${h.end_form()}
<script type="text/javascript">
var myCodeMirror = initCodeMirror('editor', '');
CodeMirror.modeURL = "${h.url('/js/mode/%N/%N.js')}";
//inject new modes
var modes_select = $('#mimetype');
for(var i=0;i<CodeMirror.modeInfo.length;i++){
var m = CodeMirror.modeInfo[i];
var opt = new Option(m.name, m.mime);
YUD.setAttribute(opt, 'mode', m.mode)
modes_select[0].options[i+1] = opt;
}
var filename_selector = '#filename';
// on select change set new mode
modes_select.on('change', function(e){
var selected = e.currentTarget;
var node = selected.options[selected.selectedIndex];
var mimetype = node.value;
var new_mode = YUD.getAttribute(node, 'mode')
setCodeMirrorMode(myCodeMirror, new_mode);
var proposed_ext = getExtFromMimeType(mimetype);
var file_data = getFilenameAndExt($(filename_selector).val());
var filename = file_data['filename'] || 'filename1';
$(filename_selector).val(filename + proposed_ext);
})
// on type the new filename set mode
$(filename_selector).on('keyup', function(e){
var file_data = getFilenameAndExt(this.value);
if(file_data['ext'] != null){
var mimetype = getMimeTypeFromExt(file_data['ext']);
var detected_mode = detectCodeMirrorMode(this.value, mimetype);
if (detected_mode){
setCodeMirrorMode(myCodeMirror, detected_mode);
modes_select.val(mimetype)
}
}
})
</script>
</div>
</div>
</div>
</%def>
|