Browse Source

Merge branch 'treenode_editor' of gimli.ms.mff.cuni.cz:/akce/mam/git/mamweb into treenode_editor

export_seznamu_prednasek
Kateřina Č 4 years ago
parent
commit
c3482097a9
  1. 11
      seminar/viewsets.py
  2. 11
      vue_frontend/src/components/UlohaVzorakNode.vue

11
seminar/viewsets.py

@ -93,4 +93,15 @@ class ProblemViewSet(viewsets.ModelViewSet):
def get_queryset(self): def get_queryset(self):
queryset = m.Problem.objects.all() queryset = m.Problem.objects.all()
ucel = self.request.query_params.get('ucel',None)
rocnik = self.request.query_params.get('rocnik',None)
tema = self.request.query_params.get('tema',None)
if rocnik is not None:
queryset = queryset.filter(rocnik=rocnik)
#if tema is not None:
return queryset return queryset

11
vue_frontend/src/components/UlohaVzorakNode.vue

@ -1,7 +1,8 @@
<template> <template>
<div class="ulohavzoraknode"> <div class="ulohavzoraknode">
<!--pre>UlohaVzorakNode {{item}} {{typeof(item)}}</pre--> <!--pre>UlohaVzorakNode {{item}} {{typeof(item)}}</pre-->
<h5>Řešení {{item.node.uloha.cislo_zadani.poradi}}.{{ item.node.uloha.kod }}: {{ item.node.uloha.nazev }}</h5> <!--h5 v-if="!editorMode">Řešení {{item.node.uloha.cislo_zadani.poradi}}.{{ item.node.uloha.kod }}: {{ item.node.uloha.nazev }}</h5-->
<h5>Řešení!</h5>
<button v-if="editorMode" v-on:click="showSelect=!showSelect" class="upravit">Upravit</button> <button v-if="editorMode" v-on:click="showSelect=!showSelect" class="upravit">Upravit</button>
<div v-if="showSelect"> <div v-if="showSelect">
<form class="searchForm" v-on:submit.prevent="submitSearch"> <form class="searchForm" v-on:submit.prevent="submitSearch">
@ -38,14 +39,14 @@ export default {
editorMode: Boolean, editorMode: Boolean,
}, },
mounted: function(){ mounted: function(){
if (this.item.node.uloha === null){
console.log("Uloha je null!");
console.log(this.item);
}
if (this.create){ if (this.create){
this.showSelect = true; this.showSelect = true;
console.log('Creating'); console.log('Creating');
} }
if (this.item !== null && this.item.node.uloha === null){
console.log("Uloha je null!");
console.log(this.item);
}
}, },
methods: { methods: {
submitSearch: function(){ submitSearch: function(){

Loading…
Cancel
Save