Skip to content

Commit cfd7639

Browse files
committed
add smartgrid base media and supports.
1 parent 5267ff1 commit cfd7639

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+284
-120
lines changed

.slugignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
deploy
2-
bootstrap
3-
bootstrap-cam
42
caminator
53
log
64
doc

makahiki/apps/managers/challenge_mgr/admin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from django.db import models
44
from django.forms.widgets import Textarea
55
from apps.managers.challenge_mgr.models import ChallengeSettings, RoundSettings, PageSettings, \
6-
PageInfo, Sponsor
6+
PageInfo, Sponsor, UploadImage
77

88

99
class PageSettingsInline(admin.TabularInline):
@@ -95,3 +95,4 @@ class ChallengeSettingsAdmin(admin.ModelAdmin):
9595
}
9696

9797
admin.site.register(ChallengeSettings, ChallengeSettingsAdmin)
98+
admin.site.register(UploadImage)
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# encoding: utf-8
2+
import datetime
3+
from south.db import db
4+
from south.v2 import SchemaMigration
5+
from django.db import models
6+
7+
class Migration(SchemaMigration):
8+
9+
def forwards(self, orm):
10+
11+
# Adding model 'UploadImage'
12+
db.create_table('challenge_mgr_uploadimage', (
13+
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14+
('image', self.gf('django.db.models.fields.files.ImageField')(max_length=255, null=True, blank=True)),
15+
))
16+
db.send_create_signal('challenge_mgr', ['UploadImage'])
17+
18+
19+
def backwards(self, orm):
20+
21+
# Deleting model 'UploadImage'
22+
db.delete_table('challenge_mgr_uploadimage')
23+
24+
25+
models = {
26+
'challenge_mgr.challengesettings': {
27+
'Meta': {'object_name': 'ChallengeSettings'},
28+
'cas_server_url': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
29+
'competition_name': ('django.db.models.fields.CharField', [], {'default': "'Kukui Cup'", 'max_length': '50'}),
30+
'competition_team_label': ('django.db.models.fields.CharField', [], {'default': "'Lounge'", 'max_length': '50'}),
31+
'contact_email': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
32+
'email_enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
33+
'email_host': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100'}),
34+
'email_port': ('django.db.models.fields.IntegerField', [], {'default': '587'}),
35+
'email_use_tls': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
36+
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
37+
'landing_introduction': ('django.db.models.fields.TextField', [], {'default': "'Aloha!'", 'max_length': '500'}),
38+
'landing_non_participant_text': ('django.db.models.fields.TextField', [], {'default': "'About'", 'max_length': '255'}),
39+
'landing_participant_text': ('django.db.models.fields.TextField', [], {'default': "'Let me in'", 'max_length': '255'}),
40+
'landing_slogan': ('django.db.models.fields.TextField', [], {'default': "'The Kukui Cup: Lights out, game on!'", 'max_length': '255'}),
41+
'ldap_search_base': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
42+
'ldap_server_url': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
43+
'site_domain': ('django.db.models.fields.CharField', [], {'default': "'kukuicup.manoa.hawaii.edu'", 'max_length': '100'}),
44+
'site_logo': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
45+
'site_name': ('django.db.models.fields.CharField', [], {'default': "'University of Hawaii at Manoa'", 'max_length': '50'}),
46+
'theme': ('django.db.models.fields.CharField', [], {'default': "'default'", 'max_length': '50'})
47+
},
48+
'challenge_mgr.pageinfo': {
49+
'Meta': {'object_name': 'PageInfo'},
50+
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
51+
'introduction': ('django.db.models.fields.TextField', [], {'max_length': '1000', 'null': 'True', 'blank': 'True'}),
52+
'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
53+
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
54+
'priority': ('django.db.models.fields.IntegerField', [], {'default': '1'}),
55+
'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
56+
'unlock_condition': ('django.db.models.fields.CharField', [], {'default': "'True'", 'max_length': '255'}),
57+
'url': ('django.db.models.fields.CharField', [], {'default': "'/'", 'max_length': '255'})
58+
},
59+
'challenge_mgr.pagesettings': {
60+
'Meta': {'ordering': "['page', 'widget']", 'unique_together': "(('page', 'widget'),)", 'object_name': 'PageSettings'},
61+
'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
62+
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
63+
'page': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['challenge_mgr.PageInfo']"}),
64+
'widget': ('django.db.models.fields.CharField', [], {'default': "'home'", 'max_length': '50'})
65+
},
66+
'challenge_mgr.roundsettings': {
67+
'Meta': {'ordering': "['start']", 'object_name': 'RoundSettings'},
68+
'end': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 5, 14, 15, 35, 24, 179412)'}),
69+
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
70+
'name': ('django.db.models.fields.CharField', [], {'default': "'Round 1'", 'max_length': '50'}),
71+
'start': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 5, 7, 15, 35, 24, 179356)'})
72+
},
73+
'challenge_mgr.sponsor': {
74+
'Meta': {'ordering': "['priority', 'name']", 'object_name': 'Sponsor'},
75+
'challenge': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['challenge_mgr.ChallengeSettings']"}),
76+
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
77+
'logo': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
78+
'logo_url': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
79+
'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
80+
'priority': ('django.db.models.fields.IntegerField', [], {'default': "'1'"}),
81+
'url': ('django.db.models.fields.CharField', [], {'max_length': '200'})
82+
},
83+
'challenge_mgr.uploadimage': {
84+
'Meta': {'object_name': 'UploadImage'},
85+
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
86+
'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'})
87+
}
88+
}
89+
90+
complete_apps = ['challenge_mgr']

