How to use the wagtail.core.blocks.RichTextBlock function in wagtail

To help you get started, we’ve selected a few wagtail examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TakwimuAfrica / Takwimu / takwimu / models / dashboard.py View on Github external
def get_services(self):
        service_settings = SupportServicesSetting.for_site(self.get_site())

        return get_takwimu_services(service_settings)

    def get_faqs(self):
        faq_settings = FAQSetting.for_site(self.get_site())

        return get_takwimu_faqs(faq_settings)


class TermsContentBlock(blocks.StructBlock):
    label = blocks.CharBlock(default="Terms", max_length=255,
                             help_text="Short title used in navigation, etc.")
    title = blocks.CharBlock(default="Terms of use", max_length=1024)
    description = blocks.RichTextBlock(default=DEFAULT_DESCRIPTION_TEXT)


class TermsBlock(blocks.StreamBlock):
    terms = TermsContentBlock()

    def get_api_representation(self, value, context=None):
        representation = super(TermsBlock, self).get_api_representation(value, context=context)
        if representation:
            content = representation[0]
            description = content['value']['description']
            if description:
                content['value']['description'] = filter_rich_text(description)

            return content

        return {}
github liqd / a4-opin / home / models / base_pages.py View on Github external
)

    intro_image = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+'
    )

    # Body
    block_types = [
        ('heading', core_blocks.CharBlock(classname="full title",
                                          icon="title")),
        ('paragraph', core_blocks.TextBlock(icon="pilcrow")),
        ('rich_text', core_blocks.RichTextBlock(icon="pilcrow")),
        ('info_block', blocks.InfoBlock()),
        ('image', image_blocks.ImageChooserBlock(icon="image")),
        ('wide_image', blocks.WideImageBlock(icon="image")),
        ('images', blocks.InlineImagesBlock(icon="image")),
        ('contact_block', blocks.ContactBlock(icon="form")),
        ('accordion_block', blocks.AccordionBlock(icon="collapse-down")),
        ('image_text_block_list', blocks.ImageTextBlockList()),
        ('rss_feed', blocks.RSSImportBlock()),
    ]

    body = translations.TranslatedField(
        'body',
        StreamField(block_types, null=True, blank=True, verbose_name='body'),
    )

    general_panels = [
github torchbox / wagtail-torchbox / tbx / services / blocks.py View on Github external
class LogosBlock(StructBlock):
    title = CharBlock()
    intro = CharBlock()
    logos = ListBlock(StructBlock((
        ('image', ImageChooserBlock()),
        ('link_page', PageChooserBlock(required=False)),
        ('link_external', URLBlock(required=False)),
    )))

    class Meta:
        icon = 'site'
        template = 'blocks/services/logos_block.html'


class ServicePageBlock(StreamBlock):
    paragraph = RichTextBlock(icon="pilcrow")
    case_studies = CaseStudyBlock()
    highlights = HighlightBlock()
    pull_quote = PullQuoteBlock(template='blocks/services/pull_quote_block.html')
    process = StepByStepBlock()
    people = PeopleBlock()
    featured_pages = FeaturedPagesBlock()
    sign_up_form_page = SignUpFormPageBlock()
    logos = LogosBlock()
github thepoly / pipeline / core / models.py View on Github external
class EmbeddedMediaBlock(StructBlock):
    embed = EmbedBlock(help_text="URL to the content to embed.")
    size = ChoiceBlock(
        choices=[("small", "Small"), ("medium", "Medium"), ("large", "Large")],
        default="medium",
        help_text="Width of video in article.",
    )

    class Meta:
        value_class = EmbeddedMediaValue
        icon = "media"


class PhotoBlock(StructBlock):
    image = ImageChooserBlock()
    caption = RichTextBlock(features=["italic"], required=False)
    size = ChoiceBlock(
        choices=[("small", "Small"), ("medium", "Medium"), ("large", "Large")],
        default="medium",
        help_text="Width of image in article.",
    )

    class Meta:
        icon = "image"


class AdBlock(StructBlock):
    image = ImageChooserBlock(help_text="Image should be 22:7")
    link = URLBlock(label="target", required=False)

    class Meta:
        icon = "image"
github TakwimuAfrica / Takwimu / takwimu / migrations / 0060_flourish_visuals.py View on Github external
class Migration(migrations.Migration):

    dependencies = [
        ('takwimu', '0059_featured_data_indicator_layout'),
    ]

    operations = [
        migrations.AlterField(
            model_name='profilepage',
            name='body',
            field=wagtail.core.fields.StreamField([('topic', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.CharBlock(required=False)), ('icon', takwimu.models.dashboard.IconChoiceBlock(required=False)), ('summary', wagtail.core.blocks.RichTextBlock(required=False)), ('body', wagtail.core.blocks.StreamBlock([('text', wagtail.core.blocks.RichTextBlock(required=False)), ('indicator', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.CharBlock()), ('widget', wagtail.core.blocks.StreamBlock([('free_form', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(help_text="This widget's tab label on the indicator", required=False)), ('title', wagtail.core.blocks.CharBlock(required=False)), ('hide_title', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('body', wagtail.core.blocks.RichTextBlock(required=False)), ('sdg', wagtail.core.blocks.ChoiceBlock(choices=[('', 'Please select an SDG'), ('no-poverty', 'No Poverty'), ('zero-hunger', 'Zero Hunger'), ('good-health-and-well-being', 'Good Health and Well-being'), ('quality-education', 'Quality Education'), ('gender-equality', 'Gender Equality'), ('clean-water-and-sanitation', 'Clean Water and Sanitation'), ('affordable-and-clean-energy', 'Affordable and Clean Energy'), ('decent-jobs-and-economic-growth', 'Decent Jobs and Economic Growth'), ('industry-innovation-and-infrastructure', 'Industry, Innovation and Infrastructure'), ('reduced-inequalities', 'Reduced Inequalities'), ('sustainable-cities-and-communities', 'Sustainable Cities and Communities'), ('responsible-consumption-and-production', 'Responsible Consumption and Production'), ('climate-action', 'Climate Action'), ('life-below-water', 'Life Below Water'), ('life-on-land', 'Life on Land'), ('peace-and-justice-strong-institutions', 'Peace and Justice - Strong Institutions'), ('partnerships-for-the-goals', 'Partnerships for the Goals')], label='SDG Goal', required=False)), ('source', wagtail.core.blocks.RichTextBlock(features=['link'], required=False))], icon='snippet', template='takwimu/_includes/dataview/freeform.html')), ('embed', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(help_text="This widget's tab label on the indicator", required=False)), ('title', wagtail.core.blocks.CharBlock(required=False)), ('hide_title', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('embed', wagtail.embeds.blocks.EmbedBlock(required=False)), ('sdg', wagtail.core.blocks.ChoiceBlock(choices=[('', 'Please select an SDG'), ('no-poverty', 'No Poverty'), ('zero-hunger', 'Zero Hunger'), ('good-health-and-well-being', 'Good Health and Well-being'), ('quality-education', 'Quality Education'), ('gender-equality', 'Gender Equality'), ('clean-water-and-sanitation', 'Clean Water and Sanitation'), ('affordable-and-clean-energy', 'Affordable and Clean Energy'), ('decent-jobs-and-economic-growth', 'Decent Jobs and Economic Growth'), ('industry-innovation-and-infrastructure', 'Industry, Innovation and Infrastructure'), ('reduced-inequalities', 'Reduced Inequalities'), ('sustainable-cities-and-communities', 'Sustainable Cities and Communities'), ('responsible-consumption-and-production', 'Responsible Consumption and Production'), ('climate-action', 'Climate Action'), ('life-below-water', 'Life Below Water'), ('life-on-land', 'Life on Land'), ('peace-and-justice-strong-institutions', 'Peace and Justice - Strong Institutions'), ('partnerships-for-the-goals', 'Partnerships for the Goals')], label='SDG Goal', required=False)), ('source', wagtail.core.blocks.RichTextBlock(features=['link'], required=False))], icon='media', template='takwimu/_includes/dataview/embed.html')), ('document', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(help_text="This widget's tab label on the indicator", required=False)), ('title', wagtail.core.blocks.CharBlock(required=False)), ('hide_title', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('document', wagtail.documents.blocks.DocumentChooserBlock(required=False)), ('sdg', wagtail.core.blocks.ChoiceBlock(choices=[('', 'Please select an SDG'), ('no-poverty', 'No Poverty'), ('zero-hunger', 'Zero Hunger'), ('good-health-and-well-being', 'Good Health and Well-being'), ('quality-education', 'Quality Education'), ('gender-equality', 'Gender Equality'), ('clean-water-and-sanitation', 'Clean Water and Sanitation'), ('affordable-and-clean-energy', 'Affordable and Clean Energy'), ('decent-jobs-and-economic-growth', 'Decent Jobs and Economic Growth'), ('industry-innovation-and-infrastructure', 'Industry, Innovation and Infrastructure'), ('reduced-inequalities', 'Reduced Inequalities'), ('sustainable-cities-and-communities', 'Sustainable Cities and Communities'), ('responsible-consumption-and-production', 'Responsible Consumption and Production'), ('climate-action', 'Climate Action'), ('life-below-water', 'Life Below Water'), ('life-on-land', 'Life on Land'), ('peace-and-justice-strong-institutions', 'Peace and Justice - Strong Institutions'), ('partnerships-for-the-goals', 'Partnerships for the Goals')], label='SDG Goal', required=False)), ('source', wagtail.core.blocks.RichTextBlock(features=['link'], required=False))], icon='doc-full', template='takwimu/_includes/dataview/document.html')), ('image', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(help_text="This widget's tab label on the indicator", required=False)), ('title', wagtail.core.blocks.CharBlock(required=False)), ('hide_title', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('image', wagtail.images.blocks.ImageChooserBlock(required=False)), ('caption', wagtail.core.blocks.TextBlock(required=False)), ('sdg', wagtail.core.blocks.ChoiceBlock(choices=[('', 'Please select an SDG'), ('no-poverty', 'No Poverty'), ('zero-hunger', 'Zero Hunger'), ('good-health-and-well-being', 'Good Health and Well-being'), ('quality-education', 'Quality Education'), ('gender-equality', 'Gender Equality'), ('clean-water-and-sanitation', 'Clean Water and Sanitation'), ('affordable-and-clean-energy', 'Affordable and Clean Energy'), ('decent-jobs-and-economic-growth', 'Decent Jobs and Economic Growth'), ('industry-innovation-and-infrastructure', 'Industry, Innovation and Infrastructure'), ('reduced-inequalities', 'Reduced Inequalities'), ('sustainable-cities-and-communities', 'Sustainable Cities and Communities'), ('responsible-consumption-and-production', 'Responsible Consumption and Production'), ('climate-action', 'Climate Action'), ('life-below-water', 'Life Below Water'), ('life-on-land', 'Life on Land'), ('peace-and-justice-strong-institutions', 'Peace and Justice - Strong Institutions'), ('partnerships-for-the-goals', 'Partnerships for the Goals')], label='SDG Goal', required=False)), ('source', wagtail.core.blocks.RichTextBlock(features=['link'], required=False))], icon='image', template='takwimu/_includes/dataview/image.html')), ('html', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(help_text="This widget's tab label on the indicator", required=False)), ('title', wagtail.core.blocks.CharBlock(required=False)), ('hide_title', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('raw_html', wagtail.core.blocks.RawHTMLBlock(required=False)), ('sdg', wagtail.core.blocks.ChoiceBlock(choices=[('', 'Please select an SDG'), ('no-poverty', 'No Poverty'), ('zero-hunger', 'Zero Hunger'), ('good-health-and-well-being', 'Good Health and Well-being'), ('quality-education', 'Quality Education'), ('gender-equality', 'Gender Equality'), ('clean-water-and-sanitation', 'Clean Water and Sanitation'), ('affordable-and-clean-energy', 'Affordable and Clean Energy'), ('decent-jobs-and-economic-growth', 'Decent Jobs and Economic Growth'), ('industry-innovation-and-infrastructure', 'Industry, Innovation and Infrastructure'), ('reduced-inequalities', 'Reduced Inequalities'), ('sustainable-cities-and-communities', 'Sustainable Cities and Communities'), ('responsible-consumption-and-production', 'Responsible Consumption and Production'), ('climate-action', 'Climate Action'), ('life-below-water', 'Life Below Water'), ('life-on-land', 'Life on Land'), ('peace-and-justice-strong-institutions', 'Peace and Justice - Strong Institutions'), ('partnerships-for-the-goals', 'Partnerships for the Goals')], label='SDG Goal', required=False)), ('source', wagtail.core.blocks.RichTextBlock(features=['link'], required=False))], icon='code', template='takwimu/_includes/dataview/code.html')), ('flourish', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(help_text="This widget's tab label on the indicator", required=False)), ('title', wagtail.core.blocks.CharBlock(required=False)), ('hide_title', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('html', wagtail.documents.blocks.DocumentChooserBlock(required=True)), ('sdg', wagtail.core.blocks.ChoiceBlock(choices=[('', 'Please select an SDG'), ('no-poverty', 'No Poverty'), ('zero-hunger', 'Zero Hunger'), ('good-health-and-well-being', 'Good Health and Well-being'), ('quality-education', 'Quality Education'), ('gender-equality', 'Gender Equality'), ('clean-water-and-sanitation', 'Clean Water and Sanitation'), ('affordable-and-clean-energy', 'Affordable and Clean Energy'), ('decent-jobs-and-economic-growth', 'Decent Jobs and Economic Growth'), ('industry-innovation-and-infrastructure', 'Industry, Innovation and Infrastructure'), ('reduced-inequalities', 'Reduced Inequalities'), ('sustainable-cities-and-communities', 'Sustainable Cities and Communities'), ('responsible-consumption-and-production', 'Responsible Consumption and Production'), ('climate-action', 'Climate Action'), ('life-below-water', 'Life Below Water'), ('life-on-land', 'Life on Land'), ('peace-and-justice-strong-institutions', 'Peace and Justice - Strong Institutions'), ('partnerships-for-the-goals', 'Partnerships for the Goals')], label='SDG Goal', required=False)), ('source', wagtail.core.blocks.RichTextBlock(features=['link'], required=False))], icon='code', template='takwimu/_includes/dataview/code.html')), ('hurumap', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(help_text="This widget's tab label on the indicator", required=False)), ('title', wagtail.core.blocks.CharBlock(required=False)), ('hide_title', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('subtitle', wagtail.core.blocks.CharBlock(required=False)), ('data_country', wagtail.core.blocks.ChoiceBlock(choices=[('ET', 'Ethiopia'), ('KE', 'Kenya'), ('NG', 'Nigeria'), ('SN', 'Senegal'), ('TZ', 'Tanzania')], label='Country')), ('sdg', wagtail.core.blocks.ChoiceBlock(choices=[('', 'Please select an SDG'), ('no-poverty', 'No Poverty'), ('zero-hunger', 'Zero Hunger'), ('good-health-and-well-being', 'Good Health and Well-being'), ('quality-education', 'Quality Education'), ('gender-equality', 'Gender Equality'), ('clean-water-and-sanitation', 'Clean Water and Sanitation'), ('affordable-and-clean-energy', 'Affordable and Clean Energy'), ('decent-jobs-and-economic-growth', 'Decent Jobs and Economic Growth'), ('industry-innovation-and-infrastructure', 'Industry, Innovation and Infrastructure'), ('reduced-inequalities', 'Reduced Inequalities'), ('sustainable-cities-and-communities', 'Sustainable Cities and Communities'), ('responsible-consumption-and-production', 'Responsible Consumption and Production'), ('climate-action', 'Climate Action'), ('life-below-water', 'Life Below Water'), ('life-on-land', 'Life on Land'), ('peace-and-justice-strong-institutions', 'Peace and Justice - Strong Institutions'), ('partnerships-for-the-goals', 'Partnerships for the Goals')], label='SDG Goal', required=False)), ('data_id', wagtail.core.blocks.ChoiceBlock(choices=[('demographics-residence_dist', 'Population by Residence'), ('demographics-sex_dist', 'Population by Sex'), ('crops-crop_distribution', 'Crops Produced'), ('health_centers-prevention_methods_dist', 'Knowledge of HIV Prevention Methods'), ('education-education_reached_distribution', 'Highest Level of Education Attained'), ('education-school_attendance_distribution', 'School Attendance by Sex'), ('donors-donor_assistance_dist', 'Principal Donors'), ('poverty-poverty_residence_dist', 'Percentage of Population living in Poverty by Residence'), ('poverty-poverty_age_dist', 'Percentage of Population living in Poverty by Age and Residence'), ('fgm-fgm_age_dist', 'Percentage of Women that have undergone FGM by Age'), ('security-seized_firearms_dist', 'Seized Firearms'), ('donors-donor_programmes_dist', 'Donor Funded Programmes'), ('budget-government_expenditure_dist', 'Government Expenditure'), ('health_centers-health_centers_dist', 'Number of health centers by type'), ('worldbank-cereal_yield_kg_per_hectare', 'Cereal Yield in Kg Per Hectare'), ('worldbank-agricultural_land', 'Agricultural land (% of land area)'), ('worldbank-gini_index', 'GINI Index'), ('worldbank-access_to_basic_services', 'People using at least basic drinking water services (% of population)'), ('worldbank-primary_school_enrollment', 'School enrollment, primary, male (% gross)'), ('worldbank-account_ownership', 'Account ownership at a financial institution or with a mobile-money-service provider, (% of population ages 15+)'), ('worldbank-youth_unemployment', 'Unemployment, youth (% of labor force ages 15-24) (modeled ILO estimate)'), ('worldbank-adult_literacy_rate', 'Literacy rate, adult (% of population ages 15 and above)'), ('worldbank-foreign_direct_investment_net_inflows', 'Foreign direct investment, net inflows (% of GDP)'), ('worldbank-maternal_mortality', 'Maternal mortality ratio (modeled estimate, per 100,000 live births)'), ('worldbank-hiv_prevalence', 'Prevalence of HIV, (% ages 15-24)'), ('worldbank-employment_to_population_ratio', 'Employment to population ratio, 15+, (%) (modeled ILO estimate)'), ('worldbank-gdp_per_capita', 'GDP per capita (current US$)'), ('worldbank-primary_education_completion_rate', 'Primary completion rate,(% of relevant age group)'), ('worldbank-secondary_school_enrollment', 'School enrollment, secondary (% gross)'), ('worldbank-nurses_and_midwives', 'Nurses and midwives (per 1,000 people)'), ('worldbank-mobile_phone_subscriptions', 'Mobile Phone Subscriptions(per 100 people)'), ('worldbank-gdp_per_capita_growth', 'GDP per capita growth (annual %)'), ('worldbank-prevalence_of_undernourishment', 'Prevalence of undernourishment (% of population)'), ('worldbank-life_expectancy_at_birth', 'Life Expectancy At Birth (Years)'), ('worldbank-tax_as_percentage_of_gdp', 'Tax As Percentage Of GDP'), ('worldbank-births_attended_by_skilled_health_staff', 'Births Attended By Skilled Health Staff (% of total)'), ('worldbank-incidence_of_malaria_per_1000_pop_at_risk', 'Incidence Of Malaria Per 1000 Population At Risk'), ('worldbank-tax_revenue', 'Tax revenue (current LCU)'), ('worldbank-gdp', 'GDP'), ('worldbank-gdp_growth', 'GDP Growth')], label='Data')), ('chart_type', wagtail.core.blocks.ChoiceBlock(choices=[('histogram', 'Histogram'), ('pie', 'Pie Chart'), ('grouped_column', 'Grouped Column')], label='Chart Type')), ('data_stat_type', wagtail.core.blocks.ChoiceBlock(choices=[('percentage', 'Percentage'), ('scaled-percentage', 'Scaled Percentage'), ('dollar', 'Dollar')], label='Stat Type')), ('data_source_link', wagtail.core.blocks.URLBlock(label='Source URL', required=False)), ('data_source_title', wagtail.core.blocks.CharBlock(label='Source Title', required=False)), ('chart_qualifier', wagtail.core.blocks.RichTextBlock(features=['h5', 'h6', 'ol', 'ul', 'bold', 'italic', 'hr', 'link'], help_text='Chart context e.g. legend, universe, etc.', label='Chart Qualifier', required=False)), ('chart_height', wagtail.core.blocks.IntegerBlock(help_text='Default is 300px', label='Chart Height', required=False)), ('widget_height', wagtail.core.blocks.IntegerBlock(help_text='Default is 450px', label='Widget Height', required=False))], icon='code', template='takwimu/_includes/dataview/hurumap.html')), ('entities', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(help_text="This widget's tab label on the indicator", required=False)), ('title', wagtail.core.blocks.CharBlock(required=False)), ('hide_title', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('entities', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('name', wagtail.core.blocks.CharBlock(required=False)), ('image', wagtail.images.blocks.ImageChooserBlock(required=False)), ('description', wagtail.core.blocks.RichTextBlock(features=['link'], required=False))]))), ('source', wagtail.core.blocks.RichTextBlock(features=['link'], required=False))], icon='group', template='takwimu/_includes/dataview/entities.html'))], max_num=1, min_num=1)), ('summary', wagtail.core.blocks.RichTextBlock(default='', required=False)), ('layout', wagtail.core.blocks.ChoiceBlock(choices=[('auto', 'Default Layout'), ('half_width', 'Half Width Layout'), ('full_width', 'Full Width Layout')], help_text="'Default Layout' means Takwimu will try to pick either 'Half' or 'Full' width layout based on the indicator type and its content. Manually choose the layout if the Takwimu picked layout does not produce the desired results."))], required=False))], required=False))]))], blank=True),
        ),
        migrations.AlterField(
            model_name='profilesectionpage',
            name='body',
            field=wagtail.core.fields.StreamField([('topic', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.CharBlock(required=False)), ('icon', takwimu.models.dashboard.IconChoiceBlock(required=False)), ('summary', wagtail.core.blocks.RichTextBlock(required=False)), ('body', wagtail.core.blocks.StreamBlock([('text', wagtail.core.blocks.RichTextBlock(required=False)), ('indicator', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.CharBlock()), ('widget', wagtail.core.blocks.StreamBlock([('free_form', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(help_text="This widget's tab label on the indicator", required=False)), ('title', wagtail.core.blocks.CharBlock(required=False)), ('hide_title', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('body', wagtail.core.blocks.RichTextBlock(required=False)), ('sdg', wagtail.core.blocks.ChoiceBlock(choices=[('', 'Please select an SDG'), ('no-poverty', 'No Poverty'), ('zero-hunger', 'Zero Hunger'), ('good-health-and-well-being', 'Good Health and Well-being'), ('quality-education', 'Quality Education'), ('gender-equality', 'Gender Equality'), ('clean-water-and-sanitation', 'Clean Water and Sanitation'), ('affordable-and-clean-energy', 'Affordable and Clean Energy'), ('decent-jobs-and-economic-growth', 'Decent Jobs and Economic Growth'), ('industry-innovation-and-infrastructure', 'Industry, Innovation and Infrastructure'), ('reduced-inequalities', 'Reduced Inequalities'), ('sustainable-cities-and-communities', 'Sustainable Cities and Communities'), ('responsible-consumption-and-production', 'Responsible Consumption and Production'), ('climate-action', 'Climate Action'), ('life-below-water', 'Life Below Water'), ('life-on-land', 'Life on Land'), ('peace-and-justice-strong-institutions', 'Peace and Justice - Strong Institutions'), ('partnerships-for-the-goals', 'Partnerships for the Goals')], label='SDG Goal', required=False)), ('source', wagtail.core.blocks.RichTextBlock(features=['link'], required=False))], icon='snippet', template='takwimu/_includes/dataview/freeform.html')), ('embed', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(help_text="This widget's tab label on the indicator", required=False)), ('title', wagtail.core.blocks.CharBlock(required=False)), ('hide_title', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('embed', wagtail.embeds.blocks.EmbedBlock(required=False)), ('sdg', wagtail.core.blocks.ChoiceBlock(choices=[('', 'Please select an SDG'), ('no-poverty', 'No Poverty'), ('zero-hunger', 'Zero Hunger'), ('good-health-and-well-being', 'Good Health and Well-being'), ('quality-education', 'Quality Education'), ('gender-equality', 'Gender Equality'), ('clean-water-and-sanitation', 'Clean Water and Sanitation'), ('affordable-and-clean-energy', 'Affordable and Clean Energy'), ('decent-jobs-and-economic-growth', 'Decent Jobs and Economic Growth'), ('industry-innovation-and-infrastructure', 'Industry, Innovation and Infrastructure'), ('reduced-inequalities', 'Reduced Inequalities'), ('sustainable-cities-and-communities', 'Sustainable Cities and Communities'), ('responsible-consumption-and-production', 'Responsible Consumption and Production'), ('climate-action', 'Climate Action'), ('life-below-water', 'Life Below Water'), ('life-on-land', 'Life on Land'), ('peace-and-justice-strong-institutions', 'Peace and Justice - Strong Institutions'), ('partnerships-for-the-goals', 'Partnerships for the Goals')], label='SDG Goal', required=False)), ('source', wagtail.core.blocks.RichTextBlock(features=['link'], required=False))], icon='media', template='takwimu/_includes/dataview/embed.html')), ('document', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(help_text="This widget's tab label on the indicator", required=False)), ('title', wagtail.core.blocks.CharBlock(required=False)), ('hide_title', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('document', wagtail.documents.blocks.DocumentChooserBlock(required=False)), ('sdg', wagtail.core.blocks.ChoiceBlock(choices=[('', 'Please select an SDG'), ('no-poverty', 'No Poverty'), ('zero-hunger', 'Zero Hunger'), ('good-health-and-well-being', 'Good Health and Well-being'), ('quality-education', 'Quality Education'), ('gender-equality', 'Gender Equality'), ('clean-water-and-sanitation', 'Clean Water and Sanitation'), ('affordable-and-clean-energy', 'Affordable and Clean Energy'), ('decent-jobs-and-economic-growth', 'Decent Jobs and Economic Growth'), ('industry-innovation-and-infrastructure', 'Industry, Innovation and Infrastructure'), ('reduced-inequalities', 'Reduced Inequalities'), ('sustainable-cities-and-communities', 'Sustainable Cities and Communities'), ('responsible-consumption-and-production', 'Responsible Consumption and Production'), ('climate-action', 'Climate Action'), ('life-below-water', 'Life Below Water'), ('life-on-land', 'Life on Land'), ('peace-and-justice-strong-institutions', 'Peace and Justice - Strong Institutions'), ('partnerships-for-the-goals', 'Partnerships for the Goals')], label='SDG Goal', required=False)), ('source', wagtail.core.blocks.RichTextBlock(features=['link'], required=False))], icon='doc-full', template='takwimu/_includes/dataview/document.html')), ('image', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(help_text="This widget's tab label on the indicator", required=False)), ('title', wagtail.core.blocks.CharBlock(required=False)), ('hide_title', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('image', wagtail.images.blocks.ImageChooserBlock(required=False)), ('caption', wagtail.core.blocks.TextBlock(required=False)), ('sdg', wagtail.core.blocks.ChoiceBlock(choices=[('', 'Please select an SDG'), ('no-poverty', 'No Poverty'), ('zero-hunger', 'Zero Hunger'), ('good-health-and-well-being', 'Good Health and Well-being'), ('quality-education', 'Quality Education'), ('gender-equality', 'Gender Equality'), ('clean-water-and-sanitation', 'Clean Water and Sanitation'), ('affordable-and-clean-energy', 'Affordable and Clean Energy'), ('decent-jobs-and-economic-growth', 'Decent Jobs and Economic Growth'), ('industry-innovation-and-infrastructure', 'Industry, Innovation and Infrastructure'), ('reduced-inequalities', 'Reduced Inequalities'), ('sustainable-cities-and-communities', 'Sustainable Cities and Communities'), ('responsible-consumption-and-production', 'Responsible Consumption and Production'), ('climate-action', 'Climate Action'), ('life-below-water', 'Life Below Water'), ('life-on-land', 'Life on Land'), ('peace-and-justice-strong-institutions', 'Peace and Justice - Strong Institutions'), ('partnerships-for-the-goals', 'Partnerships for the Goals')], label='SDG Goal', required=False)), ('source', wagtail.core.blocks.RichTextBlock(features=['link'], required=False))], icon='image', template='takwimu/_includes/dataview/image.html')), ('html', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(help_text="This widget's tab label on the indicator", required=False)), ('title', wagtail.core.blocks.CharBlock(required=False)), ('hide_title', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('raw_html', wagtail.core.blocks.RawHTMLBlock(required=False)), ('sdg', wagtail.core.blocks.ChoiceBlock(choices=[('', 'Please select an SDG'), ('no-poverty', 'No Poverty'), ('zero-hunger', 'Zero Hunger'), ('good-health-and-well-being', 'Good Health and Well-being'), ('quality-education', 'Quality Education'), ('gender-equality', 'Gender Equality'), ('clean-water-and-sanitation', 'Clean Water and Sanitation'), ('affordable-and-clean-energy', 'Affordable and Clean Energy'), ('decent-jobs-and-economic-growth', 'Decent Jobs and Economic Growth'), ('industry-innovation-and-infrastructure', 'Industry, Innovation and Infrastructure'), ('reduced-inequalities', 'Reduced Inequalities'), ('sustainable-cities-and-communities', 'Sustainable Cities and Communities'), ('responsible-consumption-and-production', 'Responsible Consumption and Production'), ('climate-action', 'Climate Action'), ('life-below-water', 'Life Below Water'), ('life-on-land', 'Life on Land'), ('peace-and-justice-strong-institutions', 'Peace and Justice - Strong Institutions'), ('partnerships-for-the-goals', 'Partnerships for the Goals')], label='SDG Goal', required=False)), ('source', wagtail.core.blocks.RichTextBlock(features=['link'], required=False))], icon='code', template='takwimu/_includes/dataview/code.html')), ('flourish', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(help_text="This widget's tab label on the indicator", required=False)), ('title', wagtail.core.blocks.CharBlock(required=False)), ('hide_title', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('html', wagtail.documents.blocks.DocumentChooserBlock(required=True)), ('sdg', wagtail.core.blocks.ChoiceBlock(choices=[('', 'Please select an SDG'), ('no-poverty', 'No Poverty'), ('zero-hunger', 'Zero Hunger'), ('good-health-and-well-being', 'Good Health and Well-being'), ('quality-education', 'Quality Education'), ('gender-equality', 'Gender Equality'), ('clean-water-and-sanitation', 'Clean Water and Sanitation'), ('affordable-and-clean-energy', 'Affordable and Clean Energy'), ('decent-jobs-and-economic-growth', 'Decent Jobs and Economic Growth'), ('industry-innovation-and-infrastructure', 'Industry, Innovation and Infrastructure'), ('reduced-inequalities', 'Reduced Inequalities'), ('sustainable-cities-and-communities', 'Sustainable Cities and Communities'), ('responsible-consumption-and-production', 'Responsible Consumption and Production'), ('climate-action', 'Climate Action'), ('life-below-water', 'Life Below Water'), ('life-on-land', 'Life on Land'), ('peace-and-justice-strong-institutions', 'Peace and Justice - Strong Institutions'), ('partnerships-for-the-goals', 'Partnerships for the Goals')], label='SDG Goal', required=False)), ('source', wagtail.core.blocks.RichTextBlock(features=['link'], required=False))], icon='code', template='takwimu/_includes/dataview/code.html')), ('hurumap', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(help_text="This widget's tab label on the indicator", required=False)), ('title', wagtail.core.blocks.CharBlock(required=False)), ('hide_title', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('subtitle', wagtail.core.blocks.CharBlock(required=False)), ('data_country', wagtail.core.blocks.ChoiceBlock(choices=[('ET', 'Ethiopia'), ('KE', 'Kenya'), ('NG', 'Nigeria'), ('SN', 'Senegal'), ('TZ', 'Tanzania')], label='Country')), ('sdg', wagtail.core.blocks.ChoiceBlock(choices=[('', 'Please select an SDG'), ('no-poverty', 'No Poverty'), ('zero-hunger', 'Zero Hunger'), ('good-health-and-well-being', 'Good Health and Well-being'), ('quality-education', 'Quality Education'), ('gender-equality', 'Gender Equality'), ('clean-water-and-sanitation', 'Clean Water and Sanitation'), ('affordable-and-clean-energy', 'Affordable and Clean Energy'), ('decent-jobs-and-economic-growth', 'Decent Jobs and Economic Growth'), ('industry-innovation-and-infrastructure', 'Industry, Innovation and Infrastructure'), ('reduced-inequalities', 'Reduced Inequalities'), ('sustainable-cities-and-communities', 'Sustainable Cities and Communities'), ('responsible-consumption-and-production', 'Responsible Consumption and Production'), ('climate-action', 'Climate Action'), ('life-below-water', 'Life Below Water'), ('life-on-land', 'Life on Land'), ('peace-and-justice-strong-institutions', 'Peace and Justice - Strong Institutions'), ('partnerships-for-the-goals', 'Partnerships for the Goals')], label='SDG Goal', required=False)), ('data_id', wagtail.core.blocks.ChoiceBlock(choices=[('demographics-residence_dist', 'Population by Residence'), ('demographics-sex_dist', 'Population by Sex'), ('crops-crop_distribution', 'Crops Produced'), ('health_centers-prevention_methods_dist', 'Knowledge of HIV Prevention Methods'), ('education-education_reached_distribution', 'Highest Level of Education Attained'), ('education-school_attendance_distribution', 'School Attendance by Sex'), ('donors-donor_assistance_dist', 'Principal Donors'), ('poverty-poverty_residence_dist', 'Percentage of Population living in Poverty by Residence'), ('poverty-poverty_age_dist', 'Percentage of Population living in Poverty by Age and Residence'), ('fgm-fgm_age_dist', 'Percentage of Women that have undergone FGM by Age'), ('security-seized_firearms_dist', 'Seized Firearms'), ('donors-donor_programmes_dist', 'Donor Funded Programmes'), ('budget-government_expenditure_dist', 'Government Expenditure'), ('health_centers-health_centers_dist', 'Number of health centers by type'), ('worldbank-cereal_yield_kg_per_hectare', 'Cereal Yield in Kg Per Hectare'), ('worldbank-agricultural_land', 'Agricultural land (% of land area)'), ('worldbank-gini_index', 'GINI Index'), ('worldbank-access_to_basic_services', 'People using at least basic drinking water services (% of population)'), ('worldbank-primary_school_enrollment', 'School enrollment, primary, male (% gross)'), ('worldbank-account_ownership', 'Account ownership at a financial institution or with a mobile-money-service provider, (% of population ages 15+)'), ('worldbank-youth_unemployment', 'Unemployment, youth (% of labor force ages 15-24) (modeled ILO estimate)'), ('worldbank-adult_literacy_rate', 'Literacy rate, adult (% of population ages 15 and above)'), ('worldbank-foreign_direct_investment_net_inflows', 'Foreign direct investment, net inflows (% of GDP)'), ('worldbank-maternal_mortality', 'Maternal mortality ratio (modeled estimate, per 100,000 live births)'), ('worldbank-hiv_prevalence', 'Prevalence of HIV, (% ages 15-24)'), ('worldbank-employment_to_population_ratio', 'Employment to population ratio, 15+, (%) (modeled ILO estimate)'), ('worldbank-gdp_per_capita', 'GDP per capita (current US$)'), ('worldbank-primary_education_completion_rate', 'Primary completion rate,(% of relevant age group)'), ('worldbank-secondary_school_enrollment', 'School enrollment, secondary (% gross)'), ('worldbank-nurses_and_midwives', 'Nurses and midwives (per 1,000 people)'), ('worldbank-mobile_phone_subscriptions', 'Mobile Phone Subscriptions(per 100 people)'), ('worldbank-gdp_per_capita_growth', 'GDP per capita growth (annual %)'), ('worldbank-prevalence_of_undernourishment', 'Prevalence of undernourishment (% of population)'), ('worldbank-life_expectancy_at_birth', 'Life Expectancy At Birth (Years)'), ('worldbank-tax_as_percentage_of_gdp', 'Tax As Percentage Of GDP'), ('worldbank-births_attended_by_skilled_health_staff', 'Births Attended By Skilled Health Staff (% of total)'), ('worldbank-incidence_of_malaria_per_1000_pop_at_risk', 'Incidence Of Malaria Per 1000 Population At Risk'), ('worldbank-tax_revenue', 'Tax revenue (current LCU)'), ('worldbank-gdp', 'GDP'), ('worldbank-gdp_growth', 'GDP Growth')], label='Data')), ('chart_type', wagtail.core.blocks.ChoiceBlock(choices=[('histogram', 'Histogram'), ('pie', 'Pie Chart'), ('grouped_column', 'Grouped Column')], label='Chart Type')), ('data_stat_type', wagtail.core.blocks.ChoiceBlock(choices=[('percentage', 'Percentage'), ('scaled-percentage', 'Scaled Percentage'), ('dollar', 'Dollar')], label='Stat Type')), ('data_source_link', wagtail.core.blocks.URLBlock(label='Source URL', required=False)), ('data_source_title', wagtail.core.blocks.CharBlock(label='Source Title', required=False)), ('chart_qualifier', wagtail.core.blocks.RichTextBlock(features=['h5', 'h6', 'ol', 'ul', 'bold', 'italic', 'hr', 'link'], help_text='Chart context e.g. legend, universe, etc.', label='Chart Qualifier', required=False)), ('chart_height', wagtail.core.blocks.IntegerBlock(help_text='Default is 300px', label='Chart Height', required=False)), ('widget_height', wagtail.core.blocks.IntegerBlock(help_text='Default is 450px', label='Widget Height', required=False))], icon='code', template='takwimu/_includes/dataview/hurumap.html')), ('entities', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(help_text="This widget's tab label on the indicator", required=False)), ('title', wagtail.core.blocks.CharBlock(required=False)), ('hide_title', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('entities', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('name', wagtail.core.blocks.CharBlock(required=False)), ('image', wagtail.images.blocks.ImageChooserBlock(required=False)), ('description', wagtail.core.blocks.RichTextBlock(features=['link'], required=False))]))), ('source', wagtail.core.blocks.RichTextBlock(features=['link'], required=False))], icon='group', template='takwimu/_includes/dataview/entities.html'))], max_num=1, min_num=1)), ('summary', wagtail.core.blocks.RichTextBlock(default='', required=False)), ('layout', wagtail.core.blocks.ChoiceBlock(choices=[('auto', 'Default Layout'), ('half_width', 'Half Width Layout'), ('full_width', 'Full Width Layout')], help_text="'Default Layout' means Takwimu will try to pick either 'Half' or 'Full' width layout based on the indicator type and its content. Manually choose the layout if the Takwimu picked layout does not produce the desired results."))], required=False))], required=False))]))], blank=True),
        ),
