From 12c1589e9c8d453c2aebb4f9662061766d2ec909 Mon Sep 17 00:00:00 2001
From: kjtdimuthu <kjtdimuthu@gmail.com>
Date: Apr 01 2016 02:35:00 +0000
Subject: Add Meeting data widget is added to commops as described issue #28


---

diff --git a/hubs/static/img/minus.png b/hubs/static/img/minus.png
new file mode 100644
index 0000000..7b50d11
Binary files /dev/null and b/hubs/static/img/minus.png differ
diff --git a/hubs/widgets/__init__.py b/hubs/widgets/__init__.py
index cc7007c..daaa5df 100755
--- a/hubs/widgets/__init__.py
+++ b/hubs/widgets/__init__.py
@@ -15,6 +15,7 @@ from hubs.widgets import github_pr
 from hubs.widgets import pagureissues
 from hubs.widgets import githubissues
 from hubs.widgets import bugzilla
+from hubs.widgets import meetingdata
 
 from hubs.widgets.workflow import pendingacls
 from hubs.widgets.workflow import updates2stable
@@ -39,6 +40,7 @@ registry = {
     'pagureissues': pagureissues,
     'githubissues': githubissues,
     'bugzilla': bugzilla,
+    'meetingdata' : meetingdata,
 
     'workflow.pendingacls': pendingacls,
     'workflow.updates2stable': updates2stable,
diff --git a/hubs/widgets/meetingdata.py b/hubs/widgets/meetingdata.py
new file mode 100755
index 0000000..0821524
--- /dev/null
+++ b/hubs/widgets/meetingdata.py
@@ -0,0 +1,24 @@
+from hubs.hinting import hint, prefixed as _
+from hubs.widgets.chrome import panel
+from hubs.widgets.base import argument
+from hubs.widgets import templating
+
+import hubs.validators as validators
+
+chrome = panel("Add Meeting Data")
+template = templating.environment.get_template('templates/meetingdata.html')
+
+@argument(name="text", default="Lorem ipsum dolor...",
+          validator=validators.text,
+          help="Some dummy text to display.")
+def data(session, widget, text):
+    return dict(text=text)
+
+
+@hint(topics=[_('hubs.widget.update')])
+def should_invalidate(message, session, widget):
+    if not message['topic'].endswith('hubs.widget.update'):
+        return False
+    if message['msg']['widget']['id'] != widget.id:
+        return False
+    return True
diff --git a/hubs/widgets/templates/meetingdata.html b/hubs/widgets/templates/meetingdata.html
new file mode 100644
index 0000000..a8c5b34
--- /dev/null
+++ b/hubs/widgets/templates/meetingdata.html
@@ -0,0 +1,14 @@
+<form>
+ 	<div class="form-group">
+		<label>Enter a calendar feed to use for meeting</label>
+			<input type="text" class="form-control" placeholder="https://apps.fedoraproject.org/calendar/api/meetings/?calendar=commops">
+	</div>
+	<div class="form-group">
+		<label>Add a meeting minute URL</label>
+		<input type="text" class="form-control" placeholder="https://meetbot-raw.fedoraproject.org/teams/commops/commops.2016-03-29-15.56.html">
+ 	</div>
+	<button type="submit" class="btn btn-info">Add</button>
+	<div class="pull-right">
+		<img src="{{ url_for('static', filename='img/minus.png') }}" width="15" height="15"><a href="#"> remove widget</a>
+	</div>
+</form>
diff --git a/populate.py b/populate.py
index 9f1816c..232d7ff 100755
--- a/populate.py
+++ b/populate.py
@@ -12,7 +12,7 @@ session = hubs.models.init(fedmsg_config['hubs.sqlalchemy.uri'], True, True)
 
 users = ['mrichard', 'duffy', 'ryanlerch', 'gnokii', 'nask0',
          'abompard', 'decause', 'ralph', 'lmacken', 'croberts', 'mattdm',
-         'pravins', 'keekri', 'linuxmodder', 'bee2502', 'jflory7']
+         'pravins', 'keekri', 'linuxmodder', 'bee2502', 'jflory7','kjtdimuthu']
 for username in users:
     fullname = 'Full Name Goes Here'
     openid = '%s.id.fedoraproject.org' % username
@@ -86,8 +86,12 @@ widget = hubs.models.Widget(plugin='meetings', index=2,
                             _config=json.dumps({'calendar': 'commops'}))
 hub.widgets.append(widget)
 
+
+widget = hubs.models.Widget(plugin='meetingdata', index=3)
+hub.widgets.append(widget)
+
 # Added a hubs about widget
-widget = hubs.models.Widget(plugin='about', index=3,
+widget = hubs.models.Widget(plugin='about', index=4,
                             _config=json.dumps({
                                 "text": "Community + Operations = CommOps",
                             }))
@@ -109,6 +113,7 @@ hub.subscribe(session, hubs.models.User.by_openid(session, 'decause.id.fedorapro
 hub.subscribe(session, hubs.models.User.by_openid(session, 'jflory7.id.fedoraproject.org'), 'member')
 hub.subscribe(session, hubs.models.User.by_openid(session, 'bee2502.id.fedoraproject.org'), 'member')
 hub.subscribe(session, hubs.models.User.by_openid(session, 'keekri.id.fedoraproject.org'), 'member')
+hub.subscribe(session, hubs.models.User.by_openid(session, 'kjtdimuthu.id.fedoraproject.org'), 'member')
 hub.subscribe(session, hubs.models.User.by_openid(session, 'linuxmodder.id.fedoraproject.org'), 'member')
 
 

