2015-07-31 12:09:12 +00:00
{% extends "base.html" %}
2014-08-29 15:42:00 +00:00
{% load projecttags %}
{% load humanize %}
2014-11-28 20:12:18 +00:00
{% load static %}
2015-10-28 14:22:05 +00:00
{% block title %} Import layer - {{project.name}} - Toaster {% endblock %}
2015-07-31 12:09:12 +00:00
{% block pagecontent %}
2014-08-29 15:42:00 +00:00
2015-07-31 12:09:12 +00:00
{% include "projecttopbar.html" %}
2014-08-29 15:42:00 +00:00
2014-11-28 20:12:18 +00:00
2015-06-24 13:53:21 +00:00
{% if project and project.release %}
2015-04-21 10:59:37 +00:00
< script src = "{% static 'js/layerDepsModal.js' %}" > < / script >
2014-11-28 20:12:18 +00:00
< script src = "{% static 'js/importlayer.js' %}" > < / script >
< script >
$(document).ready(function (){
2014-12-11 14:17:10 +00:00
var ctx = {
xhrImportLayerUrl : "{% url 'xhr_importlayer' %}",
};
2014-11-28 20:12:18 +00:00
try {
importLayerPageInit(ctx);
2014-12-11 14:17:10 +00:00
} catch (e) {
document.write("Sorry, An error has occurred loading this page");
console.warn(e);
2014-11-28 20:12:18 +00:00
}
});
< / script >
2015-07-31 12:09:12 +00:00
< form class = "span11" >
2015-08-04 15:07:10 +00:00
< fieldset >
2014-11-28 20:12:18 +00:00
< legend > Layer repository information< / legend >
2015-07-31 12:09:12 +00:00
< span class = "help-block" > The layer you are importing must be compatible with < strong > {{project.release.description}}< / strong > , which is the release you are using in this project.< / span >
2014-11-28 20:12:18 +00:00
< div class = "alert alert-error" id = "import-error" style = "display:none" >
< button type = "button" class = "close" data-dismiss = "alert" > × < / button >
2015-05-11 17:58:25 +00:00
< h3 > < / h3 >
2014-12-05 11:26:29 +00:00
< p > < / p >
2014-11-28 20:12:18 +00:00
< ul > < / ul >
< / div >
< div class = "control-group" id = "layer-name-ctrl" >
2015-08-04 15:07:10 +00:00
< label class = "control-label air" for = "import-layer-name" >
2014-11-28 20:12:18 +00:00
Layer name
2015-03-02 15:00:49 +00:00
< span class = "icon-question-sign get-help" title = "Something like 'meta-mylayer'. Your layer name must be unique and can only include letters, numbers and dashes" > < / span >
2014-11-28 20:12:18 +00:00
< / label >
< div class = "controls" >
2015-03-02 15:00:49 +00:00
< input id = "import-layer-name" type = "text" required autofocus data-autocomplete = "off" data-provide = "typeahead" >
2014-11-28 20:12:18 +00:00
< span class = "help-inline" style = "display: none;" id = "invalid-layer-name-hint" > A valid layer name can only include letters, numbers and dashes< / span >
< span class = "help-inline" style = "display: none;" id = "duplicated-layer-name-hint" > < / span >
< / div >
< / div >
2015-05-11 17:58:25 +00:00
< div id = "duplicate-layer-info" style = "display:none" >
2015-03-02 15:00:49 +00:00
< div class = "alert warning" >
< h3 > A layer called < a href = "" class = "dup-layer-link" > < span class = "dup-layer-name" > < / span > < / a > already exists< / h3 >
< p > Layer names must be unqiue. Please use a different layer name.< / p >
< / div >
< dl >
< dt >
The < span class = "dup-layer-name" > < / span > repository url is
< / dt >
< dd >
< span id = "dup-layer-vcs-url" > < / span >
< / dd >
< dt >
The < span class = "dup-layer-name" > < / span > revision is
< / dt >
< dd >
< span id = "dup-layer-revision" > < / span >
< / dd >
< / dl >
< p > < a href = "" class = "dup-layer-link" > View the < span class = "dup-layer-name" > < / span > layer information< / a > < / p >
2014-11-28 20:12:18 +00:00
2015-05-11 17:58:25 +00:00
< / div >
2015-03-02 15:00:49 +00:00
2015-05-11 17:58:25 +00:00
< div class = "fields-apart-from-layer-name" >
2014-12-02 17:28:56 +00:00
< label for = "layer-git-repo-url" class = "project-form" >
2014-08-29 15:42:00 +00:00
Git repository URL
2015-03-02 15:00:49 +00:00
< span class = "icon-question-sign get-help" title = "Fetch/clone URL of the repository. Currently, Toaster only supports Git repositories." > < / span >
2014-08-29 15:42:00 +00:00
< / label >
2014-11-28 20:12:18 +00:00
< input type = "text" id = "layer-git-repo-url" class = "input-xxlarge" required >
< label class = "project-form" for = "layer-subdir" >
2014-08-29 15:42:00 +00:00
Repository subdirectory
< span class = "muted" > (optional)< / span >
2015-03-02 15:00:49 +00:00
< span class = "icon-question-sign get-help" title = "Subdirectory within the repository where the layer is located, if not in the root (usually only used if the repository contains more than one layer)" > < / span >
2014-08-29 15:42:00 +00:00
< / label >
2014-11-28 20:12:18 +00:00
< input type = "text" id = "layer-subdir" >
< div class = "control-group" id = "layer-revision-ctrl" >
2016-03-07 12:03:34 +00:00
< label class = "control-label project-form" for = "layer-git-ref" > Git revision
2014-11-28 20:12:18 +00:00
< span class = "icon-question-sign get-help" title = "You can provide a Git branch, a tag or a commit SHA as the revision" > < / span >
< / label >
< div class = "controls" >
2015-02-24 17:20:49 +00:00
< input type = "text" class = "span3" id = "layer-git-ref" required >
2014-11-28 20:12:18 +00:00
< span class = "help-inline" style = "diaply:none;" id = "invalid-layer-revision-hint" > < / span >
< / div >
< / div >
2015-05-11 17:58:25 +00:00
< / div >
2014-11-28 20:12:18 +00:00
2014-08-29 15:42:00 +00:00
< / fieldset >
2015-03-02 15:00:49 +00:00
2015-05-11 17:58:25 +00:00
< div class = "fields-apart-from-layer-name" >
2014-08-29 15:42:00 +00:00
< fieldset class = "air" >
< legend >
Layer dependencies
< span class = "muted" > (optional)< / span >
2015-03-02 15:00:49 +00:00
< span class = "icon-question-sign get-help heading-help" title = "Other layers this layer depends upon" > < / span >
2014-08-29 15:42:00 +00:00
< / legend >
2014-11-28 20:12:18 +00:00
< ul class = "unstyled configuration-list" id = "layer-deps-list" >
2014-08-29 15:42:00 +00:00
< / ul >
< div class = "input-append" >
2014-11-28 20:12:18 +00:00
< input type = "text" autocomplete = "off" data-minLength = "1" data-autocomplete = "off" data-provide = "typeahead" placeholder = "Type a layer name" id = "layer-dependency" class = "input-xlarge" >
2015-05-11 17:58:25 +00:00
< a class = "btn" id = "add-layer-dependency-btn" >
2014-08-29 15:42:00 +00:00
Add layer
< / a >
< / div >
< span class = "help-inline" > You can only add layers Toaster knows about< / span >
< / fieldset >
2015-07-31 12:09:03 +00:00
< div class = "air" id = "form-actions" >
2014-11-28 20:12:18 +00:00
< button class = "btn btn-primary btn-large" data-toggle = "modal" id = "import-and-add-btn" data-target = "#dependencies-message" disabled > Import and add to project< / button >
2015-05-07 12:49:35 +00:00
< span class = "help-inline" id = "import-and-add-hint" style = "vertical-align: middle;" > To import a layer you need to enter a layer name, a Git repository URL and a revision (branch, tag or commit)< / span >
2014-08-29 15:42:00 +00:00
< / div >
2015-05-11 17:58:25 +00:00
< / div >
2014-11-28 20:12:18 +00:00
< / form >
2014-08-29 15:42:00 +00:00
2015-06-24 13:53:21 +00:00
{% else %} {#project and project release#}
< div class = "page-header" >
< h1 > Import layer< / h1 >
< / div >
< div class = "alert alert-info" id = "import-error" >
< h3 > Unsupported project type< / h3 >
< p > This project does not support importing layers.< / p >
< ul > < / ul >
< / div >
{% endif %}
2014-08-29 15:42:00 +00:00
{% endblock %}