more style updates to the quote form
This commit is contained in:
parent
d779e17c11
commit
7286a8c126
@ -60,7 +60,7 @@
|
|||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Create new system</legend>
|
<legend>Create new system</legend>
|
||||||
|
|
||||||
<p class="error-message"></p>
|
<p class="error-summary"></p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<%= Html.Label("Name", "SystemName", new { @class = "label" })%>
|
<%= Html.Label("Name", "SystemName", new { @class = "label" })%>
|
||||||
@ -80,8 +80,10 @@
|
|||||||
<%= Html.TextBox("SystemReleaseDate", null) %>
|
<%= Html.TextBox("SystemReleaseDate", null) %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<%= Html.Button("Save System", new { id = "create-system-submit" })%>
|
<p>
|
||||||
<%= Html.Button("Cancel", new { id = "create-system-cancel" })%>
|
<a href="#" class="submit-link button-link" id="create-system-submit" title="save sstemy">Save System</a>
|
||||||
|
<a href="#" class="cancel-link button-link" id="create-system-cancel" title="cancel">Cancel</a>
|
||||||
|
</p>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -96,7 +98,7 @@
|
|||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Create new publisher</legend>
|
<legend>Create new publisher</legend>
|
||||||
|
|
||||||
<p class="error-message"></p>
|
<p class="error-summary"></p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<%= Html.Label("Name", "PublisherName", new { @class = "label" })%>
|
<%= Html.Label("Name", "PublisherName", new { @class = "label" })%>
|
||||||
@ -115,8 +117,10 @@
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= Html.Button("Save Game", new { id = "create-game-submit" })%>
|
<p>
|
||||||
<%= Html.Button("Cancel", new { id = "create-game-cancel" })%>
|
<a href="#" class="submit-link button-link" id="create-game-submit" title="save game">Save Game</a>
|
||||||
|
<a href="#" class="cancel-link button-link" id="create-game-cancel" title="cancel">Cancel</a>
|
||||||
|
</p>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -181,6 +181,12 @@ ul.menu {
|
|||||||
.cancel-link {
|
.cancel-link {
|
||||||
background: transparent url(/media/images/cancel.png) left center no-repeat;
|
background: transparent url(/media/images/cancel.png) left center no-repeat;
|
||||||
}
|
}
|
||||||
|
.button-link {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
padding: 2px 2px 2px 18px;
|
||||||
|
border: 1px solid #000000 !important;
|
||||||
|
color: #000000 !important;
|
||||||
|
}
|
||||||
.checkbox-table {
|
.checkbox-table {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +30,8 @@
|
|||||||
.insertAfter($input);
|
.insertAfter($input);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
$.fn.clearModelErrors = function() {
|
$.fn.clearModelErrors = function() {
|
||||||
@ -43,6 +45,8 @@
|
|||||||
.find(".error-summary")
|
.find(".error-summary")
|
||||||
.empty()
|
.empty()
|
||||||
.hide();
|
.hide();
|
||||||
|
|
||||||
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
$.vgquotes = function() {
|
$.vgquotes = function() {
|
||||||
@ -313,6 +317,7 @@
|
|||||||
.find("input[type='checkbox']").removeAttr("checked").end()
|
.find("input[type='checkbox']").removeAttr("checked").end()
|
||||||
.find("> .edit-mode").val(0).end()
|
.find("> .edit-mode").val(0).end()
|
||||||
.find("> fieldset > legend").text("Create new " + type).end()
|
.find("> fieldset > legend").text("Create new " + type).end()
|
||||||
|
.clearModelErrors()
|
||||||
.toggle();
|
.toggle();
|
||||||
|
|
||||||
$("#" + type + "-select").toggle();
|
$("#" + type + "-select").toggle();
|
||||||
@ -344,7 +349,16 @@
|
|||||||
$("#create-publisher-link, #create-publisher-cancel").click(toggleFormAndLink("publisher"));
|
$("#create-publisher-link, #create-publisher-cancel").click(toggleFormAndLink("publisher"));
|
||||||
|
|
||||||
$("#create-system-submit").click(function() {
|
$("#create-system-submit").click(function() {
|
||||||
|
var submitting = false;
|
||||||
|
return function() {
|
||||||
|
if (submitting) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
submitting = true;
|
||||||
|
|
||||||
var $container = $("#create-system-form");
|
var $container = $("#create-system-form");
|
||||||
|
var $link = $(this);
|
||||||
var data = { SystemName: $("#SystemName").val(), SystemAbbreviation: $("#SystemAbbreviation").val(), SystemReleaseDate: $("#SystemReleaseDate").val() };
|
var data = { SystemName: $("#SystemName").val(), SystemAbbreviation: $("#SystemAbbreviation").val(), SystemReleaseDate: $("#SystemReleaseDate").val() };
|
||||||
var url = "/system/create";
|
var url = "/system/create";
|
||||||
var systemId = $container.find("> .edit-mode").val();
|
var systemId = $container.find("> .edit-mode").val();
|
||||||
@ -357,7 +371,10 @@
|
|||||||
$.ajax(url, {
|
$.ajax(url, {
|
||||||
type: "POST",
|
type: "POST",
|
||||||
data: data,
|
data: data,
|
||||||
beforeSend: function() { $container.clearModelErrors(); },
|
beforeSend: function() {
|
||||||
|
$container.clearModelErrors();
|
||||||
|
$link.toggleClass("submit-link loading-link");
|
||||||
|
},
|
||||||
success: function(data, statux, $xhr) {
|
success: function(data, statux, $xhr) {
|
||||||
if (data.Error !== null) {
|
if (data.Error !== null) {
|
||||||
$container.applyModelErrors(data.Error, data.Data);
|
$container.applyModelErrors(data.Error, data.Data);
|
||||||
@ -372,14 +389,27 @@
|
|||||||
$("#system-checkbox-table").find("input[value='" + data.Data.Id +"'] + label").text(data.Data.Abbreviation);
|
$("#system-checkbox-table").find("input[value='" + data.Data.Id +"'] + label").text(data.Data.Abbreviation);
|
||||||
}
|
}
|
||||||
toggleFormAndLink("system")();
|
toggleFormAndLink("system")();
|
||||||
|
},
|
||||||
|
complete: function() {
|
||||||
|
submitting = false;
|
||||||
|
$link.toggleClass("submit-link loading-link");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
};
|
||||||
|
}());
|
||||||
|
|
||||||
$("#create-publisher-submit").click(function() {
|
$("#create-publisher-submit").click(function() {
|
||||||
|
var submitting = false;
|
||||||
|
return function() {
|
||||||
|
if (submitting) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
submitting = true;
|
||||||
var $container = $("#create-publisher-form");
|
var $container = $("#create-publisher-form");
|
||||||
|
var $link = $(this);
|
||||||
var data = { PublisherName: $("#PublisherName").val(), PublisherWebsite: $("#PublisherWebsite").val() };
|
var data = { PublisherName: $("#PublisherName").val(), PublisherWebsite: $("#PublisherWebsite").val() };
|
||||||
var url = "/publisher/create";
|
var url = "/publisher/create";
|
||||||
var publisherId = $container.find("> .edit-mode").val();
|
var publisherId = $container.find("> .edit-mode").val();
|
||||||
@ -392,7 +422,10 @@
|
|||||||
$.ajax(url, {
|
$.ajax(url, {
|
||||||
type: "POST",
|
type: "POST",
|
||||||
data: data,
|
data: data,
|
||||||
beforeSend: function() { $container.clearModelErrors(); },
|
beforeSend: function() {
|
||||||
|
$container.clearModelErrors();
|
||||||
|
$link.toggleClass("submit-link loading-link");
|
||||||
|
},
|
||||||
success: function(data, statux, $xhr) {
|
success: function(data, statux, $xhr) {
|
||||||
if (data.Error !== null) {
|
if (data.Error !== null) {
|
||||||
$container.applyModelErrors(data.Error, data.Data);
|
$container.applyModelErrors(data.Error, data.Data);
|
||||||
@ -407,18 +440,31 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
toggleFormAndLink("publisher")();
|
toggleFormAndLink("publisher")();
|
||||||
|
},
|
||||||
|
complete: function() {
|
||||||
|
submitting = false;
|
||||||
|
$link.toggleClass("submit-link loading-link");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
}
|
||||||
|
}());
|
||||||
|
|
||||||
$("#create-game-submit").click(function() {
|
$("#create-game-submit").click(function() {
|
||||||
|
var submitting = false;
|
||||||
|
return function() {
|
||||||
|
if (submitting) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
submitting = true;
|
||||||
var regions = [], publishers = [], systems = [], data = { GameName: $("#GameName").val(), GameWebsite: $("#GameWebsite").val(), GameIcon: $("#GameIcon").val() };
|
var regions = [], publishers = [], systems = [], data = { GameName: $("#GameName").val(), GameWebsite: $("#GameWebsite").val(), GameIcon: $("#GameIcon").val() };
|
||||||
$("input:checked[name='GameRegions']").each(function(index, input) { if (typeof(data.GameRegions) === "undefined") { data.GameRegions = []; } data.GameRegions.push(input.value); });
|
$("input:checked[name='GameRegions']").each(function(index, input) { if (typeof(data.GameRegions) === "undefined") { data.GameRegions = []; } data.GameRegions.push(input.value); });
|
||||||
$("input:checked[name='SystemIds']").each(function(index, input) { if (typeof(data.SystemIds) === "undefined") { data.SystemIds = []; } data.SystemIds.push(input.value); });
|
$("input:checked[name='SystemIds']").each(function(index, input) { if (typeof(data.SystemIds) === "undefined") { data.SystemIds = []; } data.SystemIds.push(input.value); });
|
||||||
$("input:checked[name='PublisherIds']").each(function(index, input) { if (typeof(data.PublisherIds) === "undefined") { data.PublisherIds = []; } data.PublisherIds.push(input.value); });
|
$("input:checked[name='PublisherIds']").each(function(index, input) { if (typeof(data.PublisherIds) === "undefined") { data.PublisherIds = []; } data.PublisherIds.push(input.value); });
|
||||||
var $container = $("#create-game-form");
|
var $container = $("#create-game-form");
|
||||||
|
var $link = $(this);
|
||||||
|
|
||||||
var url = "/game/create";
|
var url = "/game/create";
|
||||||
var submittingAnEdit = $("#create-game-form > .edit-mode").val() == 1;
|
var submittingAnEdit = $("#create-game-form > .edit-mode").val() == 1;
|
||||||
@ -431,7 +477,10 @@
|
|||||||
type: "POST",
|
type: "POST",
|
||||||
data: data,
|
data: data,
|
||||||
traditional: true,
|
traditional: true,
|
||||||
beforeSend: function() { $container.clearModelErrors(); },
|
beforeSend: function() {
|
||||||
|
$container.clearModelErrors();
|
||||||
|
$link.toggleClass("submit-link loading-link");
|
||||||
|
},
|
||||||
success: function(data, status, $xhr) {
|
success: function(data, status, $xhr) {
|
||||||
if (data.Error !== null) {
|
if (data.Error !== null) {
|
||||||
$container.applyModelErrors(data.Error, data.Data);
|
$container.applyModelErrors(data.Error, data.Data);
|
||||||
@ -447,11 +496,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
toggleFormAndLink("game")();
|
toggleFormAndLink("game")();
|
||||||
|
},
|
||||||
|
complete: function() {
|
||||||
|
submitting = false;
|
||||||
|
$link.toggleClass("submit-link loading-link");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
}
|
||||||
|
}());
|
||||||
|
|
||||||
$(".dismiss-flag-link").click(function() {
|
$(".dismiss-flag-link").click(function() {
|
||||||
var $link = $(this);
|
var $link = $(this);
|
||||||
@ -785,6 +839,8 @@
|
|||||||
$("body").ajaxError(function(e, xhr, options, error){
|
$("body").ajaxError(function(e, xhr, options, error){
|
||||||
$.vgquotes.ajaxErrorHandler.call(this, xhr);
|
$.vgquotes.ajaxErrorHandler.call(this, xhr);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#search-query").focus();
|
||||||
});
|
});
|
||||||
}());
|
}());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user