diff --git a/src/app.coffee b/src/app.coffee index 10f32b3..f0ccefa 100644 --- a/src/app.coffee +++ b/src/app.coffee @@ -33,6 +33,7 @@ pertApp.config ($stateProvider,$urlRouterProvider,$locationProvider) -> templateUrl: 'table.html' controller: pertController +# "Main" Controller pertController = ($scope) -> $scope.toLocalStorage = (data,options) -> options ?= {} diff --git a/src/controllers.coffee b/src/controllers.coffee index fb73a4c..e970190 100644 --- a/src/controllers.coffee +++ b/src/controllers.coffee @@ -49,11 +49,13 @@ pertApp.controller 'ganttDiagController', ($scope) -> $scope.buildTimeline $scope.fromLocalStorage() pertApp.controller 'rawEditorController', ($scope) -> + $scope.reset = -> + $scope.toLocalStorage [] $scope.saveData = -> try data = JSON.parse $scope.taData catch e - return swal 'Error', 'The data entered is invalid', 'error' + swal 'Invalid Data', e, 'error' $scope.toLocalStorage data $scope.reloadData = -> $scope.taData = JSON.stringify $scope.fromLocalStorage silent: yes, raw: yes @@ -107,6 +109,9 @@ pertApp.controller 'editorController', ($scope) -> catch e return newdata = $scope.fromLocalStorage silent: yes, raw: yes + if !newdata? or newdata is null or !newdata.push? + newdata = [] + console.log newdata newdata.push { id: id, duration: dur, depends: deps } $scope.toLocalStorage newdata, silent: yes diff --git a/src/edit.html b/src/edit.html index fb350ff..5d6d585 100644 --- a/src/edit.html +++ b/src/edit.html @@ -1,13 +1,19 @@
+
+

Editor

+

Dependencies must be a list of IDs separated by space
+ the program does not check cyclic or invalid dependencies for you

+
+ New Activity +
+
ID
-
-
Duration @@ -16,7 +22,8 @@ Dependencies
- +
diff --git a/src/gantt.html b/src/gantt.html index 77da73a..63b70c0 100644 --- a/src/gantt.html +++ b/src/gantt.html @@ -1,3 +1,6 @@
+
+

Project Timeline

+
diff --git a/src/rawedit.html b/src/rawedit.html index 31446fe..91e2131 100644 --- a/src/rawedit.html +++ b/src/rawedit.html @@ -1,5 +1,12 @@ -
+
+

RawEditor

+

The RawEditor is intended for importing, exporting your data + and debugging.
Keep backups outside of this application if you rely on your data

- - + + +
diff --git a/src/style.css b/src/style.css index 7467cb7..7b43855 100644 --- a/src/style.css +++ b/src/style.css @@ -9,17 +9,37 @@ padding-top: 5em; } +#timeline { + margin-top: 2em; +} + +.new-activity-panel { + max-width: 50em; + margin: 0 auto 2em auto; +} + .input-group.dependencies { margin-bottom: 1em; } .input-group.duration { + margin-top: 1em; margin-bottom: 1em; } span.github { margin-top: .75em; } +span.github a { + color: black; + text-decoration: none; +} + +span.github a:hover { + color: black; + text-decoration:none; + cursor:pointer; +} @media(max-width: 765px){ span.github { display: none }