Browse Source

seminar | treenode | pridany url na jednotlive editacni operace

export_seznamu_prednasek
parent
commit
e33a33eae8
  1. 2
      seminar/templates/seminar/treenode.html
  2. 2
      seminar/templates/seminar/treenode_add_stub.html
  3. 10
      seminar/templates/seminar/treenode_recursive.html
  4. 6
      seminar/urls.py

2
seminar/templates/seminar/treenode.html

@ -16,7 +16,9 @@ dfsdfs
{% block content %} {% block content %}
<form>
{%with obj=tnldata depth=1 template_name="seminar/treenode_recursive.html" %} {%with obj=tnldata depth=1 template_name="seminar/treenode_recursive.html" %}
{%include template_name%} {%include template_name%}
{%endwith%} {%endwith%}
</form>
{% endblock content %} {% endblock content %}

2
seminar/templates/seminar/treenode_add_stub.html

@ -6,6 +6,6 @@
<option value="{{chld.0}}">{{chld.1}}</option> <option value="{{chld.0}}">{{chld.1}}</option>
{% endfor %} {% endfor %}
</select> </select>
<button>ídat</button> <button action="submit" formaction="{%url 'treenode_pridat' obj.node.id%}">idat</button>
</div> </div>
{% endif %}{# appendablebleChildren #} {% endif %}{# appendablebleChildren #}

10
seminar/templates/seminar/treenode_recursive.html

@ -4,16 +4,16 @@
<div class="node_type"> <div class="node_type">
{{obj.node}} {{obj.node}}
{% if obj.node|deletable %} {% if obj.node|deletable %}
<button>Smazat</button> <button type="submit" formaction="{%url 'treenode_smazat' obj.node.id%}">Smazat</button>
{% endif %} {% endif %}
{% if obj.parent and obj.parent|editableSiblings %} {% if obj.parent and obj.parent|editableSiblings %}
<button>Odvěsit na úroveň {{obj.parent.node}}</button> <button type="submit" formaction="{%url 'treenode_odvesit' obj.node.id%}">Odvěsit na úroveň {{obj.parent.node}}</button>
{% endif %} {% endif %}
{% if obj|canPodvesitPred %} {% if obj|canPodvesitPred %}
<button>Podvěsit pod předchozí</button> - nejsou testovací data <button type="submit" formaction="{%url 'treenode_podvesit_predchozi' obj.node.id%}">Podvěsit pod předchozí</button> - nejsou testovací data
{% endif %} {% endif %}
{% if obj|canPodvesitZa %} {% if obj|canPodvesitZa %}
<button>Podvěsit pod následující</button> - nejsou testovací data <button type="submit" formaction="{%url 'treenode_podvesit_nasledujici' obj.node.id%}">Podvěsit pod následující</button> - nejsou testovací data
{% endif %} {% endif %}
@ -42,7 +42,7 @@
{# ----------- Prohazujeme sousedy ----------#} {# ----------- Prohazujeme sousedy ----------#}
<div class="pink"> <div class="pink">
{% if not forloop.last and ch|editableSiblings %} {% if not forloop.last and ch|editableSiblings %}
<button>Prohodit ^ a v</button> <button type="submit" formaction="{%url 'treenode_prohodit' ch.node.id%}">Prohodit ^ a v</button>
{% endif %} {% endif %}
</div> </div>
{% endfor %} {% endfor %}

6
seminar/urls.py

@ -26,6 +26,12 @@ urlpatterns = [
path('cislo/<int:rocnik>.<int:cislo>/', views.CisloView.as_view(), name='seminar_cislo'), # odkomentované jenom kvůli testování archivu path('cislo/<int:rocnik>.<int:cislo>/', views.CisloView.as_view(), name='seminar_cislo'), # odkomentované jenom kvůli testování archivu
path('problem/<int:pk>/', views.ProblemView.as_view(), name='seminar_problem'), path('problem/<int:pk>/', views.ProblemView.as_view(), name='seminar_problem'),
path('treenode/<int:pk>/', views.TreeNodeView.as_view(), name='seminar_treenode'), path('treenode/<int:pk>/', views.TreeNodeView.as_view(), name='seminar_treenode'),
path('treenode/editor/pridat/<int:pk>', views.TreeNodeView.as_view(), name='treenode_pridat'),
path('treenode/editor/smazat/<int:pk>', views.TreeNodeView.as_view(), name='treenode_smazat'),
path('treenode/editor/odvesit/<int:pk>', views.TreeNodeView.as_view(), name='treenode_odvesit'),
path('treenode/editor/podvesit/predchozi/<int:pk>', views.TreeNodeView.as_view(), name='treenode_podvesit_predchozi'),
path('treenode/editor/podvesit/nasledujici/<int:pk>', views.TreeNodeView.as_view(), name='treenode_podvesit_nasledujici'),
path('treenode/editor/prohodit/<int:pk>', views.TreeNodeView.as_view(), name='treenode_prohodit'),
#path('problem/(?P<pk>\d+)/(?P<prispevek>\d+)/', views.PrispevekView.as_view(), name='seminar_problem_prispevek'), #path('problem/(?P<pk>\d+)/(?P<prispevek>\d+)/', views.PrispevekView.as_view(), name='seminar_problem_prispevek'),
# Soustredeni # Soustredeni

Loading…
Cancel
Save