404 i zmiana strony glownej
This commit is contained in:
parent
d670e38b40
commit
5e7b304359
|
|
@ -6,7 +6,10 @@ class SiteController < ApplicationController
|
||||||
|
|
||||||
def show
|
def show
|
||||||
pages_get
|
pages_get
|
||||||
@page = PublishedPage.friendly.find(params[:id])
|
@page = PublishedPage.where('id = ? OR slug = ?',params[:id],params[:id]).first
|
||||||
|
if @page.blank?
|
||||||
|
redirect_to '/404.html'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def kontakt
|
def kontakt
|
||||||
|
|
@ -16,12 +19,18 @@ class SiteController < ApplicationController
|
||||||
def preview
|
def preview
|
||||||
pages_get
|
pages_get
|
||||||
if params[:id]
|
if params[:id]
|
||||||
@page = AllPage.friendly.find(params[:id])
|
@page = AllPage.where('id = ? OR slug = ?',params[:id],params[:id]).first
|
||||||
else
|
end
|
||||||
@page = AllPage.first
|
if @page.blank?
|
||||||
|
redirect_to '/404.html'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def send_email
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def pages_get
|
def pages_get
|
||||||
@pages = PublishedPage.where('type_of != 3').order('priority ASC')
|
@pages = PublishedPage.where('type_of != 3').order('priority ASC')
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,10 @@ module ApplicationHelper
|
||||||
ret += '<ul class="navbar-nav ml-auto">'
|
ret += '<ul class="navbar-nav ml-auto">'
|
||||||
friendly_id = nil
|
friendly_id = nil
|
||||||
if params[:id]
|
if params[:id]
|
||||||
pp = PublishedPage.friendly.find(params[:id])
|
if pp = PublishedPage.where('id = ? OR slug = ?',params[:id],params[:id]).first
|
||||||
friendly_id = pp.type_of == 3 ? pp.article_friendly : params[:id]
|
friendly_id = pp.type_of == 3 ? pp.article_friendly : params[:id]
|
||||||
end
|
end
|
||||||
|
end
|
||||||
for page in pages
|
for page in pages
|
||||||
ret += '<li class="nav-item">'
|
ret += '<li class="nav-item">'
|
||||||
if !friendly_id.blank?
|
if !friendly_id.blank?
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1 @@
|
||||||
<h1>Home#index in admin</h1>
|
<p>ToDo - Zmiana hasła, do logowania</p>
|
||||||
<%= current_admin.email %>
|
|
||||||
<p>Find me in app/views/home/index.html.erb</p>
|
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,9 @@
|
||||||
<h1 class="text-uppercase">
|
<h1 class="text-uppercase">
|
||||||
<strong style="display:none" id="line2">Pieniądze są najważniejsze</strong>
|
<strong style="display:none" id="line2">Pieniądze są najważniejsze</strong>
|
||||||
</h1>
|
</h1>
|
||||||
<hr class="mini" style="visibility:hidden" id="line3">
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-8 mx-auto" >
|
<div class="col-lg-8 mx-auto" >
|
||||||
<p class="text-faded mb-5" style="visibility:hidden" id="line4">czyli dlaczego warto ubezpieczać należności</p>
|
<h3 class="text-faded mb-5" style="visibility:hidden" id="line4"><strong>czyli dlaczego warto ubezpieczać należności</strong></h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -20,7 +19,7 @@
|
||||||
$( document ).ready(function() {
|
$( document ).ready(function() {
|
||||||
$('#line1').fadeIn(2000, function() {
|
$('#line1').fadeIn(2000, function() {
|
||||||
$('#line2').fadeIn(2000, function() {
|
$('#line2').fadeIn(2000, function() {
|
||||||
$('#line3').css("visibility","visible");
|
//$('#line3').css("visibility","visible");
|
||||||
$('#line4').css("visibility","visible");
|
$('#line4').css("visibility","visible");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue