#134 Add Meeting data widget is added to commops as described issue #28
Closed 8 years ago by pingou. Opened 8 years ago by kjtdimuthu.
kjtdimuthu/fedora-hubs develop  into  develop

empty or binary file added
@@ -15,6 +15,7 @@ 

  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 @@ 

      'pagureissues': pagureissues,

      'githubissues': githubissues,

      'bugzilla': bugzilla,

+     'meetingdata' : meetingdata,

  

      'workflow.pendingacls': pendingacls,

      'workflow.updates2stable': updates2stable,

@@ -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

@@ -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>

file modified
+7 -2
@@ -12,7 +12,7 @@ 

  

  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 @@ 

                              _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, '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')

  

  

no initial comment

I think this might be backwards.

The forms in the mockups are supposed to be associated with existing widgets (like the existing meetings widget). We want the user to be able to input some data and have that be stored and passed to the widgets as the @argument values. We would use the @argument values to introspect the widgets and produce the forms.

So developing this widget is unnecessary?

So basically, there won't be a widget dedicated to the editing/configuring of each widget. Instead we have a generic approach, using the @argument decorator that generates the form dynamically, allowing a single path for all the existing widgets.

@kjtdimuthu you may want to check https://pagure.io/fedora-hubs/pull-request/138 is this can help you understand we Ralph and I were discussing here.

I am going to close this PR now, thanks for your work though, it is most appreciated :)

If you have any question, feel free to ask, here or in a ticket or in IRC or by email :)

Pull-Request has been closed by pingou

8 years ago