Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a page for Mr. B #49

Merged
merged 3 commits into from Jul 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 10 additions & 3 deletions app.wsgi
Expand Up @@ -47,20 +47,25 @@ config_file = os.getenv(
)
cfg = Config(config_file)

app = application = Bottle()
bottle.BaseTemplate.settings.update({
'extensions': ['jinja2.ext.i18n'],
'globals': {
'url': app.get_url
},
'filters': {
'markdown': markdown.Markdown(extensions=[GithubFlavoredMarkdownExtension()]).convert
}
})

app = application = Bottle()

route = app.route
post = app.post
url = app.get_url
app = LangDetector(app, languages=["ja", "en"])
app = WSGILogger(app, [StreamHandler(stdout)], ApacheFormatter())


octav = Octav(**cfg.section('OCTAV'))

cache = cache.Redis(**cfg.section('REDIS_INFO'))
Expand All @@ -85,12 +90,15 @@ def session(func):
def favicon():
raise HTTPError(status=404)


# Note: this has to come BEFORE other handlers
@route('/assets/<filename:path>', name='statics')
def statics(filename):
return static_file(filename, root='assets')

@route('/beacon')
def beacon():
lang = request.environ.get("lang")
return template('beacon.tpl', {}, lang=lang)

@route('/')
def index():
Expand All @@ -104,7 +112,6 @@ def index():
cache.set(key, conferences, 600)
return template('index.tpl', {
'pagetitle': 'top',
'body_id': "top",
'conferences': conferences,
'login': {'username': _session_user()},
'url': url
Expand Down
16 changes: 16 additions & 0 deletions assets/css/style.css
Expand Up @@ -14,3 +14,19 @@
height: 410px;
background: rgba(0,0,0,0) url(/assets/images/heroimage-hall.png) repeat-x center 0;
}

#beacon #heroimage {
position: relative;
margin-top: -59px;
margin-bottom: -79px;
height: 600px;
background: rgba(0,0,0,0) url(/assets/images/heroimage-beacon.png) repeat-x center 0;
}

#beacon-gallery div.gallery-slot img {
width: 200px;
height: 200px;
}
#beacon-gallery div.gallery-slot {
text-align: center;
}
Binary file added assets/images/heroimage-beacon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mrbeacon-001.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mrbeacon-002.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mrbeacon-003.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mrbeacon-004.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mrbeacon-005.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mrbeacon-006.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mrbeacon-007.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mrbeacon-008.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mrbeacon-009.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions view.py
Expand Up @@ -3,6 +3,7 @@
import jinja2
import functools

DEBUG=False
TEMPLATES={}

""" This class adds support for i18n/l10n on top of the base bottle.Jinja2Template """
Expand Down
52 changes: 52 additions & 0 deletions views/beacon.tpl
@@ -0,0 +1,52 @@
{% extends 'layout/base.tpl' %}

{% block body_id %}beacon{% endblock %}

{% block main %}
<main>
<div class="section article">
<div class="inner">
<h1 class="section-header">{% trans %}Meet Mr. B (Mr. Beacon)!{% endtrans %}</h1>
<div class="section-content">
{% trans %}
<p>Mr. B is our jolly mascot beaver. He likes to build stuff, just like us</p>
<p>Please feel free to use Mr B. for promoting your own builderscon or to create new swags with it!</p>
{% endtrans %}
</div>
</div>
</div>
<div class="section article" id="beacon-gallery">
<div class="inner">
<div class="section-content no-header">
{% for i in range(1,10) %}
{% if i % 3 == 1 %}
<div class="row">
{% endif %}
<div class="large-4 columns gallery-slot">
<a href="{{ url('statics', filename='images/mrbeacon-%03d.png' % i) }}"><img src="{{ url('statics', filename='images/mrbeacon-%03d.png' % i) }}"></a>
<div class="title">mrbeacon-{{ '%03d' % i }}.png</div>
</div>
{% if i % 3 == 0 or loop.last %}
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>
<div class="section article" id="tou">
<div class="inner">
<h1 class="section-header">{% trans %}Terms of Use{% endtrans %}</h1>
<div class="section-content">
{% trans %}
<ul>
<li>Permission is hereby granted to use the Mr. Beacon character, in accordance with <a href="https://creativecommons.org/licenses/by-nc/4.0/">CC-BY-NC 4.0 License</a></li>
<li>Mr. Beacon was designed by <a href="https://twitter.com/yassang0928">yassang</a></li>
<li>Attribution to the creator ("by yassang") is recommended but not required</li>
<li>Mr. Beacon is &copy; endeworks and &copy; <a href="https://twitter.com/yassang0928">yassang</a></li>
</ul>
{% endtrans %}
</div>
</div>
</div>
</main>
{% endblock %}
2 changes: 1 addition & 1 deletion views/layout/base.tpl
Expand Up @@ -9,7 +9,7 @@
<link href="{{ url('statics', filename='css/style.css') }}" rel="stylesheet"/>
{% block header %}{% endblock %}
</head>
<body{% if body_id %} id="{{ body_id }}"{% endif %}>
<body id="{% block body_id %}top{% endblock %}">
<div id="wrapper">
<header id="header">
<div class="inner">
Expand Down
2 changes: 2 additions & 0 deletions views/layout/conference.tpl
@@ -1,5 +1,7 @@
{% extends 'layout/base.tpl' %}

{% block body_id %}conference{% endblock %}

{% block menuitems %}
<li><a href="/{{ slug }}"><span class="i-home"></span></a></li>
<li><a href="/{{ slug }}/news">{% trans %}NEWS{% endtrans %}</a></li>
Expand Down