Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions class/Factory/ShowFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function post(Request $request)
$show->title = $request->pullPostString('title');
$show->active = 0;
$this->saveResource($show);
$this->createImageDirectory($show);
//$this->createImageDirectory($show);
return $show;
}

Expand All @@ -92,11 +92,7 @@ public function listing($showAll = false)

public function view($id)
{
/* @var $resource \slideshow\Resource\ShowResource */
$resource = $this->load($id);
$vars = $resource->getStringVars();

$template = new \phpws2\Template($vars);
$template = new \phpws2\Template();
$template->setModuleTemplate('slideshow', 'Show/view.html');
return $template->get();
}
Expand Down
4 changes: 2 additions & 2 deletions class/Resource/ShowResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class ShowResource extends BaseAbstract
public function __construct()
{
parent::__construct();
$this->showId = new \phpws2\Variable\IntegerVar(null, 'showId');
$this->title = new \phpws2\Variable\StringVar(null, 'title');
$this->showId = new \phpws2\Variable\IntegerVar(0, 'showId');
$this->title = new \phpws2\Variable\TextOnly(null, 'title');
$this->title->setLimit('255');
$this->active = new \phpws2\Variable\BooleanVar(0, 'active');
}
Expand Down
32 changes: 28 additions & 4 deletions javascript/Show/ShowView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,30 @@ export default class ShowView extends Component {
title: ""
}

//this.load = this.load.bind(this)
this.saveNewShow = this.saveNewShow.bind(this)
this.switchModal = this.switchModal.bind(this)
this.successMessage = this.message.bind(this)
this.updateTitle = this.updateTitle.bind(this)
}

saveNewShow(title) {
if (this.state.title != null) {
$.post('./slideshow/show/', title).done(function () {
window.location.href = './slideshow/show/edit'
}.bind(this)).fail(function () {
console.log("Fatal Error On Save Has Occured")
$.ajax({
url: 'slideshow/Show',
data: {
title: this.state.title
},
dataType: 'json',
type: 'post',
success: () => {
this.switchModal(),
this.message(),
this.load()
},
error: () => {
alert('Sorry, but this slideshow cannot be created.')
},
})
}
}
Expand All @@ -40,6 +53,17 @@ export default class ShowView extends Component {
})
}

/* This should redirect the user to the edit page.
load() {
$.get({

})
}*/

message() {
alert("New SlideShow Created!")
}

render() {

const modal = (
Expand Down