Added custom slides portlet.
This commit is contained in:
parent
3d0fe9b565
commit
dc863cc3b9
@ -16,7 +16,7 @@ class ProjectorSlide(models.Model, SlideMixin):
|
|||||||
|
|
||||||
title = models.CharField(max_length=100, verbose_name=_("Title"))
|
title = models.CharField(max_length=100, verbose_name=_("Title"))
|
||||||
text = models.TextField(null=True, blank=True, verbose_name=_("Text"))
|
text = models.TextField(null=True, blank=True, verbose_name=_("Text"))
|
||||||
weight = models.IntegerField(default=0, verbose_name=_("Weight"))
|
#weight = models.IntegerField(default=0, verbose_name=_("Weight"))
|
||||||
|
|
||||||
def slide(self):
|
def slide(self):
|
||||||
return {
|
return {
|
||||||
|
@ -11,6 +11,7 @@ $(function() {
|
|||||||
success: function(data) {
|
success: function(data) {
|
||||||
$('.activate_link').removeClass('active');
|
$('.activate_link').removeClass('active');
|
||||||
$('li').removeClass('activeline');
|
$('li').removeClass('activeline');
|
||||||
|
$('div').removeClass('activeline');
|
||||||
link.addClass('active');
|
link.addClass('active');
|
||||||
link.parent().addClass('activeline');
|
link.parent().addClass('activeline');
|
||||||
},
|
},
|
||||||
|
@ -143,5 +143,29 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div> <!-- end portlet-->
|
</div> <!-- end portlet-->
|
||||||
|
|
||||||
|
<!-- Custom slides -->
|
||||||
|
{% for category, group in categories.items %}
|
||||||
|
{% if category == 'projector' %}
|
||||||
|
<div class="portlet">
|
||||||
|
<div class="portlet-header">{% trans "Custom slides" %}</div>
|
||||||
|
<div class="portlet-content">
|
||||||
|
{% for slides in group %}
|
||||||
|
{% if slides.control_template %}
|
||||||
|
{% include slides.control_template %}
|
||||||
|
{% endif %}
|
||||||
|
{% if not forloop.last %}
|
||||||
|
<hr>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
<a href='{% url custom_slides_new %}'>
|
||||||
|
<button class="button" type="button" onclick="window.location='{% url custom_slides_new %}'">
|
||||||
|
<span class="icon add">{%trans 'New slide' %}</span>
|
||||||
|
</button>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div> <!-- end portlet-->
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
</div> <!-- end column -->
|
</div> <!-- end column -->
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
{% load tags %}
|
{% load tags %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% block title %}{{ block.super }} – {%trans "New Slide" %}{% endblock %}
|
{% block title %}{{ block.super }} – {%trans "New custom slide" %}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>{% trans 'New Slide' %}</h1>
|
<h1>{% trans 'New custom slide' %}</h1>
|
||||||
<form action="" method="post">{% csrf_token %}
|
<form action="" method="post">{% csrf_token %}
|
||||||
{{ form.as_p }}
|
{{ form.as_p }}
|
||||||
<button class="button" type="submit">
|
<button class="button" type="submit">
|
||||||
|
@ -53,7 +53,7 @@ urlpatterns = patterns('projector.views',
|
|||||||
template_name='projector/new.html',
|
template_name='projector/new.html',
|
||||||
permission_required='projector.can_manage_projector'
|
permission_required='projector.can_manage_projector'
|
||||||
),
|
),
|
||||||
name='projector_new',
|
name='custom_slides_new',
|
||||||
),
|
),
|
||||||
|
|
||||||
url(r'^bigger/$', 'projector_edit', {'direction': 'bigger'},
|
url(r'^bigger/$', 'projector_edit', {'direction': 'bigger'},
|
||||||
|
@ -395,7 +395,7 @@ input[type="submit"], input[type="button"] {
|
|||||||
.button .import{
|
.button .import{
|
||||||
background:url(../images/icons/import.png) no-repeat 0px 0px;
|
background:url(../images/icons/import.png) no-repeat 0px 0px;
|
||||||
}
|
}
|
||||||
.button .add{
|
.add{
|
||||||
background:url(../images/icons/add.png) no-repeat 0px 0px;
|
background:url(../images/icons/add.png) no-repeat 0px 0px;
|
||||||
}
|
}
|
||||||
.button .number{
|
.button .number{
|
||||||
|
Loading…
Reference in New Issue
Block a user