Skip to content

Commit

Permalink
Quick: Polish Existing Plugins (cherry-picked from GH-93, new message)
Browse files Browse the repository at this point in the history
From b510c75 "GH-93: Polish Existing Plugins" on `task/GH-93…` or `dev` branch
  • Loading branch information
wesleyboar committed Jul 13, 2021
1 parent e44356b commit 4ea2e1c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
3 changes: 2 additions & 1 deletion taccsite_cms/contrib/taccsite_blockquote/cms_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ class TaccsiteBlockquotePlugin(CMSPluginBase):
name = _('Blockquote')
render_template = 'blockquote.html'

cache = False
cache = True
text_enabled = True
allow_children = False

fieldsets = [
(None, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<figure {{ instance.attributes_str }}>
<figure {# class="s-blockquote" #}{{ instance.attributes_str }}>
<blockquote cite="{{ instance.cite_url }}">
<p>{{ instance.text }}</p>
</blockquote>
Expand Down
2 changes: 1 addition & 1 deletion taccsite_cms/contrib/taccsite_offset/cms_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TaccsiteOffsetPlugin(CMSPluginBase):
name = _('Offset Content')
render_template = 'offset.html'

cache = False
cache = True
text_enabled = False
allow_children = True

Expand Down
8 changes: 4 additions & 4 deletions taccsite_cms/contrib/taccsite_offset/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@

# Helpers

def get_direction_classname(offset):
"""Get offset content class based on standard offset value."""
def get_direction_classname(value):
"""Get direction class based on value."""

# HELP: Should we limit input by coupling this map to DIRECTION_CHOICES?
# TODO: Couple this map to DIRECTION_CHOICES
switcher = {
'right': 'o-offset-content--right',
'left': 'o-offset-content--left'
}

return switcher.get(offset, '')
return switcher.get(value, '')



Expand Down
6 changes: 3 additions & 3 deletions taccsite_cms/contrib/taccsite_offset/templates/offset.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% load cms_tags %}

<aside {{ instance.attributes_str }}>
{% for plugin in instance.child_plugin_instances %}
{% render_plugin plugin %}
<aside {# class="o-offset-content--..." #}{{ instance.attributes_str }}>
{% for plugin_instance in instance.child_plugin_instances %}
{% render_plugin plugin_instance %}
{% endfor %}
</aside>
1 change: 1 addition & 0 deletions taccsite_cms/contrib/taccsite_sample/cms_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class TaccsiteSamplePlugin(CMSPluginBase):

cache = False
text_enabled = True
allow_children = False
# NOTE: Use case is unclear
# admin_preview = True
# NOTE: To change for all TACC plugins add taccsite_cms/templates/admin/...
Expand Down

0 comments on commit 4ea2e1c

Please sign in to comment.