From 14195f7bab6ca393bf2a303da7127a86fe8f9e0f Mon Sep 17 00:00:00 2001
From: Hermann <blumh@ethz.ch>
Date: Thu, 17 May 2018 18:06:37 +0200
Subject: [PATCH] add cloud property for groups

---
 src/groups/newGroup.js  |  4 ++++
 src/groups/viewGroup.js | 18 +++++++++++++++++-
 src/views/elements.js   |  1 +
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/src/groups/newGroup.js b/src/groups/newGroup.js
index 5b9c019..c2b5b72 100644
--- a/src/groups/newGroup.js
+++ b/src/groups/newGroup.js
@@ -38,6 +38,10 @@ export default class NewGroup extends EditView {
           type: 'checkbox',
           label: 'the group can be seen by all users and they can subscribe themselves',
         },
+        requires_storage: {
+          type: 'checkbox',
+          label: "the group shares a folder with it's members in the AMIV Cloud",
+        }
       }),
       m('div', { style: { display: 'flex' } }, [
         m(TextField, { label: 'Group Moderator: ', disabled: true, style: { width: '160px' } }),
diff --git a/src/groups/viewGroup.js b/src/groups/viewGroup.js
index 6214b0f..015821b 100644
--- a/src/groups/viewGroup.js
+++ b/src/groups/viewGroup.js
@@ -1,5 +1,14 @@
 import m from 'mithril';
-import { Button, RaisedButton, Card, Toolbar, ToolbarTitle, TextField, Icon } from 'polythene-mithril';
+import {
+  Button,
+  RaisedButton,
+  Card,
+  Toolbar,
+  ToolbarTitle,
+  TextField,
+  Icon,
+  IconButton
+} from 'polythene-mithril';
 import { icons, Property } from '../views/elements';
 import ItemView from '../views/itemView';
 import TableView from '../views/tableView';
@@ -195,6 +204,13 @@ export default class viewGroup extends ItemView {
           title: 'Moderator',
           onclick: () => { m.route.set(`/users/${this.data.moderator._id}`); },
         }, `${this.data.moderator.firstname} ${this.data.moderator.lastname}`) : '',
+        this.data.requires_storage ? m(IconButton, {
+          label: 'has a folder on the AMIV Cloud',
+          style: { color: '#ffffff', backgroundColor: 'orange' },
+          icon: { svg: { content: m.trust(icons.cloud) } },
+          inactive: true,
+          compact: true,
+        }): '',
       ]),
       m('div.viewcontainer', [
         // now-column layout: This first column are the members
diff --git a/src/views/elements.js b/src/views/elements.js
index db238d0..c511751 100644
--- a/src/views/elements.js
+++ b/src/views/elements.js
@@ -19,6 +19,7 @@ export const icons = {
   ArrowLeft: '<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"/><path d="M0-.5h24v24H0z" fill="none"/></svg>',
   checked: '<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"/></svg>',
   group: '<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg>',
+  cloud: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z"/></svg>',
 };
 
 export class textInput {
-- 
GitLab