LIL-227. Add tocken to js, and disable add course link, if user non have perms

remotes/origin/hasaccess
Ivlev Denis 8 years ago
parent b29efd4069
commit 6744a0de1f
  1. 12
      project/templates/lilcity/index.html
  2. 6
      web/build/css/app.css
  3. 2
      web/build/css/app.css.map
  4. 8
      web/src/sass/_common.sass

@ -50,6 +50,11 @@
<script>
LIL_SERVER_TIME = "{% now 'U' %}";
LIL_SERVER_TIME_DIFF = Math.floor((new Date().getTime()) / 1000) - parseInt(LIL_SERVER_TIME);
{% if request.user.auth_token %}
AUTH_TOKEN = "{{ request.user.auth_token }}"
{% else %}
AUTH_TOKEN = null
{% endif %}
</script>
</head>
@ -135,7 +140,14 @@
{% endif %}
<div class="header__drop">
{% comment %} <a class="header__link header__link_border" href="#">234.120.345 руб.</a> {% endcomment %}
{% with roles='author admin' %}
{% if request.user.role in roles.split and request.user.auth_token %}
{{request.user.auth_token}}
<a class="header__link header__link_green" href="#">
{% else %}
<a class="header__link header__link_gray disabled" href="#">
{% endif %}
{% endwith %}
<div class="header__title">ДОБАВИТЬ КУРС</div>
</a>
<a class="header__link" href="{% url 'user' request.user.id %}">

@ -277,6 +277,8 @@ a.btn { display: inline-block; }
.header__link_green:hover { color: #45a400; }
.header__link_gray { color: #A7A7A7; }
.header__link_border { margin-bottom: 5px; padding: 2px 20px 10px; border-bottom: 1px solid #E6E6E6; color: #191919; }
.header__link.active .header__title:after { content: ''; position: absolute; top: 50%; left: -10px; right: -10px; height: 2px; margin-top: -2px; background-image: linear-gradient(-225deg, #FFE2EB 0%, #D8F5F5 100%); }
@ -1411,6 +1413,8 @@ a.grey-link:hover { color: #000; border-bottom: 1px #545454 solid; }
a.link--black { color: #000; }
a.disabled { pointer-events: none; cursor: default; opacity: 0.6; }
.content-block.title { font-size: 24px; font-style: bold; }
.content-block.text { font-size: 16px; padding-bottom: 24px; text-align: left; }
@ -1705,6 +1709,8 @@ a.link--black { color: #000; }
.header__link_green { color: #5BD700; }
.header__link_gray { color: #A7A7A7; }
.header__menu, .header__enter, .header__close { display: block; width: 60px; height: 60px; font-size: 0; }
.header__enter { margin: 0; font-size: 0; line-height: 1; }

File diff suppressed because one or more lines are too long

@ -473,6 +473,10 @@ a.btn
color: $green-light
&:hover
color: darken($green-light,10)
&_gray
color: $gray
+m
color: $gray
&_border
margin-bottom: 5px
padding: 2px 20px 10px
@ -3246,6 +3250,10 @@ a.grey-link
a
&.link--black
color: #000
&.disabled
pointer-events: none
cursor: default
opacity: 0.6
.content-block
&.title

Loading…
Cancel
Save