Skip to content

Commit

Permalink
del link to create/edit profile, add dropdown navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurmaev committed May 23, 2012
1 parent cc24989 commit d4e01b4
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 21 deletions.
20 changes: 4 additions & 16 deletions firstsite/static/datepicker/scripts/jquery.min.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions firstsite/static/js/bootstrap.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions firstsite/views.py
Expand Up @@ -4,6 +4,9 @@

def randpage(request):
today = datetime.date.today()
### Delete after show!!!!
from django.core.cache import cache
cache.clear()
list_events = Event.objects.raw('select * from event_event where date_end>=\
"%s" order by rand() LIMIT 5'% (today.isoformat()))

Expand Down
9 changes: 7 additions & 2 deletions template/main/add_event.html
Expand Up @@ -2,21 +2,26 @@

{% block styles %}
<link rel="stylesheet" type="text/css" media="screen" href="{{ STATIC_URL }}datepicker/styles/datePicker.css">
<link rel="stylesheet" type="text/css" media="screen" href="{{ STATIC_URL }}wysiwyg/jquery.wysiwyg.css">
{% endblock %}

{% block scripts %}
<script type="text/javascript" src="{{ STATIC_URL }}datepicker/scripts/jquery.min.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}datepicker/scripts/date.js"></script>
<!--[if IE]><script type="text/javascript" src="{{ STATIC_URL }}datepicker/scripts/jquery.bgiframe.min.js"></script><![endif]-->
<script type="text/javascript" src="{{ STATIC_URL }}datepicker/scripts/jquery.datePicker.js"></script>

<script type="text/javascript" src="{{ STATIC_URL }}wysiwyg/jquery.wysiwyg.js"></script>
<script type="text/javascript" charset="utf-8">
$(function()
{
$('.date-pick').datePicker()
});
</script>

<script type="text/javascript">
$(function() {
$('#id_text').wysiwyg();
});
</script>
{% endblock %}

{% block content %}
Expand Down
16 changes: 13 additions & 3 deletions template/main/base.html
Expand Up @@ -10,6 +10,9 @@
{% block styles %}{% endblock %}
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/main.css">
<script type="text/javascript" src="{{ STATIC_URL }}datepicker/scripts/jquery.min.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/bootstrap.min.js"></script>

{% block scripts %}{% endblock %}
</head>
{% endcache %}
Expand All @@ -25,8 +28,6 @@
<li{% path_match "active" "view_next_day" %}><a href="{% url view_next_day %}">Завтра</a></li>
<li{% path_match "active" "view_next_week" %}><a href="{% url view_next_week %}">На неделю</a></li>
<li{% path_match "active" "randpage" %}><a href="{% url randpage %}">Мне повезет!</a></li>
<li{% path_match "active" "profiles_create_profile" %}><a href="{% url profiles_create_profile %}">profiles_create_profile</a></li>
<li{% path_match "active" "profiles_edit_profile" %}><a href="{% url profiles_edit_profile %}">profiles_edit_profile</a></li>

{% if user.is_authenticated %}
<li{% path_match "active" "add_event" %}>
Expand All @@ -42,7 +43,16 @@
<ul class="nav pull-right">
<li class="divider-vertical"></li>
{% if user.is_authenticated %}
<li><a href="{% url user_logout %}">Logout</a></li>
<ul class="nav">
<li class="dropdown">
<a data-toggle="dropdown" class="dropdown-toggle" href="#">Привет, {{ user }}! <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href={% url profiles_edit_profile %}>Редактировать профиль</a></li>
<li class="divider"></li>
<li><a href="{% url user_logout %}">Logout</a></li>
</ul>
</li>
</ul>
{% else %}
<li{% path_match "active" "user_login" %}><a href="{% url user_login %}">Login</a></li>
{% endif %}
Expand Down

0 comments on commit d4e01b4

Please sign in to comment.