airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [airavata-django-portal] 03/04: AIRAVATA-2688 Fix edit link
Date Fri, 23 Feb 2018 06:39:42 GMT
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit bbda507678e4c294b994f60577287833f524c95c
Author: Marcus Christie <machrist@iu.edu>
AuthorDate: Fri Feb 23 01:33:35 2018 -0500

    AIRAVATA-2688 Fix edit link
---
 .../js/groups_components/GroupListItem.vue         | 26 ++++++----------------
 1 file changed, 7 insertions(+), 19 deletions(-)

diff --git a/django_airavata/apps/groups/static/django_airavata_groups/js/groups_components/GroupListItem.vue
b/django_airavata/apps/groups/static/django_airavata_groups/js/groups_components/GroupListItem.vue
index 3c69956..eb500a7 100644
--- a/django_airavata/apps/groups/static/django_airavata_groups/js/groups_components/GroupListItem.vue
+++ b/django_airavata/apps/groups/static/django_airavata_groups/js/groups_components/GroupListItem.vue
@@ -3,32 +3,20 @@
         <td>{{ group.name }}</td>
         <td>{{ group.ownerId }}</td>
         <td>{{ group.description }}</td>
-        <td><span v-html="action"></span></td>
+        <td>
+            <a v-if="group.isOwner || group.isAdmin"
+                :href="'/groups/edit/' + encodeURIComponent(group.id) + '/'">
+                Edit <i class="fa fa-pencil"></i>
+            </a>
+        </td>
     </tr>
 </template>
 
 <script>
-import moment from 'moment';
 
 export default {
     name: 'group-list-item',
-    props: ['group', 'type'],
-    computed: {
-      action: function() {
-          // TODO: use (isOwner || isAdmin) here
-          if(this.type == 'owner') {
-            let deleteUrl = "/api/deleteGroup/"+this.group.groupID;
-            let threeSpace = '&nbsp;&nbsp;&nbsp;'
-            return '<a href="#">Edit <i class="fa fa-pencil"></i></a>'+threeSpace+'<a
href="'+deleteUrl+'">Delete <i class="fa fa-trash"></i></a>';
-          }
-          else if(this.type == 'member') {
-            return '<a href="#">Leave <i class="fa fa-sign-out"></i></a>'
-          }
-          else {
-            return '';
-          }
-      },
-    }
+    props: ['group'],
 }
 </script>
 

-- 
To stop receiving notification emails like this one, please contact
machristie@apache.org.

Mime
View raw message