| {% extends "master.html" %} |
| {% from "_formhelper.html" import render_bootstrap_field %} |
| |
| {% block title %}New project{% endblock %} |
| {% set tag = "new_project" %} |
| |
| |
| {% block content %} |
| <div class="container"> |
| <div class="row justify-content-around"> |
| <div class="col-md-8"> |
| <div class="card mt-5"> |
| <div class="card-header"> |
| <strong>Create new Project</strong> |
| </div> |
| <div class="card-body"> |
| <form action="{{ url_for('ui_ns.new_project') }}" method="post"> |
| {{ render_bootstrap_field(form.name, field_description="the name of your project") }} |
| {{ render_bootstrap_field(form.description, field_description="short description of the project") }} |
| {{ render_bootstrap_field(form.namespace, field_description="namespace of the project") }} |
| {{ render_bootstrap_field(form.url, field_description="url of the project's website") }} |
| {{ render_bootstrap_field(form.avatar_email, field_description="libravatar email address avatar email") }} |
| {% if config.get('PRIVATE_PROJECTS', False) %} |
| {{ render_bootstrap_field(form.private, field_description="To mark the repo private") }} |
| {% endif %} |
| {{ render_bootstrap_field(form.create_readme, field_description="Create a README file automatically") }} |
| <input class="btn btn-primary" type="submit" value="Create" title="Update description"> |
| <input type="button" class="btn btn-default float-right" |
| value="Cancel" onclick="history.back();"> |
| {{ form.csrf_token }} |
| </form> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| {% endblock %} |
| |
| |
| {% if config.get('PRIVATE_PROJECTS', False) %} |
| {% block jscripts %} |
| {{ super() }} |
| <script type="text/javascript"> |
| var _user = '{{ g.fas_user.username }}'; |
| $('#private').change(function(){ |
| var _private = $('#private').is(':checked'); |
| if (_private) { |
| $('#namespace').append($('<option></option>').val(_user).html(_user)); |
| $('#namespace').val(_user); |
| $('#namespace').attr("disabled", "disabled"); |
| } else { |
| $("#namespace>option[value='" + _user + "']").remove(); |
| $('#namespace').removeAttr("disabled"); |
| } |
| }); |
| </script> |
| {% endblock %} |
| {% endif %} |