github mdn / developer-portal / developerportal / apps / events / migrations / 0015_auto_20190813_1503.py View on Github external
),
                    )
                ],
                blank=True,
                help_text="Optional list of agenda items for this event",
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="event",
            name="body",
            field=developerportal.apps.common.fields.CustomStreamField(
                [
                    (
                        "paragraph",
                        wagtail.core.blocks.RichTextBlock(
                            features=(
                                "h2",
                                "h3",
                                "h4",
                                "bold",
                                "italic",
                                "link",
                                "ol",
                                "ul",
                                "blockquote",
                                "code",
                                "hr",
                            )
                        ),
                    ),
                    ("image", wagtail.images.blocks.ImageChooserBlock()),
github ea-czech-republic / efektivnialtruismus.cz / website / theses / migrations / 0019_thesischoosehelppage.py View on Github external
class Migration(migrations.Migration):

    dependencies = [
        ('wagtailcore', '0040_page_draft_title'),
        ('theses', '0018_auto_20171228_0948'),
    ]

    operations = [
        migrations.CreateModel(
            name='ThesisChooseHelpPage',
            fields=[
                ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
                ('impact', wagtail.core.fields.StreamField((('rawHtml', wagtail.core.blocks.RawHTMLBlock()), ('heading', wagtail.core.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.core.blocks.RichTextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('embed', wagtail.embeds.blocks.EmbedBlock())), blank=True, null=True)),
                ('career', wagtail.core.fields.StreamField((('rawHtml', wagtail.core.blocks.RawHTMLBlock()), ('heading', wagtail.core.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.core.blocks.RichTextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('embed', wagtail.embeds.blocks.EmbedBlock())), blank=True, null=True)),
                ('research', wagtail.core.fields.StreamField((('rawHtml', wagtail.core.blocks.RawHTMLBlock()), ('heading', wagtail.core.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.core.blocks.RichTextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('embed', wagtail.embeds.blocks.EmbedBlock())), blank=True, null=True)),
                ('body', wagtail.core.fields.StreamField((('rawHtml', wagtail.core.blocks.RawHTMLBlock()), ('heading', wagtail.core.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.core.blocks.RichTextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('embed', wagtail.embeds.blocks.EmbedBlock())), blank=True, null=True)),
            ],
            options={
                'abstract': False,
            },
            bases=('wagtailcore.page',),
        ),
github torchbox / wagtail-torchbox / tbx / core / migrations / 0021_auto_20160412_1508.py View on Github external
field=models.CharField(help_text='Link title', max_length=255),
        ),
        migrations.AlterField(
            model_name='servicespagerelatedlink',
            name='link_external',
            field=models.URLField(blank=True, verbose_name='External link'),
        ),
        migrations.AlterField(
            model_name='servicespagerelatedlink',
            name='title',
            field=models.CharField(help_text='Link title', max_length=255),
        ),
        migrations.AlterField(
            model_name='standardpage',
            name='streamfield',
            field=wagtail.core.fields.StreamField((('h2', wagtail.core.blocks.CharBlock(classname='title', icon='title')), ('h3', wagtail.core.blocks.CharBlock(classname='title', icon='title')), ('h4', wagtail.core.blocks.CharBlock(classname='title', icon='title')), ('intro', wagtail.core.blocks.RichTextBlock(icon='pilcrow')), ('paragraph', wagtail.core.blocks.RichTextBlock(icon='pilcrow')), ('aligned_image', wagtail.core.blocks.StructBlock((('image', wagtail.images.blocks.ImageChooserBlock()), ('alignment', tbx.core.blocks.ImageFormatChoiceBlock()), ('caption', wagtail.core.blocks.CharBlock()), ('attribution', wagtail.core.blocks.CharBlock(required=False))), label='Aligned image')), ('bustout', wagtail.core.blocks.StructBlock((('image', wagtail.images.blocks.ImageChooserBlock()), ('text', wagtail.core.blocks.RichTextBlock())))), ('pullquote', wagtail.core.blocks.StructBlock((('quote', wagtail.core.blocks.CharBlock(classname='quote title')), ('attribution', wagtail.core.blocks.CharBlock())))), ('raw_html', wagtail.core.blocks.RawHTMLBlock(icon='code', label='Raw HTML')), ('embed', wagtail.embeds.blocks.EmbedBlock(icon='code')))),
        ),
        migrations.AlterField(
            model_name='standardpageclients',
            name='link_external',
            field=models.URLField(blank=True, verbose_name='External link'),
        ),
        migrations.AlterField(
            model_name='standardpageclients',
            name='title',
            field=models.CharField(help_text='Link title', max_length=255),
        ),
        migrations.AlterField(
            model_name='standardpagerelatedlink',
            name='link_external',
            field=models.URLField(blank=True, verbose_name='External link'),
        ),
github thepoly / pipeline / articles / migrations / 0001_initial.py View on Github external
models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="wagtailcore.Page",
                    ),
                ),
                ("headline", wagtail.core.fields.RichTextField()),
                ("subdeck", wagtail.core.fields.RichTextField(blank=True, null=True)),
                (
                    "body",
                    wagtail.core.fields.StreamField(
                        [
                            ("paragraph", wagtail.core.blocks.RichTextBlock()),
                            ("image", wagtail.images.blocks.ImageChooserBlock()),
                        ]
                    ),
                ),
                (
                    "summary",
                    wagtail.core.fields.RichTextField(
                        blank=True,
                        help_text="Displayed on the home page or other places to provide a taste of what the article is about.",
                        null=True,
                    ),
                ),
            ],
            options={"abstract": False},
            bases=("wagtailcore.page",),
        ),
github mozilla / donate-wagtail / donate / core / blocks.py View on Github external
icon = 'title'
        template = 'blocks/heading_block.html'


class ImageBlock(blocks.StructBlock):
    image = ImageChooserBlock()
    caption = blocks.CharBlock(required=False)

    class Meta:
        icon = 'image'
        template = 'blocks/image_block.html'


class AccordionItem(blocks.StructBlock):
    title = blocks.CharBlock()
    content = blocks.RichTextBlock(features=['bold', 'italic', 'ol', 'ul', 'link'])


class AccordionBlock(blocks.StructBlock):
    title = blocks.CharBlock()
    items = blocks.StreamBlock([
        ('item', AccordionItem()),
    ])

    class Meta:
        template = 'blocks/accordion_block.html'


class ContentBlock(blocks.StreamBlock):
    heading = HeadingBlock()
    paragraph = blocks.RichTextBlock(features=['bold', 'italic', 'ol', 'ul', 'link'])
    image = ImageBlock()