Browse Source

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

export_seznamu_prednasek
Kateřina Č 4 years ago
parent
commit
5f66adafba
  1. 6
      Makefile
  2. 9
      seminar/templates/seminar/archiv/cislo.html
  3. 5
      vue_frontend/src/components/TreeNodeRoot.vue
  4. 1
      vue_frontend/src/components/UlohaVzorakNode.vue
  5. 7
      vue_frontend/src/router/index.js

6
Makefile

@ -141,3 +141,9 @@ sync_local_db:
# Sync database and media. See above lines # Sync database and media. See above lines
sync_local: sync_local_media sync_local_db sync_local: sync_local_media sync_local_db
# Push local compiled Vue to gimli test site
push_compiled_vue_to_test:
scp vue_frontend/webpack-stats.json mam-web@gimli:/akce/mam/www/mamweb-test/vue_frontend/
rsync -ave ssh seminar/static/seminar/vue mam-web@gimli:/akce/mam/www/mamweb-test/seminar/static/seminar/
ssh mam-web@gimli.ms.mff.cuni.cz 'cd /akce/mam/www/mamweb-test/ && . env/bin/activate && ./manage.py collectstatic --noinput'

9
seminar/templates/seminar/archiv/cislo.html

@ -1,4 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load render_bundle from webpack_loader %}
{% block content %} {% block content %}
<div> <div>
@ -48,6 +49,14 @@
</div> </div>
{% endif %} {% endif %}
<script id="vuedata" type="application/json">{"treenode":{{cislo.cislonode.id}}}</script>
<div id="app">
<app></app>
</div>
{% render_bundle 'chunk-vendors' %}
{% render_bundle 'vue_app_01' %}
{% if cislo.verejna_vysledkovka %} {% if cislo.verejna_vysledkovka %}
<h2>Výsledkovka</h2> <h2>Výsledkovka</h2>

5
vue_frontend/src/components/TreeNodeRoot.vue

@ -31,10 +31,15 @@ export default {
}), }),
props:{ props:{
tnid: Number, tnid: Number,
tnsource: String,
editorMode: Boolean, editorMode: Boolean,
debugMode: Boolean, debugMode: Boolean,
}, },
mounted: function() { mounted: function() {
if (this.tnsource && this.tnsource=='inline'){
let data = JSON.parse(document.getElementById('vuedata').textContent);
this.tnid = data.treenode;
}
this.getArticles(); this.getArticles();
this.$root.$on('updateData',(arg) => { this.$root.$on('updateData',(arg) => {
console.log(arg); console.log(arg);

1
vue_frontend/src/components/UlohaVzorakNode.vue

@ -35,6 +35,7 @@ export default {
item: Object, item: Object,
create: Boolean, create: Boolean,
showSelect: Boolean, showSelect: Boolean,
editorMode: Boolean,
}, },
mounted: function(){ mounted: function(){
if (this.item.node.uloha === null){ if (this.item.node.uloha === null){

7
vue_frontend/src/router/index.js

@ -22,7 +22,12 @@ export default new Router({
name: 'treenode_zadani', name: 'treenode_zadani',
props: {'tnid': 23}, props: {'tnid': 23},
component: TreeNodeRoot component: TreeNodeRoot
}, }, {
path: '/cislo/:cislo',
name: 'treenode_cislo',
props: {'tnsource':'inline'},
component: TreeNodeRoot
}
] ]
}) })

Loading…
Cancel
Save