view rhodecode/templates/files/files_add.html @ 4116:ffd45b185016 rhodecode-2.2.5-gpl

Imported some of the GPLv3'd changes from RhodeCode v2.2.5. This imports changes between changesets 21af6c4eab3d and 6177597791c2 in RhodeCode's original repository, including only changes to Python files and HTML. RhodeCode clearly licensed its changes to these files under GPLv3 in their /LICENSE file, which states the following: The Python code and integrated HTML are licensed under the GPLv3 license. (See: https://code.rhodecode.com/rhodecode/files/v2.2.5/LICENSE or http://web.archive.org/web/20140512193334/https://code.rhodecode.com/rhodecode/files/f3b123159901f15426d18e3dc395e8369f70ebe0/LICENSE for an online copy of that LICENSE file) Conservancy reviewed these changes and confirmed that they can be licensed as a whole to the Kallithea project under GPLv3-only. While some of the contents committed herein are clearly licensed GPLv3-or-later, on the whole we must assume the are GPLv3-only, since the statement above from RhodeCode indicates that they intend GPLv3-only as their license, per GPLv3ยง14 and other relevant sections of GPLv3.
author Bradley M. Kuhn <bkuhn@sfconservancy.org>
date Wed, 02 Jul 2014 19:03:13 -0400
parents a60a0e9092c6
children
line wrap: on
line source

<%inherit file="/base/base.html"/>

<%def name="title()">
    ${_('%s Files Add') % c.repo_name}
    %if c.rhodecode_name:
        &middot; ${c.rhodecode_name}
    %endif
</%def>

<%def name="js_extra()">
<script type="text/javascript" src="${h.url('/js/codemirror.js')}"></script>
<script type="text/javascript" src="${h.url('/js/codemirror_loadmode.js')}"></script>
<script type="text/javascript" src="${h.url('/js/mode/meta.js')}"></script>
<script type="text/javascript" src="${h.url('/js/mode/meta_ext.js')}"></script>
</%def>
<%def name="css_extra()">
<link rel="stylesheet" type="text/css" href="${h.url('/css/codemirror.css')}"/>
</%def>

<%def name="page_nav()">
    ${self.menu('repositories')}
</%def>

<%def name="breadcrumbs_links()">
    ${_('Add new file')} @ ${h.show_id(c.cs)}
</%def>

<%def name="main()">
${self.repo_context_bar('files')}
<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" id="edit">
        <div id="files_data">
          ${h.form(h.url.current(),method='post',id='eform',enctype="multipart/form-data", class_="form-horizontal")}
          <h3 class="files_location">
            ${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.cs.raw_id,c.f_path)} /
              <span id="filename_container" class="file reviewer_ac">
                  <input class="input-small" type="text" value="" size="30" name="filename" id="filename" placeholder="${_('Enter filename...')}">
                  <input type="hidden" value="${c.f_path}" size="30" name="location" id="location">
                  ${_('or')} <div class="btn btn-small" id="upload_file_enable">${_('Upload File')}</div>
              </span>
              <span id="upload_file_container" class="reviewer_ac" style="display:none">
                  <input type="file"  size="20" name="upload_file" id="upload_file">
                  ${_('or')} <div class="btn btn-small" id="file_enable">${_('Create New File')}</div>
              </span>
          </h3>
            <div id="body" class="codeblock">
            <div class="code-header" id="set_mode_header">
                <label class="commit" for="set_mode">${_('New file mode')}</label>
                ${h.select('set_mode','plain',[('plain',_('plain'))])}
            </div>
                <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" placeholder="${c.default_message}"></textarea>
            </div>
            <div style="text-align: left;padding-top: 5px">
            ${h.submit('commit',_('Commit changes'),class_="btn btn-small btn-success")}
            ${h.reset('reset',_('Reset'),class_="btn btn-small")}
            </div>
            ${h.end_form()}
            <script type="text/javascript">
            var reset_url = "${h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path)}";
            var myCodeMirror = initCodeMirror('editor',reset_url);
            CodeMirror.modeURL = "${h.url('/js/mode/%N/%N.js')}";

            //inject new modes, based on codeMirrors modeInfo object
            var modes_select = YUD.get('set_mode');
            for(var i=0;i<CodeMirror.modeInfo.length;i++){
                var m = CodeMirror.modeInfo[i];
                var opt = new Option(m.name, m.mode);
                modes_select.options[i+1] = opt
            }
            YUE.on(modes_select, 'change', function(e){
                var selected = e.currentTarget;
                var new_mode = selected.options[selected.selectedIndex].value;
                setCodeMirrorMode(myCodeMirror, new_mode);
            })
            </script>
        </div>
    </div>
</div>
</%def>