Blame pagure/templates/add_user.html

Pierre-Yves Chibon 97d01f
{% extends "repo_master.html" %}
Pierre-Yves Chibon 97d01f
Ryan Lerch f4adb4
{% set tag = "home" %}
Ryan Lerch b27f8f
Ryan Lerch b27f8f
{% block header %}
Pierre-Yves Chibon 3ff704
Pierre-Yves Chibon 3ff704
    url_for('static', filename='vendor/selectize/selectize.bootstrap3.css') }}?version={{ g.version}}"/>
Ryan Lerch b27f8f
{% endblock %}
Ryan Lerch b27f8f
Pierre-Yves Chibon ff8880
{% block title %}Add user - {{
Pierre-Yves Chibon ff8880
    repo.namespace + '/' if repo.namespace }}{{ repo.name }}{% endblock %}
Pierre-Yves Chibon 97d01f
Pierre-Yves Chibon 97d01f
{% block repo %}
Vivek Anand 5a7449
Ryan Lerch b27f8f
  
Vivek Anand c55385
    
Ryan Lerch b27f8f
      Add user to the {{repo.name}} project
Ryan Lerch b27f8f
    
Ryan Lerch b27f8f
    
Pierre-Yves Chibon b130e5
      
Pierre-Yves Chibon ff8880
                       username=username, repo=repo.name,
Pierre-Yves Chibon ff8880
                       namespace=repo.namespace) }}" method="post">
Pierre-Yves Chibon 97d01f
Ryan Lerch b27f8f
      <fieldset class="form-group"></fieldset>
Ryan Lerch b27f8f
        <label for="user">Username</label>
Ryan Lerch b27f8f
        
Pierre-Yves Chibon 3ff704
          placeholder="Start typing to search users" value="">
Vivek Anand 967335
Vivek Anand 967335
        <select class="form-control" id="access" name="access"></select>
Vivek Anand 967335
          {% for access in access_levels %}
Vivek Anand 5a7449
            <option id="{{ access }}" value="{{ access }}"> {{ access }} </option>
Vivek Anand 967335
          {% endfor %}
Vivek Anand 967335
        
Ryan Lerch b27f8f
      
Pierre-Yves Chibon 97d01f
Ryan Lerch b27f8f
      

Pierre-Yves Chibon 36de81
        <input class="btn btn-secondary cancel_btn" type="button" value="Cancel">
Vivek Anand c55385
        <input class="btn btn-primary" id="add_update_button" type="submit" value="Add">
Ryan Lerch b27f8f
        {{ form.csrf_token }}
Ryan Lerch b27f8f
      

Ryan Lerch b27f8f
    
Pierre-Yves Chibon 3ff704
    

Access Levels

Pierre-Yves Chibon 3ff704
    

Vivek Anand 48704e
    Ticket: A user or a group with this level of access can only edit metadata
Vivek Anand 48704e
      of an issue. This includes changing the status of an issue, adding/removing
Vivek Anand 48704e
      tags from them, adding/removing assignees and every other option which can
Vivek Anand 48704e
      be accessed when you click "Edit Metadata" button in an issue page. However,
Vivek Anand 48704e
      this user can not "create" a new tag or "delete" an existing tag because,
Vivek Anand 48704e
      that would involve access to settings page of the project which this user
Vivek Anand 48704e
      won't have. It also won't be able to "delete" the issue because, it falls
Vivek Anand 48704e
      outside of "Edit Metadata".
Vivek Anand 48704e
    

Pierre-Yves Chibon 3ff704
    

Vivek Anand 48704e
    Commit: A user or a group with this level of access can do everything what
Vivek Anand 48704e
      a user/group with ticket access can do + it can do everything on the project
Vivek Anand 48704e
      which doesn't include access to settings page. It can "Edit Metadata" of an issue
Vivek Anand 48704e
      just like a user with ticket access would do, can merge a pull request, can push
Vivek Anand 48704e
      to the main repository directly, delete an issue, cancel a pull request etc.
Vivek Anand 48704e
    

Pierre-Yves Chibon 3ff704
    

Vivek Anand 48704e
    Admin: The user/group with this access has access to everything on the project.
Vivek Anand 48704e
      All the "users" of the project that have been added till now are having this access.
Vivek Anand 48704e
      They can change the settings of the project, add/remove users/groups on the project.
Vivek Anand 48704e
    

Ryan Lerch b27f8f
    
Ryan Lerch b27f8f
  
Ryan Lerch b27f8f
Pierre-Yves Chibon 97d01f
Pierre-Yves Chibon 97d01f
{% endblock %}
Pierre-Yves Chibon 6d49b8
Pierre-Yves Chibon 6d49b8
{% block jscripts %}
Pierre-Yves Chibon 6d49b8
{{ super() }}
Pierre-Yves Chibon 3ff704
Pierre-Yves Chibon 3ff704
    url_for('static', filename='vendor/selectize/selectize.min.js') }}?version={{ g.version}}">
Pierre-Yves Chibon 3ff704
Pierre-Yves Chibon 7694ed
<script nonce="{{ g.nonce }}" type="text/javascript"></script>
Ryan Lerch b27f8f
$( document ).ready(function() {
Vivek Anand 963f9a
  var user_to_update = "{{ user_to_update }}";
Vivek Anand 963f9a
  if (!user_to_update || user_to_update === "None") {
Vivek Anand 963f9a
    $('#user').selectize({
Vivek Anand 963f9a
        valueField: 'user',
Vivek Anand 963f9a
        labelField: 'user',
Vivek Anand 963f9a
        searchField: 'user',
Vivek Anand 963f9a
        maxItems: 1,
Vivek Anand 963f9a
        create: false,
Vivek Anand 963f9a
        load: function(query, callback) {
Vivek Anand 963f9a
          if (!query.length) return callback();
Vivek Anand 963f9a
          $.getJSON(
Vivek Anand 963f9a
            "{{ url_for('api_ns.api_users') }}", {
Vivek Anand 963f9a
              pattern: query.term
Vivek Anand 963f9a
            },
Vivek Anand 963f9a
            function( data ) {
Vivek Anand 963f9a
              callback( data.users.map(function(x) { return { user: x }; }) );
Vivek Anand 963f9a
            }
Vivek Anand 963f9a
          );
Vivek Anand 963f9a
        }
Vivek Anand 963f9a
    });
Vivek Anand 963f9a
  } else {
Vivek Anand 963f9a
    $("#user").attr("value", user_to_update);
Vivek Anand 5a7449
    $("#user").attr("readonly", true);
Vivek Anand 5a7449
    var user_access = "{{ user_access }}";
Vivek Anand 5a7449
    if (user_access !== "None") {
Vivek Anand 5a7449
      $("#" + "{{ user_access.access }}").attr("selected", "selected");
Vivek Anand 5a7449
    }
Vivek Anand c55385
    $("#card-topic").html("Update user access in {{repo.name}}");
Vivek Anand c55385
    $("#add_update_button").attr("value", "Update");
Vivek Anand 963f9a
  }
Vivek Anand 967335
Ryan Lerch b27f8f
});
Pierre-Yves Chibon 6d49b8
Pierre-Yves Chibon 6d49b8
{% endblock %}