#505 organize the linechart / weekly activity widget
Merged 6 years ago by abompard. Opened 6 years ago by ryanlerch.
ryanlerch/fedora-hubs linechart  into  develop

file modified
+1 -1
@@ -57,7 +57,7 @@ 

      'hubs.widgets.contact:Contact',

      'hubs.widgets.dummy:Dummy',

      'hubs.widgets.library:Library',

-     'hubs.widgets.linechart:Linechart',

+     'hubs.widgets.weeklyactivity:WeeklyActivity',

      'hubs.widgets.feed:Feed',

      'hubs.widgets.github_pr:GitHubPRs',

      'hubs.widgets.githubissues:GitHubIssues',

hubs/widgets/weeklyactivity/__init__.py hubs/widgets/linechart/__init__.py
file renamed
+7 -10
@@ -5,24 +5,21 @@ 

  from hubs.widgets.view import RootWidgetView

  

  

- class Linechart(Widget):

+ class WeeklyActivity(Widget):

  

-     name = "linechart"

+     name = "weeklyactivity"

      label = "Weekly Activity"

      position = "left"

-     parameters = [dict(

-         name="username",

-         label="Username",

-         default=None,

-         validator=validators.Username,

-         help="A FAS username.",

-         )]

+     hub_types = ['user']

  

  

  class BaseView(RootWidgetView):

  

      def get_context(self, instance, *args, **kwargs):

-         username = instance.config["username"]

+         # since this widget only shows on user hubs, we assume

+         # hub.name == the username

+         username = instance.hub.name

+ 

          categories = [

              'git', 'Wiki', 'Copr', 'anitya', 'mirrormanager', 'ansible',

              'fedoratagger', 'summershum', 'nuancier', 'Mailman',

hubs/widgets/weeklyactivity/templates/root.html hubs/widgets/linechart/templates/root.html
file renamed
file was moved with no change to the file

renames the linechart widget in the code to weekly activity

also, makes it only show on the user hub, and removes the config
to just show the activity for the user that the user hub belongs
to.

Commit a1f5924 fixes this pull-request

Pull-Request has been merged by abompard

6 years ago

Pull-Request has been merged by abompard

6 years ago