-
-
-
-
-
-
- what ?>
-
-
-
- when ?>
- repeats ?>
-
-
-
- who ?>
-
-
-
- style ?>
-
+
+
+
+
-
+
+
+ what ?>
+
+
+
+ when ?>
+ repeats ?>
+
+
+
+ who ?>
+
+
+
+ style ?>
+
+
+
diff --git a/application/views/scripts/schedule/add-show.phtml b/application/views/scripts/schedule/add-show.phtml
new file mode 100644
index 000000000..9802bc860
--- /dev/null
+++ b/application/views/scripts/schedule/add-show.phtml
@@ -0,0 +1 @@
+
View script for controller Schedule and script/action name addShow
\ No newline at end of file
diff --git a/application/views/scripts/schedule/index.phtml b/application/views/scripts/schedule/index.phtml
index 3aad9bd0e..917180f68 100644
--- a/application/views/scripts/schedule/index.phtml
+++ b/application/views/scripts/schedule/index.phtml
@@ -1,5 +1,7 @@
isAdmin) : ?>
+
diff --git a/public/js/airtime/schedule/add-show.js b/public/js/airtime/schedule/add-show.js
index d0fb0e2b2..21bd9c408 100644
--- a/public/js/airtime/schedule/add-show.js
+++ b/public/js/airtime/schedule/add-show.js
@@ -127,11 +127,41 @@ function setAddShowEvents() {
$("#add-show-submit")
.button()
- .click(function(){
- $("form").submit();
+ .click(function(event){
+ event.preventDefault();
+
+ var data = $("form").serializeArray();
+ var y;
+
+ $.post("/Schedule/add-show", {format: "json", data: data}, function(json){
+ if(json.form) {
+ $("#add-show-form")
+ .empty()
+ .append(json.form);
+
+ setAddShowEvents();
+ showErrorSections();
+ }
+ else {
+ scheduleRefetchEvents();
+ }
+ });
});
}
+function showErrorSections() {
+
+ if($("#schedule-show-when .errors").length > 0) {
+ $("#schedule-show-when").show();
+ }
+ if($("#schedule-show-who .errors").length > 0) {
+ $("#schedule-show-who").show();
+ }
+ if($("#schedule-show-style .errors").length > 0) {
+ $("#schedule-show-style").show();
+ }
+}
+
$(document).ready(function() {
setAddShowEvents();