Skip to content

Commit

Permalink
Fixing header
Browse files Browse the repository at this point in the history
  • Loading branch information
html committed Mar 1, 2010
1 parent 83c5580 commit c58408a
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 34 deletions.
14 changes: 14 additions & 0 deletions app/views/index/_left.haml
@@ -0,0 +1,14 @@
- has_content_for_left_block = !@category.content.strip.empty? || !@answers.empty?
- if has_content_for_left_block
%td{ :valign => "top", :width => "25%" }
%table{ :cellspacing => "0", :border => "0", :width => "100%", :cellpadding => "0" }
- if !@category.content.strip.empty?
%tr
%td
%table.left1{ :cellspacing => "0", :width => "100%", :cellpadding => "0" }
%tr
%td.left2{ :align => "left" }
%i
= simple_format(h(@category.content))
= render :partial => 'answers'
= render :partial => 'gallery'
16 changes: 9 additions & 7 deletions app/views/index/_menu.haml
Expand Up @@ -8,13 +8,14 @@
%tr.menu3
- @menu_items.each do |item|
%td{ :class => (@category == item ? 'menu_aktv' : 'menu2'), :align => "center", :style => 'padding-top:5px'}
= link_to item.title, { :category => item.id }
= link_to item.title, { :action => :index, :category => item.id }
.fr
.search
.fl
%input.searchbar{ :name => "story", :type => "text", :value => "поиск по сайту"}
.fl
%input{ :name => "image", :src => "img/search.gif", :type => "image", :align => "left", :height => "25" }
- form_tag :action => :search, :controller => :index, :html => { :method => :get } do
.search
.fl
%input.searchbar{ :name => "q", :type => "text", :value => "поиск по сайту"}
.fl
%input{ :name => "image", :src => "/img/search.gif", :type => "image", :align => "left", :height => "25" }
%tr
%td.menu1{ :height => "28", :style => 'padding:7px' }
- if @pages.size > 1
Expand All @@ -31,6 +32,7 @@
$(this).val(searchtext);
}).blur(function(){
searchtext = $(this).val();
$(this).val('поиск по сайту');
if(!searchtext)
$(this).val('поиск по сайту');
});
});
11 changes: 11 additions & 0 deletions app/views/index/index.haml
@@ -0,0 +1,11 @@
- case @pages.size
- when 0
%p
Создайте страницу
- when 1
= @pages.first.content
- else
- if defined?(@page)
= @page.content
- else
= render :partial => 'items'
33 changes: 7 additions & 26 deletions app/views/layouts/application.haml
Expand Up @@ -12,43 +12,24 @@
%table.main{ :cellspacing => "0", :border => "0", :align => "center", :width => "1000", :cellpadding => "0", :style => "margin:0 auto" }
%tr
%td{ :valign => "top" }
%img{ :src => "images/header.png", :height => "259", :width => "1000" }
%img{ :src => "/images/header.jpg", :height => "259", :width => "1000" }
%tr
%td.menu
= render :partial => 'menu'
%tr
%td
- has_content_for_left_block = !@category.content.strip.empty? || !@answers.empty?
%table.content{ :cellspacing => "0", :border => "0", :width => "100%", :cellpadding => "0", :style => (@pages.size > 1 && !defined?(@page) ? 'padding-top: 0;' : '') }
%tr
- if has_content_for_left_block
%td{ :valign => "top", :width => "25%" }
%table{ :cellspacing => "0", :border => "0", :width => "100%", :cellpadding => "0" }
- if !@category.content.strip.empty?
%tr
%td
%table.left1{ :cellspacing => "0", :width => "100%", :cellpadding => "0" }
%tr
%td.left2{ :align => "left" }
%i
= simple_format(h(@category.content))
= render :partial => 'answers'
= render :partial => 'gallery'
- if defined?(@category) && defined?(@answers)
- has_content_for_left_block = !@category.content.strip.empty? || !@answers.empty?
= render :partial => 'left', :locals => { :has_content_for_left_block => has_content_for_left_block}
- else
- has_content_for_left_block = false
%td{ :valign => "top", :style => (!has_content_for_left_block ? '' : "padding-left:10px;") }
%table{:class => (@pages.size > 1 && !defined?(@page) ? '' : 'content1'), :cellspacing => "0", :width => "100%", :cellpadding => "0" }
%tr
%td
- case @pages.size
- when 0
%p
Создайте страницу
- when 1
= @pages.first.content
- else
- if defined?(@page)
= @page.content
- else
= render :partial => 'items'
= yield
%tr
%td{ :style => "padding-top:10px;" }
%table{ :cellspacing => "0", :border => "0", :width => "100%", :cellpadding => "0" }
Expand Down
Binary file added public/images/header.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/images/header.png
Binary file not shown.
2 changes: 1 addition & 1 deletion public/stylesheets/style.css
Expand Up @@ -29,7 +29,7 @@ hr {
}
.menu {
padding-top:15px;
background-color:#3095e5;
background-color: white;
}
.menu1 {
background-image:url(/img/menu1.png);
Expand Down

0 comments on commit c58408a

Please sign in to comment.