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

Add basic personalisation blocks #135

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tm-kn
Copy link
Collaborator

@tm-kn tm-kn commented May 31, 2017

Issue #68

  • Add "visible to everyone" segment setting for PersonalisedStructBlock.

  • Add the render_fields keyword argument for PersonalisedStructBlock. Setting of the same name can be also set on Meta class of the block.

    • It takes a list of field names and renders them in order without titles.
    • If set to None, it will just use StructBlock's render() (as currently, displaying field titles & content or template specified in Meta).
  • Add a few more default blocks so they work out of the box.

    • PersonalisedCharBlock
    • PersonalisedImageChooserBlock
    • PersonalisedRichTextBlock
    • PersonalisedTextBlock

@tm-kn tm-kn self-assigned this May 31, 2017
@tm-kn tm-kn changed the title WIP: Add basic personalisation blocks (#68) WIP: Add basic personalisation blocks May 31, 2017

from wagtail_personalisation.adapters import get_segment_adapter
from wagtail_personalisation.models import Segment


def list_segment_choices():
"""Get a list of segment choices visible in the admin site when editting
Copy link
Collaborator

Choose a reason for hiding this comment

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

editting -> editing

@codecov
Copy link

codecov bot commented May 31, 2017

Codecov Report

Merging #135 into master will not change coverage.
The diff coverage is 57.14%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #135   +/-   ##
=======================================
  Coverage   68.47%   68.47%           
=======================================
  Files          55       55           
  Lines        2217     2217           
=======================================
  Hits         1518     1518           
  Misses        699      699
Impacted Files Coverage Δ
src/wagtail_personalisation/blocks.py 58.82% <57.14%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 94c947a...912b46c. Read the comment docs.

@tm-kn tm-kn force-pushed the feature/#68-improve-personalised-fields branch 2 times, most recently from f5af8e8 to a71a703 Compare May 31, 2017 16:42
@tomdyson
Copy link
Collaborator

@tm-kn can you look at the 2.7 failures, please?

@tm-kn tm-kn force-pushed the feature/#68-improve-personalised-fields branch 5 times, most recently from d7d63ad to 912b46c Compare June 5, 2017 16:07
@tm-kn tm-kn changed the title WIP: Add basic personalisation blocks Add basic personalisation blocks Jun 5, 2017
@jberghoef jberghoef force-pushed the feature/#68-improve-personalised-fields branch from 912b46c to 1d18a82 Compare July 19, 2018 13:40
@codecov-io
Copy link

codecov-io commented Jul 19, 2018

Codecov Report

Merging #135 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #135   +/-   ##
=======================================
  Coverage   92.83%   92.83%           
=======================================
  Files          66       66           
  Lines        2010     2010           
=======================================
  Hits         1866     1866           
  Misses        144      144

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a47803e...1d18a82. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants