Skip to content

Commit

Permalink
Squashed merge of site/frontera/task/GH-75-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyboar committed Aug 17, 2021
1 parent f50b6ac commit ff0855a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion taccsite_cms/contrib/taccsite_data_list/cms_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class TaccsiteDataListItemPlugin(CMSPluginBase):
plugin_name='Link'
) + '\
<br />\
The "Link" plugin\'s "Display name" field takes precedence over this plugin\'s "Label" field. <small>If "Link" pluign is not rendered, then check "Advanced settings" of this plugin.</small>',
The "Link" plugin\'s "Display name" field takes precedence over this plugin\'s "Label" field. <small>If "Link" plugin is not rendered, then check "Advanced settings" of this plugin.</small>',
'fields': (),
}),
(_('Advanced settings'), {
Expand Down
14 changes: 11 additions & 3 deletions taccsite_cms/contrib/taccsite_data_list/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@



# Helpers

def get_short_description(dict, value):
"""Get layout class based on value."""
return dict.get(value, {}).get('short_description')



# Constants

ORIENTATION_CHOICES = get_choices(ORIENTATION_DICT)
Expand Down Expand Up @@ -55,9 +63,9 @@ class TaccsiteDataList(CMSPlugin):
attributes = fields.AttributesField()

def get_short_description(self):
orientation = ORIENTATION_DICT[self.orientation]['short_description']
type_style = TYPE_STYLE_DICT[self.type_style]['short_description']
density = DENSITY_DICT[self.density]['short_description']
orientation = get_short_description(ORIENTATION_DICT, self.orientation)
type_style = get_short_description(TYPE_STYLE_DICT, self.type_style)
density = get_short_description(DENSITY_DICT, self.density)

return density + ', ' + orientation + ' ' + type_style

Expand Down

0 comments on commit ff0855a

Please sign in to comment.