Edit and View Links and Symbols in Widgets fixed (#206)

This commit is contained in:
Norman Jäckel 2012-06-23 10:43:01 +02:00
parent b12ae6b0a0
commit b1ed56176e
8 changed files with 50 additions and 33 deletions

View File

@ -20,13 +20,19 @@
<a href="{% url projector_activate_slide item.sid %}" class="activate_link {% if item.active %}active{% endif %}"> <a href="{% url projector_activate_slide item.sid %}" class="activate_link {% if item.active %}active{% endif %}">
<div></div> <div></div>
</a> </a>
<a href="{% model_url item 'delete' %}" title="{% trans 'Delete' %}" class="icon delete right">
<span></span>
</a>
<a href="{% model_url item 'edit' %}" title="{% trans 'Edit' %}" class="icon edit right">
<span></span>
</a>
<a href="{% url projctor_preview_slide item.sid %}" title="{% trans 'Preview' %}" class="icon preview right"> <a href="{% url projctor_preview_slide item.sid %}" title="{% trans 'Preview' %}" class="icon preview right">
<span></span> <span></span>
</a> </a>
{% for p in item.get_ancestors %} {% for p in item.get_ancestors %}
<span class="indentation">&nbsp;</span> <span class="indentation">&nbsp;</span>
{% endfor %} {% endfor %}
<a href="{% model_url item 'edit' %}">{{ item }}</a> <a href="{% model_url item 'view' %}">{{ item }}</a>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>

View File

@ -8,10 +8,16 @@
<a href="{% url projector_activate_slide application.sid %}" class="activate_link {% if application.active %}active{% endif %}"> <a href="{% url projector_activate_slide application.sid %}" class="activate_link {% if application.active %}active{% endif %}">
<div></div> <div></div>
</a> </a>
<a href="{% model_url application 'delete' %}" title="{% trans 'Delete' %}" class="icon delete right">
<span></span>
</a>
<a href="{% model_url application 'edit' %}" title="{% trans 'Edit' %}" class="icon edit right">
<span></span>
</a>
<a href="{% url projctor_preview_slide application.sid %}" title="{% trans 'Preview' %}" class="icon preview right"> <a href="{% url projctor_preview_slide application.sid %}" title="{% trans 'Preview' %}" class="icon preview right">
<span></span> <span></span>
</a> </a>
<a href="{% model_url application 'edit' %}"> <a href="{% model_url application 'view' %}">
{% if application.number %} {% if application.number %}
{% trans 'Application' %} {{ application.number }}: {% trans 'Application' %} {{ application.number }}:
{% endif %} {% endif %}

View File

@ -0,0 +1,24 @@
{% load staticfiles %}
{% load i18n %}
{% load tags %}
<ul style="line-height: 180%">
{% for assignment in assignments %}
<li class="{% if assignment.active %}activeline{% endif %}">
<a href="{% url projector_activate_slide assignment.sid %}" class="activate_link {% if assignment.active %}active{% endif %}">
<div></div>
</a>
<a href="{% model_url assignment 'delete' %}" title="{% trans 'Delete' %}" class="icon delete right">
<span></span>
</a>
<a href="{% model_url assignment 'edit' %}" title="{% trans 'Edit' %}" class="icon edit right">
<span></span>
</a>
<a href="{% url projctor_preview_slide assignment.sid %}" title="{% trans 'Preview' %}" class="icon preview right">
<span></span>
</a>
<a href="{% model_url assignment 'view' %}">{{ assignment }}</a>
</li>
{% endfor %}
</ul>

View File

@ -31,7 +31,7 @@ from utils.pdf import stylesheet
from utils.views import FormView, DeleteView, PDFView, RedirectView from utils.views import FormView, DeleteView, PDFView, RedirectView
from utils.template import Tab from utils.template import Tab
from projector.api import get_model_widget from projector.projector import Widget
from poll.views import PollFormView from poll.views import PollFormView
@ -619,4 +619,7 @@ def register_tab(request):
def get_widgets(request): def get_widgets(request):
return [get_model_widget(name='assignments', model=Assignment)] return [
Widget(name='assignments', template='assignment/widget.html',
context={'assignments': Assignment.objects.all()})
]

View File

@ -122,13 +122,3 @@ def projector_message_set(message, sid=None):
def projector_message_delete(): def projector_message_delete():
config['projector_message'] = '' config['projector_message'] = ''
def get_model_widget(name, model):
return Widget(
name=name,
template='projector/model_widget.html',
context={
'slides': model.objects.all(),
}
)

View File

@ -1,18 +0,0 @@
{% load staticfiles %}
{% load i18n %}
{% load tags %}
<ul style="line-height: 180%">
{% for slide in slides %}
<li class="{% if slide.active %}activeline{% endif %}">
<a href="{% url projector_activate_slide slide.sid %}" class="activate_link {% if slide.active %}active{% endif %}">
<div></div>
</a>
<a href="{% url projctor_preview_slide slide.sid %}" title="{% trans 'Preview' %}" class="icon preview right">
<span></span>
</a>
<a href="{% model_url slide 'edit' %}">{{ slide }}</a>
</li>
{% endfor %}
</ul>

View File

@ -8,7 +8,10 @@
<a href="{% url projector_activate_slide slide.sid %}" class="activate_link {% if slide.active %}active{% endif %}"> <a href="{% url projector_activate_slide slide.sid %}" class="activate_link {% if slide.active %}active{% endif %}">
<div></div> <div></div>
</a> </a>
<a href="{% url customslide_delete slide.id %}" title="{% trans 'Delete slide' %}" class="icon delete right"> <a href="{% url customslide_delete slide.id %}" title="{% trans 'Delete' %}" class="icon delete right">
<span></span>
</a>
<a href="{% url customslide_edit slide.id %}" title="{% trans 'Edit' %}" class="icon edit right">
<span></span> <span></span>
</a> </a>
<a href="{% url projctor_preview_slide slide.sid %}" title="{% trans 'Preview' %}" class="icon preview right"> <a href="{% url projctor_preview_slide slide.sid %}" title="{% trans 'Preview' %}" class="icon preview right">

View File

@ -581,6 +581,9 @@ ul.results {
.preview { .preview {
background:url("../images/icons/preview.png") no-repeat 0px 0px; background:url("../images/icons/preview.png") no-repeat 0px 0px;
} }
.edit {
background:url("../images/icons/edit.png") no-repeat 0px 0px;
}
.delete { .delete {
background:url("../images/icons/delete.png") no-repeat 0px 0px; background:url("../images/icons/delete.png") no-repeat 0px 0px;
} }