comparison rhodecode/templates/files/files_add.html @ 1483:7b67b0dcad6d beta

Added initial support for creating new nodes in repos
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 22 Sep 2011 04:33:29 +0300
parents
children 1db451a44504
comparison
equal deleted inserted replaced
1482:a39c0e5fca89 1483:7b67b0dcad6d
1 <%inherit file="/base/base.html"/>
2
3 <%def name="title()">
4 ${c.repo_name} ${_('Edit file')} - ${c.rhodecode_name}
5 </%def>
6
7 <%def name="js_extra()">
8 <script type="text/javascript" src="${h.url('/js/codemirror.js')}"></script>
9 </%def>
10 <%def name="css_extra()">
11 <link rel="stylesheet" type="text/css" href="${h.url('/css/codemirror.css')}"/>
12 </%def>
13
14 <%def name="breadcrumbs_links()">
15 ${h.link_to(u'Home',h.url('/'))}
16 &raquo;
17 ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
18 &raquo;
19 ${_('add file')} @ R${c.cs.revision}:${h.short_id(c.cs.raw_id)}
20 </%def>
21
22 <%def name="page_nav()">
23 ${self.menu('files')}
24 </%def>
25 <%def name="main()">
26 <div class="box">
27 <!-- box / title -->
28 <div class="title">
29 ${self.breadcrumbs()}
30 <ul class="links">
31 <li>
32 <span style="text-transform: uppercase;">
33 <a href="#">${_('branch')}: ${c.cs.branch}</a></span>
34 </li>
35 </ul>
36 </div>
37 <div class="table">
38 <div id="files_data">
39 ${h.form(h.url.current(),method='post',id='eform')}
40 <h3>${_('Add new file')}</h3>
41 <div class="form">
42 <div class="fields">
43 <div class="field">
44 <div class="label">
45 <label for="location">${_('Location')}</label>
46 </div>
47 <div class="input">
48 <input type="text" value="${c.f_path}" size="30" name="location" id="location">
49 </div>
50 </div>
51
52 <div class="field">
53 <div class="label">
54 <label for="filename">${_('File Name')}:</label>
55 </div>
56 <div class="input">
57 <input type="text" value="" size="30" name="filename" id="filename">
58 </div>
59 </div>
60 </div>
61 </div>
62 <div id="body" class="codeblock">
63 <pre id="editor_pre"></pre>
64 <textarea id="editor" name="content" style="display:none"></textarea>
65 <div style="padding-top: 10px;">${_('commit message')}</div>
66 <textarea id="commit" name="message" style="height: 100px;width: 99%"></textarea>
67 </div>
68 <div style="text-align: right;padding-top: 5px">
69 <input id="reset" type="button" value="${_('Reset')}" class="ui-button-small" />
70 ${h.submit('commit',_('Commit changes'),class_="ui-button-small-blue")}
71 </div>
72 ${h.end_form()}
73 <script type="text/javascript">
74 var myCodeMirror = CodeMirror.fromTextArea(YUD.get('editor'),{
75 mode: "null",
76 lineNumbers:true
77 });
78 YUE.on('reset','click',function(){
79 window.location="${h.url('files_home',repo_name=c.repo_name,revision=c.cs.revision,f_path=c.f_path)}";
80 })
81 </script>
82 </div>
83 </div>
84 </div>
85 </%def>