Skip to content

Instantly share code, notes, and snippets.

Created September 19, 2017 13:42
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jensens/e07b324d40f1acdffd752969f0071949 to your computer and use it in GitHub Desktop.
cornerribbon tile Plone
<!DOCTYPE html>
<html lang="en" xml:lang="en" xmlns="" xmlns:tal="" xmlns:i18n="" i18n:domain="">
<style tal:condition="view/show">
/* The ribbons */
position: fixed;
top: 25px;
left: -50px;
width: 200px;
line-height: 28px;
background: purple;
box-shadow: 0 0 3px rgba(0,0,0,.3);
color: #f0f0f0;
letter-spacing: 1px;
text-align: center;
z-index: 20000;
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
/* Different positions */{
left: -50px;
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
/* right: -50px; */
top: 0;
right: -85px;
left: auto;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
/* Colors */
.corner-ribbon.white{background: #f0f0f0; color: #555;}{background: #333;}
.corner-ribbon.grey{background: #999;}{background: #39d;}{background: #2c7;}
.corner-ribbon.turquoise{background: #1b9;}
.corner-ribbon.purple{background: #95b;}{background: purple;}{background: #e82;}
.corner-ribbon.yellow{background: #ec0;}
<div tal:condition="view/show" class="corner-ribbon top-right sticky ${view/color} shaddow">${view/text}</div>
# -*- coding: utf-8 -*-
from plone.tiles import Tile
import os
class CornerRibbonTile(Tile):
"""Configureable ribbon
def _tag(self):
return os.environ.get('STATUS', 'DEV')
def show(self):
return self._tag != 'live'
def text(self):
if self._tag == 'latest':
return 'RC'
return 'DEV'
def color(self):
if self._tag == 'latest':
return 'purple'
return 'orange'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment