Permalink
Browse files

Removed some site specific options. Removed blogRoutesTests since the…

…y have not been updated to account for authentication (bad Hector).
  • Loading branch information...
1 parent c3634f7 commit 77a4278fed2f99c7f5587c0b19f07b399a000abc @hectorcorrea committed Oct 16, 2012
Showing with 198 additions and 212 deletions.
  1. +0 −6 README.md
  2. +1 −1 data_test/blog.1.html
  3. +5 −6 data_test/blogs.json
  4. +1 −1 models/authModel.coffee
  5. +0 −2 models/topicModelTest.coffee
  6. +1 −1 package.json
  7. +8 −20 routes/blogRoutes.coffee
  8. +177 −173 routes/blogRoutesTest.coffee
  9. +5 −2 todo.txt
View
@@ -66,9 +66,3 @@ This is a very rough work in progress as I learn and play with Node.js.
Feel free to contact me with questions or comments about this project.
-You can see a running version version of this code here:
-
- [http://simple-blog.jitsu.com](http://simple-blog.jitsu.com)
-
-Keep in mind that you'll need to host to the site on your own in order
-to be able to add new topics or edit existing ones.
@@ -1 +1 @@
-c2
+updated content 1
View
@@ -1,11 +1,10 @@
{ "nextId": 2, "blogs":[
{
"id": 1,
- "title": "updated title 2",
- "createdOn": "2012-09-13T01:53:58.872Z",
- "updatedOn": "2012-09-13T01:53:58.899Z",
- "postedOn": null,
- "url": "updated-title-2",
- "summary": "s1"
+ "title": "new title 1",
+ "createdOn": "2012-10-16T02:25:54.237Z",
+ "updatedOn": "2012-10-16T02:25:54.266Z",
+ "url": "new-title-1",
+ "summary": "new summary 1"
}
]}
@@ -62,7 +62,7 @@ readAuthData = (filePath) ->
data = JSON.parse text
else
# TODO: initialize with admin user name.
- # data = { user: adminUserEmail }
+ # data = { "user": "somebody@gmail.com" }
data = {}
return data
@@ -29,8 +29,6 @@ testGetUrlFromTitle = ->
test = new TestUtil("topicModelTest.testGetUrlFromTitle", verbose)
test.passIf model._getUrlFromTitle("hello") is "hello", "basic test"
test.passIf model._getUrlFromTitle("hello-World") is "hello-world", "lowercase test"
- test.passIf model._getUrlFromTitle("hello-World.aspx") is "hello-world-aspx", "dots test"
- test.passIf model._getUrlFromTitle("hello-c#-World.aspx") is "hello-csharp-world-aspx", "c# test"
test.passIf model._getUrlFromTitle("this is #4") is "this-is-4", "pound (#) test"
testValidateGoodTopic()
View
@@ -1,6 +1,6 @@
{
"name": "simple-blog",
- "version": "0.0.1-11",
+ "version": "0.0.1-12",
"private": true,
"dependencies": {
"express": "= 3.0.0rc4",
@@ -3,11 +3,6 @@ fs = require 'fs'
{TopicModel} = require '../models/topicModel'
authModel = require '../models/authModel'
-_normalizeTopicTitle = (title) ->
- title = title.trim().toLowerCase()
- title = title.replace('.aspx', '')
- title
-
# encode < and > as &lt and >
_encodeContent = (content) ->
@@ -83,13 +78,7 @@ viewOne = (req, res) ->
if url
model.getOneByUrl url, (err, topic) ->
if err
- normalizedTitle = _normalizeTopicTitle(url)
- model.getOneByUrl normalizedTitle, (err2, topic2) ->
- if err2
- renderNotFound res, err
- else
- Logger.info "Redirecting to #{normalizedTitle}"
- res.redirect '/blog/' + normalizedTitle, 301
+ renderNotFound res, err
else
topic.content = _decodeContent(topic.content)
isReadOnly = authModel.isAuthenticated(req, dataPath) is false
@@ -269,14 +258,13 @@ saveNew = (req, res) ->
module.exports = {
- viewOne: viewOne,
- viewRecent: viewRecent,
- viewAll: viewAll,
- edit: edit,
- save: save,
- editNew: editNew,
- saveNew: saveNew,
+ viewOne: viewOne
+ viewRecent: viewRecent
+ viewAll: viewAll
+ edit: edit
+ save: save
+ editNew: editNew
+ saveNew: saveNew
rssList: rssList
- _normalizeTopicTitle: _normalizeTopicTitle
}
Oops, something went wrong.

0 comments on commit 77a4278

Please sign in to comment.