Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
924a726
intial commit
jchris May 2, 2010
5a6360b
installation instructions in readme
jchris May 2, 2010
e15e148
form for photos
jchris May 15, 2010
658b143
import upload code from futon. thanks @cmlenz
jchris May 15, 2010
3c9cb8a
display attached images
jchris May 16, 2010
3d25a99
upload image with message
jchris May 16, 2010
1cf2e16
bad validation
jchris May 18, 2010
73bdc9d
remove bad validation fun
jchris Jun 12, 2010
39b7608
add alt tag to the image
jchris Jun 12, 2010
3d8557e
update vendor/couchapp
jchris Jul 10, 2010
c5a8762
update from couchapp repo
jchris Jul 11, 2010
4c58926
simplify form handler
jchris Jul 11, 2010
75e16a1
whitespace
jchris Jul 11, 2010
8f9a942
update namespaces
jchris Jul 12, 2010
0cf6c07
update vendor
jchris Jul 20, 2010
31c38e0
update from vendor
jchris Jul 20, 2010
0d01486
udpate vendor
jchris Jul 23, 2010
951006a
update vendor couchapp
jchris Jul 27, 2010
abbbea4
update vendor
jchris Sep 15, 2010
04ca906
merge master
jchris Sep 15, 2010
39f1558
selenas changes
jchris Sep 15, 2010
d606bab
merge more from selena
jchris Sep 15, 2010
f0b6c9c
migrate docs to have uuid ids
jchris Sep 15, 2010
0a6fe57
migrate script docs to have uuid ids
jchris Sep 15, 2010
1e1d040
got profiles displaying properly
jchris Sep 15, 2010
67d1986
cosmetics
jchris Sep 15, 2010
c6af426
Merge branch 'master' into cm
jchris Sep 15, 2010
ad5192f
note about improving the app with link to code
jchris Sep 15, 2010
0a6f89e
Added a check to make sure we only list URL items where the URL is no…
maghoff Sep 28, 2010
cd95ed9
made some ui tweeks to make it look more 'couchcampy'
dopplerreflect Oct 8, 2010
25d7a61
made some ui tweeks to make it look more 'couchcampy'
dopplerreflect Oct 8, 2010
b7ef884
Merge branch 'master' of github.com:doppler/couchcamp_profiles
dopplerreflect Oct 8, 2010
5bb3395
differentiate url li style from li style
dopplerreflect Oct 8, 2010
e835769
added a bg pic
dopplerreflect Oct 8, 2010
75f569a
added raccoon image
Oct 8, 2010
4e65b37
added script to replicate back to couchcamp.couchone.com/profiles, an…
dopplerreflect Oct 9, 2010
d55838f
fix merge conflict
dopplerreflect Oct 9, 2010
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Generated CouchApp

