##// END OF EJS Templates
hovercards: added commit hovercard for files, and dashboard views.
hovercards: added commit hovercard for files, and dashboard views.

File last commit:

r3882:74da9073 default
r4032:07c1bd09 default
Show More
files_edit.mako
124 lines | 4.3 KiB | application/x-mako | MakoHtmlLexer
templating: use .mako as extensions for template files.
r1282 <%inherit file="/base/base.mako"/>
<%def name="title()">
dan
file: new file editors...
r3754 ${_('{} Files Edit').format(c.repo_name)}
templating: use .mako as extensions for template files.
r1282 %if c.rhodecode_name:
&middot; ${h.branding(c.rhodecode_name)}
%endif
</%def>
<%def name="menu_bar_nav()">
${self.menu_items(active='repositories')}
</%def>
dan
file: new file editors...
r3754 <%def name="breadcrumbs_links()"></%def>
templating: use .mako as extensions for template files.
r1282
<%def name="menu_bar_subnav()">
${self.repo_menu(active='files')}
</%def>
<%def name="main()">
dan
file: new file editors...
r3754
templating: use .mako as extensions for template files.
r1282 <div class="box">
dan
file: new file editors...
r3754
templating: use .mako as extensions for template files.
r1282 <div class="edit-file-title">
dan
file: new file editors...
r3754 <span class="title-heading">${_('Edit file')} @ <code>${h.show_id(c.commit)}</code></span>
dan
files: fixed branch icon for SVN...
r3755 % if c.commit.branch:
<span class="tag branchtag">
<i class="icon-branch"></i> ${c.commit.branch}
</span>
% endif
templating: use .mako as extensions for template files.
r1282 </div>
dan
file: new file editors...
r3754
${h.secure_form(h.route_path('repo_files_update_file', repo_name=c.repo_name, commit_id=c.commit.raw_id, f_path=c.f_path), id='eform', request=request)}
templating: use .mako as extensions for template files.
r1282 <div class="edit-file-fieldset">
dan
file: new file editors...
r3754 <div class="path-items">
<ul>
<li class="breadcrumb-path">
<div>
<a href="${h.route_path('repo_files', repo_name=c.repo_name, commit_id=c.commit.raw_id, f_path='')}"><i class="icon-home"></i></a> /
<a href="${h.route_path('repo_files', repo_name=c.repo_name, commit_id=c.commit.raw_id, f_path=c.file.dir_path)}">${c.file.dir_path}</a> ${('/' if c.file.dir_path else '')}
templating: use .mako as extensions for template files.
r1282 </div>
dan
file: new file editors...
r3754 </li>
<li class="location-path">
<input type="hidden" value="${c.f_path}" name="root_path">
<input class="file-name-input input-small" type="text" value="${c.file.name}" name="filename" id="filename" placeholder="${_('Filename e.g example.py, or docs/readme.md')}">
</li>
</ul>
templating: use .mako as extensions for template files.
r1282 </div>
dan
file: new file editors...
r3754
templating: use .mako as extensions for template files.
r1282 </div>
<div class="table">
ui: new commits page....
r3882 <div>
templating: use .mako as extensions for template files.
r1282
dan
file: new file editors...
r3754 <div id="codeblock" class="codeblock">
<div class="editor-items">
<div class="editor-action active show-editor pull-left" onclick="fileEditor.showEditor(); return false">
${_('Edit')}
</div>
<div class="editor-action show-preview pull-left" onclick="fileEditor.showPreview(); return false">
${_('Preview')}
</div>
files: ported repository files controllers to pyramid views.
r1927
dan
file: new file editors...
r3754 <div class="pull-right">
${h.dropdownmenu('line_wrap', 'off', [('on', _('Line wraps on')), ('off', _('line wraps off')),])}
</div>
<div class="pull-right">
${h.dropdownmenu('set_mode','plain',[('plain', _('plain'))],enable_filter=True)}
</div>
templating: use .mako as extensions for template files.
r1282 </div>
dan
file: new file editors...
r3754 <div id="editor_container">
<pre id="editor_pre"></pre>
<textarea id="editor" name="content" >${h.escape(c.file.content)|n}</textarea>
<div id="editor_preview" ></div>
</div>
templating: use .mako as extensions for template files.
r1282 </div>
</div>
</div>
<div class="edit-file-fieldset">
<div class="fieldset">
dan
file: new file editors...
r3754 <div class="message">
<textarea id="commit" name="message" placeholder="${c.default_message}"></textarea>
templating: use .mako as extensions for template files.
r1282 </div>
</div>
dan
file: new file editors...
r3754 <div class="pull-left">
${h.submit('commit_btn',_('Commit changes'), class_="btn btn-small btn-success")}
templating: use .mako as extensions for template files.
r1282 </div>
</div>
${h.end_form()}
</div>
<script type="text/javascript">
dan
file: new file editors...
r3754 $(document).ready(function() {
templating: use .mako as extensions for template files.
r1282 var modes_select = $('#set_mode');
dan
file: new file editors...
r3754 var filename_selector = '#filename';
templating: use .mako as extensions for template files.
r1282 fillCodeMirrorOptions(modes_select);
dan
file: new file editors...
r3754 fileEditor = new FileEditor('#editor');
templating: use .mako as extensions for template files.
r1282 // try to detect the mode based on the file we edit
dan
file: new file editors...
r3754 var detected_mode = detectCodeMirrorMode("${c.file.name}", "${c.file.mimetype}");
templating: use .mako as extensions for template files.
r1282
dan
file: new file editors...
r3754 if (detected_mode) {
setCodeMirrorMode(fileEditor.cm, detected_mode);
var mimetype = $(modes_select).find("option[mode={0}]".format(detected_mode)).val();
$(modes_select).select2("val", mimetype).trigger('change');
templating: use .mako as extensions for template files.
r1282 }
// on change of select field set mode
dan
file: new file editors...
r3754 setCodeMirrorModeFromSelect(modes_select, filename_selector, fileEditor.cm, null);
templating: use .mako as extensions for template files.
r1282
// on entering the new filename set mode, from given extension
dan
file: new file editors...
r3754 setCodeMirrorModeFromInput(modes_select, filename_selector, fileEditor.cm, null);
templating: use .mako as extensions for template files.
r1282
dan
file: new file editors...
r3754 });
templating: use .mako as extensions for template files.
r1282
</script>
</%def>