Skip to content

Commit

Permalink
Merge pull request #4 from akshayknarayan/props
Browse files Browse the repository at this point in the history
Minor Changes
  • Loading branch information
Mark Weitzel committed Aug 18, 2013
2 parents c7a04e7 + 193f4ce commit e2847a9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
4 changes: 2 additions & 2 deletions applications/props/props-app/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h4>Customize what props can be given and received in your community.</h4>
<input class="input-mini" type="text" placeholder="Level" id="level-inp" maxlength=4>
<label for="definition-inp" style="margin:0px">Description</label>
<textarea class="input-large" id="definition-inp" rows="3" placeholder="Your Prop's Tagline" style="resize:none"></textarea>
<p style="margin:0px">Image URL<br><small>Provide an Absolute Path To The Image For This Prop.</small></p>
<p style="margin:0px">Image URL<br><small>Provide a Fully Qualified URL To The Image For This Prop.</small></p>
<input type="text" id="img-inp" placeholder="Link to Image">
<p style="margin:0px"><small>All images will be scaled to 128x128</small></p>
<a href="#" class="btn btn-primary" id="create-it">Save Prop!</a>
Expand Down Expand Up @@ -97,4 +97,4 @@ <h4>Default Props</h4>

<script type="text/javascript" charset="utf-8" src="dist/admin.min.js"></script>

</html>
</html>
23 changes: 11 additions & 12 deletions applications/props/props-server/web.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ DB = require "./lib/db_postgres.coffee"
activity = require "./lib/activity.coffee"
util = require './lib/util.js'
proptypes = require "./lib/defproptypes.js"
#bunchball = require "./lib/bunchball.js" ##see line 295. To enable bunchball gamification, please contact jive-dev [at] jivesoftware.com or post in community.jivesoftware.com
#To enable bunchball gamification, please contact jive-dev [at] jivesoftware.com or post in community.jivesoftware.com
#bunchball = require "./lib/bunchball.js" ##Un-comment to enable. see line 282.

console.log("current dir:", __dirname);

Expand Down Expand Up @@ -279,17 +280,15 @@ app.post "/props", oauth.verifySignature(oauthLookup), (req, res) ->
res.send err, 400
else
DB.PropType.findById req.opensocial.getJiveId(), propObj.prop_type, (err1, propTypeResult) ->
# propImageUrl = propTypeResult.image_url
# creds = oauthCreds[req.opensocial.getAppId()]
# activity.postProp req.opensocial.getJiveId(), propObj, propImageUrl, creds

#post this prop to bunchball gamification. comment this function call out to disable.

#######################################################################################################################
### to see the bunchball call, please contact jive-dev [at] jivesoftware.com or post in community.jivesoftware.com ####
#######################################################################################################################

# if not using bunchball, un-comment this line to just send an http response
#post this prop to bunchball gamification. un-comment these lines out to enable.
#if (propTypeResult)
# bunchball.newProp(propObj.user_id, propObj.giver_id, propTypeResult.title, () ->
# res.send result, 201
# );
#else
# res.send result, 201

# if not using bunchball, comment out this line
res.send result, 201
);

Expand Down
9 changes: 9 additions & 0 deletions applications/props/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Welcome to the new and improved version of the props app!
- Edit lib/util.js in props-server to point to your database and your server.
- In your database, run dbsetup.sql
- If using heroku: cat dbsetup.sql | heroku pg:psql
- otherwise: psql < dbsetup.sql

####Bunchball####
- Please contact jive-dev [at] jivesoftware.com or post in community.jivesoftware.com to get the bunchball gamification library for props app
Expand Down Expand Up @@ -52,6 +53,14 @@ Welcome to the new and improved version of the props app!
8. Deploy props-app in your instance (git push jiveapps ...)
9. Profit!

###Enabling Bunchball Gamification###
0. Contact jive-dev [at] jivesoftware.com or post in community.jivesoftware.com to get the bunchball gamification library for props app.
1. Place the bunchball.js file in the lib directory of props-server.
2. Un-comment line 34 of web.coffee (the require statement)
3. Un-comment lines 283-291 of web.coffee. Be careful not to mess with the indentation.
4. Comment out line 292 of web.coffee.
5. Do any configuration inside bunchball to set up gamification.

##Postgres DB Structure##
-------------------------

Expand Down

0 comments on commit e2847a9

Please sign in to comment.