This repo is a snapshot of the development going on in [The CouchApp generate command.](http://github.com/couchapp/couchapp/tree/master/templates/app/)

It's easier for me to receive patches against couchapp/couchapp. This repo is intended primarily so you can deploy new versions of the example app without needing to upgrade CouchApp.

Install with

couchapp push . http://localhost:5984/proto

or (if you have security turned on)

couchapp push . http://myname:mypass@localhost:5984/proto

Binary file added _attachments/couchcampfire.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _attachments/couchcoon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 51 additions & 2 deletions _attachments/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,66 @@
<link rel="stylesheet" href="style/main.css" type="text/css">
</head>
<body>
<div id='header'>
<div id="account"></div>

<h1>CouchCamp Profiles</h1>

<h1>CouchCamp Profiles (a.k.a &quot;Replication Party&quot;)</h1>
<p>If you were at CouchCamp (even in spirit) please add yourself to this list!
Please help us <a href="http://github.com/couchone/couchcamp_profiles">improve the application.</a></p>
<div id="profile"></div>
</div>
<div id="items"></div>

<div id="sidebar">
<p>
<a href='http://www.couch.io/couchcamp'>CouchCamp</a> took place
September 8-10, 2010 at Walker Creek Ranch in the mountains about
an hour north of San Francisco, California.
</p>
<p>
The setting was unique. A campground miles from any bar, restaurant
or hotel. With wild deer, raccoons and foxes curiously attending
nighttime activities around the campfire.
</p>
<p>
This isolated setting proved to be a fertile breeding ground for
the creation and sharing of new ideas. One of those ideas was a
&quot;Replication Party&quot;, wherein attendees would all create
a &quot;/profile&quot; database, and add some info about themselves
to it, then replicate that database with other attendees.
</p>
<p>
What you see here is the result, so far.
</p>
<p>
Whether you were at CouchCamp or not, please feel free to contribute.
</p>
<textarea rows='20'>
# create a /profiles database on your CouchDB:

curl -X PUT http://user:pass@localhost:5984/profiles

# Replicate CouchCamp /profiles to it:

curl -X POST -H 'Content-type: application/json' -d '{"source":"http://couchcamp.couchone.com/profiles","target":"http://localhost:5984/profiles"}' http://localhost:5984/_replicate

# see what other profile docs look like, then create your own.
# then post it back here

curl -X POST -H 'Content-type: application/json' -d '{"target":"http://couchcamp.couchone.com/profiles","source":"http://localhost:5984/profiles"}' http://localhost:5984/_replicate
</textarea>
<p style='text-align:center'>
<img src='couchcoon.jpg' />
</p>
</div>
</body>
<script src="vendor/couchapp/loader.js"></script>
<script src="/_utils/script/jquery.form.js"></script>
<script type="text/javascript" charset="utf-8">
$.couch.app(function(app) {
$("#account").evently("account", app);
$("#profile").evently("profile", app);
$.evently.connect("#account","#profile", ["loggedIn","loggedOut"]);
$("#items").evently("items", app);
});
</script>
Expand Down
49 changes: 38 additions & 11 deletions _attachments/style/main.css
Original file line number Diff line number Diff line change
@@ -1,51 +1,74 @@
/* add styles here */

body {
background: black;
color: #DA0;
font:1em Helvetica, sans-serif;
padding:4px;
}

#header {
background: url('../couchcampfire.jpg') no-repeat;;
}
a, a:hover, a:visited {
color: #A70;
}

h1 {
margin-top:0;
color: orange;
}

#account {
float:right;
}

#profile {
border:4px solid #edd;
background:#fee;
padding:8px;
margin-bottom:8px;
font-size: .8em;
}

#profile form {
float:left;
}

#items {
border:4px solid #dde;
background:#eef;
border: 4px solid #600;
background: #300;
padding:8px;
width:60%;
float:left;
}

#items img.attachment {
width:500px;
}

#sidebar {
border:4px solid #dfd;
border:4px solid #600;
background: #300;
padding:8px;
float:right;
width:30%;
width:35%;
}

#items li {
border:4px solid #f5f5ff;
background:#fff;
border:4px solid orange;
background: black;
padding:8px;
margin:4px 0;
}

#items li.url {
border: 0px;
padding: 0px;
margin: 0px;
}

form {
padding:4px;
margin:6px;
background-color:#ddd;
background-color:#300;
border: 4px solid #600;
}

