Remove uneeded files and rename.

This commit is contained in:
Senén Rodero Rodríguez
2017-07-22 18:28:47 +02:00
committed by taitus
parent a188105910
commit fd9bec4d1f
5 changed files with 38 additions and 163 deletions

View File

@@ -11,7 +11,7 @@ class NotificationsController < ApplicationController
def show def show
@notification = current_user.notifications.find(params[:id]) @notification = current_user.notifications.find(params[:id])
redirect_to url_for(@notification.linkable_resource) redirect_to linkable_resource_path(@notification)
end end
def mark_all_as_read def mark_all_as_read
@@ -25,4 +25,13 @@ class NotificationsController < ApplicationController
@notification.mark_as_read @notification.mark_as_read
end end
def linkable_resource_path(notification)
case notification.linkable_resource.class.name
when "Budget::Investment"
budget_investment_path @notification.linkable_resource.budget, @notification.linkable_resource
else
url_for @notification.linkable_resource
end
end
end end

View File

@@ -1,138 +1,29 @@
<div class="row"> <div class="highlight small-12 column section-recommended">
<h2 class="text-center">Recomendaciones que te pueden interesar</h2> <div class="row">
<div class="small-12 medium-4 column text-center budgets">
<div class="card small-11 small-centered debates">
<h4>Debates recomendados</h4>
<div class="orbit" role="region" aria-label="Favorite Space Pictures" data-orbit="" data-use-m-u-i="false" data-resize="" id="" data-events="resize">
<div class="orbit-wrapper">
<ul class="orbit-container no-bullet" tabindex="0" >
<li class="orbit-slide no-motionui is-active is-in" data-slide="0" style="position: relative;" aria-live="polite">
<div class="card">
<img src="https://dummyimage.com/600x400/000/fff">
<div class="card-section">
<h5>Titulo debate 1 </h5>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>
</div>
</div>
</li>
<li class="orbit-slide no-motionui" data-slide="slide-1" style="position: relative; display: none;"> <h2 class="text-center"><%= t("welcome.recommended.title") %></h2>
<div class="card"> <div class="small-12 column carousel-image">
<img src="https://dummyimage.com/600x400/000/fff"> <%= render "recommended_carousel", recommendeds: recommended_debates,
<div class="card-section"> key: "debates",
<h5>Titulo debate 2</h5> image_field: nil,
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p> image_version: nil,
</div> image_default: "https://dummyimage.com/600x400/000/fff",
</div> klass: "large-offset-1" %>
</li>
<%= render "recommended_carousel", recommendeds: recommended_proposals,
key: "proposals",
image_field: nil,
image_version: nil,
image_default: "https://dummyimage.com/600x400/000/fff",
klass: "" %>
<%= render "recommended_carousel", recommendeds: recommended_budget_investments,
key: "budget-investments",
image_field: nil, #example value :image (PR#1691)
image_version: nil, #example value :thumb (PR#1691)
image_default: "https://dummyimage.com/600x400/000/fff",
klass: "end" %>
<li class="orbit-slide no-motionui" data-slide="slide-2" style="position: relative; display: none;">
<div class="card">
<img src="https://dummyimage.com/600x400/000/fff">
<div class="card-section">
<h5>Titulo debate 3</h5>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>
</div>
</div>
</li>
</ul>
</div>
<div class="orbit-controls">
<button class="orbit-previous" aria-label="previous" tabindex="0"><span class="show-for-sr">Previous Slide</span>◀</button>
<button class="orbit-next" aria-label="next" tabindex="0"><span class="show-for-sr">Next Slide</span>▶</button>
</div>
</div>
</div> </div>
</div> </div>
<div class="small-12 medium-4 column text-center">
<div class="card small-11 small-centered proposals">
<h4>Propuestas recomendadas</h4>
<div class="orbit" role="region" aria-label="Favorite Space Pictures" data-orbit="" data-use-m-u-i="false" data-resize="" id="" data-events="resize">
<div class="orbit-wrapper">
<ul class="orbit-container no-bullet" tabindex="0" >
<li class="orbit-slide no-motionui is-active is-in" data-slide="0" style="position: relative;" aria-live="polite">
<div class="card">
<img src="https://dummyimage.com/600x400/000/fff">
<div class="card-section">
<h5>Titulo propuesta 1</h5>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>
</div>
</div>
</li>
<li class="orbit-slide no-motionui" data-slide="slide-1" style="position: relative; display: none;">
<div class="card">
<img src="https://dummyimage.com/600x400/000/fff">
<div class="card-section">
<h5>Titulo propuesta 2</h5>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>
</div>
</div>
</li>
<li class="orbit-slide no-motionui" data-slide="slide-2" style="position: relative; display: none;">
<div class="card">
<img src="https://dummyimage.com/600x400/000/fff">
<div class="card-section">
<h5>Titulo propuesta 3</h5>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>
</div>
</div>
</li>
</ul>
</div>
<div class="orbit-controls">
<button class="orbit-previous" aria-label="previous" tabindex="0"><span class="show-for-sr">Previous Slide</span>◀</button>
<button class="orbit-next" aria-label="next" tabindex="0"><span class="show-for-sr">Next Slide</span>▶</button>
</div>
</div>
</div>
</div>
<div class="small-12 medium-4 column text-center">
<div class="card small-11 small-centered budget">
<h4>Presupuestos recomendados</h4>
<div class="orbit" role="region" aria-label="Favorite Space Pictures" data-orbit="" data-use-m-u-i="false" data-resize="" id="" data-events="resize">
<div class="orbit-wrapper">
<ul class="orbit-container no-bullet" tabindex="0" >
<li class="orbit-slide no-motionui is-active is-in" data-slide="0" style="position: relative;" aria-live="polite">
<div class="card">
<img src="https://dummyimage.com/600x400/000/fff">
<div class="card-section">
<h5>Titulo presupuesto 1 </h5>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>
</div>
</div>
</li>
<li class="orbit-slide no-motionui" data-slide="slide-1" style="position: relative; display: none;">
<div class="card">
<img src="https://dummyimage.com/600x400/000/fff">
<div class="card-section">
<h5>Titulo presupuesto 2</h5>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>
</div>
</div>
</li>
<li class="orbit-slide no-motionui" data-slide="slide-2" style="position: relative; display: none;">
<div class="card">
<img src="https://dummyimage.com/600x400/000/fff">
<div class="card-section">
<h5>Titulo presupuesto 3 </h5>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>
</div>
</div>
</li>
</ul>
</div>
<div class="orbit-controls">
<button class="orbit-previous" aria-label="previous" tabindex="0"><span class="show-for-sr">Previous Slide</span>◀</button>
<button class="orbit-next" aria-label="next" tabindex="0"><span class="show-for-sr">Next Slide</span>▶</button>
</div>
</div>
</div>
</div>
</div> </div>

