From e775aa21158b6b997c71b94075ead1f0c2ed38e1 Mon Sep 17 00:00:00 2001
From: Bhagyashree <bhagyashree.iitg@gmail.com>
Date: Mar 12 2016 19:33:37 +0000
Subject: [PATCH 1/4] Fixing Issue #96


---

diff --git a/hubs/__init__.py b/hubs/__init__.py
old mode 100644
new mode 100755
diff --git a/hubs/app.py b/hubs/app.py
old mode 100644
new mode 100755
diff --git a/hubs/consumer.py b/hubs/consumer.py
old mode 100644
new mode 100755
diff --git a/hubs/default_config.py b/hubs/default_config.py
old mode 100644
new mode 100755
diff --git a/hubs/defaults.py b/hubs/defaults.py
old mode 100644
new mode 100755
diff --git a/hubs/hinting.py b/hubs/hinting.py
old mode 100644
new mode 100755
diff --git a/hubs/models.py b/hubs/models.py
old mode 100644
new mode 100755
diff --git a/hubs/utils.py b/hubs/utils.py
old mode 100644
new mode 100755
diff --git a/hubs/validators.py b/hubs/validators.py
old mode 100644
new mode 100755
diff --git a/hubs/widgets/__init__.py b/hubs/widgets/__init__.py
old mode 100644
new mode 100755
diff --git a/hubs/widgets/about.py b/hubs/widgets/about.py
old mode 100644
new mode 100755
diff --git a/hubs/widgets/badges.py b/hubs/widgets/badges.py
old mode 100644
new mode 100755
diff --git a/hubs/widgets/base.py b/hubs/widgets/base.py
old mode 100644
new mode 100755
diff --git a/hubs/widgets/chrome.py b/hubs/widgets/chrome.py
old mode 100644
new mode 100755
diff --git a/hubs/widgets/cobwebs.py b/hubs/widgets/cobwebs.py
old mode 100644
new mode 100755
diff --git a/hubs/widgets/dummy.py b/hubs/widgets/dummy.py
old mode 100644
new mode 100755
diff --git a/hubs/widgets/fedmsgstats.py b/hubs/widgets/fedmsgstats.py
old mode 100644
new mode 100755
diff --git a/hubs/widgets/feed.py b/hubs/widgets/feed.py
old mode 100644
new mode 100755
diff --git a/hubs/widgets/github_pr.py b/hubs/widgets/github_pr.py
old mode 100644
new mode 100755
diff --git a/hubs/widgets/githubissues.py b/hubs/widgets/githubissues.py
old mode 100644
new mode 100755
diff --git a/hubs/widgets/linechart.py b/hubs/widgets/linechart.py
old mode 100644
new mode 100755
diff --git a/hubs/widgets/meetings.py b/hubs/widgets/meetings.py
old mode 100644
new mode 100755
index 1dfd8ec..c3a8382
--- a/hubs/widgets/meetings.py
+++ b/hubs/widgets/meetings.py
@@ -16,19 +16,31 @@ chrome = panel('Reminders', key='meetings')
 def next_meeting(meetings):
     now = datetime.datetime.utcnow()
     for meeting in meetings:
