From 6b0109e5562f2ed428702a9da0e085eabbda072c Mon Sep 17 00:00:00 2001 From: Amos Haviv Date: Thu, 25 Jul 2013 16:17:09 +0300 Subject: [PATCH] Articles Example Fix --- app/views/includes/head.jade | 1 + public/css/common.css | 2 +- public/css/views/articles.css | 11 +++++++++++ public/js/controllers/articles.js | 3 ++- public/js/controllers/header.js | 10 ++++++++++ public/views/articles/create.html | 8 ++++---- public/views/articles/list.html | 1 + public/views/articles/view.html | 2 +- public/views/header.html | 2 +- 9 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 public/css/views/articles.css diff --git a/app/views/includes/head.jade b/app/views/includes/head.jade index 9d064c4924..f5a260c3dd 100755 --- a/app/views/includes/head.jade +++ b/app/views/includes/head.jade @@ -24,6 +24,7 @@ head link(rel='stylesheet', href='/css/common.css') link(rel='stylesheet', href='/css/views/index.css') + link(rel='stylesheet', href='/css/views/articles.css') //if lt IE 9 script(src='http://html5shim.googlecode.com/svn/trunk/html5.js') diff --git a/public/css/common.css b/public/css/common.css index 8d716b6c33..1aab6ffd9a 100755 --- a/public/css/common.css +++ b/public/css/common.css @@ -4,7 +4,7 @@ } .content { - margin-top: 40px; + margin-top: 50px; width: 100%; } diff --git a/public/css/views/articles.css b/public/css/views/articles.css new file mode 100644 index 0000000000..247bfc26ba --- /dev/null +++ b/public/css/views/articles.css @@ -0,0 +1,11 @@ +h1 { + text-align: center; +} + +ul { + list-style: none; +} + +li:not(:last-child) { + border-bottom: 1px solid #ccc; +} \ No newline at end of file diff --git a/public/js/controllers/articles.js b/public/js/controllers/articles.js index b0665df043..b65381b0c5 100644 --- a/public/js/controllers/articles.js +++ b/public/js/controllers/articles.js @@ -1,4 +1,5 @@ -function ArticlesController($scope, $routeParams, $location, Articles) { +function ArticlesController($scope, $routeParams, $location, Global, Articles) { + $scope.global = Global; $scope.articles = []; $scope.article = {}; diff --git a/public/js/controllers/header.js b/public/js/controllers/header.js index 1f755b186a..74203588af 100644 --- a/public/js/controllers/header.js +++ b/public/js/controllers/header.js @@ -1,5 +1,15 @@ function HeaderController($scope, $location, Global) { $scope.global = Global; + $scope.menu = [ + { + "title": "Articles", + "link": "articles" + }, + { + "title": "Create New Article", + "link": "articles/create" + } + ]; $scope.init = function() { diff --git a/public/views/articles/create.html b/public/views/articles/create.html index d3713ed9ce..a815c7e9f1 100644 --- a/public/views/articles/create.html +++ b/public/views/articles/create.html @@ -1,15 +1,15 @@
- +
- +
- +
- +
diff --git a/public/views/articles/list.html b/public/views/articles/list.html index d5c3006c3f..23fe544a0d 100644 --- a/public/views/articles/list.html +++ b/public/views/articles/list.html @@ -7,4 +7,5 @@

{{article.title}}

{{article.content}}
+

No articles yet.
Why don't you Create One?

\ No newline at end of file diff --git a/public/views/articles/view.html b/public/views/articles/view.html index 6105ab914d..821d0b670c 100644 --- a/public/views/articles/view.html +++ b/public/views/articles/view.html @@ -1,6 +1,6 @@
{{article.created | date:'medium'}} / {{article.user.name}} -

{{article.title}}

+

{{article.title}} edit

{{article.content}}
\ No newline at end of file diff --git a/public/views/header.html b/public/views/header.html index 8877549f1e..649f8f498c 100644 --- a/public/views/header.html +++ b/public/views/header.html @@ -1,7 +1,7 @@