@threebean are these changes correct?
@threebean i need to enhance its look and html/css but is the logic alright? and is this the expected output?
So, I think this url.format(username=username) line doesn't do anything. It would substitute the value of username in for a {username} string in the original url, but there is no such target in there.
username
{username}
Furthermore, the url is hardcoded for issues from the 'pagure' repo on https://pagure.io/.
Perhaps, instead of this widget taking username as a config argument, it should take a repo argument.. that way you could set up a fedora-hubs ticket widget that would show the latest tickets open for the fedora-hubs project.
repo
fedora-hubs
Since we're using bootstrap, you can make tables look nice pretty easily with something like:
<table class="table">
See the bootstrap docs for some examples.
I bet you can get away without hardcoding the width in the style attribute here. Remove these style tags and let the bootstrap css framework do the work.
Heh, this is kind of an odd data structure to choose.
A dict of lists?
Perhaps instead try a list of dicts. I bet it will make the code flow better and be more readable in the end.
Then, you'll be able to do things like issue_details['id'] = issue_id and issue_details['title'] = issue_title and at the end of the loop, do all_issues.append(issue_details).
issue_details['id'] = issue_id
issue_details['title'] = issue_title
all_issues.append(issue_details)
I think the call to response.json() might be taxing.
response.json()
Can you instead do something like:
data = response.json() and then do issue_id = data['issues'][i]['id']?
data = response.json()
issue_id = data['issues'][i]['id']
After you get a chance to address some of the comments above, could you upload a screenshot here? I'm curious to see how it looks with the changes.
Right now, it looks like this:
https://cdn.pbrd.co/images/1UB8hCwv.png
I will post another screenshot after making the changes.
Cool! I see what you mean now about it being "big" versus "small".
I think if you set left=False in hubs/defaults.py, then it will show up on the right column and be smaller.
left=False
hubs/defaults.py
@ralph I left it intentionally actually.
So that means all the issues/pull-requests widget should be smaller and appear on the left hand side.
Sorry, All Issues/Pull-request widget should be on the right hand side and smaller.
Cool. This is coming along nicely! I'll leave some more feedback inline if that's okay.
@ralph okay
I'm not sure you need the 'username' argument anymore. It can probably be dropped.
Like mentioned below, you can probably drop the username argument here and replace it with 'repo': 'fedora-hubs',.
'repo': 'fedora-hubs',
This link should probably go to pagure.io/{{repo}}/issues. See?
pagure.io/{{repo}}/issues
Latest screenshot: http://pasteboard.co/1XGQ0pU7.png
Cool. Thank you for the updates!
I think I see one more potential issue:
data(...)
Can you try testing it by pointing it at some different pagure repos?
Some ideas for the layout that we can change in the future -- don't worry about these for now:
<table>
text-right
@dhrish20, can you make the same 'Assign to'/'Opened by' change to this widget that you made to the pull-request widget?
@ralph sorry for the delay. My exams were going on. I will work on this one ASAP.
@ralph 1) This is the screenshot for non-existant repo: https://cdn.pbrd.co/images/2ttICJYf.png
2) This is the screenshot for a repo with less than 3 issues: https://cdn.pbrd.co/images/2ttQljvj.png I tested it for "libpagure" repo which has 1 issue currently.
@ralph I have made the "Assigned to"/"Opened by" change. This is the screenshot after making the change: https://cdn.pbrd.co/images/2tBhA3Qw.png
@ralph In one of the comments above, you've written "Maybe we can force the 'Unclaimed' text to right with a text-right class, or something like that."
So, should I shift the "Opened by" and "Assigned to" user names to the right side? Currently, its on the left side of the widget.
This has been merged. Will continue to work on it.