Files
@ 9b80fb893e7f
Branch filter:
Location: kallithea/rhodecode/templates/files/files_add.html
9b80fb893e7f
4.6 KiB
text/html
fix for issue #277,
- cleaned the LDAP code a little
- cleaned the LDAP code a little
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 111 | <%inherit file="/base/base.html"/>
<%def name="title()">
${c.repo_name} ${_('Edit file')} - ${c.rhodecode_name}
</%def>
<%def name="js_extra()">
<script type="text/javascript" src="${h.url('/js/codemirror.js')}"></script>
</%def>
<%def name="css_extra()">
<link rel="stylesheet" type="text/css" href="${h.url('/css/codemirror.css')}"/>
</%def>
<%def name="breadcrumbs_links()">
${h.link_to(u'Home',h.url('/'))}
»
${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
»
${_('add file')} @ R${c.cs.revision}:${h.short_id(c.cs.raw_id)}
</%def>
<%def name="page_nav()">
${self.menu('files')}
</%def>
<%def name="main()">
<div class="box">
<!-- box / title -->
<div class="title">
${self.breadcrumbs()}
<ul class="links">
<li>
<span style="text-transform: uppercase;">
<a href="#">${_('branch')}: ${c.cs.branch}</a></span>
</li>
</ul>
</div>
<div class="table">
<div id="files_data">
${h.form(h.url.current(),method='post',id='eform',enctype="multipart/form-data")}
<h3>${_('Add new file')}</h3>
<div class="form">
<div class="fields">
<div class="field">
<div class="label">
<label for="location">${_('Location')}</label>
</div>
<div class="input">
<input type="text" value="${c.f_path}" size="30" name="location" id="location">
${_('use / to separate directories')}
</div>
</div>
<div id="filename_container" class="field file">
<div class="label">
<label for="filename">${_('File Name')}:</label>
</div>
<div class="input">
<input type="text" value="" size="30" name="filename" id="filename">
<input type="button" class="ui-button-small" value="upload file" id="upload_file_enable">
</div>
</div>
<div id="upload_file_container" class="field" style="display:none">
<div class="label">
<label for="location">${_('Upload file')}</label>
</div>
<div class="file">
<input type="file" size="30" name="upload_file" id="upload_file">
<input type="button" class="ui-button-small" value="create file" id="file_enable">
</div>
</div>
</div>
</div>
<div id="body" class="codeblock">
<div id="editor_container">
<pre id="editor_pre"></pre>
<textarea id="editor" name="content" style="display:none"></textarea>
</div>
<div style="padding: 10px;color:#666666">${_('commit message')}</div>
<textarea id="commit" name="message" style="height: 100px;width: 99%;margin-left:4px"></textarea>
</div>
<div style="text-align: right;padding-top: 5px">
<input id="reset" type="button" value="${_('Reset')}" class="ui-button-small" />
${h.submit('commit',_('Commit changes'),class_="ui-button-small-blue")}
</div>
${h.end_form()}
<script type="text/javascript">
var myCodeMirror = CodeMirror.fromTextArea(YUD.get('editor'),{
mode: "null",
lineNumbers:true
});
YUE.on('reset','click',function(e){
window.location="${h.url('files_home',repo_name=c.repo_name,revision=c.cs.revision,f_path=c.f_path)}";
});
YUE.on('file_enable','click',function(){
YUD.setStyle('editor_container','display','');
YUD.setStyle('upload_file_container','display','none');
YUD.setStyle('filename_container','display','');
});
YUE.on('upload_file_enable','click',function(){
YUD.setStyle('editor_container','display','none');
YUD.setStyle('upload_file_container','display','');
YUD.setStyle('filename_container','display','none');
});
</script>
</div>
</div>
</div>
</%def>
|