summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2017-11-26 13:21:28 +0100
committersteckbrief <steckbrief@chefmail.de>2017-11-26 13:21:28 +0100
commit66fa1ca8e3ae25af82fb43fb9f79342fc3f65787 (patch)
tree2d24e12beda1a9cef4d0c66399877b3069288da7
parentd6dfb30a86deb8278732904cee0b05a9cfa230e2 (diff)
fixed some bugs in create story workflow, gitignore added
Diffstat (limited to '')
-rw-r--r--.gitignore1
-rw-r--r--.gitmodules1
-rw-r--r--admin.html12
-rw-r--r--createStory.php2
-rw-r--r--index.php6
m---------lib/commons0
-rw-r--r--lib/functions.stories.inc.php (renamed from lib/functions.stories.php)0
7 files changed, 15 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b0b617d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+stories/**
diff --git a/.gitmodules b/.gitmodules
index e16573f..63f632e 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,4 @@
[submodule "lib/commons"]
path = lib/commons
url = gitosis@repos.thedevstack.de:user/tristan/thedevstack-php-commons
+ branch = master
diff --git a/admin.html b/admin.html
index ba5d37f..a17ff0f 100644
--- a/admin.html
+++ b/admin.html
@@ -6,7 +6,7 @@
<script src="https://www.sl-its.de/js/jquery-1.11.2.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script>
- function uploadSeriesLogo() {
+ function createNewStory() {
var data = new FormData($('#create-story-form')[0]);
//var file = $('#story-logo').prop('files')[0];
//data.append('file', file);
@@ -80,7 +80,7 @@
<form action="" method="post" enctype="multipart/form-data" id="create-story-form">
<div class="form-group">
<label for="name">Name der Kindergeschichte:</label>
- <input type="text" class="form-control" id="story-name">
+ <input type="text" class="form-control" id="story-name" name="story-name">
</div>
<div class="form-group">
<input type="file" name="story-logo" id="story-logo">
@@ -94,5 +94,11 @@
</div>
</div>
+ <script>
+ $('#create-story-form').submit(function(event) {
+ createNewStory();
+ event.preventDefault();
+ });
+ </script>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/createStory.php b/createStory.php
index 906a302..6a115d9 100644
--- a/createStory.php
+++ b/createStory.php
@@ -13,7 +13,7 @@ $storyName = getMandatoryPostParameter('story-name', '', true);
$storyLogoFile = getOptionalPostParameter('story-logo');
$storyDescription = getOptionalPostParameter('story-description');
-$pathToStory = __DIR__.DIRECTORY_SEPARATOR.generateDirectoryName($storyName);
+$pathToStory = __DIR__.DIRECTORY_SEPARATOR.'stories'.DIRECTORY_SEPARATOR.generateDirectoryName($storyName);
$result = createEntity($pathToStory, $storyDescription, $storyLogoFile, 'logo.png');
if (TRUE !== $result) {
diff --git a/index.php b/index.php
index d4dff95..e8b6d5f 100644
--- a/index.php
+++ b/index.php
@@ -1,8 +1,8 @@
<?php
-require_once(__DIR__.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'functions.stories.php');
+require_once(__DIR__.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'functions.stories.inc.php');
-$tvSeriesDir = ".";
+$tvSeriesDir = __DIR__.DIRECTORY_SEPARATOR.'stories';
$tvSeriesDirContent = array_diff(scandir($tvSeriesDir), array('..', '.'));
@@ -111,4 +111,4 @@ $currentTvSeriesName = visibleName($currentTvSeries);
?>
</div>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/lib/commons b/lib/commons
-Subproject 03cf2a22fe227633cf901dc1d9cf1024b8d07b5
+Subproject b713fcfb99dc9c2061fef5e9d0c074aaf8aac4d
diff --git a/lib/functions.stories.php b/lib/functions.stories.inc.php
index a8102c3..a8102c3 100644
--- a/lib/functions.stories.php
+++ b/lib/functions.stories.inc.php