Commit 4edc9cf26e81b96e2b9639a1f8d00653cdbb560a

Authored by AurelioAHeckert
1 parent d6be7e30

ActionItem152: load the controller's css

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1249 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/views/layouts/application.rhtml
... ... @@ -18,6 +18,11 @@
18 18 <%= stylesheet_link_tag 'blocks' %>
19 19 <%= stylesheet_link_tag 'forms' %>
20 20 <%= stylesheet_link_tag 'login-box' %>
  21 + <%=
  22 + # Load the controller's css file if it exists:
  23 + css = "controller_"+ @controller.controller_name() +".css"
  24 + stylesheet_link_tag( css ) if File.exists?( "public/stylesheets/"+css )
  25 + %>
21 26  
22 27 <%# FIXME %>
23 28 <%= stylesheet_link_tag '/designs/templates/default/stylesheets/style.css' %>
... ... @@ -32,7 +37,11 @@
32 37 <% end %>
33 38 </head>
34 39  
35   - <body class='noosfero category<%= category_color %>' onload='noosfero_init();'>
  40 + <body class='noosfero category<%= category_color %><%=
  41 + # Identify the current controller and action for the CSS:
  42 + " controller_"+ @controller.controller_name() +
  43 + " action_"+ @controller.controller_name() +"_"+ @controller.action_name()
  44 + %>' onload='noosfero_init();'>
36 45  
37 46 <% unless flash[:notice].nil? %>
38 47 <div id='notice' onclick="Element.hide('notice');">
... ...
app/views/profile_editor/index.rhtml
1   -<h2><%= _('My profile') %></h2>
  1 +<h1><%= _('My profile') %></h1>
2 2  
3 3 <%= link_to (@profile.image ? image_tag( @profile.image.public_filename) : _('Put image')), :action => 'change_image' %>
4 4  
... ...
app/views/profile_editor/person_info.rhtml
1   -<h2><%= _('Edit person info') %></h2>
  1 +<h1><%= _('Edit person info') %></h1>
2 2  
3 3 <% labelled_form_for :info, @info do |f| %>
4 4  
... ...