Skip to content

Commit

Permalink
fix whitespace problems in templates
Browse files Browse the repository at this point in the history
unfortunately {% spaceless %} does not remove whitespace inside attribute values
  • Loading branch information
stefanfoulis committed Jul 27, 2012
1 parent 04ab14e commit 42f1a49
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 52 deletions.
35 changes: 13 additions & 22 deletions cmsplugin_facebook/templates/cmsplugin_facebook/likebox.html
@@ -1,35 +1,26 @@
{% comment %}
<!-- Example from Facebook website: -->
<!--
<!--
<iframe src="http://www.facebook.com/plugins/likebox.php?
href=http%3A%2F%2Fwww.facebook.com%2Fplatform&amp;width=292&amp;
colorscheme=light&amp;connections=10&amp;
stream=true&amp;
header=true&amp;
height=587"
scrolling="no"
frameborder="0"
style="border:none;
overflow:hidden;
width:292px;
height:587px;"
height=587"
scrolling="no"
frameborder="0"
style="border:none;
overflow:hidden;
width:292px;
height:587px;"
allowTransparency="true">
</iframe> -->
{% endcomment %}
{% spaceless %}
<iframe src="http://www.facebook.com/plugins/likebox.php?
href={% autoescape on %}{{ instance.pageurl }}{% endautoescape %}&amp;
width={% if instance.width %}{{ instance.width }}{% else %}{{ width|default:295 }}{% endif %}&amp;
connections={{ instance.connections }}&amp;
stream={% if instance.stream %}true{% else %}false{% endif %}&amp;
header={% if instance.header %}true{% else %}false{% endif %}&amp;
height={{ instance.height }}"
scrolling="no"
frameborder="0"
style="border:none;
overflow:hidden;
width:{% if instance.width %}{{ instance.width }}{% else %}{{ width|default:295 }}{% endif %}px;
height:{{ instance.height }}px;"
allowTransparency="{{instance.transparent}}">
<iframe src="http://www.facebook.com/plugins/likebox.php?href={% autoescape on %}{{ instance.pageurl }}{% endautoescape %}&amp;width={% if instance.width %}{{ instance.width }}{% else %}{{ width|default:295 }}{% endif %}&amp;connections={{ instance.connections }}&amp;stream={% if instance.stream %}true{% else %}false{% endif %}&amp;header={% if instance.header %}true{% else %}false{% endif %}&amp;height={{ instance.height }}"
scrolling="no"
frameborder="0"
style="border:none;overflow:hidden;width:{% if instance.width %}{{ instance.width }}{% else %}{{ width|default:295 }}{% endif %}px;height:{{ instance.height }}px;"
allowTransparency="{{instance.transparent}}">
</iframe>
{%endspaceless%}
28 changes: 10 additions & 18 deletions cmsplugin_facebook/templates/cmsplugin_facebook/likebutton.html
@@ -1,31 +1,23 @@
{% comment %}
<!-- Example from Facebook -->
<!--
<!--
<iframe src="http://www.facebook.com/plugins/like.php?
href=http%3A%2F%2Fwww.facebook.com%2Fbarackobama&amp;
layout=standard&amp;
show_faces=true&amp;
width=450&amp;
action=like&amp;
height=80"
scrolling="no"
frameborder="0"
style="border:none; overflow:hidden; width:450px; height:80px;"
scrolling="no"
frameborder="0"
style="border:none; overflow:hidden; width:450px; height:80px;"
allowTransparency="true">
</iframe> -->
{% endcomment %}
{% spaceless%}
<iframe src="http://www.facebook.com/plugins/like.php?
href={% autoescape on %}{{ instance.pageurl }}{% endautoescape %}&amp;
layout={% if instance.layout %}{{instance.layout}}{% endif %}&amp;
show_faces={{instance.show_faces}}&amp;
width={% if instance.width %}{{ instance.width }}{% else %}{{ width|default:295 }}&amp;{% endif %}
height={{ instance.height }}
action=like&amp;
colorscheme=light&amp;"
scrolling="no"
frameborder="0"
style="border:none;overflow:hidden; width:{% if instance.width %}{{ instance.width }}{% else %}{{ width|default:295 }}{% endif %}px; height:{{ instance.height }}px;"
allowTransparency="true">
{% spaceless %}
<iframe src="http://www.facebook.com/plugins/like.php?href={% autoescape on %}{{ instance.pageurl }}{% endautoescape %}&amp;layout={% if instance.layout %}{{instance.layout}}{% endif %}&amp;show_faces={{instance.show_faces}}&amp;width={% if instance.width %}{{ instance.width }}{% else %}{{ width|default:295 }}{% endif %}&amp;height={{ instance.height }}&amp;action=like&amp;colorscheme=light"
frameborder="0"
style="border:none;overflow:hidden; width:{% if instance.width %}{{ instance.width }}{% else %}{{ width|default:295 }}{% endif %}px; height:{{ instance.height }}px;"
allowTransparency="true">
</iframe>
{% endspaceless%}
{% endspaceless%}
18 changes: 6 additions & 12 deletions cmsplugin_facebook/templates/cmsplugin_facebook/sharebutton.html
@@ -1,20 +1,14 @@
{% comment %}
<!-- Example from Facebook -->
<!-- <a
name="fb_share"
<!-- <a
name="fb_share"
type="button" # Can be button, button_count or box_count (box_count is above, button_count is inline)
href="http://www.facebook.com/sharer.php">Share</a>
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
-->
{{ instance.style }} can be "button", "button_count" or "box_count" (box_count is above, button_count is inline)
{% endcomment %}
{% spaceless %}
<a
name="fb_share"
type="{{ instance.style }}" # Can be button, button_count or box_count (box_count is above, button_count is inline)
href="http://www.facebook.com/sharer.php"
{% if instance.share_url %}
share_url="{{instance.share_url}}"
{% endif %}>{{instance.button_text}}</a>
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>

<a name="fb_share" type="{{ instance.style }}" href="http://www.facebook.com/sharer.php"{% if instance.share_url %} share_url="{{ instance.share_url }}"{% endif %}>{{ instance.button_text }}</a>
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
{% endspaceless %}

0 comments on commit 42f1a49

Please sign in to comment.