makahiki/apps/managers/challenge_mgr/models.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99

1010
_MEDIA_LOCATION = "challenge"
11+
"""location for challenge files."""
12+
13+
_MEDIA_LOCATION_UPLOAD = "uploads"
1114
"""location for uploaded files."""
1215

1316

@@ -277,3 +280,14 @@ class Meta:
277280

278281
def __unicode__(self):
279282
return ""
283+
284+
285+
class UploadImage(models.Model):
286+
"""Defines the global settings for the challenge."""
287+
image = models.ImageField(
288+
upload_to=media_file_path(_MEDIA_LOCATION_UPLOAD),
289+
max_length=255, blank=True, null=True,
290+
help_text="The uploaded image.",)
291+
292+
def __unicode__(self):
293+
return self.image.name

makahiki/apps/widgets/prizes/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from apps.utils.utils import media_file_path
88

99

10-
_MEDIA_LOCATION = "prize"
10+
_MEDIA_LOCATION = "prizes"
1111
"""location for uploaded files."""
1212

1313

makahiki/apps/widgets/raffle/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
RAFFLE_END_PERIOD = 2
1111
"""Number of hours prior to the end of a round that the raffle closes."""
1212

13-
_MEDIA_LOCATION = "raffle"
13+
_MEDIA_LOCATION = "prizes"
1414
"""location for uploaded files."""
1515

1616

makahiki/apps/widgets/smartgrid/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
from apps.managers.cache_mgr import cache_mgr
2121
from apps.widgets.smartgrid import NOSHOW_PENALTY_DAYS
2222

23-
_MEDIA_LOCATION_ACTION = os.path.join("smartgrid", "action")
23+
_MEDIA_LOCATION_ACTION = os.path.join("smartgrid", "actions")
2424
"""location for the uploaded files for actions."""
2525

26-
_MEDIA_LOCATION_MEMBER = os.path.join("smartgrid", "member")
26+
_MEDIA_LOCATION_MEMBER = os.path.join("smartgrid", "members")
2727
"""location for the uploaded files for actionmembers."""
2828

2929

makahiki/fixtures/base_settings.json

