diff --git a/Gulpfile.js b/Gulpfile.js index 936075cc..553197d9 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -32,7 +32,7 @@ gulp.task('js', function(){ gulp.task('sass', function () { return gulp.src('src/**/*.scss') .pipe(cached('styles')) - .pipe(sass()) + .pipe(sass().on('error', sass.logError)) .pipe(autoprefixer()) .pipe(remember('styles')) .pipe(concat('all.css')) diff --git a/src/modals/new-snippet-editor.scss b/src/modals/new-snippet-editor.scss index 4faa7b04..cc833a6e 100644 --- a/src/modals/new-snippet-editor.scss +++ b/src/modals/new-snippet-editor.scss @@ -3,7 +3,7 @@ $editor-border-color: $border-color; .new-snippet-modal{ - + .ace_editor { height: 200px; border: solid 1px $editor-border-color; diff --git a/src/services/snippet.js b/src/services/snippet.js index 6468262a..3ea16ca0 100644 --- a/src/services/snippet.js +++ b/src/services/snippet.js @@ -16,8 +16,15 @@ angular.module('codexen.services') return $http.post(url, params) } + var show = function (id) { + var url = apiUrl + 'snippets/' + id + + return $http.get(url) + } + return { findByUser: findByUser, - create: create + create: create, + show: show } }) diff --git a/src/states/clips/list.js b/src/states/clips/list.js new file mode 100644 index 00000000..e69de29b diff --git a/src/states/home/home.tpl.html b/src/states/home/home.tpl.html index a22d1c45..007d21cb 100644 --- a/src/states/home/home.tpl.html +++ b/src/states/home/home.tpl.html @@ -1,5 +1,5 @@
App for Code snippets
diff --git a/src/states/snippets/detail.js b/src/states/snippets/detail.js
new file mode 100644
index 00000000..b78b4b35
--- /dev/null
+++ b/src/states/snippets/detail.js
@@ -0,0 +1,15 @@
+/* global angular */
+angular.module('codexen.states')
+ .controller('SnippetsDetailController', function (Snippet, $state) {
+ var vm = this
+
+ vm.isLoaded = false
+
+ var snippetId = $state.params.id
+
+ Snippet.show(snippetId)
+ .success(function (data) {
+ vm.snippet = data.snippet
+ vm.isLoaded = true
+ })
+ })
diff --git a/src/states/snippets/detail.tpl.html b/src/states/snippets/detail.tpl.html
new file mode 100644
index 00000000..1758aaa4
--- /dev/null
+++ b/src/states/snippets/detail.tpl.html
@@ -0,0 +1,33 @@
+
+ +
+ + + + +