Permalink
Browse files

Fix conflict in dbAccess

  • Loading branch information...
2 parents 791f1cc + 19c15c2 commit bfcf100d3e17cfbee076876759e535e128a000ae @jewong committed Apr 1, 2011
Showing with 141 additions and 58 deletions.
  1. +17 −1 README.md
  2. +11 −0 config.js
  3. +0 −1 lib/routes.js
  4. +2 −2 node_modules/dbAccess.js
  5. +21 −17 node_modules/editIssue.js
  6. +24 −23 node_modules/saveIssue.js
  7. +49 −0 node_modules/settings.js
  8. +7 −6 package.json
  9. +2 −2 server.js
  10. +8 −6 views/editIssue.html
View
@@ -399,7 +399,9 @@ Calling `response.redirectTo(path)` will generate a redirect HTTP 302. `path` is
res.redirectTo('/signin');
## Messages ##
-folderids: 0 = inbox 1 = sent
+folderids:
+ 0 = inbox
+ 1 = sent
### Messages API ###
**Load the messages library:**
@@ -409,4 +411,18 @@ folderids: 0 = inbox 1 = sent
* **messages.getMessages(userId, folderId, function(error, messageList) {})**
* **messages.getMessage(messageId, folderId, function(error, message) {})**
+## Application Settings ##
+Application settings can be defined as key-value pairs in config.js. Setting values can be
+accessed from anywhere by requiring settings, then using 'settings.getSetting('<setting name>')'.
+For example, we have a setting in config.js that defines the location of the database file as follows:
+ db_file: 'db/CivicConnect.db'
+
+dbAccess.js can read this setting like so:
+ var settings = require('settings');
+ var DATABASE_NAME = settings.getSetting('db_file');
+ db.open(DATABASE_NAME, function(open_error) {...});
+
+If you would like to have a default value for your setting (in case it isn't defined for
+whatever reason), you may set that in settings.js. See the existing default setting definitions
+in there for an example of how to do this.
View
@@ -0,0 +1,11 @@
+// Define application settings here. Each setting is a key value
+// pair. Example:
+// logging_level: 5, // Notice the comma
+// some_other_option: 'hello' // notice there is no semicolon at the end
+
+settings = {
+ db_file: 'db/CivicConnect.db',
+ email_account: 'civicconnect@gmail.com',
+ email_password: '',
+ email_smtp_server: 'smtp.gmail.com'
+}
View
1 lib/routes.js 100755 → 100644
@@ -33,7 +33,6 @@ var SearchTagIssue = require('searchTagIssue').SearchTagIssue;
var EditComments = require('editComments').EditComments;
var DeleteComments = require('deleteComments').DeleteComments;
-
var r = new Router();
/*
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,12 +1,13 @@
{
- "name": "seng513project",
- "description": "asdf",
+ "name": "CivicConnect",
+ "description": "A full-featured web application being developed as part of the SENG 513 course at the University of Calgary, Winter 2011.",
"version": "0.0.0",
+ "homepage": "http://pages.cpsc.ucalgary.ca/~sillito/seng-513/project.html",
"repository": {
"type": "git",
- "url": "https://github.com/mdoerk/seng513project"
+ "url": "git://github.com/mdoerk/seng513project.git"
},
- "author": "df <f> (f)",
+ "author": "auth names <auth emails> (authurl)",
"main": "server.js",
"directories": {
"lib": "node_modules"
@@ -15,9 +16,9 @@
"test": "node runTests.js"
},
"engines": {
- "node": "*"
+ "node": "0.4.3"
},
"dependencies": {
"sqlite": "1.0.3"
}
-}
+}
View
@@ -3,7 +3,7 @@ var fs = require('fs'),
url = require('url'),
util = require('util'),
router = require('./lib/routes').router,
- templating = require('templatingModule');
+ templating = require('templatingModule');
var port = 8124;
@@ -18,7 +18,7 @@ for (var i = 0; i < argv.length; i++) {
break;
}
}
-
+
var server = function(req, res) {
req.getUser = require('user').getUser;
res.render = templating.render;
View
@@ -2,9 +2,10 @@
<h1> Edit Issue Details </h1>
<form id="edit_issue" action="saveIssue" method="post" enctype="multipart/form-data" onsubmit="return checkMandatoryFields(this);">
<p><input type="hidden" name="id" value="{{issueId}}"/></p>
- <p>Title</p> <p><input type="text" name="title" value= "{{title}}"/></p>
- <p>Description</p><p><textarea rows="10" cols="50" name="description">{{description}}</textarea></p>
- <p>Location</p> <p><input type="text" name="location" value= "{{location}}"/></p>
+ <p>Title<font color="#cc0000">* </font><input type="text" name="title" value= "{{title}}"/></p>
+ <p>Description<font color="#cc0000">*</font></br>
+ <textarea rows="10" cols="50" name="description">{{description}}</textarea></p>
+ <p>Location <input type="text" name="location" value= "{{location}}"/></p>
<p>Relevant File<br>
<div id="edit_fileShow">
Current File: {{#file_name}}<a href="{{file_link}}">{{file_name}}</a>
@@ -32,11 +33,12 @@ <h1> Edit Issue Details </h1>
});
});
</script>
- <p>Link</p> <p><input type="text" name="link" value= "{{link}}"/></p>
- <p>Status</p> <SELECT name="status">
+ <p>Relevant Link (please input only <b><i>one</i></b> link) <input type="text" name="link" value= "{{link}}"/></p>
+ <p><a class="hint" title="For example, entering 'roads tax' will file the issue with 2 tags: 'roads' and 'tax'">Tags (separate each tag with a space)</a> <input type="text" name="tags" value="{{tags}}" /></p>
+ <p>Status <SELECT name="status">
<OPTION VALUE="open" {{#openSelected}}SELECTED{{/openSelected}}>Open</OPTION>
<OPTION VALUE="resolved" {{#resolvedSelected}}SELECTED{{/resolvedSelected}}>Resolved</OPTION>
- </SELECT>
+ </SELECT></p>
<p><input type="submit" value="Save Issue" /></p>
</form>
<br />

0 comments on commit bfcf100

Please sign in to comment.