|
@@ -296,8 +296,8 @@ ${ commonheader(_('Welcome Home'), "home", user) | n,unicode }
|
|
|
</p>
|
|
</p>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="modal-footer">
|
|
<div class="modal-footer">
|
|
|
- <div id="saveProjectAlert" class="alert-message error hide" style="position: absolute; left: 78px;">
|
|
|
|
|
- <span class="label label-important"></span>
|
|
|
|
|
|
|
+ <div id="saveProjectAlert" class="alert-message error hide" style="position: absolute; left: 78px;">
|
|
|
|
|
+ <span class="label label-important"></span>
|
|
|
</div>
|
|
</div>
|
|
|
<a href="#" data-dismiss="modal" class="btn">${_('Cancel')}</a>
|
|
<a href="#" data-dismiss="modal" class="btn">${_('Cancel')}</a>
|
|
|
<a id="tagsNewBtn" href="#" class="btn btn-primary disable-feedback">${ _('Add') }</a>
|
|
<a id="tagsNewBtn" href="#" class="btn btn-primary disable-feedback">${ _('Add') }</a>
|
|
@@ -381,32 +381,30 @@ ${ commonshare() | n,unicode }
|
|
|
|
|
|
|
|
$("#tagsNewBtn").on("click", function () {
|
|
$("#tagsNewBtn").on("click", function () {
|
|
|
var tag_name = $("#tagsNew").val();
|
|
var tag_name = $("#tagsNew").val();
|
|
|
-
|
|
|
|
|
- if ($.trim(tag_name) == "") {
|
|
|
|
|
- $("#saveProjectAlert span").text("${_('File name is required.')}");
|
|
|
|
|
- $("#saveProjectAlert").show();
|
|
|
|
|
- $("#tagsNew").addClass("fieldError");
|
|
|
|
|
- resetPrimaryButtonsStatus(); //globally available
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if ($.trim(tag_name) == "") {
|
|
|
|
|
+ $("#saveProjectAlert span").text("${_('File name is required.')}");
|
|
|
|
|
+ $("#saveProjectAlert").show();
|
|
|
|
|
+ $("#tagsNew").addClass("fieldError");
|
|
|
|
|
+ resetPrimaryButtonsStatus(); // Globally available
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- $.post("/desktop/api/tag/add_tag", {
|
|
|
|
|
|
|
+ $.post("/desktop/api/tag/add_tag", {
|
|
|
name: tag_name
|
|
name: tag_name
|
|
|
- },function (data) {
|
|
|
|
|
- if(data.status==-1)
|
|
|
|
|
- {
|
|
|
|
|
- $("#saveProjectAlert span").text("${_('project name already exists')}");
|
|
|
|
|
- $("#saveProjectAlert").show();
|
|
|
|
|
- resetPrimaryButtonsStatus(); //globally available
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- data.name = hueUtils.htmlEncode(data.name);
|
|
|
|
|
- viewModel.createTag(data);
|
|
|
|
|
- $("#tagsNew").val("");
|
|
|
|
|
- $(document).trigger("info", "${_('Project created')}");
|
|
|
|
|
- $("#addTagModal").modal("hide");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }, function (data) {
|
|
|
|
|
+ if (data.status == -1) {
|
|
|
|
|
+ $("#saveProjectAlert span").text("${_('project name already exists')}");
|
|
|
|
|
+ $("#saveProjectAlert").show();
|
|
|
|
|
+ resetPrimaryButtonsStatus(); //globally available
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ data.name = hueUtils.htmlEncode(data.name);
|
|
|
|
|
+ viewModel.createTag(data);
|
|
|
|
|
+ $("#tagsNew").val("");
|
|
|
|
|
+ $(document).trigger("info", "${_('Project created')}");
|
|
|
|
|
+ $("#addTagModal").modal("hide");
|
|
|
|
|
+ }
|
|
|
}).fail(function (xhr, textStatus, errorThrown) {
|
|
}).fail(function (xhr, textStatus, errorThrown) {
|
|
|
$(document).trigger("error", "${_("There was an error processing your action: ")}" + xhr.responseText); // reserved name, duplicate etc
|
|
$(document).trigger("error", "${_("There was an error processing your action: ")}" + xhr.responseText); // reserved name, duplicate etc
|
|
|
});
|
|
});
|
|
@@ -423,7 +421,7 @@ ${ commonshare() | n,unicode }
|
|
|
function addTag() {
|
|
function addTag() {
|
|
|
$("#tagsNew").val('');
|
|
$("#tagsNew").val('');
|
|
|
$("#addTagModal").modal("show");
|
|
$("#addTagModal").modal("show");
|
|
|
- $("#saveProjectAlert").hide();
|
|
|
|
|
|
|
+ $("#saveProjectAlert").hide();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function removeTag() {
|
|
function removeTag() {
|