View File

@@ -1,4 +1,4 @@
<div class="small-12 medium-4 column text-center <%= key %>"> <div class="small-12 medium-4 large-3 column text-center <%= key %> <%= klass if klass %> ">
<div class="card small-centered <%= key %>-inner"> <div class="card small-centered <%= key %>-inner">
<h4><%= t("welcome.recommended.#{key.underscore}.title") %></h4> <h4><%= t("welcome.recommended.#{key.underscore}.title") %></h4>

View File

@@ -1,25 +0,0 @@
<div class="highlight small-12 column section-recommended">
<div class="row">
<h2 class="text-center"><%= t("welcome.recommended.title") %></h2>
<%= render "recommended_carousel", recommendeds: recommended_debates,
key: "debates",
image_field: nil,
image_version: nil,
image_default: "https://dummyimage.com/600x400/000/fff" %>
<%= render "recommended_carousel", recommendeds: recommended_proposals,
key: "proposals",
image_field: nil,
image_version: nil,
image_default: "https://dummyimage.com/600x400/000/fff" %>
<%= render "recommended_carousel", recommendeds: recommended_budget_investments,
key: "budget-investments",
image_field: nil, #example value :image (PR#1691)
image_version: nil, #example value :thumb (PR#1691)
image_default: "https://dummyimage.com/600x400/000/fff" %>
</div>
</div>

View File

@@ -47,7 +47,7 @@
<% end %> <% end %>
<% if current_user.present? %> <% if current_user.present? %>
<%= render "recommended_no_image", recommended_debates: current_user.recommended_debates, <%= render "recommended", recommended_debates: current_user.recommended_debates,
recommended_proposals: current_user.recommended_proposals, recommended_proposals: current_user.recommended_proposals,
recommended_budget_investments: current_user.recommended_budget_investments %> recommended_budget_investments: current_user.recommended_budget_investments %>
<% end %> <% end %>