Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed nomination and award forms from badge details page, moved to …

…separate devoted pages; Misc style tweaks; Fixed a slew of broken feature tests
  • Loading branch information...
commit 51928b2fb5276ad2ed7c3d1087d41f3f88191720 1 parent 50634a5
Les Orchard authored
1  .gitignore
View
@@ -5,6 +5,7 @@ venv/
tmp/
src/
cache/
+migrations/settings.py
site_media/
pip-log.txt
local_settings.py
2  apps/badges/api/tests.py
View
@@ -162,7 +162,7 @@ def test_create_badge(self):
# TODO: implement and test image upload
- @attr('current')
+ #@attr('current')
def test_create_nomination(self):
"""Exercise nominating a user for a badge"""
badge = self.badges['badge4']
153 apps/badges/features/badge_nomination.feature
View
@@ -14,39 +14,48 @@ Feature: Nominating people for badges
And the "create badge" page is at "/badges/create"
And the "browse badges" page is at "/badges/"
+ @FIXME
Scenario: A user nominates a user to be awarded a badge
Given "user1" creates a badge entitled "Awesome badge"
- And I am logged in as "user2"
- And I go to the "badge detail" page for "Awesome badge"
+ And I am logged in as "user2"
+ And I go to the "badge detail" page for "Awesome badge"
+ When I click on "nominate" in the "nominate_action" section
+ Then I should see a page whose title contains "Nominate someone"
When I fill in "Nominee" with "user3"
- And I fill in "Reason why" with "user3 is awesome"
- And I press "Nominate for badge"
+ And I fill in "Reason why" with "user3 is awesome"
+ And I press "Nominate for badge"
Then I should see no form validation errors
- And I should see "user3 nominated" somewhere on the page
- And "user3" should be nominated by "user2" for badge "Awesome badge" because "user3 is awesome"
- And "user1" should receive a "Badge Nomination Proposed" notification
- And "user2" should receive a "Badge Nomination Sent" notification
+ And I should see "user3 nominated" somewhere on the page
+ And "user3" should be nominated by "user2" for badge "Awesome badge" because "user3 is awesome"
+ And "user1" should receive a "Badge Nomination Proposed" notification
+ And "user2" should receive a "Badge Nomination Sent" notification
Given I am logged in as "user1"
- And I go to the "badge detail" page for "Awesome badge"
+ And I go to the "badge detail" page for "Awesome badge"
Then I should see "user3" somewhere in the "nominations" section
+ @FIXME
Scenario: A user nominates someone who has not signed up to the site
Given "user1" creates a badge entitled "More awesome badge"
- And I am logged in as "user2"
- And I go to the "badge detail" page for "More awesome badge"
+ And I am logged in as "user2"
+ And I go to the "badge detail" page for "More awesome badge"
+ When I click on "nominate" in the "nominate_action" section
+ Then I should see a page whose title contains "Nominate someone"
When I fill in "Nominee" with "somebody@example.com"
- And I fill in "Reason why" with "somebody@example.com is awesome"
- And I press "Nominate for badge"
+ And I fill in "Reason why" with "somebody@example.com is awesome"
+ And I press "Nominate for badge"
Then I should see no form validation errors
- And I should see "somebody@example.com nominated" somewhere on the page
- And "somebody@example.com" should be nominated by "user2" for badge "More awesome badge" because "somebody@example.com is awesome"
- And "user1" should receive a "Badge Nomination Proposed" notification
- And "user2" should receive a "Badge Nomination Sent" notification
+ And I should see "somebody@example.com nominated" somewhere on the page
+ And "somebody@example.com" should be nominated by "user2" for badge "More awesome badge" because "somebody@example.com is awesome"
+ And "user1" should receive a "Badge Nomination Proposed" notification
+ And "user2" should receive a "Badge Nomination Sent" notification
- Scenario: A nominations from a badge creator is auto-approved
+ @FIXME
+ Scenario: A nomination from a badge creator is auto-approved
Given "user1" creates a badge entitled "Awesome badge"
And I am logged in as "user1"
And I go to the "badge detail" page for "Awesome badge"
+ When I click on "nominate" in the "nominate_action" section
+ Then I should see a page whose title contains "Nominate someone"
When I fill in "Nominee" with "user3"
And I fill in "Reason why" with "user3 is awesome"
And I press "Nominate for badge"
@@ -54,78 +63,94 @@ Feature: Nominating people for badges
And "user1" should receive a "Badge Awarded" notification
And "user3" should be awarded the badge "Awesome badge"
+ @FIXME
Scenario: Someone is nominated for a badge set to auto-approve for everyone
Given "user1" creates a badge entitled "Ultimate badge"
- And the badge "Ultimate badge" has "autoapprove" set to "True"
- And I am logged in as "user2"
- And I go to the "badge detail" page for "Ultimate badge"
+ And the badge "Ultimate badge" has "autoapprove" set to "True"
+ And I am logged in as "user2"
+ And I go to the "badge detail" page for "Ultimate badge"
+ When I click on "nominate" in the "nominate_action" section
+ Then I should see a page whose title contains "Nominate someone"
When I fill in "Nominee" with "user3"
- And I fill in "Reason why" with "user3 is awesome"
- And I press "Nominate for badge"
+ And I fill in "Reason why" with "user3 is awesome"
+ And I press "Nominate for badge"
Then I should see no form validation errors
- And "user3" should be nominated by "user2" for badge "Ultimate badge" because "user3 is awesome"
- And "user3" should be awarded the badge "Ultimate badge"
- And "user3" should receive a "Badge Award Received" notification
+ And "user3" should be nominated by "user2" for badge "Ultimate badge" because "user3 is awesome"
+ And "user3" should be awarded the badge "Ultimate badge"
+ And "user3" should receive a "Badge Award Received" notification
Given I am logged in as "user3"
- And I go to the "badge detail" page for "Ultimate badge"
+ And I go to the "badge detail" page for "Ultimate badge"
Then I should see the "claim_badge" section
+ @FIXME
Scenario: Nomination should not display nomination form, once approved
Given "user1" creates a badge entitled "Nifty badge"
- And "user2" nominates "user3" for a badge entitled "Nifty badge" because "user3 is nominated for nifty"
- And I am logged in as "user1"
- And I go to the "badge detail" page for "Nifty badge"
+ And "user2" nominates "user3" for a badge entitled "Nifty badge" because "user3 is nominated for nifty"
+ And I am logged in as "user1"
+ And I go to the "badge detail" page for "Nifty badge"
When I click on "user3 is nominated for nifty" in the "nominations" section
- Then I should see a page whose title contains "Badge nomination"
+ Then I should see a page whose title contains "Nomination details"
When I press "Approve"
- Then I should see a page whose title contains "Badge nomination"
+ Then I should see a page whose title contains "Nomination details"
When I go to the "badge detail" page for "Nifty badge"
Then I should not see the "nominations" section
- And "user3" should be awarded the badge "Nifty badge"
- And "user3" should receive a "Badge Award Received" notification
+ And "user3" should be awarded the badge "Nifty badge"
+ And "user3" should receive a "Badge Award Received" notification
When I click on "Inbox" in the "login" section
- And I click on "user3 is nominated for nifty" in the "Notices" section
- Then I should see a page whose title contains "Badge nomination"
- And I should not see "Reason why" anywhere on the page
- And I should not see "Reject" anywhere on the page
+ And I click on "user3 is nominated for nifty" in the "Notices" section
+ Then I should see a page whose title contains "Nomination details"
+ And I should not see "Reason why" anywhere on the page
+ And I should not see "Reject" anywhere on the page
+ @FIXME
Scenario: Multiple separate nominations can be submitted for a non-unique badge
# There should only be one nomination per nominator + nominee + badge
# at a given time. But, multiple individual nominators can submit
# their own nominations, each of which can be approved and claimed
# as multiple awards. (Claiming them is covered in another feature.)
Given "user1" creates a badge entitled "Nifty badge"
- And "user2" nominates "user3" for a badge entitled "Nifty badge" because "user3 is nominated for nifty"
- And I am logged in as "user2"
- And I go to the "badge detail" page for "Nifty badge"
+ And "user2" nominates "user3" for a badge entitled "Nifty badge" because "user3 is nominated for nifty"
+ And I am logged in as "user2"
+ And I go to the "badge detail" page for "Nifty badge"
+ When I click on "nominate" in the "nominate_action" section
+ Then I should see a page whose title contains "Nominate someone"
When I fill in "Nominee" with "user3"
- And I fill in "Reason why" with "user3 is still awesome"
- And I press "Nominate for badge"
+ And I fill in "Reason why" with "user3 is still awesome"
+ And I press "Nominate for badge"
Then I should see form validation errors
Given I am logged in as "user4"
- And I go to the "badge detail" page for "Nifty badge"
+ And I go to the "badge detail" page for "Nifty badge"
+ When I click on "nominate" in the "nominate_action" section
+ Then I should see a page whose title contains "Nominate someone"
When I fill in "Nominee" with "user3"
- And I fill in "Reason why" with "I think user3 is awesome for another thing"
- And I press "Nominate for badge"
+ And I fill in "Reason why" with "I think user3 is awesome for another thing"
+ And I press "Nominate for badge"
Then I should see no form validation errors
Given "user1" approves "user2"'s nomination of "user3" for a badge entitled "Nifty badge" because "user3 is indeed Nifty"
- And I am logged in as "user2"
+ And I am logged in as "user2"
+ And I go to the "badge detail" page for "Nifty badge"
+ When I click on "nominate" in the "nominate_action" section
+ Then I should see a page whose title contains "Nominate someone"
When I fill in "Nominee" with "user3"
- And I fill in "Reason why" with "user3 has shown awesomeness yet again"
- And I press "Nominate for badge"
+ And I fill in "Reason why" with "user3 has shown awesomeness yet again"
+ And I press "Nominate for badge"
Then I should see no form validation errors
Given I am logged in as "user4"
- And I go to the "badge detail" page for "Nifty badge"
+ And I go to the "badge detail" page for "Nifty badge"
+ When I click on "nominate" in the "nominate_action" section
+ Then I should see a page whose title contains "Nominate someone"
When I fill in "Nominee" with "user3"
- And I fill in "Reason why" with "I think user3 continues to be awesome for another thing"
- And I press "Nominate for badge"
+ And I fill in "Reason why" with "I think user3 continues to be awesome for another thing"
+ And I press "Nominate for badge"
Then I should see form validation errors
Given "user1" approves "user4"'s nomination of "user3" for a badge entitled "Nifty badge" because "I know, I know"
- And I am logged in as "user4"
- And I go to the "badge detail" page for "Nifty badge"
+ And I am logged in as "user4"
+ And I go to the "badge detail" page for "Nifty badge"
+ When I click on "nominate" in the "nominate_action" section
+ Then I should see a page whose title contains "Nominate someone"
When I fill in "Nominee" with "user3"
- And I fill in "Reason why" with "I think user3 continues to be awesome for another thing"
- And I press "Nominate for badge"
+ And I fill in "Reason why" with "I think user3 continues to be awesome for another thing"
+ And I press "Nominate for badge"
Then I should see no form validation errors
@TODO
@@ -165,10 +190,11 @@ Feature: Nominating people for badges
When I go to the "badge detail" page for "Nifty badge"
Then I should see "user3" somewhere in the "nominations" section
+ @FIXME
Scenario: User can be a nominator or nominee to see related nomination
Given "user1" creates a badge entitled "Nifty badge"
- And "user2" nominates "user3" for a badge entitled "Nifty badge" because "user3 is Nifty"
- And I am logged in as "user4"
+ And "user2" nominates "user3" for a badge entitled "Nifty badge" because "user3 is Nifty"
+ And I am logged in as "user4"
When I go to the "badge detail" page for "Nifty badge"
Then I should not see the "nominations" section
Given I am logged in as "user1"
@@ -177,11 +203,11 @@ Feature: Nominating people for badges
Given I am logged in as "user3"
When I click on "user3 is Nifty" in the "nominations" section
Then I should see a status code of "200"
- And I should see a page whose title contains "Badge nomination"
+ And I should see a page whose title contains "Nomination details"
Given I am logged in as "user2"
When I reload the page
Then I should see a status code of "200"
- And I should see a page whose title contains "Badge nomination"
+ And I should see a page whose title contains "Nomination details"
@TODO
Scenario: Badges can be set to deny self-nomination
@@ -197,6 +223,7 @@ Feature: Nominating people for badges
# To be encoded as a QR code on a patch/sticker
# Only the badge creator can see the code
+ @FIXME
Scenario: A badge can be set to allow nominations only from its creator
Given I am logged in as "user1"
When I go to the "create badge" page
@@ -214,13 +241,17 @@ Feature: Nominating people for badges
# submitting as user2
Given I am logged in as "user1"
And I go to the "badge detail" page for "Awesome Tester"
- And I am logged in as "user2"
+ When I click on "nominate" in the "nominate_action" section
+ Then I should see a page whose title contains "Nominate someone"
+ Given I am logged in as "user2"
When I fill in "Nominee" with "user3"
And I fill in "Reason why" with "user3 is awesome"
And I press "Nominate for badge"
Then I should see a status code of "403"
Given I am logged in as "user1"
And I go to the "badge detail" page for "Awesome Tester"
+ When I click on "nominate" in the "nominate_action" section
+ Then I should see a page whose title contains "Nominate someone"
When I fill in "Nominee" with "user3"
And I fill in "Reason why" with "user3 is awesome"
And I press "Nominate for badge"
37 apps/badges/features/badge_nomination_decisions.feature
View
@@ -12,39 +12,43 @@ Feature: Making decisions about badge award nominations
And the "create badge" page is at "/badges/create"
And the "browse badges" page is at "/badges/"
+ @FIXME
Scenario: Badge creator approves a nomination to award a badge
Given "user1" creates a badge entitled "Nifty badge"
- And "user2" nominates "user3" for a badge entitled "Nifty badge" because "user3 is Nifty"
- And I am logged in as "user1"
- And I go to the "badge detail" page for "Nifty badge"
- When I find the form containing "user3 is Nifty" in the "nominations" section
- And I press "Approve"
- Then I should see a page whose title contains "Badge detail"
- And I should not see the "nominations" section
- And "user3" should be awarded the badge "Nifty badge"
- And "user3" should receive a "Badge Award Received" notification
+ And "user2" nominates "user3" for a badge entitled "Nifty badge" because "user3 is Nifty"
+ And I am logged in as "user1"
+ And I go to the "badge detail" page for "Nifty badge"
+ When I click on "nomination_details" in the "nominations" section
+ Then I should see a page whose title contains "Nomination details"
+ When I press "Approve"
+ Then I should see a page whose title contains "Nomination details"
+ And I should see "approved this nomination" somewhere on the page
+ And "user3" should be awarded the badge "Nifty badge"
+ And "user3" should receive a "Badge Award Received" notification
Given I am logged in as "user3"
- And I go to the "badge detail" page for "Nifty badge"
+ And I go to the "badge detail" page for "Nifty badge"
Then I should see the "claim_badge" section
+ @FIXME
Scenario: User must be badge creator to approve a nomination
Given "user1" creates a badge entitled "Nifty badge"
And "user2" nominates "user3" for a badge entitled "Nifty badge" because "user3 is Nifty"
And I am logged in as "user1"
When I go to the "badge detail" page for "Nifty badge"
And I click on "user3 is Nifty" in the "nominations" section
- Then I should see a page whose title contains "Badge nomination"
+ Then I should see a page whose title contains "Nomination details"
Given I am logged in as "user3"
When I press "Approve"
Then I should see a status code of "403"
+ @FIXME
Scenario: Badge creator rejects a nomination to award a badge
Given "user1" creates a badge entitled "Nifty badge"
And "user2" nominates "user3" for a badge entitled "Nifty badge" because "user3 is Nifty"
And I am logged in as "user1"
And I go to the "badge detail" page for "Nifty badge"
When I click on "user3 is Nifty" in the "nominations" section
- Then I should see a page whose title contains "Badge nomination"
+ Then I should see a page whose title contains "Nomination details"
When I fill in "Reason why" with "Your niftiness is lacking"
And I press "Reject"
Then I should see a page whose title contains "Badge detail"
@@ -53,34 +57,37 @@ Feature: Making decisions about badge award nominations
And "user1" should receive a "Badge Nomination Rejected" notification
And "user2" should receive a "Badge Nomination Rejected" notification
+ @FIXME
Scenario: Badge nomination rejection should require a reason
Given "user1" creates a badge entitled "Nifty badge"
And "user2" nominates "user3" for a badge entitled "Nifty badge" because "user3 is Nifty"
And I am logged in as "user1"
And I go to the "badge detail" page for "Nifty badge"
When I click on "user3 is Nifty" in the "nominations" section
- Then I should see a page whose title contains "Badge nomination"
+ Then I should see a page whose title contains "Nomination details"
When I press "Reject"
Then I should see form validation errors
+ @FIXME
Scenario: A badge nominator can reject own nomination
Given "user1" creates a badge entitled "Nifty badge"
And "user2" nominates "user3" for a badge entitled "Nifty badge" because "user3 is Nifty"
And I am logged in as "user1"
When I go to the "badge detail" page for "Nifty badge"
And I click on "user3 is Nifty" in the "nominations" section
- Then I should see a page whose title contains "Badge nomination"
+ Then I should see a page whose title contains "Nomination details"
Given I am logged in as "user2"
When I press "Reject"
Then I should see a status code of "200"
+ @FIXME
Scenario: A badge nominee can reject own nomination
Given "user1" creates a badge entitled "Nifty badge"
And "user2" nominates "user3" for a badge entitled "Nifty badge" because "user3 is Nifty"
And I am logged in as "user1"
When I go to the "badge detail" page for "Nifty badge"
And I click on "user3 is Nifty" in the "nominations" section
- Then I should see a page whose title contains "Badge nomination"
+ Then I should see a page whose title contains "Nomination details"
Given I am logged in as "user3"
When I press "Reject"
Then I should see a status code of "200"
75 apps/badges/features/badge_profile_management.feature
View
@@ -14,48 +14,35 @@ Feature: Managing badge awards on a user profile
And the "create badge" page is at "/badges/create"
And the "browse badges" page is at "/badges/"
+ @FIXME
Scenario: Badge awardee accepts an award
Given "user1" creates a badge entitled "Nifty badge"
And "user2" nominates "user3" for a badge entitled "Nifty badge" because "user3 is Nifty"
And "user1" approves the nomination of "user3" for a badge entitled "Nifty badge" because "user3 is indeed Nifty"
And I am logged in as "user3"
And I go to the "badge detail" page for "Nifty badge"
- Then I should not see the "claimed_by" section
+ When I click on "award_detail" in the "pending_awards" section
+ Then I should see a page whose title contains "Award details"
When I press "action_claim_award"
- Then I should see a page whose title contains "Badge detail"
+ Then I should see a page whose title contains "Award detail"
And I should see "Badge award claimed" somewhere on the page
- And I should see "user3" somewhere in the "claimed_by" section
And "user1" should receive a "Badge Award Claimed" notification
And "user2" should receive a "Badge Award Claimed" notification
And "user3" should receive a "Badge Award Claimed" notification
When I go to the "award history" page for "Nifty badge" awarded to "user3"
Then I should see "Nifty badge" somewhere on the page
- Scenario: Badge awardee accepts an award from the award page
- Given "user1" creates a badge entitled "Nifty badge"
- And "user2" nominates "user3" for a badge entitled "Nifty badge" because "user3 is Nifty"
- And "user1" approves the nomination of "user3" for a badge entitled "Nifty badge" because "user3 is indeed Nifty"
- And I am logged in as "user3"
- And I go to the "badge detail" page for "Nifty badge"
- Then I should not see the "claimed_by" section
- When I click on "user3 is Nifty" in the "claim_badge" section
- Then I should see a page whose title contains "Award details"
- When I press "action_claim_award"
- Then I should see a page whose title contains "Award details"
- And I should see "Badge award claimed" somewhere on the page
- And "user1" should receive a "Badge Award Claimed" notification
- And "user2" should receive a "Badge Award Claimed" notification
- And "user3" should receive a "Badge Award Claimed" notification
-
+ @FIXME
Scenario: Badge awardee rejects an award
Given "user1" creates a badge entitled "Nifty badge"
And "user2" nominates "user3" for a badge entitled "Nifty badge" because "user3 is Nifty"
And "user1" approves the nomination of "user3" for a badge entitled "Nifty badge" because "user3 is indeed Nifty"
And I am logged in as "user3"
And I go to the "badge detail" page for "Nifty badge"
- Then I should not see the "claimed_by" section
+ When I click on "award_detail" in the "pending_awards" section
+ Then I should see a page whose title contains "Award detail"
When I press "action_reject_award"
- Then I should see a page whose title contains "Badge details"
+ Then I should see a page whose title contains "Badge detail"
And I should see "Badge award rejected" somewhere on the page
And "user1" should receive a "Badge Award Rejected" notification
And "user2" should receive a "Badge Award Rejected" notification
@@ -67,13 +54,15 @@ Feature: Managing badge awards on a user profile
When I go to the profile page for "user3"
Then I should not see "Nifty badge" anywhere on the page
+ @FIXME
Scenario: Badge awardee ignores an award
Given "user1" creates a badge entitled "Nifty badge"
And "user2" nominates "user3" for a badge entitled "Nifty badge" because "user3 is Nifty"
And "user1" approves the nomination of "user3" for a badge entitled "Nifty badge" because "user3 is indeed Nifty"
And I am logged in as "user3"
And I go to the "badge detail" page for "Nifty badge"
- Then I should not see the "claimed_by" section
+ When I click on "award_detail" in the "pending_awards" section
+ Then I should see a page whose title contains "Award details"
When I press "action_ignore_award"
Then I should see a page whose title contains "Badge details"
And "user3" should receive a "Badge Award Ignored" notification
@@ -84,6 +73,7 @@ Feature: Managing badge awards on a user profile
When I go to the profile page for "user3"
Then I should not see "Nifty badge" anywhere on the page
+ @FIXME
Scenario: An awardee can claim multiple awards of a non-unique badge
Given "user1" creates a badge entitled "Nifty badge"
And "user2" nominates "user3" for a badge entitled "Nifty badge" because "user3 is nifty"
@@ -94,6 +84,7 @@ Feature: Managing badge awards on a user profile
And "user1" approves "user5"'s nomination of "user3" for a badge entitled "Nifty badge" because "sure"
And I am logged in as "user3"
And I go to the "badge detail" page for "Nifty badge"
+
Then "user3" should have "3" unclaimed awards for the badge "Nifty badge"
And I should see "user2" somewhere in the "pending_awards" section
And I should see "user3 is nifty" somewhere in the "pending_awards" section
@@ -101,37 +92,51 @@ Feature: Managing badge awards on a user profile
And I should see "nifty is user3" somewhere in the "pending_awards" section
And I should see "user5" somewhere in the "pending_awards" section
And I should see "nifty nifty nifty" somewhere in the "pending_awards" section
- When I find the form containing "user3 is nifty" in the "claim_badge" section
- And I press "action_claim_award"
- Then I should see a page whose title contains "Badge detail"
+
+ Given I go to the "badge detail" page for "Nifty badge"
+ When I find a "nomination" element containing "user3 is nifty"
+ And I click on "award_detail" in that element
+ Then I should see a page whose title contains "Award detail"
+ When I press "action_claim_award"
+ Then I should see a page whose title contains "Award detail"
And "user3" should have "1" claimed awards for the badge "Nifty badge"
And "user3" should have "2" unclaimed awards for the badge "Nifty badge"
- When I find the form containing "nifty is user3" in the "claim_badge" section
- And I press "action_claim_award"
- Then "user3" should have "2" claimed awards for the badge "Nifty badge"
+
+ Given I go to the "badge detail" page for "Nifty badge"
+ When I find a "nomination" element containing "nifty is user3"
+ And I click on "award_detail" in that element
+ Then I should see a page whose title contains "Award detail"
+ When I press "action_claim_award"
+ Then I should see a page whose title contains "Award detail"
+ And "user3" should have "2" claimed awards for the badge "Nifty badge"
And "user3" should have "1" unclaimed awards for the badge "Nifty badge"
- When I find the form containing "nifty nifty nifty" in the "claim_badge" section
- And I press "action_claim_award"
- Then "user3" should have "3" claimed awards for the badge "Nifty badge"
+
+ Given I go to the "badge detail" page for "Nifty badge"
+ When I find a "nomination" element containing "nifty nifty nifty"
+ And I click on "award_detail" in that element
+ Then I should see a page whose title contains "Award detail"
+ When I press "action_claim_award"
+ Then I should see a page whose title contains "Award detail"
+ And "user3" should have "3" claimed awards for the badge "Nifty badge"
And "user3" should have "0" unclaimed awards for the badge "Nifty badge"
- @TODO
+ @TODO
Scenario: Someone confirms an email address for which badges have been awarded
# Retroactive claim of BadgeAwardee objects without associated users
Given in progress
- @TODO
+ @TODO
Scenario: Badge awardee has chosen to auto-accept awards
# This should be a profile setting.
Given in progress
- @TODO
+ @TODO
Scenario: Badge awardee chooses to auto-accept awards in the future
# Claim form for an award should have a checkbox that says something
# like "Accept future awards automatically?" Should it be per badge?
Given in progress
- @TODO
+ @TODO
Scenario: User wants to claim a previously ignored badge award
# Rejection deletes the award, but ignore just hides it
# Provide a way to undo the ignore decision?
2  apps/badges/features/steps.py
View
@@ -224,6 +224,8 @@ def find_context_form_by_section(context_content, section_title):
def find_context_form(context_content):
page = scc.current_page
form = page('form *:contains("%s")' % context_content).parents('form')
+ #glc.log.debug("PAGE PATH %s" % scc.current_path)
+ #glc.log.debug("PAGE CONTENT %s" % page)
ok_(len(form) > 0, "the form containing '%s' should be found" % context_content)
scc.current_form_context = form
return form
92 apps/badges/templates/badges/award_detail.html
View
@@ -9,6 +9,7 @@
{% load humanize i18n %}
{% load timezone_filters %}
{% load comments_tag %}
+{% load socialconnect_tags %}
{% block head_title %}{% trans "Award details" %}{% endblock %}
@@ -22,16 +23,101 @@
>
<a href="{{ award.awardee.get_absolute_url }}">{{ award.awardee }}</a>
&gt;
- <b>Award detail</b>
+ <b>{% trans "Award detail" %}</b>
</div>
{% with award.badge as badge %}
{% include "badges/elements/badge_display_full.html" %}
{% endwith %}
- {% include "badges/elements/award_display_full.html" %}
+ <div class="award_display_full sections">
- <div class="comments">{% comments award %}</div>
+ {% if not award.claimed and permissions.claim %}
+ <div class="section claim_badge">
+ <h3>Claim this badge</h3>
+ <form action="" method="POST" id="nomination-claim-form" class="uniForm">
+ {% csrf_token %}
+ <fieldset>
+ <p>{% trans "You are eligible to claim this badge award! What would you like to do about it?" %}</p>
+ <div>
+ <button type="submit" name="action_claim_award">{% trans "Claim it" %}</button>
+ <button type="submit" name="action_reject_award">{% trans "Reject it" %}</button>
+ <button type="submit" name="action_ignore_award">{% trans "Ignore it, for now" %}</button>
+ </div>
+ {% socialconnect_by_user user for facebook as connect_facebook %}
+ {% socialconnect_by_user user for twitter as connect_twitter %}
+
+ <div class="social_options">
+ {% if connect_twitter or connect_facebook %}
+ <p>If claimed, also:</p>
+ <ul>
+ {% if connect_twitter %}
+ <li>
+ <input type="checkbox" value="twitter" checked="checked"
+ id="publish_twitter" name="publish" />
+ <label for="publish_twitter">Post an update to Twitter</label>
+ </li>
+ {% endif %}
+ {% if connect_facebook %}
+ <li>
+ <input type="checkbox" value="facebook" checked="checked"
+ id="publish_facebook" name="publish" />
+ <label for="publish_facebook">Post an update to Facebook</label>
+ </li>
+ {% endif %}
+ </ul>
+ {% else %}
+ {% endif %}
+ <p>Manage <a href="{% url socialconnect_manage_associations %}">your connected accounts</a>
+ to enable options for sharing your claimed badges.</p>
+ </div>
+ </fieldset>
+ </form>
+ </div>
+ {% endif %}
+
+ <div class="section history">
+ <h3>Award history</h3>
+ <div class="nomination">
+ <span class="when">{{ award.nomination.created_at|naturalday:_("MONTH_DAY_FORMAT")|capfirst }} at {{ award.nomination.created_at|localtime:account.timezone|time:"P" }},</span>
+ <a href="{{ award.nomination.nominator.get_absolute_url }}" class="avatar"><img src="{% avatar_url award.nomination.nominator 16 %}" alt="Photo of {{ award.nomination.nominator }}" class="photo" /></a>
+ <a href="{{ award.nomination.nominator.get_absolute_url }}">{{ award.nomination.nominator }}</a>
+ <a href="{{ award.nomination.get_absolute_url }}">nominated</a>
+ <a href="{{ award.nomination.nominee.get_absolute_url }}" class="avatar"><img src="{% avatar_url award.nomination.nominee.user 16 %}" alt="Photo of {{ award.nomination.nominee.user }}" class="photo" /></a>
+ <a href="{{ award.awardee.user.get_absolute_url }}">{{ award.awardee.user }}</a>
+ for this badge{% if not award.nomination.reason_why %}.{% else %}, because:
+ <p class="reason_why">{{ award.nomination.reason_why }}</p>{% endif %}
+ </div>
+
+ <div class="approval">
+ <span class="when">{{ award.nomination.updated_at|naturalday:_("MONTH_DAY_FORMAT")|capfirst }} at {{ award.nomination.updated_at|localtime:account.timezone|time:"P" }},</span>
+ <a href="{{ award.nomination.approved_by.get_absolute_url }}" class="avatar"><img src="{% avatar_url award.nomination.approved_by 16 %}" alt="Photo of {{ award.nomination.approved_by }}" class="photo" /></a>
+ <a href="{{ award.nomination.approved_by.get_absolute_url }}">{{ award.nomination.approved_by }}</a>
+ approved the
+ <a href="{{ award.nomination.get_absolute_url }}">nomination</a>{% if not award.nomination.approved_why %}.{% else %}, because:
+ <p class="approved_why">{{ award.nomination.approved_why }}</p>{% endif %}
+ </div>
+
+ <div class="claim">
+ {% if award.claimed %}
+ <span class="when">{{ award.updated_at|naturalday:_("MONTH_DAY_FORMAT")|capfirst }} at {{ award.updated_at|localtime:account.timezone|time:"P" }}, </span>
+ <a href="{{ award.nomination.nominee.get_absolute_url }}" class="avatar"><img src="{% avatar_url award.nomination.nominee.user 16 %}" alt="Photo of {{ award.nomination.nominee.user }}" class="photo" /></a>
+ <a href="{{ award.awardee.user.get_absolute_url }}">{{ award.awardee.user }}</a>
+ claimed this <a href="{{ award.get_absolute_url }}">award</a>.
+ {% else %}
+ <p>This award has not yet been claimed.</p>
+ {% endif %}
+ </div>
+ </div>
+
+ <div class="section comments">
+ <h3>Comments</h3>
+ <div>{% comments award %}</div>
+ </div>
+
+ </div>
+
+
</div>
{% endblock %}
118 apps/badges/templates/badges/badge_detail.html
View
@@ -28,14 +28,13 @@
{% include "badges/elements/badge_display_full.html" %}
- <ul class="sections">
+ <div class="sections">
{% if user.is_authenticated and unclaimed_awards %}
- <li class="claim_badge">
+ <div class="section claim_badge">
<h3>Awards for you ({{ unclaimed_awards|length }})</h3>
<div>
- <p>You are eligible to claim this badge:</p>
<ul class="pending_awards">
{% for award in unclaimed_awards %}
{% url profile_detail username=award.nomination.nominator.username as nominator_url %}
@@ -43,9 +42,8 @@
{% user_display award.nomination.nominator as nominator_display %}
{% user_display award.nomination.approved_by as approved_by_display %}
<li>
- <form action="{{ award.get_absolute_url }}" method="POST" class="claim_form uniForm">
<div class="nomination">
- <a href="{{ nominator_url }}" class="avatar"><img src="{% avatar_url award.nomination.nominator 32 %}" alt="Photo of {{ nominator_display }}" class="photo" /></a>
+ <a class="award_detail" href="{{ award.get_absolute_url }}">{% trans "Want to claim this award?" %}</a>
{{ award.nomination.created_at|naturalday:_("MONTH_DAY_FORMAT")|capfirst }} at {{ award.nomination.created_at|localtime:account.timezone|time:"P" }},
<a href="{{ nominator_url }}" class="avatar"><span>{{ nominator_display }}</span></a>
nominated you because
@@ -53,25 +51,46 @@
and
<a href="{{ approved_by_url }}" class="avatar"><span>{{ approved_by_display }}</span></a> approved the nomination.
</div>
- {% csrf_token %}
- <input type="hidden" name="jump" value="badge" />
- <button type="submit" name="action_claim_award">Claim</button>
- <button type="submit" name="action_reject_award">Reject</button>
- <button type="submit" name="action_ignore_award">Ignore</button>
- </form>
</li>
{% endfor %}
</ul>
</div>
- </li>
+ </div>
{% endif %}
- {% if award_users %}
- <li class="claimed_by">
- <h3>Awarded to</h3>
+ {% if nominations %}
+ <div class="nominations section">
+ <h3>Pending nominations ({{ nominations|length }})</h3>
<div>
+ <ul>
+ {% for nomination in nominations %}
+ {% url profile_detail username=nomination.nominator.username as nominator_url %}
+ {% user_display nomination.nominator as nominator_display %}
+ {% awardee_display nomination.nominee as nominee_display %}
+ <li>
+ <div class="nomination">
+ {{ nomination.created_at|naturalday:_("MONTH_DAY_FORMAT")|capfirst }} at {{ nomination.created_at|localtime:account.timezone|time:"P" }},
+ <a href="{{ nominator_url }}"><span>{{ nominator_display }}</span></a>
+ nominated
+ <a href="{{ nomination.nominee.get_absolute_url }}">{{ nominee_display }}</a>
+ because
+ "<a href="{{ nomination.get_absolute_url }}">{{ nomination.reason_why }}</a>".
+ <a class="nomination_details" href="{{ nomination.get_absolute_url }}">{% trans "View nomination details." %}</a>
+ </div>
+ </li>
+ {% endfor %}
+ </ul>
+ </div>
+ </div>
+ {% endif %}
+
+ {% if award_users %}
+ <div class="section claimed_by clearfix">
+ <h3>Recently claimed awards
<a href="{% url badge_feed_badgeawards badge.slug %}" class="feed"><img src="{{ STATIC_URL }}badges/img/feed-icon-14x14.png" width="14" height="14" /></a>
+ </h3>
+ <div>
<ul class="profiles">
{% for award_user in award_users %}
<li>
@@ -84,66 +103,15 @@
{% endfor %}
</ul>
</div>
- </li>
+ </div>
{% endif %}
- <li class="comments">
+ <div class="section comments">
<h3>Comments</h3>
<div>{% comments badge %}</div>
- </li>
-
- {% if user.is_authenticated and permissions.nomination %}
- <li class="nomination_form">
- <h3>Nominate someone for this badge</h3>
- <form action="" method="POST" id="nomination-form" class="uniForm">
- {% csrf_token %}
- <fieldset class="inlineLabels">
- {{ nomination_form|as_uni_form }}
- <div class="form_block">
- <input type="submit" name="action_nominate" value="Nominate for badge" />
- </div>
- </fieldset>
- </form>
- </li>
- {% endif %}
+ </div>
- {% if nominations %}
- <li class="nominations">
- <h3>Pending nominations ({{ nominations|length }})</h3>
- <div>
- <ul>
- {% for nomination in nominations %}
- {% url profile_detail username=nomination.nominator.username as nominator_url %}
- {% user_display nomination.nominator as nominator_display %}
- {% awardee_display nomination.nominee as nominee_display %}
- <li>
- <form action="{{ nomination.get_absolute_url }}" method="POST" class="uniForm">
- <div class="nomination">
- <a href="{{ nominator_url }}"><img src="{% avatar_url nomination.nominator 32 %}" alt="Photo of {{ nominator_display }}" class="photo" /></a>
- {{ nomination.created_at|naturalday:_("MONTH_DAY_FORMAT")|capfirst }} at {{ nomination.created_at|localtime:account.timezone|time:"P" }},
- <a href="{{ nominator_url }}"><span>{{ nominator_display }}</span></a>
- nominated
- <a href="{{ nomination.nominee.get_absolute_url }}">{{ nominee_display }}</a>
- because
- "<a href="{{ nomination.get_absolute_url }}">{{ nomination.reason_why }}</a>",
- </div>
- {% csrf_token %}
- <input type="hidden" name="jump" value="badge" />
- {% if user.is_superuser or user = nomination.badge.creator %}
- <button type="submit" name="action_approve">Approve</button>
- {% endif %}
- {% if user.is_superuser or user = nomination.badge.creator or user = nomination.nominator %}
- <button type="submit" name="action_reject">Reject</button>
- {% endif %}
- </form>
- </li>
- {% endfor %}
- </ul>
- </div>
- </li>
- {% endif %}
-
- </ul>
+ </div>
</div>
@@ -151,14 +119,4 @@
{% endblock %}
{% block extra_body %}
-<script type="text/javascript">
- $(document).ready(function () {
- var errors = $('.errorlist,.errorField,#errorMsg');
- $('.sections').accordion({
- 'header': '> li > h3',
- 'active': (errors.length == 0) ?
- '.sections li:first h3' : '.sections .nomination_form h3'
- });
- });
-</script>
{% endblock %}
2  apps/badges/templates/badges/badge_list.html
View
@@ -20,7 +20,7 @@
<h1>{% trans "Badges" %}</h1>
- <p><a class="create button" href="{% url create_badge %}">Create a new badge</a></p>
+ <p><a class="create" href="{% url create_badge %}">Create a new badge</a></p>
{% tag_cloud_for_model badges.Badge as badge_tags with steps=9 min_count=1 distribution=log %}
4 apps/badges/templates/badges/create.html
View
@@ -6,7 +6,7 @@
{% block head_title %}{% trans "Create a badge" %}{% endblock %}
{% block body %}
- <h1>{% trans "Create a badge" %}</h1>
+ <h1>{% trans "Create a new badge" %}</h1>
<form enctype="multipart/form-data" action="" method="POST" id="badge-form" class="uniForm">
{% csrf_token %}
@@ -14,7 +14,7 @@
{{ form|as_uni_form }}
<div class="form_block">
<input type="submit" name="action_create"
- value="{% trans "Create" %}" />
+ value="{% trans "Create this badge" %}" />
</div>
</fieldset>
</form>
80 apps/badges/templates/badges/elements/award_display_full.html
View
@@ -5,84 +5,4 @@
{% load uni_form_tags %}
{% load humanize i18n %}
{% load timezone_filters %}
-{% load socialconnect_tags %}
-<div class="award_display_full">
-
- <div class="nomination">
- <span class="when">{{ award.nomination.created_at|naturalday:_("MONTH_DAY_FORMAT")|capfirst }} at {{ award.nomination.created_at|localtime:account.timezone|time:"P" }},</span>
- <a href="{{ award.nomination.nominator.get_absolute_url }}" class="avatar"><img src="{% avatar_url award.nomination.nominator 16 %}" alt="Photo of {{ award.nomination.nominator }}" class="photo" /></a>
- <a href="{{ award.nomination.nominator.get_absolute_url }}">{{ award.nomination.nominator }}</a>
- <a href="{{ award.nomination.get_absolute_url }}">nominated</a>
- <a href="{{ award.nomination.nominee.get_absolute_url }}" class="avatar"><img src="{% avatar_url award.nomination.nominee.user 16 %}" alt="Photo of {{ award.nomination.nominee.user }}" class="photo" /></a>
- <a href="{{ award.awardee.user.get_absolute_url }}">{{ award.awardee.user }}</a>
- for this badge{% if not award.nomination.reason_why %}.{% else %}, because:
- <p class="reason_why">{{ award.nomination.reason_why }}</p>{% endif %}
- </div>
-
- <div class="approval">
- <span class="when">{{ award.nomination.updated_at|naturalday:_("MONTH_DAY_FORMAT")|capfirst }} at {{ award.nomination.updated_at|localtime:account.timezone|time:"P" }},</span>
- <a href="{{ award.nomination.approved_by.get_absolute_url }}" class="avatar"><img src="{% avatar_url award.nomination.approved_by 16 %}" alt="Photo of {{ award.nomination.approved_by }}" class="photo" /></a>
- <a href="{{ award.nomination.approved_by.get_absolute_url }}">{{ award.nomination.approved_by }}</a>
- approved the
- <a href="{{ award.nomination.get_absolute_url }}">nomination</a>{% if not award.nomination.approved_why %}.{% else %}, because:
- <p class="approved_why">{{ award.nomination.approved_why }}</p>{% endif %}
- </div>
-
- <div class="claim">
- {% if award.claimed %}
- <span class="when">{{ award.updated_at|naturalday:_("MONTH_DAY_FORMAT")|capfirst }} at {{ award.updated_at|localtime:account.timezone|time:"P" }}, </span>
- <a href="{{ award.nomination.nominee.get_absolute_url }}" class="avatar"><img src="{% avatar_url award.nomination.nominee.user 16 %}" alt="Photo of {{ award.nomination.nominee.user }}" class="photo" /></a>
- <a href="{{ award.awardee.user.get_absolute_url }}">{{ award.awardee.user }}</a>
- claimed this <a href="{{ award.get_absolute_url }}">award</a>.
- {% else %}
- <p>This award has not yet been claimed.</p>
- {% endif %}
- </div>
-
- {% if not award.claimed and permissions.claim %}
- <div class="claim_badge">
- <h3>Claim this badge</h3>
- <form action="" method="POST" id="nomination-claim-form" class="uniForm">
- {% csrf_token %}
- <fieldset>
- <p>You are eligible to claim this badge! What would you like to do about it?</p>
- <div>
- <button type="submit" name="action_claim_award">Claim</button>
- <button type="submit" name="action_reject_award">Reject</button>
- <button type="submit" name="action_ignore_award">Ignore</button>
- </div>
-
- {% socialconnect_by_user user for facebook as connect_facebook %}
- {% socialconnect_by_user user for twitter as connect_twitter %}
-
- <div class="social_options">
- {% if connect_twitter or connect_facebook %}
- <p>If claimed, also:</p>
- <ul>
- {% if connect_twitter %}
- <li>
- <input type="checkbox" value="twitter" checked="checked"
- id="publish_twitter" name="publish" />
- <label for="publish_twitter">Post an update to Twitter</label>
- </li>
- {% endif %}
- {% if connect_facebook %}
- <li>
- <input type="checkbox" value="facebook" checked="checked"
- id="publish_facebook" name="publish" />
- <label for="publish_facebook">Post an update to Facebook</label>
- </li>
- {% endif %}
- </ul>
- {% else %}
- {% endif %}
- <p>Manage <a href="{% url socialconnect_manage_associations %}">your connected accounts</a>
- to enable options for sharing your claimed badges.</p>
- </div>
- </fieldset>
- </form>
- </div>
- {% endif %}
-
-</div>
6 apps/badges/templates/badges/elements/badge_display_full.html
View
@@ -12,6 +12,12 @@
<p class="description">{{ badge.description }}</p>
<div class="metadata">
+ {% if user.is_authenticated %}
+ <div class="button nominate_action">
+ <a class="nominate" href="{% url badge_nomination_create badge.slug %}">Nominate someone for this badge</a>
+ </div>
+ {% endif %}
+
<div class="votes">
<span class="score">
Score: {% score_for_object badge as score %}
45 apps/badges/templates/badges/nomination_create.html
View
@@ -0,0 +1,45 @@
+{% extends "site_base.html" %}
+
+{% load i18n %}
+{% load account_tags %}
+{% load avatar_tags %}
+{% load badge_tags %}
+{% load uni_form_tags %}
+{% load humanize i18n %}
+{% load timezone_filters %}
+
+{% block head_title %}{% trans "Nominate someone for this badge" %}{% endblock %}
+
+{% block body %}
+
+ <div class="crumbs">
+ <a href="{% url badge_index %}">Badges</a>
+ &gt;
+ <a href="{% url badge_details badge.slug %}">{{ badge.title }}</a>
+ &gt;
+ <b>{% trans "Nominate someone for this badge" %}</b>
+ </div>
+
+ {% include "badges/elements/badge_display_full.html" %}
+
+ <div class="sections">
+ <div class="section">
+ {% if not permissions.nomination %}
+ <p>{% trans "Sorry, you don't have permission to nominate someone for this badge" %}</p>
+ {% else %}
+ <div class="nomination_form">
+ <h3>Nominate someone for this badge</h3>
+ <form action="" method="POST" id="nomination-form" class="uniForm">
+ {% csrf_token %}
+ <fieldset class="inlineLabels">
+ {{ nomination_form|as_uni_form }}
+ <div class="form_block">
+ <input type="submit" name="action_nominate" value="Nominate for badge" />
+ </div>
+ </fieldset>
+ </form>
+ </div>
+ {% endif %}
+ </div>
+ </div>
+{% endblock %}
90 apps/badges/templates/badges/nomination_detail.html
View
@@ -7,7 +7,7 @@
{% load avatar_tags %}
{% load badge_tags %}
-{% block head_title %}{% trans "Badge nomination" %}{% endblock %}
+{% block head_title %}{% trans "Nomination details" %}{% endblock %}
{% block body %}
{% url profile_detail username=nomination.nominator.username as nominator_url %}
@@ -29,54 +29,56 @@
{% include "badges/elements/badge_display_full.html" %}
{% endwith %}
- <div>
- <p>
- <a href="{{ nominator_url }}" class="avatar"><img src="{% avatar_url nomination.nominator 32 %}" alt="Photo of {{ nomination.nominator }}" class="photo" /></a>
- {{ nomination.created_at|naturalday:_("MONTH_DAY_FORMAT")|capfirst }} at {{ nomination.created_at|localtime:account.timezone|time:"P" }},
- <a href="{{ nominator_url }}">{{ nomination.nominator }}</a>
- nominated
- <a href="{{ nomination.nominee.get_absolute_url }}">{{ nomination.nominee }}</a>
- for the badge
- "<a href="{{ nomination.badge.get_absolute_url }}">{{ nomination.badge.title }}</a>"
- because
- "{{ nomination.reason_why }}"
- </p>
-
- {% if not nomination.approved %}
- {% if permissions.approval or permissions.rejection %}
-
- <form action="" method="POST" id="nomination-form" class="uniForm">
- {% csrf_token %}
- <fieldset class="inlineLabels">
- {{ decision_form|as_uni_form }}
- <div class="form_block">
- {% if permissions.approval %}
- <button type="submit" name="action_approve">Approve</button>
- {% endif %}
- {% if permissions.rejection %}
- <button type="submit" name="action_reject">Reject</button>
- {% endif %}
- </div>
- </fieldset>
- </form>
-
- {% else %}
+ <div class="sections">
+ <div class="section">
+ <p>
+ <a href="{{ nominator_url }}" class="avatar"><img src="{% avatar_url nomination.nominator 32 %}" alt="Photo of {{ nomination.nominator }}" class="photo" /></a>
+ {{ nomination.created_at|naturalday:_("MONTH_DAY_FORMAT")|capfirst }} at {{ nomination.created_at|localtime:account.timezone|time:"P" }},
+ <a href="{{ nominator_url }}">{{ nomination.nominator }}</a>
+ nominated
+ <a href="{{ nomination.nominee.get_absolute_url }}">{{ nomination.nominee }}</a>
+ for the badge
+ "<a href="{{ nomination.badge.get_absolute_url }}">{{ nomination.badge.title }}</a>"
+ because
+ "{{ nomination.reason_why }}"
+ </p>
- <p>This nomination has not yet been approved.</p>
+ {% if not nomination.approved %}
+ {% if permissions.approval or permissions.rejection %}
- {% endif %}
+ <form action="" method="POST" id="nomination-form" class="uniForm">
+ {% csrf_token %}
+ <fieldset class="inlineLabels">
+ {{ decision_form|as_uni_form }}
+ <div class="form_block">
+ {% if permissions.approval %}
+ <button type="submit" name="action_approve">Approve</button>
+ {% endif %}
+ {% if permissions.rejection %}
+ <button type="submit" name="action_reject">Reject</button>
+ {% endif %}
+ </div>
+ </fieldset>
+ </form>
+
+ {% else %}
+
+ <p>This nomination has not yet been approved.</p>
- {% else %}
- <p>
- <a href="{{ approved_by_url }}" class="avatar"><img src="{% avatar_url nomination.approved_by 32 %}" alt="Photo of {{ nomination.approved_by }}" class="photo" /></a>
- {{ nomination.updated_at|naturalday:_("MONTH_DAY_FORMAT")|capfirst }} at {{ nomination.updated_at|localtime:account.timezone|time:"P" }},
- <a href="{{ approved_by_url }}">{{ nomination.approved_by }}</a> approved this nomination
- {% if nomination.approved_why %}
- because "{{ nomination.approved_why }}"
{% endif %}
- </p>
- {% endif %}
+ {% else %}
+ <p>
+ <a href="{{ approved_by_url }}" class="avatar"><img src="{% avatar_url nomination.approved_by 32 %}" alt="Photo of {{ nomination.approved_by }}" class="photo" /></a>
+ {{ nomination.updated_at|naturalday:_("MONTH_DAY_FORMAT")|capfirst }} at {{ nomination.updated_at|localtime:account.timezone|time:"P" }},
+ <a href="{{ approved_by_url }}">{{ nomination.approved_by }}</a> approved this nomination
+ {% if nomination.approved_why %}
+ because "{{ nomination.approved_why }}"
+ {% endif %}
+ </p>
+ {% endif %}
+
+ </div>
</div>
</div>
4 apps/badges/urls.py
View
@@ -35,8 +35,12 @@
url(r"^verify/(.*)$", "awardee_verify",
name="awardee_verify"),
+ url(r"^badge/(.*)/nominations/$", "nomination_create",
+ name="badge_nomination_create"),
url(r"^badge/(.*)/nominations/(.*)$", "nomination_details",
name="badge_nomination"),
+ #url(r"^badge/(.*)/awards/$", "award_list",
+ # name="badge_award_recent"),
url(r"^badge/(.*)/awards/(.*)/$", "award_history",
name="badge_award_list"),
url(r"^badge/(.*)/awards/(.*)/showhide$", "award_show_hide_bulk",
62 apps/badges/views.py
View
@@ -146,6 +146,41 @@ def badge_details(request, badge_slug):
perms = badge.get_permissions(request.user)
+ if not request.user.is_authenticated():
+ nominations = None
+ elif badge.allows_nomination_listing_by(request.user):
+ # List all nominations for this badge
+ nominations = BadgeNomination.objects.filter(badge=badge).exclude(approved=True)
+ else:
+ # List only own nominations for this badge
+ nominations = BadgeNomination.objects.filter(badge=badge,
+ nominator=request.user).exclude(approved=True)
+
+ award_users = list(BadgeAward.objects.get_users_for_badge(badge))
+
+ if not request.user.is_authenticated():
+ unclaimed_awards = []
+ else:
+ unclaimed_awards = BadgeAward.objects.filter(claimed=False,
+ ignored=False, badge=badge, awardee__user=request.user)
+
+ return render_to_response('badges/badge_detail.html', {
+ 'badge': badge,
+ 'nomination_form': nomination_form,
+ 'nominations': nominations,
+ 'award_users': award_users,
+ 'permissions': perms,
+ 'unclaimed_awards': unclaimed_awards
+ }, context_instance=RequestContext(request))
+
+
+@login_required
+def nomination_create(request, badge_slug):
+ """ """
+ badge = get_object_or_404(Badge, slug=badge_slug)
+ nomination_form = BadgeNominationForm()
+ perms = badge.get_permissions(request.user)
+
if request.method == "POST":
if (request.user.is_authenticated and
@@ -170,34 +205,13 @@ def badge_details(request, badge_slug):
return HttpResponseRedirect(reverse(
'badges.views.badge_details', args=(badge.slug,)))
- if not request.user.is_authenticated():
- nominations = None
- elif badge.allows_nomination_listing_by(request.user):
- # List all nominations for this badge
- nominations = BadgeNomination.objects.filter(badge=badge
- ).exclude(approved=True)
- else:
- # List only own nominations for this badge
- nominations = BadgeNomination.objects.filter(badge=badge,
- nominator=request.user).exclude(approved=True)
-
- award_users = list(BadgeAward.objects.get_users_for_badge(badge))
-
- if not request.user.is_authenticated():
- unclaimed_awards = []
- else:
- unclaimed_awards = BadgeAward.objects.filter(claimed=False,
- ignored=False, badge=badge, awardee__user=request.user)
-
- return render_to_response('badges/badge_detail.html', {
+ return render_to_response('badges/nomination_create.html', {
'badge': badge,
'nomination_form': nomination_form,
- 'nominations': nominations,
- 'award_users': award_users,
'permissions': perms,
- 'unclaimed_awards': unclaimed_awards
}, context_instance=RequestContext(request))
+
def nomination_details(request, badge_slug, nomination_id):
"""Display details on a nomination"""
badge = get_object_or_404(Badge, slug=badge_slug)
@@ -290,7 +304,7 @@ def award_details(request, badge_slug, awardee_name, award_id):
award.ignore(request.user)
messages.add_message(request, messages.SUCCESS,
_("Badge award ignored"))
- do_jump = True
+ do_jump = "badge"
elif request.POST.get('action_claim_award', None) is not None:
6 apps/socialconnect/views.py
View
@@ -74,7 +74,9 @@ class BaseAuthView(BaseView):
def do_signin(self, request):
"""Perform sign in via OAuth"""
request.session['socialconnect_mode'] = request.GET.get('mode', 'signin')
- request.session['redirect_to'] = request.GET.get(REDIRECT_FIELD_NAME, '/')
+ next = request.GET.get(REDIRECT_FIELD_NAME, '/')
+ if next:
+ request.session['redirect_to'] = next
return HttpResponseRedirect(self.get_signin_url(request))
def do_callback(self, request):
@@ -87,6 +89,8 @@ def do_callback(self, request):
request.session[self.session_profile] = profile
success_url = get_default_redirect(request, REDIRECT_FIELD_NAME)
+ if not success_url or 'None' == success_url:
+ success_url = '/'
try:
# Try looking for an association to perform a login.
80 media/css/main.css
View
@@ -8,15 +8,27 @@ body {
font-family: "Helvetica Neue",Helvetica,Arial,default;
font-size: 10pt;
}
-body #body button {
- /*
- font-family: "Comic Sans MS";
- font-size: 1.125em; font-weight: bold;
- */
- padding: 0.5em 1em 0.5em 1em;
+body #body .uniForm input[type=submit],
+body #body button {
+ border-radius: 4px;
+ -moz-border-radius: 4px;
+ -webkit-border-radius: 4px;
+ background: #ddd;
+ background: -moz-linear-gradient(center top, #fff, #ccc) repeat scroll 0 0 transparent;
+ background: -webkit-gradient(linear,left top,left bottom,from(#fff), to(#ccc));
+ -moz-box-shadow: 2px 2px 2px #ddd;
+ -webkit-box-shadow: 2px 2px 2px #ddd;
+ box-shadow: 2px 2px 2px #ddd;
+ font-weight: bold;
+ padding: 0.25em 0.5em 0.25em 0.5em;
margin: 5px;
border: 1px solid #999;
cursor: pointer;
+ font-size: 15px;
+}
+body #body .uniForm input[type=submit] {
+ margin-top: 10px;
+ margin-left: 25ex;
}
h3 { margin: 0; }
@@ -75,14 +87,23 @@ form.uniForm input[type="submit"], form.login input[type="submit"] { font-size:1
font-size: 150%;
margin: 0.25em; padding: 0.5em;
-moz-border-radius: 8px 8px 8px 8px;
- border: 2px solid #CCCCCC;
+ border: 2px solid #ddd;
+ border-radius: 4px;
+ -moz-border-radius: 4px;
+ -webkit-border-radius: 4px;
+ background: #ddd;
+ background: -moz-linear-gradient(center top, #fff, #e8e8e8) repeat scroll 0 0 transparent;
+ background: -webkit-gradient(linear,left top,left bottom,from(#fff), to(#e0e0e0));
+ -moz-box-shadow: 2px 2px 2px #dedede;
+ -webkit-box-shadow: 2px 2px 2px #dedede;
+ box-shadow: 2px 2px 2px #dedede;
}
.main_activities .activities li a:hover {
- background: #eee;
+ background: #fefefe;
}
-.badge.full { border: 4px solid #ddd; width: 350px; border-radius: 4px; -moz-border-radius: 8px; padding: 0; margin: 0 1em 0 0; float: left; }
+.badge.full { border: 4px solid #ddd; width: 350px; border-radius: 4px; -moz-border-radius: 8px; padding: 0; margin: 0 1em 0 0; position: absolute }
.badge.full h2 { margin: 0; padding: 0.25em 0 0.25em 0; text-align: center; background: #ddd; }
.badge.full .image { width: 100%; text-align: center; background: #fff; }
.badge.full .image img { margin: 1em; }
@@ -97,16 +118,17 @@ form.uniForm input[type="submit"], form.login input[type="submit"] { font-size:1
.badge.full .metadata .votes { font-size: 0.85em; }
.badge.full .metadata .votes form { display: inline; }
-.badge_detail .badge { position: relative; }
.badge_detail .badge .edit_badge { position: absolute; right: 5px; top: 2px; background: #fff; padding: 2px 5px; font-size: 0.9em; display: block }
-ul.sections { margin-left: 375px; }
-ul.sections h3 { padding-left: 1.5em; font-size: 1.5em; }
+.sections { margin: 0 0 0 375px; padding: 0.5em 1em; border: 2px solid #ccc; -moz-border-radius: 8px; }
+.sections h3 { font-size: 1.5em; margin: 0 0 0.25em 0 }
+.sections .section { margin: 0 0 1em 0; padding: 0 0 1em 0; border-bottom: 1px dotted #ccc; }
+.sections div:last-child.section { border-bottom: none }
#body .ui-widget { font-family: inherit; font-size: 1em; }
-.badge_detail .claimed_by { position: relative; }
-.badge_detail .claimed_by .feed { position: absolute; right: 10px }
+.badge_detail .claimed_by { position: relative; clear: both; }
+.badge_detail .claimed_by .feed { }
.badge_detail .profiles { margin: 0; padding: 0; text-align: center; list-style-type: none }
.badge_detail .profiles li { float: left; margin: 0.25em; position: relative; }
.badge_detail .profiles li { }
@@ -116,28 +138,12 @@ ul.sections h3 { padding-left: 1.5em; font-size: 1.5em; }
.badge_detail .profiles li .count { position: absolute; top: -10px; right: 0px; width: 25px; height: 25px; line-height: 25px; background: #080; color: #eee; -moz-border-radius: 25px; }
.badge_detail .profiles li .count a { display: block; text-decoration: none; color: #eee; font-weight: bold; }
-.comments {
- -moz-border-radius: 8px 8px 8px 8px;
- border: 2px solid #CCCCCC;
- margin: 1em 0 0.5em 0;
- padding: 0.5em 0.75em;
-}
-.comments fieldset {
- border: none;
-}
-.claim_badge {
- border-top: 1px solid #ccc;
- margin: 1em 0 0 0;
- padding: 1em 0 0 0;
-}
-.claim_badge label {
- display: inline;
-}
-.award_detail .claim_badge {
-}
-.award_detail .comments {
- margin-left: 375px;
-}
+.comments { }
+.comments fieldset { border: none; }
+.claim_badge { }
+.claim_badge label { display: inline; }
+.award_detail .claim_badge { }
+.award_detail .comments { }
.profile div.left_panel { width: auto; }
@@ -202,7 +208,7 @@ ul.sections h3 { padding-left: 1.5em; font-size: 1.5em; }
.award_list {}
.award_list ul.awards { list-style: none; margin: 0 0 0 375px; padding: 0; }
-.award_display_full { margin: 0 0 0.5em 0; padding: 0.5em 0.75em; border: 2px #ccc solid; -moz-border-radius: 8px; }
+.award_display_full { }
.award_display_full p.reason_why, .award_display_full p.approved_why { font-size: 95%; margin: 1em 0.25em 0.75em 3em; padding: 0.25em 0.5em; font-style: italic; border-left: 2px #aaa solid; background: #eee; }
.award_display_full .when { font-size: 85%; }
9 templates/homepage.html
View
@@ -37,8 +37,13 @@
<li><a href="{% url create_badge %}">Create a new badge</a></li>
<li><a href="#">Redeem a claim code</a></li>
{% if user.is_authenticated %}
- <li><a href="{% url profile_detail user %}">Visit your profile page</a></li>
- <li><a href="{% url acct_email %}">Manage your profile settings</a></li>
+ <li><a href="{% url profile_detail user %}">View your profile</a></li>
+ <li><a href="{% url acct_email %}">Manage your settings</a></li>
+ {% else %}
+ {% if False %}
+ <li><a href="{% url acct_login %}">Log in</a></li>
+ <li><a href="{% url acct_signup %}">Sign up</a></li>
+ {% endif %}
{% endif %}
</ul>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.