-        string = "%s %s" % (meeting['meeting_date'],
+        start_string = "%s %s" % (meeting['meeting_date'],
                             meeting['meeting_time_start'])
-        dt = datetime.datetime.strptime(string, "%Y-%m-%d %H:%M:%S")
+        start_dt = datetime.datetime.strptime(start_string, "%Y-%m-%d %H:%M:%S")
 
-        if now < dt:
-            meeting['human_time'] = arrow.get(dt).humanize()
-            meeting['start_date'] = dt.strftime('%b %d')
+        stop_string = "%s %s" % (meeting['meeting_date_end'],
+                            meeting['meeting_time_stop'])
+        stop_dt = datetime.datetime.strptime(stop_string, "%Y-%m-%d %H:%M:%S")
+
+        if now < start_dt:
+            meeting['human_time'] = arrow.get(start_dt).humanize()
+            meeting['start_date'] = start_dt.strftime('%b %d')
+            meeting['stop_date'] = stop_dt.strftime('%b %d')
+            meeting['display_time'] = True
+            meeting['display_duration'] = False            
             # Just UTC for now until we do this on the client and can access
             # their local with moment.js.
             meeting['start_time'] = meeting['meeting_time_start'][:-3] + " UTC"
+            meeting['stop_time'] = meeting['meeting_time_stop'][:-3] + " UTC"
             meeting['location'] = meeting['meeting_location']
             if '@' in meeting['location']:
                 meeting['location'] = '#' + meeting['location'].split('@')[0]
+            if stop_dt - start_dt >= datetime.timedelta(hours=24) :
+                meeting['display_time'] = False
+                if stop_dt - start_dt > datetime.timedelta(hours=24) :
+                    meeting['display_duration'] = True
             return meeting
 
     return None
@@ -41,9 +53,15 @@ template = jinja2_environment.from_string("""
         {% set next = items | next_meeting %}
         {% if next %}
         <p>The {{ next.meeting_name }} is {{ next.human_time }}</p>
+        {% if next.display_duration %}
+        <h1 class='inline'>{{next.start_date}} - {{next.stop_date}}</h1>
+        {% else %}
         <h1 class='inline'>{{next.start_date}}</h1>
+        {% endif %}
         <div class='inline'>
+            {% if next.display_time %}
             @{{next.start_time}}<br/>
+            {% endif %}
             {{next.location}}<br/>
             {{next.meeting_information_html}}
         </div>
diff --git a/hubs/widgets/pagure_pr.py b/hubs/widgets/pagure_pr.py
old mode 100644
new mode 100755
diff --git a/hubs/widgets/pagureissues.py b/hubs/widgets/pagureissues.py
old mode 100644
new mode 100755
diff --git a/hubs/widgets/rules.py b/hubs/widgets/rules.py
old mode 100644
new mode 100755
diff --git a/hubs/widgets/stats.py b/hubs/widgets/stats.py
old mode 100644
new mode 100755
diff --git a/hubs/widgets/sticky.py b/hubs/widgets/sticky.py
old mode 100644
new mode 100755
diff --git a/hubs/widgets/subscriptions.py b/hubs/widgets/subscriptions.py
old mode 100644
new mode 100755
diff --git a/hubs/widgets/test.py b/hubs/widgets/test.py
old mode 100644
new mode 100755

From 7228454834dce91447271366f26ed129d15d91f2 Mon Sep 17 00:00:00 2001
From: Bhagyashree <bhagyashree.iitg@gmail.com>
Date: Mar 12 2016 19:41:57 +0000
Subject: [PATCH 2/4] Revert Changes : Fixing Issue #96


---

diff --git a/hubs/widgets/meetings.py b/hubs/widgets/meetings.py
old mode 100755
new mode 100644
index c3a8382..1dfd8ec
--- a/hubs/widgets/meetings.py
+++ b/hubs/widgets/meetings.py
@@ -16,31 +16,19 @@ chrome = panel('Reminders', key='meetings')
 def next_meeting(meetings):
     now = datetime.datetime.utcnow()
     for meeting in meetings:
-        start_string = "%s %s" % (meeting['meeting_date'],
+        string = "%s %s" % (meeting['meeting_date'],
                             meeting['meeting_time_start'])
-        start_dt = datetime.datetime.strptime(start_string, "%Y-%m-%d %H:%M:%S")
+        dt = datetime.datetime.strptime(string, "%Y-%m-%d %H:%M:%S")
 
-        stop_string = "%s %s" % (meeting['meeting_date_end'],
-                            meeting['meeting_time_stop'])
-        stop_dt = datetime.datetime.strptime(stop_string, "%Y-%m-%d %H:%M:%S")
-
-        if now < start_dt:
-            meeting['human_time'] = arrow.get(start_dt).humanize()
-            meeting['start_date'] = start_dt.strftime('%b %d')
-            meeting['stop_date'] = stop_dt.strftime('%b %d')
-            meeting['display_time'] = True
-            meeting['display_duration'] = False            
+        if now < dt:
+            meeting['human_time'] = arrow.get(dt).humanize()
+            meeting['start_date'] = dt.strftime('%b %d')
             # Just UTC for now until we do this on the client and can access
             # their local with moment.js.
             meeting['start_time'] = meeting['meeting_time_start'][:-3] + " UTC"
-            meeting['stop_time'] = meeting['meeting_time_stop'][:-3] + " UTC"
             meeting['location'] = meeting['meeting_location']
             if '@' in meeting['location']:
                 meeting['location'] = '#' + meeting['location'].split('@')[0]
-            if stop_dt - start_dt >= datetime.timedelta(hours=24) :
-                meeting['display_time'] = False
-                if stop_dt - start_dt > datetime.timedelta(hours=24) :
-                    meeting['display_duration'] = True
             return meeting
 
     return None
@@ -53,15 +41,9 @@ template = jinja2_environment.from_string("""
         {% set next = items | next_meeting %}
         {% if next %}
         <p>The {{ next.meeting_name }} is {{ next.human_time }}</p>
-        {% if next.display_duration %}
-        <h1 class='inline'>{{next.start_date}} - {{next.stop_date}}</h1>
-        {% else %}
         <h1 class='inline'>{{next.start_date}}</h1>
-        {% endif %}
         <div class='inline'>
-            {% if next.display_time %}
             @{{next.start_time}}<br/>
-            {% endif %}
             {{next.location}}<br/>
             {{next.meeting_information_html}}
         </div>

From 682f69918139a5a9685420266593e01cec9ef61e Mon Sep 17 00:00:00 2001
From: Bhagyashree <bhagyashree.iitg@gmail.com>
Date: Mar 12 2016 19:44:31 +0000
Subject: [PATCH 3/4] Fixing Issue #96 - No extra files in commit this time


---

diff --git a/hubs/widgets/meetings.py b/hubs/widgets/meetings.py
old mode 100644
new mode 100755
index 1dfd8ec..c3a8382
--- a/hubs/widgets/meetings.py
+++ b/hubs/widgets/meetings.py
@@ -16,19 +16,31 @@ chrome = panel('Reminders', key='meetings')
 def next_meeting(meetings):
     now = datetime.datetime.utcnow()
     for meeting in meetings:
-        string = "%s %s" % (meeting['meeting_date'],
+        start_string = "%s %s" % (meeting['meeting_date'],
                             meeting['meeting_time_start'])
-        dt = datetime.datetime.strptime(string, "%Y-%m-%d %H:%M:%S")
+        start_dt = datetime.datetime.strptime(start_string, "%Y-%m-%d %H:%M:%S")
 
-        if now < dt:
-            meeting['human_time'] = arrow.get(dt).humanize()
-            meeting['start_date'] = dt.strftime('%b %d')
+        stop_string = "%s %s" % (meeting['meeting_date_end'],
+                            meeting['meeting_time_stop'])
+        stop_dt = datetime.datetime.strptime(stop_string, "%Y-%m-%d %H:%M:%S")
+
+        if now < start_dt:
+            meeting['human_time'] = arrow.get(start_dt).humanize()
+            meeting['start_date'] = start_dt.strftime('%b %d')
+            meeting['stop_date'] = stop_dt.strftime('%b %d')
+            meeting['display_time'] = True
+            meeting['display_duration'] = False            
             # Just UTC for now until we do this on the client and can access
             # their local with moment.js.
             meeting['start_time'] = meeting['meeting_time_start'][:-3] + " UTC"
+            meeting['stop_time'] = meeting['meeting_time_stop'][:-3] + " UTC"
             meeting['location'] = meeting['meeting_location']
             if '@' in meeting['location']:
                 meeting['location'] = '#' + meeting['location'].split('@')[0]
+            if stop_dt - start_dt >= datetime.timedelta(hours=24) :
+                meeting['display_time'] = False
+                if stop_dt - start_dt > datetime.timedelta(hours=24) :
+                    meeting['display_duration'] = True
             return meeting
 
     return None
@@ -41,9 +53,15 @@ template = jinja2_environment.from_string("""
         {% set next = items | next_meeting %}
         {% if next %}
         <p>The {{ next.meeting_name }} is {{ next.human_time }}</p>
+        {% if next.display_duration %}
+        <h1 class='inline'>{{next.start_date}} - {{next.stop_date}}</h1>
+        {% else %}
         <h1 class='inline'>{{next.start_date}}</h1>
+        {% endif %}
         <div class='inline'>
+            {% if next.display_time %}
             @{{next.start_time}}<br/>
+            {% endif %}
             {{next.location}}<br/>
             {{next.meeting_information_html}}
         </div>

From 5f0f7e814910805c2e399e49a27f7849880b4319 Mon Sep 17 00:00:00 2001
From: Bhagyashree <bhagyashree.iitg@gmail.com>
Date: Mar 12 2016 21:10:01 +0000
Subject: [PATCH 4/4] Updated Design for github PR widget(like Pagure PR widget)


---

diff --git a/hubs/widgets/github_pr.py b/hubs/widgets/github_pr.py
index 6a33091..ff890aa 100755
--- a/hubs/widgets/github_pr.py
+++ b/hubs/widgets/github_pr.py
@@ -17,47 +17,52 @@ log = logging.getLogger(__name__)
 chrome = panel("Github: Pull Requests")
 
 template = jinja2.Template("""
-  <br />
-  {% for i in range(display_number) %}
-    <div>
-      <table class="table-responsive table-condensed">
-        <tr>
-          <td valign="top" class="panel-heading">
-            <b>#{{ pulls[i]['number'] }}</b>
-          </td>
-          <td width="300px">
-            <b>{{ pulls[i]['title'] }}</b>
-          </td>
-        </tr>
-      </table>
-      <table class="table-responsive table-condensed">
-        <tr>
-          <td width="300px">
-            <font size="2">
-              <i>Opened by <a href="https://github.com/{{ pulls[i]['user'] }}" target="_blank">{{ pulls[i]['user'] }}</a></i>
-              {% if pulls[i]['assignee']|string() == "None" %}
-                <br /><i>Unclaimed</i>
-              {% else %}
-                 <br /><i>Assigned by <a href="https://github.com/{{ pulls[i]['assignee'] }}" target="_blank">{{ pulls[i]['assignee'] }}</a></i>
-              {% endif %}
-            </font>
-          </td>
-          <td>
-             <a href="{{ pulls[i]['url'] }}" target="_blank">
-               <button type="button" class="btn btn-default" aria-label="Left Align">
-                 <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
-               </button>
-             </a>
-          </td>
-        </tr>
-      </table>
-    </div>
-    {% endfor %}
-    {% if more != 0 %}
-    <div class="row">
-      <a href="https://github.com/{{ organization }}" target="_blank"><center>and {{ more }} more</center></a>
-    </div>
-    {% endif %}
+<a class="btn btn-success" target="_blank"
+    href="https://github.com/{{ organization }}" >
+  Organization Github Page
+</a>
+<hr/>
+
+  {% for pr in pulls[:display_number] %}
+    <li class="media">
+      <div class="media-left">
+        <a  href="{{ pr['url'] }}" 
+            target="_blank">
+        <span class="label label-default">#{{ pr['number'] }}</span>
+        </a>
+      </div>
+      <div class="media-body">
+        <h4 class="media-heading">
+          {{ organization }} -
+          <span title="{{ pr['title'] }}">
+            {{ pr['title'] }} {% if
+              pr['title'] | length > 45 %} ... {% endif %}
+          </span>
+        </h4>
+        Opened by:
+          <a href="https://github.com/{{ pr['user'] }}" 
+              target="_blank">
+            {{ pr['user'] }}
+          </a>
+        --
+        {% if pr['assignee'] %}
+          Assigned to:
+          <a href="https://github.com/{{ pr['assignee'] }}"
+              target="_blank">
+            {{ pr['assignee'] }}
+          </a>
+        {% else %}
+          <span class="text-muted">Unassigned</span>
+        {% endif %}
+      </div>
+    </li>
+  {% endfor %}
+  {% if all_pr | length > display_number %}
+  <li>
+    And {{ all_pr | length - display_number }} more ...
+  </li>
+  {% endif %}
+</ul>
 """)
 
 

