Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored and improved client folder listing view #690

Merged
merged 4 commits into from
Feb 23, 2018

Conversation

ramonski
Copy link
Contributor

Description of the issue/feature this PR addresses

Improves the client folder listing view (Mainly PEP8 and folder-item improvement)

Current behavior before PR

Not all columns were selectable and correctly rendered

Desired behavior after PR is merged

All available columns are selectable and correctly rendered

--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.

Copy link
Member

@xispa xispa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small comment re self.icon

'Fax', ]
},
self.icon = "{}/{}".format(
self.portal_url, "++resource++bika.lims.images/client_big.png")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use this function https://github.com/senaite/senaite.core/blob/master/bika/lims/utils/__init__.py#L797-L808

self.icon = get_image("client_big.png")

("MemberDiscountApplies", {
"toggle": False,
"title": _("Member Discount")}),
))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for toggling to False those geographical things ;)

item["replace"]["EmailAddress"] = get_email_link(item["EmailAddress"])
# translate True/FALSE values
item["replace"]["BulkDiscount"] = obj.getBulkDiscount() and _("Yes") or _("No")
item["replace"]["MemberDiscountApplies"] = obj.getMemberDiscountApplies() and _("Yes") or _("No")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!. An "iconic" alternative could be:

img_url = get_image('ok.png')
item["replace"]["BulkDiscount"] = obj.getBulkDiscount() and img_icon or " "
...

@xispa xispa merged commit 48592d7 into master Feb 23, 2018
@xispa xispa deleted the clientfolder-view-refactoring branch February 23, 2018 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants