Skip to content

Commit

Permalink
Merge branch 'deployable'
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-c committed Feb 15, 2013
2 parents 7959c65 + 71b8596 commit 494129c
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 9 deletions.
3 changes: 2 additions & 1 deletion app/controllers/home_page.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class HomePage extends Controller
recents.sort (a, b) -> a.favorited < b.favorited

mostRecent = for recent, i in recents when i < 3
locations = recent.subjects[0].location.standard
locations = recent.subjects[0]?.location.standard
continue unless locations
locations[Math.floor locations.length / 2]

@imageChanger.setSources mostRecent
Expand Down
4 changes: 4 additions & 0 deletions app/models/subject.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ class Subject extends Model

# Grab subjects randomly.
getter = Api.get("/projects/serengeti/groups/subjects?limit=#{count}").deferred

getter.done (rawSubjects) =>
fetcher.resolve (@fromJSON rawSubject for rawSubject in rawSubjects)

getter.fail =>
fetcher.resolve []

fetcher.promise() # Resolves with all fetched subjects

@fromJSON: (raw) =>
Expand Down
14 changes: 14 additions & 0 deletions app/translations/en_us.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ module.exports =
are providing a powerful new window into the dynamics of Africa’s most elusive wildlife species.
We need your help to classify all the different animals caught in millions of camera trap images.
'''
allSeasonsComplete: '''
<p>With your help, we've classified all the data we have so far. Great work!</p>
<p>
We're leaving some images up for further classification, but we have more projects
(like <a href="https://www.zooniverse.org/project/cyclonecenter">Cyclone Center</a>
and <a href="https://www.zooniverse.org/project/batdetective">Bat Detective</a>) that need your help.
Visit <a href="https://www.zooniverse.org/">zooniverse.org</a> to see them all.
</p>
<p>
Keep an eye on <a href="http://blog.snapshotserengeti.org/">the blog</a>
to learn what happens with the data the project has generated
and to find out when more images from the Serengeti are available.
</p>
'''
action: 'Start classifying'
currentStatus: '<span class="classification-count">0</span> classifications by <span class="user-count">0</span> volunteers'

Expand Down
25 changes: 17 additions & 8 deletions app/views/home_page.eco
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<% translate = require 'lib/translate' %>
<% seasons = require 'lib/seasons' %>

<% allSeasonsComplete = true %>
<% (allSeasonsComplete = false if complete / total < 0.99) for {complete, total}, i in seasons %>

<div class="recents">
<div class="image-changer"></div>
</div>
Expand All @@ -10,18 +13,24 @@
<hr />

<p><%= translate 'home.content' %></p>
<hr />
<% if not allSeasonsComplete: %><hr /><% end %>

<% for {season, total, complete}, i in seasons: %>
<div class="progress">
<p><strong>Season <%= season %></strong> progress</p>
<% if allSeasonsComplete: %>
<div class="all-seasons-complete">
<%- translate 'home.allSeasonsComplete' %>
</div>
<% else: %>
<% for {season, total, complete}, i in seasons: %>
<div class="progress">
<p><strong>Season <%= season %></strong> progress</p>

<div class="track">
<div class="fill" style="width: <%= (complete / total) * 100 %>%;"></div>
<div class="track">
<div class="fill" style="width: <%= (complete / total) * 100 %>%;"></div>
</div>
</div>
</div>
<% end %>
<hr />
<% end %>
<hr />

<p class="action">
<a href="#/classify"><%= translate 'home.action' %></a>
Expand Down
11 changes: 11 additions & 0 deletions css/home_page.styl
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@
}
}

.all-seasons-complete {
background: linear-gradient(top, darken($green-really, 10%), $green-really);
border-radius: 2px;
box-shadow: 0 1px 3px rgba($black, 0.33);
font-size: 12px;
margin: 0 -3px;
padding: 1px 15px;
position: relative;
text-shadow: none;
}

.action {
margin-top: 25px;

Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
"zooniverse": "git+ssh://[email protected]:zooniverse/Zooniverse.git#master",
"zootorial": "~0.0.4",
"moment": "~1.7.2"
},
"scripts": {
"start": "hem server --port 6371"
}
}

0 comments on commit 494129c

Please sign in to comment.