div.avatar {
Expand Down Expand Up @@ -73,3 +96,7 @@ div.avatar img {
#items ul {
list-style: none;
}

textarea {
width: 95%;
}
Binary file removed evently/items/_changes/.data.js.swp
Binary file not shown.
Binary file removed evently/items/_changes/.mustache.html.swp
Binary file not shown.
11 changes: 7 additions & 4 deletions evently/items/_changes/data.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
function(data) {

var dbname = $$(this).app.db.name;
// $.log(data);
var items = [];
for (var i=0; i < data.rows.length; i++) {
var r = data.rows[i].value, item = {};
var r = data.rows[i].value, item = {}, v=r;
item.bio = r.bio || "";
item.name = v.name;
item.company = v.company;
item.email = v.email;
item.id = data.rows[i].id;
item.dbname = dbname;
item.urls = [];
item.name = data.rows[i].id;

if (r.url) {
item.urls.push({url:r.url, label:"www"});
}
Expand Down
17 changes: 11 additions & 6 deletions evently/items/_changes/mustache.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@ <h3>CouchCampers</h3>
{{#attachments}}
<img width=200 src="../../{{src}}" style="float:left; padding-right:10px;">
{{/attachments}}
<b>{{name}}</b> <br/>
<i>{{bio}}</i> <br/>
<b>{{name}}</b>
{{company}} <br/>
{{#email}}<a href="mailto:{{email}}">{{email}}</a>{{/email}}
<p><i>{{bio}}</i></p> <br/>
<ul>
{{#urls}}
<li>
<a href="{{url}}">{{label}}</a>
</li>
{{#urls}}
{{#url}}
<li class='url'>
<a href="{{url}}">{{label}}</a>
</li>
{{/url}}
{{/urls}}
</ul>
<a href="/_utils/document.html?{{dbname}}/{{id}}">edit in Futon</a>
<div style="clear:left;"></div>
</li>
{{/items}}
Expand Down
1 change: 1 addition & 0 deletions evently/profile/loggedOut/mustache.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>Please log in to create your profile. Signup is super easy, all you need is a name and password, none of the email verification or whatever. Cheers!</p>
22 changes: 19 additions & 3 deletions evently/profile/profileReady/mustache.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<p>Most applications will customize this template (<tt>ddoc.evently.profile.profileReady.mustache</tt>) for user input.</p>

<div class="avatar">
{{#gravatar_url}}<img src="{{gravatar_url}}"/>{{/gravatar_url}}
<div class="name">
Expand All @@ -8,7 +6,25 @@
</div>

<form>
<label>New message from {{nickname}}: <input type="text" name="message" size=60 value=""></label>
<h3>New profile saved by {{nickname}}.</h3>
<p><label>
Your photo:
<input type="file" name="_attachments">
</label></p>
<p><label>Name: <input type="text" name="name" size=40 value=""></label></p>
<p><label>Company: <input type="text" name="company" size=40 value=""></label></p>
<p><label>Bio: <input type="text" name="bio" size=100 value=""></label></p>
<p><label>Email: <input type="text" name="email" size=80 value=""></label></p>
<fieldset>
<legend>URLs</legend>
<p><label>Twitter: <input type="text" name="url-twitter" size=80 value=""></label></p>
<p><label>Source Code: <input type="text" name="url-sourcecode" size=80 value=""></label></p>
<p><label>WWW: <input type="text" name="url-www" size=80 value=""></label></p>
<p><label>CouchDB: <input type="text" name="url-couchdb" size=80 value=""></label></p>
</fieldset>
<p><input type="hidden" name="_rev" value="">
<input type="submit" value="Create Profile"></p>
<p>If you want to edit this information later, there is an "Edit in Futon" link on each listed profile.</p>
</form>

<div style="clear:left;"></div>
36 changes: 31 additions & 5 deletions evently/profile/profileReady/selectors/form/submit.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,39 @@
function() {
var form = this;
function(e) {
e.preventDefault();
var form = $(this);
var f = form.serializeObject();
var doc = {
created_at : new Date(),
profile : $$("#profile").profile,
message : $("[name=message]", form).val()
bio : f.bio,
name : f.name,
company : f.company,
urls : {
www : f["url-www"],
sourcecode : f["url-sourcecode"],
twitter : f["url-twitter"],
couchdb : f["url-couchdb"]
},
email : f.email
};
$$(this).app.db.saveDoc(doc, {
var db = $$(this).app.db;

db.saveDoc(doc, {
success : function() {
$("[name=message]", form).val("");
$("input[name='_rev']", form).val(doc._rev);
var as = $("input[name='_attachments']", form).val();
if (as) {
$("[name=name]", form).val("Uploading file...");
// thank you cmlenz for Futon's original upload code
form.ajaxSubmit({
url: db.uri + $.couch.encodeDocId(doc._id),
success: function(resp) {
form[0].reset();
}
});
} else {
form[0].reset();
}
}
});
return false;
Expand Down
40 changes: 40 additions & 0 deletions migrate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
var couchdb = require("couchdb")
, client = couchdb.createClient(5984, "localhost", "xxx", "xxx")
, db = client.db("profiles")
;

db.allDocs(function(er, view) {
view.rows.forEach(function(r) {
console.log(r.id)
db.getDoc(r.id, {attachments:true}, function(er, doc) {
if (er) {
console.log("getDoc", er)
} else {
console.log(doc._id)
var rev = doc._rev;
var name = doc._id;
if (name.length < 30) {
delete doc._rev;
delete doc._id;
doc.name = name;
db.removeDoc(name, rev, function(er) {
if (er) {
console.log("error deleting", name, er)
} else {
console.log("deleted", name)
}
})
// console.log("update", doc)
// db.saveDoc(doc, function(er, resp) {
// if (er) {
// console.log(er)
// } else {
//
// }
// })
}
}
});
});

});
3 changes: 0 additions & 3 deletions vendor/couchapp/README.md

This file was deleted.

Loading