Blame pagure/templates/edit_file.html

Pierre-Yves Chibon 7ff840
{% extends "repo_master.html" %}
Pierre-Yves Chibon 7ff840
Pierre-Yves Chibon ff8880
{% block title %}Edit - {{
Pierre-Yves Chibon ff8880
    repo.namespace + '/' if repo.namespace }}{{ repo.name }}{% endblock %}
Ryan Lerch f4adb4
{% set tag = "home" %}
Ryan Lerch f6b451
{% block header %}
Neha Kandpal 68fd3d
<script src="{{ url_for('static', filename='vendor/codemirror/codemirror.js') }}?version={{ g.version}}"></script>
Neha Kandpal 68fd3d
<link href="{{ url_for('static', filename='vendor/codemirror/codemirror.css') }}?version={{ g.version}}" rel="stylesheet">
Ryan Lerch f6b451
{% endblock%}
Pierre-Yves Chibon 7ff840
Pierre-Yves Chibon 7ff840
{% block repo %}
Pierre-Yves Chibon 7ff840
Ryan Lerch f6b451
Ryan Lerch f6b451
  
Ryan Lerch 0f2b01
      
    Pierre-Yves Chibon b130e5
          
  1. Pierre-Yves Chibon 08a80b
                repo=repo.name,
    Pierre-Yves Chibon 08a80b
                username=username,
    Pierre-Yves Chibon 08a80b
                namespace=repo.namespace,
    Pierre-Yves Chibon 08a80b
                identifier=branchname)
    Ryan Lerch 6d2e06
          }}">  {{ branchname }}{%
    Ryan Lerch f6b451
        for file in filename.split('/') %}
    Pradeep CE (cep) 886066
          {% set path = '/'.join(filename.split('/')[:loop.index]) %}
    Ryan Lerch f6b451
          {% if loop.index != loop.length %}
  2. Pierre-Yves Chibon b130e5
          href="{{ url_for('ui_ns.view_file',
    Pierre-Yves Chibon 08a80b
                repo=repo.name,
    Pierre-Yves Chibon 08a80b
                username=username,
    Pierre-Yves Chibon 08a80b
                namespace=repo.namespace,
    Pierre-Yves Chibon 08a80b
                identifier=branchname,
    Pierre-Yves Chibon ff8880
                filename=path)}}"
    Ryan Lerch 6d2e06
            >  {{ file }}
    Pierre-Yves Chibon ff8880
            {%
    Pierre-Yves Chibon ff8880
            elif file
    Ryan Lerch 6d2e06
            %}
  3. Ryan Lerch 6d2e06
                if output_type == 'tree' %}fa-folder{%
    Ryan Lerch 6d2e06
                else %}fa-file{%
    Pierre-Yves Chibon ff8880
                endif %}">  {{ file }}{%
    Pierre-Yves Chibon ff8880
            endif %}
    Ryan Lerch f6b451
        {% endfor %}
    Ryan Lerch f6b451
        
    Ryan Lerch f6b451
      
    Ryan Lerch f6b451
      
    Ryan Lerch f6b451
        
    Pierre-Yves Chibon b130e5
              'ui_ns.edit_file',
    Pierre-Yves Chibon 08a80b
              repo=repo.name,
    Pierre-Yves Chibon 08a80b
              username=username,
    Pierre-Yves Chibon 08a80b
              namespace=repo.namespace,
    Pierre-Yves Chibon 08a80b
              branchname=branchname, filename=filename) }}"
    Ryan Lerch f6b451
              method="post">
    Ryan Lerch f6b451
        {{ form.csrf_token }}
    Ryan Lerch f6b451
    Ryan Lerch f6b451
        <textarea id="textareaCode" name="content">{{ data }}</textarea>
    Ryan Lerch f6b451
    Ryan Lerch cde3ef
        
    Ryan Lerch f6b451
          <fieldset class="form-group"></fieldset>
    Ryan Lerch f6b451
            <label for="email">Committing as</label>
    Ryan Lerch f6b451
            
    Ryan Lerch f6b451
              <select class="c-select" id="email" name="email"></select>
    Pierre-Yves Chibon b76d2d
                {% for email in user.emails %}
    Pierre-Yves Chibon b76d2d
                
    Pierre-Yves Chibon b76d2d
                    if form.email.data == email.email %}selected{%
    Pierre-Yves Chibon b76d2d
                    endif %}>{{ email.email }}
    Pierre-Yves Chibon b76d2d
                {% endfor %}
    Pierre-Yves Chibon b76d2d
              
    Pierre-Yves Chibon 997f5e
              {{ user.default_email | avatar(16) | safe }}
    Pierre-Yves Chibon 4f6636
              {{ user.fullname or user.user }}
    Ryan Lerch f6b451
            
    Ryan Lerch f6b451
          
    Ryan Lerch f6b451
          <fieldset class="form-group"></fieldset>
    Ryan Lerch f6b451
            <label for="branch">Branch</label>
    Ryan Lerch f6b451
            
    Ryan Lerch f6b451
              <select class="c-select" name="branch"></select>
    Pierre-Yves Chibon 78c393
                {% for branch in g.branches %}
    Pierre-Yves Chibon b76d2d
                
    Pierre-Yves Chibon a4a6f8
                    if form.branch.data == branch or branchname == branch %}selected{%
    Pierre-Yves Chibon b76d2d
                    endif %}>{{ branch }}
    Pierre-Yves Chibon b76d2d
                {% endfor %}
    Ryan Lerch f6b451
              
    Ryan Lerch f6b451
              <input checked="" name="braction" type="radio" value="existing">Existing branch
    Pierre-Yves Chibon b76d2d
              <input name="braction" type="radio" value="new">New branch
    Ryan Lerch f6b451
            
    Ryan Lerch f6b451
          
    Ryan Lerch f6b451
          <fieldset class="form-group"></fieldset>
    Ryan Lerch f6b451
            <label for="commit_title">Commit Title</label>
    Ryan Lerch f6b451
            
    Ryan Lerch f6b451
                placeholder="Update {{ filename }}"
    Pierre-Yves Chibon efb116
                value="{{ form.commit_title.data if form.commit_title.data else
    Pierre-Yves Chibon efb116
                'Update %s' % filename }}" />
    Ryan Lerch f6b451
          
    Ryan Lerch f6b451
          <fieldset class="form-group"></fieldset>
    Ryan Lerch f6b451
            <label for="commit_message">Commit Description</label>
    Ryan Lerch f6b451
            
    yadneshk 008685
                name="commit_message" placeholder="An optional description of the change">{%
    yadneshk 008685
                if repo.settings['Enforce_signed-off_commits_in_pull-request'] %}Signed-off-by: {{
    yadneshk 008685
                user.user or user.fullname }} <{{ user.default_email }}>{%
    yadneshk 008685
                endif %}
    yadneshk 008685
                {{- form.commit_message.data if form.commit_message.data -}}
    Ryan Lerch f6b451
            
    yadneshk 008685
    Ryan Lerch f6b451
          
    Ryan Lerch f6b451
          
    Ryan Lerch f6b451
            <input class="btn btn-primary" type="submit" value="Commit changes">
    shivani cd7e79
            <input class="btn btn-secondary" onclick="history.back();" type="button" value="Cancel">
    Ryan Lerch f6b451
          
    Ryan Lerch f6b451
        
    Ryan Lerch f6b451
    Ryan Lerch f6b451
        
    Ryan Lerch f6b451
      
    Ryan Lerch f6b451
     
    Pierre-Yves Chibon 7ff840
    Pierre-Yves Chibon 7ff840
    {% endblock %}
    Pierre-Yves Chibon 7ff840
    Pierre-Yves Chibon 7ff840
    {% block jscripts %}
    Pierre-Yves Chibon 7ff840
    {{ super() }}
    Ryan Lerch f6b451
    <script>var myCodeMirror = CodeMirror.fromTextArea(document.getElementById("textareaCode"), {</script>
    Ryan Lerch f6b451
        lineNumbers: true
    Ryan Lerch f6b451
      });
    Pierre-Yves Chibon 7694ed
    <script nonce="{{ g.nonce }}" type="text/javascript"></script>
    Pierre-Yves Chibon 7ff840
    Pierre-Yves Chibon b76d2d
    var lbranch = $('#branch').html();
    Pierre-Yves Chibon b76d2d
    Pierre-Yves Chibon b76d2d
    $("input[name=braction]:radio").change(function (e) {
    Pierre-Yves Chibon b76d2d
      if ($(e.currentTarget).val() == 'new'){
    Pierre-Yves Chibon b76d2d
        $('#branch').html('<input name="branch" placeholder="Branch name" type="text">');
    Pierre-Yves Chibon b76d2d
      } else {
    Pierre-Yves Chibon b76d2d
        $('#branch').html(lbranch);
    Pierre-Yves Chibon b76d2d
      }
    Pierre-Yves Chibon b76d2d
    });
    Pierre-Yves Chibon 7ff840
    Pierre-Yves Chibon 7ff840
    {% endblock %}