/* If we have added layer dependencies */
if (depsList) {
- alertMsg.append("You have added <strong>"+(depsList.length+1)+"</strong> layers: <span id=\"layer-affected-name\"></span> and its dependencies ");
+ alertMsg.append("You have added <strong>"+(depsList.length+1)+"</strong> layers to <a id=\"project-affected-name\"></a>: <span id=\"layer-affected-name\"></span> and its dependencies ");
/* Build the layer deps list */
depsList.map(function(layer, i){
alertMsg.append(link);
});
} else {
- alertMsg.append("You have added <strong>1</strong> layer: <span id=\"layer-affected-name\"></span>");
+ alertMsg.append("You have added <strong>1</strong> layer to <a id=\"project-affected-name\"></a>: <strong id=\"layer-affected-name\"></strong>");
}
var layerName = addLayerBtn.data('layer-name');
alertMsg.children("#layer-affected-name").text(layerName);
+ alertMsg.children("#project-affected-name").text(ctx.projectName).attr('href', ctx.projectPageUrl);
+
$("#alert-area").show();
}
+ $("#dismiss-alert").click(function(){ $(this).parent().hide() });
+
/* Add or remove this layer from the project */
$(".add-layer").click(function() {
var btn = $(this);
$(document).ready(function (){
var ctx = {
projectPageUrl : "{% url 'project' project.id %}",
+ projectName : "{{project.name}}",
xhrEditProjectUrl : "{% url 'xhr_projectedit' project.id %}",
projectId : {{project.id}},
xhrDataTypeaheadUrl : "{% url 'xhr_datatypeahead' %}",
</div>
<div class="alert alert-info lead" id="alert-area" style="display:none">
- <button type="button" class="close" id="dismiss-alert" data-dismiss="alert">×</button>
+ <button type="button" class="close" id="dismiss-alert">×</button>
<span id="alert-msg"></span>
- <p style="margin-top:10px;"><a href="{% url 'project' project.id %}">Go to project configuration</a></p>
</div>
{% include "basetable_top.html" %}