Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Fixed some UI things, made announcement categories even better
Browse files Browse the repository at this point in the history
  • Loading branch information
manavgabhawala committed Mar 26, 2017
1 parent a86893b commit 4b9759a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 23 deletions.
2 changes: 1 addition & 1 deletion MHacks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class Announcement(Any):
info = models.TextField(default='')
broadcast_at = models.DateTimeField()
category = models.PositiveIntegerField(validators=[MinValueValidator(0),
MaxValueValidator(31)])
MaxValueValidator(31)], help_text="0 for none; 1 for emergency; 2 for logistics; 4 for food; 8 for event; Add 16 to make sponsored")
approved = models.BooleanField(default=False)
sent = models.BooleanField(default=False)

Expand Down
47 changes: 25 additions & 22 deletions static/javascript/announcements.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,33 +68,36 @@ refresh.click(function(){
});

function mapCategoryIndex(category) {
switch (category) {
case 1:
return 0;
case 2:
return 1;
case 4:
return 2;
case 8:
return 3;
if (category & 1) {
return 0;
}
if (category & 2) {
return 1;
}
if (category & 4) {
return 2;
}
if (category & 8) {
return 3;
}

return 0;
}

function formatAnnouncementCategoryIdentifier(category) {
switch (category) {
case 1:
return "Emergency";
case 2:
return "Logistics";
case 4:
return "Food";
case 8:
return "Event";
case 16:
return "Sponsor";
if (category & 1) {
return "Emergency";
}
if (category & 2) {
return "Logistics";
}
if (category & 4) {
return "Food";
}
if (category & 8) {
return "Event";
}
if (category & 16) {
return "Sponsor";
}

return "Other";
}
1 change: 1 addition & 0 deletions static/stylesheets/live.css
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ body{
.content-box {
background-color: rgba(0,0,0,0.4);
border-radius: 20px;
-webkit-backdrop-filter: saturate(150%) blur(20px);
}

@media only screen and (max-width: 850px){
Expand Down

0 comments on commit 4b9759a

Please sign in to comment.