annotate rhodecode/templates/files/files_edit.html @ 3237:f5dd76e2a7af beta

disable file editing when not on branch head fixes issue #462
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 27 Jan 2013 00:18:49 +0100
parents c20adbaf16af
children 1f334a68d057
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1305
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
1 <%inherit file="/base/base.html"/>
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
2
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
3 <%def name="title()">
2417
76d156bef5a2 Better i18n for page titles.
Vincent Duvert <vincent@duvert.net>
parents: 2199
diff changeset
4 ${_('%s Edit file') % c.repo_name} - ${c.rhodecode_name}
1305
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
5 </%def>
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
6
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
7 <%def name="js_extra()">
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
8 <script type="text/javascript" src="${h.url('/js/codemirror.js')}"></script>
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
9 </%def>
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
10 <%def name="css_extra()">
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
11 <link rel="stylesheet" type="text/css" href="${h.url('/css/codemirror.css')}"/>
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
12 </%def>
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
13
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
14 <%def name="breadcrumbs_links()">
2492
79818f546538 i18n 'Home' in breadcrumbs
Takumi IINO <trot.thunder@gmail.com>
parents: 2417
diff changeset
15 ${h.link_to(_(u'Home'),h.url('/'))}
1305
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
16 &raquo;
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
17 ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
18 &raquo;
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
19 ${_('edit file')} @ R${c.cs.revision}:${h.short_id(c.cs.raw_id)}
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
20 </%def>
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
21
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
22 <%def name="page_nav()">
3198
c20adbaf16af html: random indentation fixes
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
23 ${self.menu('files')}
1305
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
24 </%def>
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
25 <%def name="main()">
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
26 <div class="box">
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
27 <!-- box / title -->
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
28 <div class="title">
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
29 ${self.breadcrumbs()}
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
30 <ul class="links">
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
31 <li>
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
32 <span style="text-transform: uppercase;">
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
33 <a href="#">${_('branch')}: ${c.cs.branch}</a></span>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
34 </li>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
35 </ul>
1305
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
36 </div>
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
37 <div class="table">
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 2492
diff changeset
38 <div id="files_data">
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 2492
diff changeset
39 <h3 class="files_location">${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.cs.revision,c.file.path)}</h3>
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 2492
diff changeset
40 ${h.form(h.url.current(),method='post',id='eform')}
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 2492
diff changeset
41 <div id="body" class="codeblock">
1737
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1720
diff changeset
42 <div class="code-header">
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1720
diff changeset
43 <div class="stats">
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1720
diff changeset
44 <div class="left"><img src="${h.url('/images/icons/file.png')}"/></div>
2084
feb0fccdcf83 fixed vcs issue with last_changeset for filenodes
Marcin Kuzminski <marcin@python-works.com>
parents: 1888
diff changeset
45 <div class="left item">${h.link_to("r%s:%s" % (c.file.changeset.revision,h.short_id(c.file.changeset.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=c.file.changeset.raw_id))}</div>
1737
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1720
diff changeset
46 <div class="left item">${h.format_byte_size(c.file.size,binary=True)}</div>
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1720
diff changeset
47 <div class="left item last">${c.file.mimetype}</div>
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1720
diff changeset
48 <div class="buttons">
1756
Marcin Kuzminski <marcin@python-works.com>
parents: 1737
diff changeset
49 ${h.link_to(_('show annotation'),h.url('files_annotate_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="ui-btn")}
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
50 ${h.link_to(_('show as raw'),h.url('files_raw_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="ui-btn")}
1756
Marcin Kuzminski <marcin@python-works.com>
parents: 1737
diff changeset
51 ${h.link_to(_('download as raw'),h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="ui-btn")}
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
52 % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
1737
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1720
diff changeset
53 % if not c.file.is_binary:
1756
Marcin Kuzminski <marcin@python-works.com>
parents: 1737
diff changeset
54 ${h.link_to(_('source'),h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="ui-btn")}
1737
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1720
diff changeset
55 % endif
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
56 % endif
1737
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1720
diff changeset
57 </div>
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1720
diff changeset
58 </div>
2199
31ebf7010566 various fixes for git and mercurial with InMemoryCommit backend and non-ascii files
Marcin Kuzminski <marcin@python-works.com>
parents: 2084
diff changeset
59 <div class="commit">${_('Editing file')}: ${c.file.unicode_path}</div>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
60 </div>
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 2492
diff changeset
61 <pre id="editor_pre"></pre>
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 2492
diff changeset
62 <textarea id="editor" name="content" style="display:none">${h.escape(c.file.content)|n}</textarea>
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 2492
diff changeset
63 <div style="padding: 10px;color:#666666">${_('commit message')}</div>
3237
f5dd76e2a7af disable file editing when not on branch head fixes issue #462
Marcin Kuzminski <marcin@python-works.com>
parents: 3198
diff changeset
64 <textarea id="commit" name="message" style="height: 60px;width: 99%;margin-left:4px" placeholder="${c.default_message}"></textarea>
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 2492
diff changeset
65 </div>
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 2492
diff changeset
66 <div style="text-align: left;padding-top: 5px">
1756
Marcin Kuzminski <marcin@python-works.com>
parents: 1737
diff changeset
67 ${h.submit('commit',_('Commit changes'),class_="ui-btn")}
Marcin Kuzminski <marcin@python-works.com>
parents: 1737
diff changeset
68 ${h.reset('reset',_('Reset'),class_="ui-btn")}
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 2492
diff changeset
69 </div>
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 2492
diff changeset
70 ${h.end_form()}
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 2492
diff changeset
71 <script type="text/javascript">
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 2492
diff changeset
72 var reset_url = "${h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.file.path)}";
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 2492
diff changeset
73 initCodeMirror('editor',reset_url);
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 2492
diff changeset
74 </script>
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 2492
diff changeset
75 </div>
1305
166317d464f3 Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
76 </div>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
77 </div>
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1789
diff changeset
78 </%def>