Skip to content
Browse files

del link to create/edit profile, add dropdown navbar

  • Loading branch information...
1 parent cc24989 commit d4e01b4e314ad936cda04e325add5c7b2c2df5c1 @Kurmaev committed
View
20 firstsite/static/datepicker/scripts/jquery.min.js
4 additions, 16 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
7 firstsite/static/js/bootstrap.min.js
@@ -0,0 +1,7 @@
+/**
+* Bootstrap.js by @fat & @mdo
+* plugins: bootstrap-transition.js, bootstrap-dropdown.js
+* Copyright 2012 Twitter, Inc.
+* http://www.apache.org/licenses/LICENSE-2.0.txt
+*/
+!function(a){a(function(){a.support.transition=function(){var a=function(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"},c;for(c in b)if(a.style[c]!==undefined)return b[c]}();return a&&{end:a}}()})}(window.jQuery),!function(a){function d(){a(b).parent().removeClass("open")}var b='[data-toggle="dropdown"]',c=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};c.prototype={constructor:c,toggle:function(b){var c=a(this),e,f,g;if(c.is(".disabled, :disabled"))return;return f=c.attr("data-target"),f||(f=c.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,"")),e=a(f),e.length||(e=c.parent()),g=e.hasClass("open"),d(),g||e.toggleClass("open"),!1}},a.fn.dropdown=function(b){return this.each(function(){var d=a(this),e=d.data("dropdown");e||d.data("dropdown",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.dropdown.Constructor=c,a(function(){a("html").on("click.dropdown.data-api",d),a("body").on("click.dropdown",".dropdown form",function(a){a.stopPropagation()}).on("click.dropdown.data-api",b,c.prototype.toggle)})}(window.jQuery)
View
3 firstsite/views.py
@@ -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()))
View
9 template/main/add_event.html
@@ -2,14 +2,14 @@
{% 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()
{
@@ -17,6 +17,11 @@
});
</script>
+<script type="text/javascript">
+$(function() {
+ $('#id_text').wysiwyg();
+});
+</script>
{% endblock %}
{% block content %}
View
16 template/main/base.html
@@ -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 %}
@@ -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" %}>
@@ -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 %}

0 comments on commit d4e01b4

Please sign in to comment.
Something went wrong with that request. Please try again.