Permalink
Browse files

Added extra buttons for the Proposals, and menu items

  • Loading branch information...
1 parent 7923036 commit b306d23d300b6b9ae73b0fb1bdb40038b8bf6415 @alfredo alfredo committed Jun 29, 2012
View
19 apps/challenges/context_processors.py
@@ -31,3 +31,22 @@ def assigned_submissions_processor(request):
.exclude(judgement__judge=profile))
return {'assignment_count': assigned.count()}
+
+class ClosedPhase(object):
+ """Object that mimicks a closed ``Phase``"""
+
+ @property
+ def is_open(self):
+ return False
+
+ @property
+ def is_closed(self):
+ return True
+
+
+def phases_context_processor(request):
+ """Makes the ``Phases`` available in the templates"""
+ return {
+ 'ideation': request.ideation if request.ideation else ClosedPhase(),
+ 'development': request.development if request.development else ClosedPhase(),
+ }
View
1 apps/challenges/forms.py
@@ -93,6 +93,7 @@ class DevelopmentEntryForm(EntryForm):
# e.g. to make the stkety_note required:
# sketh_note = forms.ImageField()
repository_url = forms.URLField()
+ blog_url = forms.URLField()
class Meta:
model = Submission
View
123 apps/challenges/management/commands/challenges_dummy_content.py
@@ -0,0 +1,123 @@
+from datetime import datetime
+from dateutil.relativedelta import relativedelta
+from optparse import make_option
+
+from django.core.management.base import BaseCommand, CommandError
+from django.conf import settings
+
+from challenges.models import Submission, Category, Phase, Challenge, Project
+
+
+class Command(BaseCommand):
+ help = """Generates dummy fixtures for the ``Phases`` and ``RoundPhases``
+ It requires at least ideation and development ``Phases`` created.
+ Rounds in the development ``Phase`` will be created if missing
+
+ Open the Ideation ``Phase``::
+
+ python manage.py challenges_dummy_content --ideation
+
+ Open the Development ``Phase`` (with an open round)::
+
+ python manage.py challenges_dummy_content --development
+
+ Open both the Ideation and Development ``Phases`` (with an open round)::
+
+ python manage.py challenges_dummy_content --ideation --development
+
+ Open the Development ``Phase`` (with the rounds closed)::
+
+ python manage.py challenges_dummy_content --development --closedrounds
+
+ """
+
+ option_list = BaseCommand.option_list + (
+ make_option('--ideation',
+ action='store_true',
+ dest='ideation',
+ help='Set the Ideation Phase Open'),
+ make_option('--development',
+ action='store_true',
+ dest='development',
+ help='Set the Development Phase Open'),
+ # Development Rounds are open by default
+ make_option('--closedrounds',
+ action='store_true',
+ default=False,
+ dest='closed_rounds',
+ help='Set the Development Phase Rounds Closed'),
+ )
+
+ now = datetime.utcnow()
+
+ def _update_object(self, phase, **kwargs):
+ """Update the ``Phase`` with the provides_values"""
+ for attr, value in kwargs.items():
+ setattr(phase, attr, value)
+ phase.save()
+ return phase
+
+ def _update_rounds(self, development, with_open_rounds=True):
+ """Creates or manages ``PhaseRounds`` for the given ``Phase``
+ if ``with_open_rounds`` is disabled all the rounds will be closed
+ """
+ rounds = development.phaseround_set.all()
+ if not rounds:
+ # Create 3 dummy phaess if there is none available
+ print "Creating dummy Development Rounds"
+ create_round = lambda i: (development.phaseround_set
+ .create(name='Round %s' % i,
+ start_date=development.end_date,
+ end_date=development.end_date))
+ rounds = [create_round(i) for i in range(1, 4)]
+ print "Updating Development Rounds"
+ # list the available rounds and open the first one.
+ for i, item in enumerate(rounds):
+ if i == 1 and with_open_rounds:
+ print "Opening first Development Round"
+ item.start_date = development.start_date
+ item.end_date = development.end_date - relativedelta(days=1)
+ else:
+ item.start_date = development.end_date
+ item.end_date = development.end_date
+ item.save()
+ return rounds
+
+ def handle(self, *args, **options):
+ # answer = raw_input('This will IRREVERSIBLY add TEST DATA to your '
+ # 'database. Proceed (yes/no)? ')
+ # if answer != 'yes':
+ # raise CommandError('Phew. Import canceled.')
+ ideation = Phase.objects.get_ideation_phase()
+ development = Phase.objects.get_development_phase()
+ now = datetime.utcnow()
+ delta = relativedelta(days=15)
+ # Ideation ``Phase``
+ if ideation:
+ if options['ideation']:
+ print "Opening Ideation Phase"
+ start_date = now - delta
+ end_date = now + delta
+ else:
+ print "Closing Ideation Phase"
+ start_date = now - delta - delta
+ end_date = now - delta
+ ideation = self._update_object(ideation, start_date=start_date,
+ end_date=end_date)
+ # Development ``Phase``
+ if development:
+ if options['development']:
+ print "Opening Development Phase"
+ start_date = now - relativedelta(days=3)
+ end_date = now + delta + delta
+ else:
+ print "Closing Development Phase"
+ start_date = now - delta - relativedelta(days=3)
+ end_date = now - relativedelta(days=3)
+ development = self._update_object(development,
+ start_date=start_date,
+ end_date=end_date)
+ # create ``PhaseRounds`` for the development phase
+ with_open_rounds = not options['closed_rounds']
+ rounds = self._update_rounds(development, with_open_rounds)
+ print "Done!"
View
6 apps/challenges/management/commands/challenges_dummy_ideation.py
@@ -55,7 +55,7 @@ def create_user(handle):
return profile
class Command(BaseCommand):
- help = """Bootstraps Mozilla Ignite data in the ideation phase, without the
+ help = """Bootstraps Mozilla Ignite data in the Ideation phase, without the
development phase changes. Used to simulate the current content on the site.
This is only suitable to be run on a Development environment.
"""
@@ -69,9 +69,9 @@ def handle(self, *args, **kwargs):
raise CommandError("IMPORTANT: Make sure you only run this on a "
"Development environment ")
print("Make sure, the project code base has NOT the development phase "
- "changes, before running this")
+ "changes merged, before running this command")
answer = raw_input("Does the project codebase ONLY contain the "
- "Ideation codebase (yes/no)? ")
+ "Ideation codebase. (yes/no)? ")
if answer != 'yes':
raise CommandError("Make sure your codebase .")
answer = raw_input("This will IRREVERSIBLY add TEST DATA to your "
View
4 apps/challenges/migrations/0041_auto__add_field_submission_repository_url.py
@@ -143,12 +143,16 @@ def backwards(self, orm):
'created_on': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.utcnow'}),
'description': ('django.db.models.fields.TextField', [], {}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'interest_making': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'is_draft': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_winner': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'life_improvements': ('django.db.models.fields.TextField', [], {'default': "''"}),
'phase': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['challenges.Phase']"}),
'phase_round': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['challenges.PhaseRound']", 'null': 'True', 'blank': 'True'}),
'repository_url': ('django.db.models.fields.URLField', [], {'max_length': '500', 'blank': 'True'}),
'sketh_note': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'take_advantage': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'team_members': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '60'}),
'updated_on': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'})
},
View
248 apps/challenges/migrations/0042_auto__add_field_submission_blog_url.py
@@ -0,0 +1,248 @@
+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+
+ # Adding field 'Submission.blog_url'
+ db.add_column('challenges_submission', 'blog_url', self.gf('django.db.models.fields.URLField')(default='', max_length=500, blank=True), keep_default=False)
+
+
+ def backwards(self, orm):
+
+ # Deleting field 'Submission.blog_url'
+ db.delete_column('challenges_submission', 'blog_url')
+
+
+ models = {
+ 'auth.group': {
+ 'Meta': {'object_name': 'Group'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'auth.user': {
+ 'Meta': {'object_name': 'User'},
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'challenges.category': {
+ 'Meta': {'object_name': 'Category'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '60'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '60', 'db_index': 'True'})
+ },
+ 'challenges.challenge': {
+ 'Meta': {'object_name': 'Challenge'},
+ 'allow_voting': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'description': ('django.db.models.fields.TextField', [], {}),
+ 'end_date': ('django.db.models.fields.DateTimeField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'moderate': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'project': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['projects.Project']"}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '60', 'db_index': 'True'}),
+ 'start_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.utcnow'}),
+ 'summary': ('django.db.models.fields.TextField', [], {}),
+ 'title': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '60'})
+ },
+ 'challenges.exclusionflag': {
+ 'Meta': {'object_name': 'ExclusionFlag'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'notes': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'submission': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['challenges.Submission']"})
+ },
+ 'challenges.externallink': {
+ 'Meta': {'object_name': 'ExternalLink'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'submission': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['challenges.Submission']", 'null': 'True', 'blank': 'True'}),
+ 'url': ('django.db.models.fields.URLField', [], {'max_length': '255'})
+ },
+ 'challenges.judgeassignment': {
+ 'Meta': {'unique_together': "(('submission', 'judge'),)", 'object_name': 'JudgeAssignment'},
+ 'created_on': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.utcnow'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'judge': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['users.Profile']"}),
+ 'submission': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['challenges.Submission']"})
+ },
+ 'challenges.judgement': {
+ 'Meta': {'unique_together': "(('submission', 'judge'),)", 'object_name': 'Judgement'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'judge': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['users.Profile']"}),
+ 'notes': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'submission': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['challenges.Submission']"})
+ },
+ 'challenges.judginganswer': {
+ 'Meta': {'unique_together': "(('judgement', 'criterion'),)", 'object_name': 'JudgingAnswer'},
+ 'criterion': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['challenges.JudgingCriterion']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'judgement': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'answers'", 'to': "orm['challenges.Judgement']"}),
+ 'rating': ('django.db.models.fields.IntegerField', [], {})
+ },
+ 'challenges.judgingcriterion': {
+ 'Meta': {'ordering': "('id',)", 'object_name': 'JudgingCriterion'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'max_value': ('django.db.models.fields.IntegerField', [], {'default': '10'}),
+ 'phases': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'judgement_criteria'", 'blank': 'True', 'through': "orm['challenges.PhaseCriterion']", 'to': "orm['challenges.Phase']"}),
+ 'question': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '250'})
+ },
+ 'challenges.phase': {
+ 'Meta': {'ordering': "('order',)", 'unique_together': "(('challenge', 'name'),)", 'object_name': 'Phase'},
+ 'challenge': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'phases'", 'to': "orm['challenges.Challenge']"}),
+ 'end_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 12, 29, 18, 8, 19, 769423)'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'order': ('django.db.models.fields.IntegerField', [], {}),
+ 'start_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.utcnow'})
+ },
+ 'challenges.phasecriterion': {
+ 'Meta': {'unique_together': "(('phase', 'criterion'),)", 'object_name': 'PhaseCriterion'},
+ 'criterion': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['challenges.JudgingCriterion']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'phase': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['challenges.Phase']"}),
+ 'weight': ('django.db.models.fields.DecimalField', [], {'default': '10', 'max_digits': '4', 'decimal_places': '2'})
+ },
+ 'challenges.phaseround': {
+ 'Meta': {'object_name': 'PhaseRound'},
+ 'end_date': ('django.db.models.fields.DateTimeField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'phase': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['challenges.Phase']"}),
+ 'slug': ('django_extensions.db.fields.AutoSlugField', [], {'allow_duplicates': 'False', 'max_length': '50', 'separator': "u'-'", 'blank': 'True', 'populate_from': "'name'", 'overwrite': 'False', 'db_index': 'True'}),
+ 'start_date': ('django.db.models.fields.DateTimeField', [], {})
+ },
+ 'challenges.submission': {
+ 'Meta': {'ordering': "['-id']", 'object_name': 'Submission'},
+ 'blog_url': ('django.db.models.fields.URLField', [], {'max_length': '500', 'blank': 'True'}),
+ 'brief_description': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
+ 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['challenges.Category']"}),
+ 'collaborators': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['users.Profile']"}),
+ 'created_on': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.utcnow'}),
+ 'description': ('django.db.models.fields.TextField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'interest_making': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'is_draft': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_winner': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'life_improvements': ('django.db.models.fields.TextField', [], {'default': "''"}),
+ 'phase': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['challenges.Phase']"}),
+ 'phase_round': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['challenges.PhaseRound']", 'null': 'True', 'blank': 'True'}),
+ 'repository_url': ('django.db.models.fields.URLField', [], {'max_length': '500', 'blank': 'True'}),
+ 'sketh_note': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'take_advantage': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'team_members': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '60'}),
+ 'updated_on': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'})
+ },
+ 'challenges.submissionhelp': {
+ 'Meta': {'ordering': "('-updated',)", 'object_name': 'SubmissionHelp'},
+ 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'notes': ('django.db.models.fields.TextField', [], {}),
+ 'parent': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['challenges.SubmissionParent']", 'unique': 'True'}),
+ 'status': ('django.db.models.fields.IntegerField', [], {'default': '2'}),
+ 'updated': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'})
+ },
+ 'challenges.submissionparent': {
+ 'Meta': {'ordering': "('-created',)", 'object_name': 'SubmissionParent'},
+ 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_featured': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'modified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}),
+ 'status': ('django.db.models.fields.IntegerField', [], {'default': '1'}),
+ 'submission': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['challenges.Submission']"})
+ },
+ 'challenges.submissionversion': {
+ 'Meta': {'unique_together': "(('submission', 'parent'),)", 'object_name': 'SubmissionVersion'},
+ 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['challenges.SubmissionParent']"}),
+ 'submission': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['challenges.Submission']"})
+ },
+ 'contenttypes.contenttype': {
+ 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'projects.project': {
+ 'Meta': {'object_name': 'Project'},
+ 'allow_participation': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'allow_sub_projects': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'description': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
+ 'featured': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'featured_image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'followers': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'projects_following'", 'symmetrical': 'False', 'to': "orm['users.Profile']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'long_description': ('django.db.models.fields.TextField', [], {}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'parent_project_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100', 'db_index': 'True'}),
+ 'sub_project_label': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
+ 'team_members': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['users.Profile']", 'symmetrical': 'False'}),
+ 'topics': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['topics.Topic']", 'symmetrical': 'False'})
+ },
+ 'taggit.tag': {
+ 'Meta': {'object_name': 'Tag'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100', 'db_index': 'True'})
+ },
+ 'taggit.taggeditem': {
+ 'Meta': {'object_name': 'TaggedItem'},
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'taggit_taggeditem_tagged_items'", 'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'object_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True'}),
+ 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'taggit_taggeditem_items'", 'to': "orm['taggit.Tag']"})
+ },
+ 'topics.topic': {
+ 'Meta': {'object_name': 'Topic'},
+ 'description': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'draft': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '250', 'null': 'True', 'blank': 'True'}),
+ 'long_description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100', 'db_index': 'True'})
+ },
+ 'users.profile': {
+ 'Meta': {'object_name': 'Profile'},
+ 'avatar': ('django.db.models.fields.files.ImageField', [], {'max_length': '250', 'null': 'True', 'blank': 'True'}),
+ 'bio': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'featured': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'featured_image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}),
+ 'website': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'})
+ }
+ }
+
+ complete_apps = ['challenges']
View
22 apps/challenges/models.py
@@ -189,12 +189,20 @@ def is_open(self):
return self.start_date < now and now < self.end_date
@cached_property
+ def has_started(self):
+ return datetime.utcnow() > self.start_date
+
+ @cached_property
def is_ideation(self):
return self.name == settings.IGNITE_IDEATION_NAME
@cached_property
def is_development(self):
- return self.phase.name == settings.IGNITE_DEVELOPMENT_NAME
+ return self.name == settings.IGNITE_DEVELOPMENT_NAME
+
+ @cached_property
+ def slug_url(self):
+ return 'proposals' if self.is_development else 'ideas'
@receiver(signals.post_save, sender=Phase)
@@ -278,11 +286,6 @@ class Submission(BaseModel):
blank=True, null=True,
on_delete=models.SET_NULL)
collaborators = models.TextField(blank=True)
- # Add Development Phase fields.
- # Make sure they are not required at the Database level.
- # We will make them required at the ``DevelopmentEntryForm`` Level.
- repository_url = models.URLField(max_length=500, verify_exists=False,
- blank=True)
life_improvements = models.TextField(default="",
verbose_name=_(u'How does this improve the lives of people?'))
take_advantage = models.TextField(blank=True, null=True,
@@ -291,6 +294,13 @@ class Submission(BaseModel):
verbose_name=_(u'Are you interested in making this app?'))
team_members = models.TextField(blank=True, null=True,
verbose_name=_(u'Tell us about your team making this app'))
+ # Add Development Phase fields.
+ # Make sure they are not required at the Database level.
+ # We will make them required at the ``DevelopmentEntryForm`` Level.
+ repository_url = models.URLField(max_length=500, verify_exists=False,
+ blank=True)
+ blog_url = models.URLField(max_length=500, verify_exists=False,
+ blank=True)
# managers
View
9 apps/challenges/views.py
@@ -11,12 +11,11 @@
from django.http import HttpResponseRedirect, Http404, HttpResponseForbidden
from django.shortcuts import get_object_or_404
from django.utils.decorators import method_decorator
-from django.views.decorators.http import require_POST
from django.views.generic.base import TemplateResponseMixin
from django.views.generic.list import ListView
from django.views.generic.detail import SingleObjectMixin
-from django.views.generic.edit import (ProcessFormView, UpdateView,
- DeleteView, ModelFormMixin)
+from django.views.generic.edit import ProcessFormView, DeleteView, ModelFormMixin
+
import jingo
from tower import ugettext as _
from awards.forms import AwardForm
@@ -83,8 +82,9 @@ def show(request, project, slug, phase, template_name='challenges/show.html',
raise Http404
project = challenge.project
"""Pagination options """
+ # TODO
entry_set = Submission.objects.visible(request.user)
- entry_set = entry_set.filter(phase__challenge=challenge)
+ entry_set = entry_set.filter(phase__challenge=challenge, phase=phase)
if category:
entry_set = entry_set.filter(category__name=category)
page_number = get_page(request.GET)
@@ -292,6 +292,7 @@ def add_submission(request, phase, form_class=NewEntryForm,
'form': form,
'link_form': link_form,
'error_count': error_count,
+ 'phase': phase,
}
if extra_context:
context.update(extra_context)
View
15 apps/ignite/templates/ignite/splash.html
@@ -18,7 +18,12 @@ <h2 class="busta">
<div class="busta">
<p class="box intro"><strong>Design and build apps for the faster, smarter internet of the future</strong>. Mozilla and the National Science Foundation invite you to take part in an open innovation challenge. The goal: show how next-generation networks can revolutionize healthcare, education, public safety, energy and more.</p>
<div class="gather wimper">
- <a href="{{ url('create_entry', phase='ideas') }}" class="cta">get started</a><br /> or <a href="{{ url('about_ignite') }}">learn more</a>
+ {% if ideation.is_open %}
+ <a href="{{ url('create_entry', phase='ideas') }}" class="cta">get started</a><br /> or <a href="{{ url('about_ignite') }}">learn more</a>
+ {% endif %}
+ {% if development.is_open %}
+ <a href="{{ url('create_entry', phase='proposals') }}" class="cta">create a proposal</a><br /> or <a href="{{ url('about_ignite') }}">learn more</a>
+ {% endif %}
</div>
</div>
</div>
@@ -60,15 +65,23 @@ <h2 class="point">Design and build apps that revolutionize focus areas like thes
{% endfor %}
</ul>
</section>
+{% if ideation.is_open %}
<h2 class="faux_trigger box">Now through August 23rd: let's brainstorm. <strong>$15,000</strong> in prizes.</h2>
+{% endif %}
<div class="columns project_data content_columns">
<div class="dynamic main col box">
<p class="intro"><strong>What would you do with an Internet without limits?</strong> How can next-generation apps change the world? Share your ideas. You don't need to be a developer or technologist to participate -- at this stage we're just seeking good ideas. All are welcome!</p>
</div>
<div class="bonus col box">
<div class="highlight">
+ {% if ideation.is_open %}
<h2 class="point box-title">What's your big idea?</h2>
<a class="cta" href="{{ url('create_entry', phase='ideas') }}">Get started</a>
+ {% endif %}
+ {% if development.is_open %}
+ <h2 class="point box-title">What's your proposal?</h2>
+ <a class="cta" href="{{ url('create_entry', phase='proposals') }}">Send your proposal!</a>
+ {% endif %}
</div>
</div>
</div>
View
4 apps/ignite/views.py
@@ -8,7 +8,7 @@
from events.models import Event
-def splash(request, project, slug, template_name='challenges/show.html'):
+def splash(request, project, slug, template_name='ignite/splash.html'):
"""Show an individual project challenge."""
project = get_object_or_404(Project, slug=project)
challenge = get_object_or_404(project.challenge_set, slug=slug)
@@ -19,7 +19,7 @@ def splash(request, project, slug, template_name='challenges/show.html'):
.filter(phase__challenge=challenge)
.order_by("?"))
event_list = Event.objects.get_featured()[:5]
- return jingo.render(request, 'ignite/splash.html', {
+ return jingo.render(request, template_name, {
'challenge': challenge,
'project': project,
'phases': list(enumerate(challenge.phases.all(), start=1)),
View
9 settings_ignite.py
@@ -28,17 +28,10 @@
TEMPLATE_CONTEXT_PROCESSORS += (
'ignite.context_processors.browserid_target_processor',
'challenges.context_processors.assigned_submissions_processor',
+ 'challenges.context_processors.phases_context_processor',
)
ABSOLUTE_URL_OVERRIDES = {
'auth.user': lambda u: "/profile/%s/" % u.username,
}
-
-# ``DEVELOPMENT_PHASE`` only enables templating overriding
-# any other functionality has been implemented using
-# Phases/Rounds start and end dates.
-if DEVELOPMENT_PHASE:
- TEMPLATE_DIRS = (
- path('templates_ignite', 'development'),
- ) + TEMPLATE_DIRS
View
54 templates_ignite/challenges/all.html
@@ -10,22 +10,41 @@
{% block header %}
<header class="busta">
-<h1 class="shout">{% block title_listing %}Ideas{% endblock %}</h1>
+<h1 class="shout">
+ {% block title_listing %}
+ {% if phase.is_ideation %}
+ Ideas
+ {% endif %}
+ {% if phase.is_development %}
+ Proposals
+ {% endif %}
+ {% endblock %}
+</h1>
+ {% if phase.days_remaining > 0 %}
<div class="meta">
- <p class="intro">You have <em>{{ days_remaining }}</em> days to submit ideas</p>
- <a class="cta" href="{{ url('create_entry', phase='ideas') }}">{{ _('Create submission') }}</a>
+ <p class="intro">You have <em>{{ phase.days_remaining }}</em> days to submit {{ phase.slug_url }}</p>
+ {% if phase.is_open %}
+ <a class="cta" href="{{ url('create_entry', phase=phase.slug_url) }}">{{ _('Create submission') }}</a>
+ {% endif %}
+
</div>
+{% endif %}
</header>
{% endblock %}
{% block content %}
<div class="content_columns columns with_nav">
<nav class="tags col box nav">
<ul>
- <li><a{% if not category %} class="current"{% endif %} href="{{ url('entries_all', phase='ideas') }}">All ideas</a></li>
+ {% if phase.is_ideation %}
+ <li><a{% if not category %} class="current"{% endif %} href="{{ url('entries_all', phase='ideas') }}">All ideas</a></li>
+ {% endif %}
+ {% if phase.is_development %}
+ <li><a{% if not category %} class="current"{% endif %} href="{{ url('entries_all', phase='proposals') }}">All proposals</a></li>
+ {% endif %}
{% if categories %}
{% for cat in categories %}
- <li><a{% if category.slug==cat.slug %} class="current wimper"{% endif %} href="{{ url('entries_for_category', category=cat.slug, phase='ideas') }}">{{ cat.name }}</a></li>
+ <li><a{% if category.slug==cat.slug %} class="current wimper"{% endif %} href="{{ url('entries_for_category', category=cat.slug, phase=phase.slug_url) }}">{{ cat.name }}</a></li>
{% endfor %}
{% endif %}
</ul>
@@ -34,8 +53,14 @@ <h1 class="shout">{% block title_listing %}Ideas{% endblock %}</h1>
{% if category %}
<h2 class="{{category.slug }}">{{ category.name }}</h2>
{% else %}
+{% if phase.is_ideation %}
<h2 class="all">All ideas</h2>
{% endif %}
+{% if phase.is_development %}
+<h2 class="all">All proposals</h2>
+{% endif %}
+
+{% endif %}
{% if entries.object_list.count() != 0 %}
<ol class="submissions columns">
{% for entry in entries.object_list %}
@@ -89,9 +114,24 @@ <h3 class="title wimper">
{% endif %}
{% else %}
{% if category.name %}
- <p class="point">We currently don't have any ideas for {{ category.name }} - be the first to <a class="cta" href="{{ url('create_entry', phase='ideas') }}">create an idea</a></p>
+ {% if phase.is_ideation %}
+ <p class="point">We currently don't have any ideas for {{ category.name }}
+ {% if phase.is_open %}- be the first to <a class="cta" href="{{ url('create_entry', phase='ideas') }}">create an idea</a>{% endif %}
+</p>
+ {% endif %}
+ {% if phase.is_development %}
+ <p class="point">We currently don't have any proposals for {{ category.name }} {% if phase.is_open %}- be the first to <a class="cta" href="{{ url('create_entry', phase='proposals') }}">create an proposal</a></p>{% endif %}
+
+ {% endif %}
+
{% else %}
- <p class="point">We currently don't have any ideas submitted for any of the focus areas - pick your favourite and be the first to <a class="cta" href="{{ url('create_entry', phase='ideas') }}">create an idea</a></p>
+
+ {% if phase.is_ideation %}
+<p class="point">We currently don't have any ideas submitted for any of the focus areas - pick your favourite and be the first to <a class="cta" href="{{ url('create_entry', phase=phase.slug_urg) }}">create an idea</a></p>
+ {% endif %}
+ {% if phase.is_development %}
+<p class="point">We currently don't have any proposal submitted for any of the focus areas - pick your favourite and be the first to <a class="cta" href="{{ url('create_entry', phase=phase.slug_url) }}">create an proposal</a></p>
+ {% endif %}
{% endif %}
{% endif %}
</div>
View
28 templates_ignite/challenges/create.html
@@ -20,7 +20,13 @@
{% block content %}
{% block greeting %}
+{% if phase.is_ideation %}
<h1 class="shout">{{ _('Submit an idea') }}</h1>
+{% endif %}
+
+{% if phase.is_development %}
+<h1 class="shout">{{ _('Submit a proposal') }}</h1>
+{% endif %}
<p class="page-intro">{{ _("Congratulations! You've taken the first step towards making the world, and the internet, a better place. Fill out the form below to get started in the Mozilla Ignite Challenge.") }}</p>
{% endblock %}
<p><span class="error-hint">*</span> means a required field</p>
@@ -118,6 +124,28 @@ <h1 class="shout">{{ _('Submit an idea') }}</h1>
</div>
</div>
{% endif %}
+
+{% if form.blog_url %}
+ <div class="highlight {% if form.blog_url.errors %}fail{% endif %}">
+ <label for="{{ form.blog_url.auto_id }}" class="announce">{% if form.blog_url.errors %}<em>Error in</em> {% endif %}{{ _('Provide a URL for your blog') }}</label>
+ <div class="ed">
+ {% for error in form.blog_url.errors %}
+ <strong>* {{ error }}</strong>
+ {% endfor%}
+ {{ form.blog_url }}
+ </div>
+ <div class="">
+ <p>Please address the following questions on your blog:</p>
+ <ul>
+ <li>How is it going? How is your app progressing?</li>
+ <li>What's been done?</li>
+ <li>What are some of the challenges you are experiencing/have experienced?</li>
+ <li>What are you planning on tackling next?</li>
+ </ul>
+ </div>
+ </div>
+ {% endif %}
+
<fieldset class="external_links highlight {% if link_form.non_form_errors() %}fail{% endif %}">
<legend><span class="announce">{% if link_form.non_form_errors() %}<em>Error in</em> {% endif %}{{ _('External links') }}</span></legend>
<p class="hint">If you've got additional information about your idea elsewhere on the internet (like YouTube pitches, wireframes or blog posts), please include them here. The more information you provide, the better!</p>
View
146 templates_ignite/development/second_base.html
@@ -1,146 +0,0 @@
-<!DOCTYPE html{% block schema_org %}{% endblock %}>
-<!--[if (lt IE 9)]><html class="no-js bad-ie" lang="{{ LANG }}" dir="{{ DIR }}"><![endif]-->
-<!--[if (gt IE 8)|!(IE)]><html class="no-js" lang="{{ LANG }}" dir="{{ DIR }}"><![endif]-->
-<head>
- <title>DEVELOPMENT PHASE - {% block page_title %}{% endblock %}{{ app_name }}</title>
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
- <meta name="viewport" content="initial-scale=1.0, width=device-width">
- {% block site_css %}
- {{ css('ignite_devices') }}
- {% endblock %}
- <link rel="stylesheet" media="all and (min-width:30em)" href="{{ MEDIA_URL }}ignite/css/desktop.css" />
- <!--[if lt IE 9]>
- <script type="text/javascript" src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
- <link rel="stylesheet" media="screen" href="{{ MEDIA_URL }}ignite/css/desktop.css" />
- <![endif]-->
- <link rel="icon" href="{{ MEDIA_URL }}ignite/img/favicon.ico" />
- {% block social_meta %}{% endblock %}
-</head>
-<body id="{% block page_id %}{% endblock %}" class="{% block section_class %}{% endblock %}">
- <script type="text/javascript">
- document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/, '');
- var ignite = window.ignite || {};
- ignite.data = {
- MEDIA_URL : {{ MEDIA_URL }},
- JS_BUILD_ID: 'foo'
- };
- </script>
- <header class="masthead">
- <div class="busta clearfix">
- {% block site_title %}<p class="brand"><a href="{{ url('challenge_show') }}"><img src="{{ MEDIA_URL }}ignite/img/logo.png" alt="Mozilla Ignite" width="200" height="35" /></a></p>{% endblock %}
- <a href="http://www.mozilla.org" class="tab">mozilla.org</a>
- <nav>
- <ul>
- <li><a href="{{ url('about_ignite') }}">{{ _('About the challenge') }}</a></li>
- <li><a href="{{ url('entries_all') }}">{{ _('Submissions') }}</a></li>
- <li><a href="{{ url('our_judges') }}">{{ _('Judges') }}</a></li>
- <li><a href="/blog/">{{ _('Blog') }}</a></li>
- {% block login %}
- {% if not user.is_authenticated() %}
- <li>{% include "registration/_login_form.html" %}</li>
- {% else %}
- <li><a class="logout" href="{{ url('logout') }}">{{ _('Log out') }}</a></li>
- {% endif %}
- {% endblock %}
- </ul>
- </nav>
- {% if user.is_authenticated() %}
- <div style="font-size: 12px;">
- <p style="clear: both; float: left; margin-right: 20px;">Signed in as {{ user.get_profile().display_name }}</p>
- <a style="float: left; text-transform: lowercase; margin-right: 20px;" href="{{ url('users_profile', username=user.username) }}">View profile</a>
- <a style="float: left; text-transform: lowercase;" href="{{ url('users_edit') }}">Edit profile</a>
- </div>
- {% endif %}
- </div>
- </header>
- <div role="main">
- <section>
- {% block header %}{% endblock %}
- <div class="entre">
- <div class="busta">
- {% if perms.challenges.judge_submission and assignment_count %}
- <div class="busta styleme" style="background-color: #ffff00;">
- {% block judgecall %}
- {% trans count=assignment_count, url=url('entries_assigned') %}
- <p>Hi there: you have <a href="{{ url }}">{{ count }} submission</a> awaiting your judgement.</p>
- {% pluralize %}
- <p>Hi there: you have <a href="{{ url }}">{{ count }} submissions</a> awaiting your judgement.</p>
- {% endtrans %}
- {% endblock %}
- </div>
- {% endif %}
- {% block alerts %}
- {% if messages %}
- <section class="alerts">
- <ul class="busta">
- {% for message in messages %}
- <li>{{ message|safe }}</li>
- {% endfor %}
- </ul>
- </section>
- {% endif %}
- {% endblock %}
- {% block content %}{% endblock %}
- </div>
- </div>
- </section>
- </div>
- {% block footer %}
- <aside>
- <section class="partners">
- <div class="busta">
- <h2>Our partners</h2>
- <ul>
- <li><a href="http://www.nsf.gov"><img src="{{ MEDIA_URL }}ignite/img/partners/nsf.png" width="90" height="75" alt="National Science Foundation" /></a></li>
- <li><a href="http://www.geni.net"><img src="{{ MEDIA_URL }}ignite/img/partners/geni.png" width="90" height="75" alt="geni - exploring networks of the future" /></a></li>
- <li><a href="http://www.zerodivide.org"><img width="90" height="75" alt="Zero Divide" src="{{ MEDIA_URL }}ignite/img/partners/zd.png"></a></li>
- <li><a href="http://www.webfwd.org"><img width="90" height="75" alt="WebFWD" src="{{ MEDIA_URL }}ignite/img/partners/webfwd.png"></a></li>
- <li><a href="http://developer.mozilla.org"><img width="90" height="75" alt="Mozilla Developer Network" src="{{ MEDIA_URL }}ignite/img/partners/mdn.png"></a></li>
- <li><a href="http://us-ignite.org"><img width="90" height="75" alt="US Ignite" src="{{ MEDIA_URL }}ignite/img/partners/ignite.png"></a></li>
- </ul>
- </div>
- </section>
- <section class="external">
- <div class="busta">
- <div class="col box tweet">
- <h2>Follow and tweet</h2>
- <p>What becomes possible at 1GBps? What's the future of the web and smart networks? Tweet your thoughts with <a href="https://twitter.com/#!/search?q=%23usignite">#usignite</a>.</p>
- <a href="https://twitter.com/mozilla" class="twitter-follow-button" data-show-count="false">Follow @mozilla</a>
- <script src="//platform.twitter.com/widgets.js" type="text/javascript"></script>
- </div>
- <div class="col box learn">
- <h2>Learn more</h2>
- <ul>
- <li><a href="mailto:ignite@mozillafoundation.org">Contact us</a></li>
- <li><a href="http://www.geni.net">Visit <abbr title="Global Environment for Network Innovations">GENI</abbr> website</a></li>
- <li><a href="http://www.nsf.gov/cise/usignite/">Visit <abbr title="United States">US</abbr> Ignite website</a></li>
- </ul>
- </div>
- <div class="col box mozilla">
- <h2>Connect with Mozilla</h2>
- <ul>
- <li><a href="http://www.mozilla.org/about/mission.html">Learn about Mozilla's mission</a></li>
- <li><a href="https://donate.mozilla.org/join/">Join Mozilla</a></li>
- <li><a href="http://www.facebook.com/mozilladrumbeat/">Like us on Facebook</a></li>
- </ul>
- </div>
- </div>
- </section>
- </aside>
- {% endblock %}
- {% block site_js %}
- {{ js('ignite_core') }}
- {% endblock %}
- {% block page_js %}{% endblock %}
- {% if not waffle.switch('in_dev') %}
- <script type="text/javascript">
- var uvOptions = {};
- (function() {
- var uv = document.createElement('script'); uv.type = 'text/javascript'; uv.async = true;
- uv.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'widget.uservoice.com/s399jcs76KmYlVNnbr8hKQ.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(uv, s);
- })();
- </script>
- {% endif %}
-</body>
-</html>
View
1 templates_ignite/second_base.html
@@ -33,6 +33,7 @@
<ul>
<li><a href="{{ url('about_ignite') }}">{{ _('About the challenge') }}</a></li>
<li><a href="{{ url('entries_all', phase='ideas') }}">{{ _('Ideas') }}</a></li>
+ {% if development.has_started %}<li><a href="{{ url('entries_all', phase='proposals') }}">{{ _('Proposals') }}</a></li>{% endif %}
{% if waffle.switch('show_judges') %}
<li><a href="{{ url('our_judges') }}">{{ _('Judges') }}</a></li>
{% endif %}
View
9 templates_ignite/users/profile.html
@@ -86,7 +86,14 @@ <h3 class="title wimper">
{% endfor %}
</ul>
{% endif %}
-<a href="{{ url('create_entry', phase='ideas') }}" class="cta">{{ _('Create an idea') }}</a>
+ {% if ideation.is_open %}
+ <a href="{{ url('create_entry', phase='ideas') }}" class="cta">{{ _('Create an idea') }}</a>
+ {% endif %}
+ {% if development.is_open %}
+ <a href="{{ url('create_entry', phase='proposals') }}" class="cta">{{ _('Create a proposal') }}</a>
+ {% endif %}
+
+
</div>
</div>
{% endblock %}
View
7 urls_ignite.py
@@ -23,9 +23,8 @@
'allow_xmlhttprequest': True,
}
-urlpatterns = patterns('',
- (r'^admin/', include(admin.site.urls)),
- (r'^browserid/', include('django_browserid.urls')),
+urlpatterns = patterns(
+ '',
url(r'^accounts/logout/$', 'django.contrib.auth.views.logout', kwargs={'next_page': '/'}, name='logout'),
url(r'^accounts/login/$', 'jingo.render', kwargs={'template': 'registration/login.html'}, name='login'),
url(r'^$', 'ignite.views.splash', kwargs=_ignite_kwargs, name='challenge_show'),
@@ -79,6 +78,8 @@
(r'^booking/', include('timeslot.urls', namespace='timeslot'),),
(r'^webcast/', include('webcast.urls', namespace='webcast'),),
(r'^search/', include('search.urls', namespace='search'),),
+ (r'^admin/', include(admin.site.urls)),
+ (r'^browserid/', include('django_browserid.urls')),
(r'', include('users.urls')),
)

0 comments on commit b306d23

Please sign in to comment.