added link to blog and removed <center> tag cause it's haraam
[shapado:piglops-shapado.git] / app / views / layouts / application.html.haml
1 !!! Strict
2 %html{ "xml:lang" => I18n.locale, :lang => I18n.locale, :xmlns => "http://www.w3.org/1999/xhtml" }
3   %head
4     %meta{ :content => "text/html; charset=utf-8", "http-equiv" => "Content-Type" }
5     %title
6       Shapado - Questions & Answers
7     %meta{ :name => "description", :content => "" }
8     %meta{ :name => "keywords", :content => "" }
9     %link{:rel=>"icon", :type=>"image/png", :href=>"/favicon.ico"}
10     -if @feed_urls && !@feed_urls.empty?
11       -@feed_urls.each do |title, url|
12         %link{:rel=>"alternate", :type=>"application/atom+xml", :title => h(title), :href=> url}
13
14     = javascript_include_tag "jquery", "jquery-ui", "showdown", "jquery.textarea", "application"
15     = javascript_include_tag 'jquery.droppy'
16     = javascript_include_tag 'modules/sessions.js'
17     = javascript_include_tag 'modules/show_question.js'
18     = javascript_include_tag 'openid/js/jquery.openid.min.js'
19     = javascript_include_tag 'jquery.notifyBar.js'
20     = yield :js
21
22     = stylesheet_link_tag 'compiled/grid.css', :media => 'screen, projection'
23     = stylesheet_link_tag 'compiled/application.css', :media => 'screen, projection'
24     = stylesheet_link_tag 'compiled/markdown_editor.css', :media => 'screen, projection'
25     = stylesheet_link_tag 'compiled/components/droppy.css', :media => 'screen, projection'
26     = stylesheet_link_tag '/javascripts/openid/css/style.css', :media => 'screen, projection'
27     = yield :css
28
29   %body
30     .two-column
31       -if !AppConfig.system_notice.blank?
32         #system-msg
33           .internal
34             = AppConfig.system_notice
35       #header
36         #logo
37           %a{:href => root_path}
38             =image_tag "logo.png", :height => "45", :alt => "Shapado"
39           %ul#menu_logo
40             %li
41               = link_to "FAQ", questions_path(:tags => "faq")
42             %li
43               -if @category
44                 = link_to category_desc(@category), ""
45               -else
46                 = link_to t("views.layout.categories"), "/"
47               %ul
48                 -category_options.each do |desc, value|
49                   %li
50                     = link_to(desc, subdomain_url(value))
51             %li
52               -if @languages && !@languages.empty?
53                 = link_to language_desc(@languages.first), ""
54               -else
55                 = link_to t("views.layout.languages"), "/"
56               %ul
57                 -if logged_in?
58                   -languages_options(current_user.preferred_languages).each do |desc, value|
59                     %li
60                       = link_to desc, subdomain_url(value)
61                 -else
62                   -languages_options.each do |desc, value|
63                     %li
64                       = link_to desc, tag_url(value)
65             -if !logged_in?
66               = link_to 'Get the facts!', "/facts#facts"
67
68         #user-actions
69           #user-nav
70             -if logged_in?
71               .box.right{:style => "width: 55%;"}
72                 .gravatar.left{:style => "margin: 2px;"}
73                   = gravatar current_user.email.to_s
74                 .row1
75                   = link_to h(current_user.login), user_path(current_user)
76                   %span{:style => "font-size: 12px; font-weight: bold"}
77                     == (#{current_user.reputation.to_i})
78                   .right
79                     =link_to I18n.t('views.layout.settings'), settings_path
80                     |
81                     =link_to I18n.t('views.layout.logout'), logout_path
82                 .row2{:style => "padding: 7px"}
83                   -form_tag search_path, :class => "form", :method => :get do
84                     = text_field_tag 'q', params[:q], :class => "text-field", :style => "width: 55%"
85                     %button{:type => "submit"}
86                       = I18n.t('views.layout.search', :default => "Go")
87       .clear
88       %br
89       #navigation{:class => "#{@active_tab}"}
90         #menu_primary
91           %ul
92             %li.questions
93               =link_to I18n.t("views.layout.questions"), questions_path
94             %li.tags
95               =link_to I18n.t("views.layout.tags"), tags_questions_path
96             %li.users
97               =link_to I18n.t("views.layout.users"), users_path
98             %li.unanswered
99               =link_to I18n.t("views.layout.unanswered"), unanswered_questions_path
100             -if logged_in?
101               -if current_user.moderator?
102                 %li.moderate
103                   =link_to I18n.t("views.layout.moderate"), moderate_path, :style => "background: #E55353; color: #fff"
104               -current_user.preferred_tags.each do |tag|
105                 %li{:class => (@active_tag == "tag_#{tag}" ? 'selected' : '' ) }
106                   =link_to h(tag), questions_path(:tags => tag)
107             %li.ask_question
108               =link_to I18n.t("views.layout.ask_question"), new_question_path, :rel => 'nofollow'
109       #main-content
110         #messages
111           -flash.each do |k,v|
112             .message{:class => k.to_s}
113               .internal.markdown
114                 = markdown(v)
115         #layout
116           #content
117             .internal
118               -if !logged_in?
119                 .box.highlight
120                   = t("views.layout.openid.explaination")
121
122                   -form_tag session_path, :id => 'openid' do
123                     &nbsp;
124               %br
125               = yield
126           #sidebar
127             .internal
128               .questions_count
129                 -if @questions
130                   -if @question.respond_to?(:total_entries)
131                     = number_with_delimiter(@questions.total_entries)
132                   -else
133                     = number_with_delimiter(@questions.size)
134                 -else
135                   = number_with_delimiter(Question.count(language_conditions))
136               %p
137                 = t "views.layout.questions"
138               = yield :sidebar
139               = render :partial => "shared/adbard"
140
141               %br
142               -if @feed_urls && !@feed_urls.empty?
143                 -@feed_urls.each do |title, url|
144                   %a.feed_url{:href => url}
145                     %span.icon
146                       =image_tag "atom.png"
147                     %span.text
148                       = h(title)
149                   .clear
150                   %br
151       #footer
152         %hr
153         %div
154           %p
155             = link_to AppConfig.site, AppConfig.site
156             is a multi-topic and multi-language question-and-answer website service brought to you by #{link_to "Ricodigo.com", "http://ricodigo.com"}. It runs the #{link_to 'Shapado', 'http://gitorious.org/shapado'} question-and-answer software, version 0.1, available under the #{link_to 'GNU Affero General Public License','http://www.fsf.org/licensing/licenses/agpl-3.0.html'}.
157         #cc.center
158           = image_tag('/images/ccby.png')
159           == All Shapado.com content and data are available under the #{link_to 'Creative Commons Attribution 3.0 license', 'http://creativecommons.org/licenses/by/3.0/'}
160         #blog.center
161           = link_to 'Our Blog', 'http://blog.ricodigo.com/shapado'
162       = render :partial => "shared/googlean"
163       .clear
164
165