Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added published status graphics

Signed-off-by: Jens Alm <jens.alm@mac.com>
  • Loading branch information...
commit 0fdd18998aacdd4cfc05635a868425604f14b79a 1 parent c8bd706
@ulmus authored
View
3  cards/resources.py
@@ -19,7 +19,8 @@ class CardResource(ModelResource):
"body",
"type",
"keywords",
- "protected"
+ "protected",
+ "published_status",
)
View
BIN  db.sqlite
Binary file not shown
View
9 static/d12/scripts/cards.coffee
@@ -39,6 +39,13 @@ Handlebars.registerHelper("cardCategoryDisplaySymbol", (abbr) ->
when "ADVN" then "O"
)
+Handlebars.registerHelper("cardPublishedStatusDisplay", (abbr) ->
+ switch abbr
+ when "SGST" then new Handlebars.SafeString('<div class="stamp">SUGGESTION</div>')
+ when "DRFT" then new Handlebars.SafeString('<div class="stamp">DRAFT</div>')
+ else ""
+)
+
# The Card Models and Collections
class Card extends Foundation.Model
@@ -198,6 +205,7 @@ class CardView extends Foundation.ModelView
{{attr.title}}
</h2>
{{#if attr.protected }}<div class="noprint lock"><i class="icon-lock"></i></div>{{/if }}
+ {{cardPublishedStatusDisplay attr.published_status}}
<div class="cardtext">
<div class="body">
{{{markdown attr.body}}}
@@ -235,6 +243,7 @@ class CardInDeckView extends Foundation.ModelView
<h2 class="title">
{{card.attributes.title}}
</h2>
+ {{cardPublishedStatusDisplay card.attributes.published_status}}
<div class="cardtext">
<div class="body">
{{{markdown card.attributes.body}}}
View
13 static/d12/scripts/min/cards.js
@@ -57,6 +57,17 @@
}
});
+ Handlebars.registerHelper("cardPublishedStatusDisplay", function(abbr) {
+ switch (abbr) {
+ case "SGST":
+ return new Handlebars.SafeString('<div class="stamp">SUGGESTION</div>');
+ case "DRFT":
+ return new Handlebars.SafeString('<div class="stamp">DRAFT</div>');
+ default:
+ return "";
+ }
+ });
+
Card = (function(_super) {
__extends(Card, _super);
@@ -328,6 +339,7 @@
{{attr.title}}\
</h2>\
{{#if attr.protected }}<div class="noprint lock"><i class="icon-lock"></i></div>{{/if }}\
+ {{cardPublishedStatusDisplay attr.published_status}}\
<div class="cardtext">\
<div class="body">\
{{{markdown attr.body}}}\
@@ -380,6 +392,7 @@
<h2 class="title">\
{{card.attributes.title}}\
</h2>\
+ {{cardPublishedStatusDisplay card.attributes.published_status}}\
<div class="cardtext">\
<div class="body">\
{{{markdown card.attributes.body}}}\
View
13 static/d12/styles/css/style.css
@@ -109,6 +109,19 @@ div.card .contents .title {
background-image: -webkit-linear-gradient(bottom, #d4d2d4 7%, #f2f2f2 70%);
background-image: -ms-linear-gradient(bottom, #d4d2d4 7%, #f2f2f2 70%);
}
+div.card .contents .stamp {
+ text-align: center;
+ z-index: 10;
+ opacity: 0.06;
+ font-family: "Droid Sans", sans-serif;
+ font-size: 30pt;
+ font-weight: bold;
+ position: absolute;
+ width: 100%;
+ -webkit-transform: rotate(-45deg);
+ transform: rotate(-45deg);
+ top: 42mm;
+}
div.card .contents .cardtext {
font-family: "Droid Serif", serif;
width: auto;
View
14 static/d12/styles/style.less
@@ -125,6 +125,20 @@ div.card {
background-image: -ms-linear-gradient(bottom, rgb(212,210,212) 7%, rgb(242,242,242) 70%);
}
+ .stamp {
+ text-align: center;
+ z-index: 10;
+ opacity: 0.06;
+ font-family: "Droid Sans", sans-serif;
+ font-size: 30pt;
+ font-weight: bold;
+ position: absolute;
+ width: 100%;
+ -webkit-transform: rotate(-45deg);
+ transform: rotate(-45deg);
+ top: 42mm;
+ }
+
.cardtext {
font-family: "Droid Serif", serif;
width: auto;
Please sign in to comment.
Something went wrong with that request. Please try again.