Commit 4edc9cf26e81b96e2b9639a1f8d00653cdbb560a
1 parent
d6be7e30
Exists in
master
and in
29 other branches
ActionItem152: load the controller's css
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1249 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
3 changed files
with
12 additions
and
3 deletions
Show diff stats
app/views/layouts/application.rhtml
@@ -18,6 +18,11 @@ | @@ -18,6 +18,11 @@ | ||
18 | <%= stylesheet_link_tag 'blocks' %> | 18 | <%= stylesheet_link_tag 'blocks' %> |
19 | <%= stylesheet_link_tag 'forms' %> | 19 | <%= stylesheet_link_tag 'forms' %> |
20 | <%= stylesheet_link_tag 'login-box' %> | 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 | <%# FIXME %> | 27 | <%# FIXME %> |
23 | <%= stylesheet_link_tag '/designs/templates/default/stylesheets/style.css' %> | 28 | <%= stylesheet_link_tag '/designs/templates/default/stylesheets/style.css' %> |
@@ -32,7 +37,11 @@ | @@ -32,7 +37,11 @@ | ||
32 | <% end %> | 37 | <% end %> |
33 | </head> | 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 | <% unless flash[:notice].nil? %> | 46 | <% unless flash[:notice].nil? %> |
38 | <div id='notice' onclick="Element.hide('notice');"> | 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 | <%= link_to (@profile.image ? image_tag( @profile.image.public_filename) : _('Put image')), :action => 'change_image' %> | 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