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

Upgrade to font-awesome 4 without breaking compatibility with older CKANs (FA 3) #51

Merged
merged 3 commits into from
May 23, 2017

Conversation

mattfullerton
Copy link
Contributor

No description provided.

@@ -2,7 +2,7 @@

{% block page_primary_action %}
{% if h.check_access('ckanext_pages_update', {}) %}
{% link_for _('Add Article'), controller='ckanext.pages.controller:PagesController', action='blog_edit', page='', class_='btn btn-primary', icon='plus-sign-alt' %}
{% link_for _('Add Article'), controller='ckanext.pages.controller:PagesController', action='blog_edit', page='', class_='btn btn-primary', icon='plus-square' %}
Copy link
Contributor

Choose a reason for hiding this comment

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

I can see how the changes of the classes in the HTML are backwards compatible (since they only add classes), but I'm not so sure about these changes here which replace the old icon name in the helper call. Wouldn't this break things on old CKAN versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

!! You're right, of course. Hmm. All I can say is those places where it happens are primary actions and will manifest as buttons on standard CKANs. Hence the icon is less critical than in other places where we lose the view of the link completely.

Copy link
Contributor

Choose a reason for hiding this comment

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

In that case I'd prefer to put these changes into version-dependent conditionals.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, see below

Copy link
Contributor

@torfsen torfsen left a comment

Choose a reason for hiding this comment

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

Great, @mattfullerton! I have one more little request (see comment), otherwise this looks good!

@@ -124,7 +134,8 @@ def get_helpers(self):
'build_nav_main': build_pages_nav_main,
'render_content': render_content,
'get_wysiwyg_editor': get_wysiwyg_editor,
'get_recent_blog_posts': get_recent_blog_posts
'get_recent_blog_posts': get_recent_blog_posts,
'get_plus_icon': get_plus_icon
Copy link
Contributor

Choose a reason for hiding this comment

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

The names of helper functions in extensions should include the extension name as a prefix to avoid name clashes. So this should be pages_get_plus_icon instead.

@torfsen torfsen merged commit 4d3e401 into ckan:master May 23, 2017
@torfsen
Copy link
Contributor

torfsen commented May 23, 2017

Thanks, @mattfullerton!

torfsen added a commit that referenced this pull request May 23, 2017
torfsen added a commit that referenced this pull request Oct 2, 2017
Some FA 4 icon names had already been added in #51, but others were
missed.
torfsen added a commit that referenced this pull request Oct 2, 2017
Some FA 4 icon names had already been added in #51, but others were
missed.
torfsen added a commit that referenced this pull request Oct 2, 2017
Some FA 4 icon names had already been added in #51, but others were
missed.
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.

2 participants