Skip to content

Commit

Permalink
hard code selectable slot kinds in the view not the template. meh meh…
Browse files Browse the repository at this point in the history
… meh :/
  • Loading branch information
codersquid committed May 9, 2014
1 parent 8e62ceb commit 4004a35
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
13 changes: 12 additions & 1 deletion symposion/schedule/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def schedule_conference(request):

ctx = {
"sections": sections,
"selectable_slot_kinds": selectable_slot_kinds(),
}
return render(request, "schedule/schedule_conference.html", ctx)

Expand All @@ -56,6 +57,7 @@ def schedule_detail(request, slug=None):
ctx = {
"schedule": schedule,
"days": days,
"selectable_slot_kinds": selectable_slot_kinds(),
}
return render(request, "schedule/schedule_detail.html", ctx)

Expand Down Expand Up @@ -118,11 +120,20 @@ def schedule_edit(request, slug=None):
ctx = {
"schedule": schedule,
"days": days,
"form": form
"form": form,
"selectable_slot_kinds": selectable_slot_kinds(),
}
return render(request, "schedule/schedule_edit.html", ctx)


def selectable_slot_kinds():
# HACK
# I want the form to be customizable and right now the template
# I'm working from has "talk" and "tutorial" hardcoded as the only
# grid kinds that have affordances to select from the proposals list
return ["talk", "tutorial", "sprint", "bof"]


@login_required
def schedule_slot_edit(request, slug, slot_pk):

Expand Down
4 changes: 2 additions & 2 deletions symposion/templates/schedule/_edit_grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<td class="time">{{ row.time|date:"h:iA" }}</td>
{% for slot in row.slots %}
<td class="slot slot-{{ slot.kind.label }}" colspan="{{ slot.colspan }}" rowspan="{{ slot.rowspan }}">
{% if slot.kind.label == "talk" or slot.kind.label == "tutorial" %}
{% if slot.kind.label in selectable_slot_kinds %}
{% if not slot.content %}
<a class="btn btn-mini edit-slot" data-action="{% url 'schedule_slot_edit' schedule.section.slug slot.pk %}" href="#">+</a>
{% else %}
Expand All @@ -37,4 +37,4 @@
</tr>
{% endfor %}
</tbody>
</table>
</table>
2 changes: 1 addition & 1 deletion symposion/templates/schedule/_grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<td class="time">{{ row.time|date:"h:iA" }}</td>
{% for slot in row.slots %}
<td class="slot slot-{{ slot.kind.label }}" colspan="{{ slot.colspan }}" rowspan="{{ slot.rowspan }}">
{% if slot.kind.label == "talk" or slot.kind.label == "tutorial" %}
{% if slot.kind.label in selectable_slot_kinds %}
{% if not slot.content %}
{% else %}
<span class="title">
Expand Down

0 comments on commit 4004a35

Please sign in to comment.