Merge pull request #157 from AyuntamientoMadrid/tags

Adds styles for tag cloud
This commit is contained in:
Enrique García
2015-08-13 12:24:32 +02:00
4 changed files with 17 additions and 7 deletions

View File

@@ -310,7 +310,7 @@ footer {
&:hover {
color: $link;
cursor: pointer;
background: #e5f1f8;
background: $tags-bg-hover;
border: 1px solid $brand;
}
}
@@ -328,6 +328,17 @@ footer {
a {
padding: $line-height/4 $line-height/3;
.label {
color: white;
}
&:hover {
.label {
background: $brand;
}
}
}
}

View File

@@ -30,6 +30,7 @@ $link: #2895F1;
$link-hover: #2178BF;
$tags-bg: #FAFAFA;
$tags-bg-hover: #E5F1F8;
$tags-border: #F0F0F0;
$tags-color: #8F8F8F;

View File

@@ -1,6 +1,6 @@
<div id="tag-cloud" class="tag-cloud">
<h3><%= t("shared.tags_cloud.tags") %></h3>
<% tag_cloud Debate.tag_counts, %w[s m l] do |tag, css_class| %>
<%= link_to sanitize("#{tag.name}(#{tag.taggings_count})"), debates_path(tag: tag.name), class: css_class %>
<%= link_to sanitize("#{tag.name} <span class='label round info'>#{tag.taggings_count}</span>"), debates_path(tag: tag.name), class: css_class %>
<% end %>
</div>

View File

@@ -51,11 +51,9 @@ feature 'Tags' do
visit debates_path
within "#tag-cloud" do
expect(page).to have_css(".s", text: "Medio Ambiente(1)")
expect(page).to have_css(".m", text: "Corrupción(5)")
expect(page).to have_css(".l", text: "Economía(10)")
end
within(:css, "#tag-cloud .s") { expect(page).to have_content('Medio Ambiente 1') }
within(:css, "#tag-cloud .m") { expect(page).to have_content('Corrupción 5') }
within(:css, "#tag-cloud .l") { expect(page).to have_content('Economía 10') }
end
scenario 'Create' do