Lines changed: 96 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,98 @@
11
[
2-
{
3-
"pk": 1,
4-
"model": "challenge_mgr.challengesettings",
5-
"fields": {
6-
"competition_name": "Kukui Cup/UH",
7-
"site_domain": "kukuicup.manoa.hawaii.edu",
8-
"site_name": "University of Hawaii at Manoa",
9-
"landing_sponsors": "[<img src=\"/site_media/static/images/sponsors/logo.csdl.gif\" title=\"Collaborative Software Development Laboratory\">](http://csdl.ics.hawaii.edu)\r\n[<img src=\"/site_media/static/images/sponsors/logo.reis.2.png\" title=\"Renewable Energy & Island Sustainability\">](http://manoa.hawaii.edu/reis)\r\n[<img src=\"/site_media/static/images/sponsors/logo.manoa.2.png\" title=\"Student Housing Services, UH Manoa\">](http://manoa.hawaii.edu/housing)\r\n[<img src=\"http://www.nsf.gov/images/logos/nsf1sm.gif\" width=\"75px title=\"National Science Foundation\">](http://www.nsf.gov)\r\n[<img src=\"/site_media/static/images/sponsors/dbedt-logo.jpg\" title=\"DBEDT\">](http://energy.hawaii.gov)",
10-
"landing_slogan": "##The Kukui Cup: Lights out, game on!",
11-
"email_use_tls": true,
12-
"landing_non_participant_text": "###I'm not registered\r\n#####but I'd like to know more about the Kukui Cup</h5>",
13-
"email_port": 587,
14-
"theme": "default",
15-
"cas_server_url": "https://login.its.hawaii.edu/cas/",
16-
"contact_email": "test",
17-
"email_enabled": false,
18-
"site_logo": "",
19-
"landing_participant_text": "### I'm a registered player \r\n##### You will be prompted for \r\n##### your UH username and password, it's safe",
20-
"landing_introduction": "Aloha! The Kukui Cup is an energy challenge that can be played by all first year UH students living in the Hale Aloha residence halls.",
21-
"competition_team_label": "Lounge",
22-
"email_host": "localhost"
2+
{
3+
"pk": 1,
4+
"model": "challenge_mgr.challengesettings",
5+
"fields": {
6+
"competition_name": "Kukui Cup/UH",
7+
"site_domain": "kukuicup.manoa.hawaii.edu",
8+
"site_name": "University of Hawaii at Manoa",
9+
"ldap_search_base": null,
10+
"landing_slogan": "##The Kukui Cup: Lights out, game on!",
11+
"email_use_tls": true,
12+
"landing_non_participant_text": "###I'm not registered\r\n#####but I'd like to know more about the Kukui Cup</h5>",
13+
"email_port": 587,
14+
"theme": "default",
15+
"cas_server_url": "https://login.its.hawaii.edu/cas/",
16+
"contact_email": "[email protected]",
17+
"email_enabled": false,
18+
"site_logo": "media/challenge/icon-uh-logo.png",
19+
"ldap_server_url": null,
20+
"landing_participant_text": "### I'm a registered player \r\n##### You will be prompted for \r\n##### your UH username and password, it's safe",
21+
"landing_introduction": "Aloha! The Kukui Cup is an energy challenge that can be played by all first year UH students living in the Hale Aloha residence halls.",
22+
"competition_team_label": "Lounge",
23+
"email_host": "smtp.gmail.com"
24+
}
25+
},
26+
{
27+
"pk": 1,
28+
"model": "score_mgr.scoresettings",
29+
"fields": {
30+
"active_threshold_points": 50,
31+
"quest_bonus_points": 0,
32+
"setup_points": 5,
33+
"signup_bonus_points": 2,
34+
"noshow_penalty_points": 4,
35+
"referral_bonus_points": 10
36+
}
37+
},
38+
{
39+
"pk": 2,
40+
"model": "challenge_mgr.sponsor",
41+
"fields": {
42+
"name": "Collaborative Software Development Laboratory",
43+
"url": "http://csdl.ics.hawaii.edu",
44+
"challenge": 1,
45+
"priority": 1,
46+
"logo": "media/challenge/logo.csdl.gif",
47+
"logo_url": ""
48+
}
49+
},
50+
{
51+
"pk": 4,
52+
"model": "challenge_mgr.sponsor",
53+
"fields": {
54+
"name": "Student Housing Services, UH Manoa",
55+
"url": "http://manoa.hawaii.edu/housing",
56+
"challenge": 1,
57+
"priority": 2,
58+
"logo": "media/challenge/logo.manoa.2.png",
59+
"logo_url": ""
60+
}
61+
},
62+
{
63+
"pk": 3,
64+
"model": "challenge_mgr.sponsor",
65+
"fields": {
66+
"name": "Renewable Energy & Island Sustainability",
67+
"url": "http://manoa.hawaii.edu/reis",
68+
"challenge": 1,
69+
"priority": 3,
70+
"logo": "media/challenge/logo.reis.2.png",
71+
"logo_url": ""
72+
}
73+
},
74+
{
75+
"pk": 5,
76+
"model": "challenge_mgr.sponsor",
77+
"fields": {
78+
"name": "National Science Foundation",
79+
"url": "http://www.nsf.gov",
80+
"challenge": 1,
81+
"priority": 4,
82+
"logo": "",
83+
"logo_url": "http://www.nsf.gov/images/logos/nsf1sm.gif"
84+
}
85+
},
86+
{
87+
"pk": 6,
88+
"model": "challenge_mgr.sponsor",
89+
"fields": {
90+
"name": "DBEDT",
91+
"url": "http://energy.hawaii.gov",
92+
"challenge": 1,
93+
"priority": 5,
94+
"logo": "media/challenge/dbedt-logo.jpg",
95+
"logo_url": ""
96+
}
2397
}
24-
},
25-
{
26-
"pk": 1,
27-
"model": "score_mgr.scoresettings",
28-
"fields": {
29-
"active_threshold_points": 50,
30-
"quest_bonus_points": 0,
31-
"setup_points": 5,
32-
"signup_bonus_points": 2,
33-
"noshow_penalty_points": 4,
34-
"referral_bonus_points": 10
35-
}
36-
}
37-
]
98+
]

0 commit comments

Comments
 (0)