Skip to content

Commit

Permalink
emphasize in-domain redirections in domains (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
breezewish committed Jul 2, 2017
1 parent a440da5 commit f93419a
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions vj4/handler/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def render_html(self, template_name, **kwargs):
if '_' not in kwargs:
kwargs['_'] = self.translate
kwargs['domain_id'] = self.domain_id
kwargs['domain'] = self.domain
if 'page_name' not in kwargs:
kwargs['page_name'] = self.NAME
if 'page_title' not in kwargs:
Expand Down
2 changes: 2 additions & 0 deletions vj4/ui/common/variables.inc.styl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ $header-bg-height = 320px
$header-bg-height-mini = $header-bg-height - $header-layer-height
$header-logo-width = 280px
$header-logo-height = 150px
$header-logo-domain-lh = 60px
$header-logo-system-lh = 30px

$footer-bg-color = $content-bg-color

Expand Down
30 changes: 30 additions & 0 deletions vj4/ui/components/header/header.page.styl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
$header-gap-mini = ($header-bg-height-mini - $nav-item-height - $header-logo-height) / 2
$header-gap-mini-domain = ($header-bg-height-mini - $nav-item-height - $header-logo-domain-lh - $header-logo-system-lh) / 2

.header
position: relative
Expand Down Expand Up @@ -44,6 +45,35 @@ $header-gap-mini = ($header-bg-height-mini - $nav-item-height - $header-logo-hei
+mobile()
display: inline-block

.header__logo--domain
font-size: rem(40px)
margin-top: rem($header-gap-mini-domain + $nav-item-height)
height: rem($header-logo-domain-lh)
line-height: rem($header-logo-domain-lh)

a
text-shadow: 1px 1px 5px rgba(#000, 0.4)

&, &:hover, &:visited, &:link
color: #FFF
text-decoration: none

.header__logo--system
line-height: rem($header-logo-system-lh)
color: #FFF
font-size: rem($font-size-small)

a
opacity: 0.8

&, &:hover, &:visited, &:link
text-decoration: none
color: #FFF

&:hover
opacity: 1
text-decoration: underline

.location-path
color: rgba(#FFF, 0.3)
line-height: rem(30px)
Expand Down
5 changes: 5 additions & 0 deletions vj4/ui/templates/layout/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
{% include "partials/nav_hamburger.html" %}
<div class="header{% if header_mini %} mini{% endif %}">
<div class="header-content"><div class="row"><div class="columns">
{% if domain_id == vj4.model.builtin.DOMAIN_ID_SYSTEM %}
<a class="header__logo" href="{{ reverse_url('domain_main', domain_id=vj4.model.builtin.DOMAIN_ID_SYSTEM) }}" target="_self"></a>
{% else %}
<div class="header__logo--domain"><a href="{{ reverse_url('domain_main') }}" target="_self">{{ domain['name'] }}</a></div>
<div class="header__logo--system"><a href="{{ reverse_url('domain_main', domain_id=vj4.model.builtin.DOMAIN_ID_SYSTEM) }}" target="_blank">Powered by Vijos</a></div>
{% endif %}
</div></div></div>
{% include "partials/path.html" %}
</div>
Expand Down
3 changes: 3 additions & 0 deletions vj4/ui/templates/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ <h1>{{ _('Development') }}</h1>
<div class="footer__category">
<h1>{{ _('Support') }}</h1>
<ul class="footer__category__list">
{% if domain_id != vj4.model.builtin.DOMAIN_ID_SYSTEM %}
<li class="footer__category__item"><a href="{{ reverse_url('domain_main', domain_id=vj4.model.builtin.DOMAIN_ID_SYSTEM) }}">{{ _('Vijos') }}</a></li>
{% endif %}
<li class="footer__category__item"><a href="//vijos.github.io/about-vijos/">{{ _('Help') }}</a></li>
<!--<li class="footer__category__item"><a href="#">{{ _('Blog') }}</a></li>-->
<li class="footer__category__item"><a href="//vijos.github.io/about-vijos/about/contact-us/">{{ _('QQ Group') }}</a></li>
Expand Down
2 changes: 2 additions & 0 deletions vj4/ui/templates/partials/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
<nav class="nav slideout-menu" id="menu">
<div class="row"><div class="columns clearfix">
<ol class="nav__list nav__list--main clearfix">
{% if domain_id == vj4.model.builtin.DOMAIN_ID_SYSTEM %}
<li class="nav__list-item"><a href="{{ reverse_url('domain_main', domain_id=vj4.model.builtin.DOMAIN_ID_SYSTEM) }}" class="nav__logo">&nbsp;</a></li>
{% endif %}
{{ nav_item('domain_main', 'domain_main') }}
{{ nav_item('problem_main', 'problem') }}
{{ nav_item('training_main', 'training') }}
Expand Down

0 comments on commit f93419a

Please sign in to comment.