airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [1/3] airavata-django-portal git commit: AIRAVATA-2537 Simple Project list view
Date Wed, 11 Oct 2017 19:42:29 GMT
Repository: airavata-django-portal
Updated Branches:
  refs/heads/master fee999bef -> 4ed82de91


AIRAVATA-2537 Simple Project list view


Project: http://git-wip-us.apache.org/repos/asf/airavata-django-portal/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-django-portal/commit/71ca603c
Tree: http://git-wip-us.apache.org/repos/asf/airavata-django-portal/tree/71ca603c
Diff: http://git-wip-us.apache.org/repos/asf/airavata-django-portal/diff/71ca603c

Branch: refs/heads/master
Commit: 71ca603c0a5747f09e8ce49c161c661e01f2c179
Parents: fee999b
Author: Marcus Christie <machrist@iu.edu>
Authored: Thu Sep 28 14:41:55 2017 -0400
Committer: Marcus Christie <machrist@iu.edu>
Committed: Thu Sep 28 14:41:55 2017 -0400

----------------------------------------------------------------------
 .../js/entry-project-list.js                    | 17 +++++++++---
 .../js/views/ProjectList.vue                    | 27 ++++++++++----------
 .../js/views/ProjectListContainer.vue           | 23 +++++++++++++++++
 .../js/views/ProjectListItem.vue                | 17 ++++++++++++
 .../projects_list.html                          |  2 +-
 django_airavata/templates/base.html             |  6 +++--
 6 files changed, 72 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-django-portal/blob/71ca603c/django_airavata/apps/workspace/static/django_airavata_workspace/js/entry-project-list.js
----------------------------------------------------------------------
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/entry-project-list.js
b/django_airavata/apps/workspace/static/django_airavata_workspace/js/entry-project-list.js
index 14d61c1..7d771c2 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/entry-project-list.js
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/entry-project-list.js
@@ -1,7 +1,18 @@
 import Vue from 'vue'
-import ProjectList from './views/ProjectList.vue'
+import ProjectListContainer from './views/ProjectListContainer.vue'
 
 new Vue({
-  el: '#app',
-  render: h => h(ProjectList)
+  el: '#project-list',
+  template: '<project-list-container v-bind:initialProjects="projects"></project-list-container>',
+  data: {
+      projects: null
+  },
+  components: {
+      ProjectListContainer
+  },
+  beforeMount: function () {
+      if (this.$el.dataset.projects) {
+          this.projects = JSON.parse(this.$el.dataset.projects);
+      }
+  }
 })

http://git-wip-us.apache.org/repos/asf/airavata-django-portal/blob/71ca603c/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/ProjectList.vue
----------------------------------------------------------------------
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/ProjectList.vue
b/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/ProjectList.vue
index 89d380b..a7fdfcc 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/ProjectList.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/ProjectList.vue
@@ -1,24 +1,23 @@
 <template>
     <ul id="project-list">
-        <li v-for="project in projects">
-            {{ project.name }}
-        </li>
+        <project-list-item v-bind:project="project" v-for="project in projects" v-bind:key="project.projectID">
+        </project-list-item>
     </ul>
 </template>
 
 <script>
+import ProjectListItem from './ProjectListItem.vue'
+
 export default {
-  name: 'project-list',
-  data () {
-    return {
-      projects: [
-              {"name": "Project 1"},
-              {"name": "Project 2"},
-              {"name": "Project 3"},
-              {"name": "Project 4"},
-          ]
-      }
-  }
+    name: 'project-list',
+    props: ['projects'],
+    data: function () {
+        return {
+        }
+    },
+    components: {
+        ProjectListItem
+    }
 }
 </script>
 

http://git-wip-us.apache.org/repos/asf/airavata-django-portal/blob/71ca603c/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/ProjectListContainer.vue
----------------------------------------------------------------------
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/ProjectListContainer.vue
b/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/ProjectListContainer.vue
new file mode 100644
index 0000000..47d1b5f
--- /dev/null
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/ProjectListContainer.vue
@@ -0,0 +1,23 @@
+<template>
+    <project-list v-bind:projects="projects"></project-list>
+</template>
+
+<script>
+import ProjectList from './ProjectList.vue'
+
+export default {
+    props: ['initialProjects'],
+    name: 'project-list-container',
+    data () {
+        return {
+            projects: this.initialProjects
+        }
+    },
+    components: {
+        ProjectList
+    }
+}
+</script>
+
+<style>
+</style>

http://git-wip-us.apache.org/repos/asf/airavata-django-portal/blob/71ca603c/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/ProjectListItem.vue
----------------------------------------------------------------------
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/ProjectListItem.vue
b/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/ProjectListItem.vue
new file mode 100644
index 0000000..9903dd1
--- /dev/null
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/views/ProjectListItem.vue
@@ -0,0 +1,17 @@
+<template>
+    <li>{{ project.name }}</li>
+</template>
+
+<script>
+export default {
+    name: 'project-list-item',
+    props: ['project'],
+    data: function () {
+        return {
+        }
+    }
+}
+</script>
+
+<style>
+</style>

http://git-wip-us.apache.org/repos/asf/airavata-django-portal/blob/71ca603c/django_airavata/apps/workspace/templates/django_airavata_workspace/projects_list.html
----------------------------------------------------------------------
diff --git a/django_airavata/apps/workspace/templates/django_airavata_workspace/projects_list.html
b/django_airavata/apps/workspace/templates/django_airavata_workspace/projects_list.html
index 399e478..3ab4184 100644
--- a/django_airavata/apps/workspace/templates/django_airavata_workspace/projects_list.html
+++ b/django_airavata/apps/workspace/templates/django_airavata_workspace/projects_list.html
@@ -6,7 +6,7 @@
 
 <h1>Projects</h1>
 
-<div id="app"></div>
+<div id="project-list" data-projects="{{ projects_data }}"></div>
 
 {% endblock content %}
 

http://git-wip-us.apache.org/repos/asf/airavata-django-portal/blob/71ca603c/django_airavata/templates/base.html
----------------------------------------------------------------------
diff --git a/django_airavata/templates/base.html b/django_airavata/templates/base.html
index 092c046..29af934 100644
--- a/django_airavata/templates/base.html
+++ b/django_airavata/templates/base.html
@@ -51,8 +51,10 @@
         {% block nav-items %}
         {% endblock %}
     </nav>
-    {% block content %}
-    {% endblock %}
+    <main class="main-content">
+        {% block content %}
+        {% endblock %}
+    </main>
 </div>
 
 {% block scripts %}


Mime
View raw message