Mercurial > kallithea
comparison rhodecode/templates/files/files_add.html @ 2031:82a88013a3fd
merge 1.3 into stable
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 26 Feb 2012 17:25:09 +0200 |
parents | f91d3f9b7230 |
children | 76d156bef5a2 |
comparison
equal
deleted
inserted
replaced
2005:ab0e122b38a7 | 2031:82a88013a3fd |
---|---|
18 » | 18 » |
19 ${_('add file')} @ R${c.cs.revision}:${h.short_id(c.cs.raw_id)} | 19 ${_('add file')} @ R${c.cs.revision}:${h.short_id(c.cs.raw_id)} |
20 </%def> | 20 </%def> |
21 | 21 |
22 <%def name="page_nav()"> | 22 <%def name="page_nav()"> |
23 ${self.menu('files')} | 23 ${self.menu('files')} |
24 </%def> | 24 </%def> |
25 <%def name="main()"> | 25 <%def name="main()"> |
26 <div class="box"> | 26 <div class="box"> |
27 <!-- box / title --> | 27 <!-- box / title --> |
28 <div class="title"> | 28 <div class="title"> |
29 ${self.breadcrumbs()} | 29 ${self.breadcrumbs()} |
30 <ul class="links"> | 30 <ul class="links"> |
31 <li> | 31 <li> |
32 <span style="text-transform: uppercase;"> | 32 <span style="text-transform: uppercase;"> |
33 <a href="#">${_('branch')}: ${c.cs.branch}</a></span> | 33 <a href="#">${_('branch')}: ${c.cs.branch}</a></span> |
34 </li> | 34 </li> |
35 </ul> | 35 </ul> |
36 </div> | 36 </div> |
37 <div class="table"> | 37 <div class="table"> |
38 <div id="files_data"> | 38 <div id="files_data"> |
39 ${h.form(h.url.current(),method='post',id='eform',enctype="multipart/form-data")} | 39 ${h.form(h.url.current(),method='post',id='eform',enctype="multipart/form-data")} |
40 <h3>${_('Add new file')}</h3> | 40 <h3>${_('Add new file')}</h3> |
44 <div class="label"> | 44 <div class="label"> |
45 <label for="filename">${_('File Name')}:</label> | 45 <label for="filename">${_('File Name')}:</label> |
46 </div> | 46 </div> |
47 <div class="input"> | 47 <div class="input"> |
48 <input type="text" value="" size="30" name="filename" id="filename"> | 48 <input type="text" value="" size="30" name="filename" id="filename"> |
49 <input type="button" class="ui-button-small" value="upload file" id="upload_file_enable"> | 49 ${_('or')} <span class="ui-btn" id="upload_file_enable">${_('Upload file')}</span> |
50 </div> | 50 </div> |
51 </div> | 51 </div> |
52 <div id="upload_file_container" class="field" style="display:none"> | 52 <div id="upload_file_container" class="field" style="display:none"> |
53 <div class="label"> | 53 <div class="label"> |
54 <label for="location">${_('Upload file')}</label> | 54 <label for="location">${_('Upload file')}</label> |
55 </div> | 55 </div> |
56 <div class="file"> | 56 <div class="file"> |
57 <input type="file" size="30" name="upload_file" id="upload_file"> | 57 <input type="file" size="30" name="upload_file" id="upload_file"> |
58 <input type="button" class="ui-button-small" value="create file" id="file_enable"> | 58 ${_('or')} <span class="ui-btn" id="file_enable">${_('Create new file')}</span> |
59 </div> | 59 </div> |
60 </div> | 60 </div> |
61 <div class="field"> | 61 <div class="field"> |
62 <div class="label"> | 62 <div class="label"> |
63 <label for="location">${_('Location')}</label> | 63 <label for="location">${_('Location')}</label> |
64 </div> | 64 </div> |
65 <div class="input"> | 65 <div class="input"> |
66 <input type="text" value="${c.f_path}" size="30" name="location" id="location"> | 66 <input type="text" value="${c.f_path}" size="30" name="location" id="location"> |
67 ${_('use / to separate directories')} | 67 ${_('use / to separate directories')} |
68 </div> | 68 </div> |
69 </div> | 69 </div> |
70 </div> | 70 </div> |
71 </div> | 71 </div> |
72 <div id="body" class="codeblock"> | 72 <div id="body" class="codeblock"> |
73 <div id="editor_container"> | 73 <div id="editor_container"> |
74 <pre id="editor_pre"></pre> | 74 <pre id="editor_pre"></pre> |
75 <textarea id="editor" name="content" style="display:none"></textarea> | 75 <textarea id="editor" name="content" style="display:none"></textarea> |
76 </div> | 76 </div> |
77 <div style="padding: 10px;color:#666666">${_('commit message')}</div> | 77 <div style="padding: 10px;color:#666666">${_('commit message')}</div> |
78 <textarea id="commit" name="message" style="height: 100px;width: 99%;margin-left:4px"></textarea> | 78 <textarea id="commit" name="message" style="height: 100px;width: 99%;margin-left:4px"></textarea> |
79 </div> | 79 </div> |
80 <div style="text-align: right;padding-top: 5px"> | 80 <div style="text-align: l;padding-top: 5px"> |
81 <input id="reset" type="button" value="${_('Reset')}" class="ui-button-small" /> | 81 ${h.submit('commit',_('Commit changes'),class_="ui-btn")} |
82 ${h.submit('commit',_('Commit changes'),class_="ui-button-small-blue")} | 82 ${h.reset('reset',_('Reset'),class_="ui-btn")} |
83 </div> | 83 </div> |
84 ${h.end_form()} | 84 ${h.end_form()} |
85 <script type="text/javascript"> | 85 <script type="text/javascript"> |
86 var myCodeMirror = CodeMirror.fromTextArea(YUD.get('editor'),{ | 86 var reset_url = "${h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path)}"; |
87 mode: "null", | 87 initCodeMirror('editor',reset_url); |
88 lineNumbers:true | |
89 }); | |
90 YUE.on('reset','click',function(e){ | |
91 window.location="${h.url('files_home',repo_name=c.repo_name,revision=c.cs.revision,f_path=c.f_path)}"; | |
92 }); | |
93 | |
94 YUE.on('file_enable','click',function(){ | |
95 YUD.setStyle('editor_container','display',''); | |
96 YUD.setStyle('upload_file_container','display','none'); | |
97 YUD.setStyle('filename_container','display',''); | |
98 }); | |
99 | |
100 YUE.on('upload_file_enable','click',function(){ | |
101 YUD.setStyle('editor_container','display','none'); | |
102 YUD.setStyle('upload_file_container','display',''); | |
103 YUD.setStyle('filename_container','display','none'); | |
104 }); | |
105 | |
106 </script> | 88 </script> |
107 </div> | 89 </div> |
108 </div> | 90 </div> |
109 </div> | 91 </div> |
110 </%def> | 92 </%def> |