Commit 976dd94af6711f99fd2143a03a1f4317f60c68c1

Authored by AurelioAHeckert
1 parent fc5d7084

ActionItem152: assets menu e outras coisinhas...

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1260 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/helpers/application_helper.rb
... ... @@ -10,6 +10,8 @@ module ApplicationHelper
10 10  
11 11 include FormsHelper
12 12  
  13 + include AssetsHelper
  14 +
13 15 # Displays context help. You can pass the content of the help message as the
14 16 # first parameter or using template code inside a block passed to this
15 17 # method. *Note*: the block is ignored if <tt>content</tt> is not
... ...
app/helpers/assets_helper.rb 0 → 100644
... ... @@ -0,0 +1,15 @@
  1 +module AssetsHelper
  2 +
  3 + def generate_assets_menu()
  4 + '
  5 + <li><a href="#"><span class="ico-menu-blog"></span> Blogs</a></li>
  6 + <li><a href="#"><span class="ico-menu-album"></span> Albuns</a></li>
  7 + <li><a href="#"><span class="ico-menu-product"></span> Produtos</a></li>
  8 + <li><a href="#"><span class="ico-menu-enterprise"></span> Empreendimentos</a></li>
  9 + <li><a href="#"><span class="ico-menu-"></span> bli 5</a></li>
  10 + <li><a href="#"><span class="ico-menu-"></span> bli 6</a></li>
  11 + <li><a href="#"><span class="ico-menu-"></span> bli 7</a></li>
  12 + '
  13 + end
  14 +
  15 +end
... ...
app/helpers/boxes_helper.rb
... ... @@ -20,7 +20,7 @@ module BoxesHelper
20 20  
21 21 def display_boxes(holder, main_content)
22 22 boxes = holder.boxes.first(holder.boxes_limit)
23   - content = boxes.map { |item| display_box(item, main_content) }.join("\n")
  23 + content = boxes.reverse.map { |item| display_box(item, main_content) }.join("\n")
24 24 content = main_content if (content.blank?)
25 25 content_tag('div', content, :class => 'boxes', :id => 'boxes' )
26 26 end
... ...
app/views/box_organizer/index.rhtml
1   -<h2><%= _('Organizing visual design')%></h2>
  1 +<h1><%= _('Organizing visual design')%></h1>
2 2  
3 3 <% button_bar do %>
4 4 <%= lightbox_button('add', _('Add a block'), { :action => 'add_block' }) %>
... ...
app/views/shared/categories_menu.rhtml
1   -<ul id='cat_menu'>
  1 +<ul id="cat_menu">
2 2 <%= link_to( "<span>"+ @environment.name() +"</span>", {:controller=>"home"}, :id=>"menu_link_to_envhome", :title=>@environment.name) %>
3 3 <% @environment.display_categories.each do |item| %>
4   - <li id='category<%= item.display_color %>'<%= ' class="active"' if (@category && (@category.top_ancestor == item)) %>>
  4 + <li id="category<%= item.display_color %>"<%= ' class="active"' if (@category && (@category.top_ancestor == item)) %>>
5 5 <%= item.name %>
6 6 <ul>
7 7 <% item.children.each do |child| %>
... ... @@ -10,4 +10,15 @@
10 10 </ul>
11 11 </li>
12 12 <% end %>
13   -</ul>
  13 +</ul><!-- fim id="cat_menu" -->
  14 +
  15 +<div id="assets_menu">
  16 + <div id="assets_menu_list">
  17 + <ul id="assets_menu_ul">
  18 + <%= generate_assets_menu %>
  19 + </ul>
  20 + </div><!-- fim id="assets_menu_list" -->
  21 + <div id="assets_menu_layout_iten"></div>
  22 +</div><!-- fim id="assets_menu" -->
  23 +<%= javascript_include_tag 'assets-menu' %>
  24 +
... ...
public/designs/icons/default/album-HC.gif 0 → 100644

98 Bytes

public/designs/icons/default/blog-HC.gif 0 → 100644

139 Bytes

public/designs/icons/default/enterprise-HC.gif 0 → 100644

156 Bytes

public/designs/icons/default/menu-without-ico-HC.gif 0 → 100644

95 Bytes

public/designs/icons/default/product-HC.gif 0 → 100644

130 Bytes

public/designs/icons/default/style.css
... ... @@ -19,4 +19,8 @@
19 19 .icon-search { background-image: url(gnome-search.png); }
20 20 .icon-ok { background-image: url(gtk-ok.png); }
21 21 .icon-login { background-image: url(key-HC.gif); }
22   -
  22 +.ico-menu- { background-image: url(menu-without-ico-HC.gif) }
  23 +.ico-menu-blog { background-image: url(blog-HC.gif); }
  24 +.ico-menu-album { background-image: url(album-HC.gif); }
  25 +.ico-menu-product { background-image: url(product-HC.gif); }
  26 +.ico-menu-enterprise { background-image: url(enterprise-HC.gif); }
... ...
public/designs/templates/default/stylesheets/style.css
... ... @@ -9,17 +9,12 @@
9 9 }
10 10  
11 11 .box-2 {
12   - position: absolute;
13   - top: 0px;
14   - left: 0px;
  12 + float: left;
15 13 width: 270px;
16   - margin-left: 10px;
17 14 }
18 15  
19 16 .box-3 {
20   - position: absolute;
21   - top: 0px;
22   - right: 10px;
  17 + float: right;
23 18 width: 200px;
24 19 }
25 20  
... ...
public/img-source/assets-menu.xcf 0 → 100644
No preview for this file type
public/javascripts/assets-menu.js 0 → 100644
... ... @@ -0,0 +1,36 @@
  1 +
  2 +var amul = document.getElementById( "assets_menu_ul" );
  3 +amul.h = 56;
  4 +amul.minSize = 56;
  5 +amul.maxSize = amul.getElementsByTagName("li").length * 19;
  6 +window.amul = amul;
  7 +
  8 +amul.onmouseover = function () {
  9 + clearTimeout( this.timeoutClose );
  10 + if ( this.h < this.maxSize ) {
  11 + this.h += 10;
  12 + this.style.height = this.h +"px";
  13 + this.timeoutOpen = setTimeout( "window.amul.onmouseover()", 33 );
  14 + } else {
  15 + this.h = this.maxSize;
  16 + this.style.height = this.h +"px";
  17 + }
  18 +}
  19 +
  20 +amul.onmouseout = function ( doIt ) {
  21 + clearTimeout( this.timeoutOpen );
  22 + if ( doIt ) {
  23 + if ( this.h > this.minSize ) {
  24 + this.h -= 10;
  25 + this.style.height = this.h +"px";
  26 + this.timeoutClose = setTimeout( "window.amul.onmouseout(true)", 33 );
  27 + } else {
  28 + this.h = this.minSize;
  29 + this.style.height = this.h +"px";
  30 + }
  31 + } else {
  32 + // Work arround IE bug
  33 + this.timeoutClose = setTimeout( "window.amul.onmouseout(true)", 200 );
  34 + }
  35 +}
  36 +
... ...
public/stylesheets/menu.css
... ... @@ -177,7 +177,7 @@ body.category4 .linkSubMenu { background-image: url(/images/borda-esq-aba-vermel
177 177 top: 22px;
178 178 left: 0px;
179 179 right: 0px;
180   - padding: 0px 0px 2px 20px;
  180 + padding: 0px 170px 2px 20px;
181 181 margin: 0px;
182 182 border: 1px solid #FFF;
183 183 border-top: none;
... ... @@ -196,3 +196,89 @@ body.category4 .linkSubMenu { background-image: url(/images/borda-esq-aba-vermel
196 196 padding-right: 15px;
197 197 }
198 198  
  199 +/* * * Assets Menu * * * * * * * * * * * */
  200 +
  201 +#assets_menu {
  202 + position: absolute;
  203 + top: 21px;
  204 + right: 0px;
  205 + padding: 0px 0px 0px 10px;
  206 +}
  207 +
  208 +#assets_menu_layout_iten {
  209 + position: absolute;
  210 + top: 0px;
  211 + left: 0px;
  212 + width: 11px;
  213 + height: 11px;
  214 + overflow: hidden;
  215 + background: url(/images/top-bar/assets-menu-top-azul.gif);
  216 +}
  217 +body.category1 #assets_menu_layout_iten { background: url(/images/top-bar/assets-menu-top-laranja.gif) }
  218 +body.category2 #assets_menu_layout_iten { background: url(/images/top-bar/assets-menu-top-verde.gif) }
  219 +body.category3 #assets_menu_layout_iten { background: url(/images/top-bar/assets-menu-top-lilas.gif) }
  220 +body.category4 #assets_menu_layout_iten { background: url(/images/top-bar/assets-menu-top-vermelho.gif) }
  221 +
  222 +#assets_menu_list {
  223 + padding: 2px 0px 6px 5px;
  224 + background: url(/images/top-bar/assets-menu-bg-azul.gif) 0% 100%;
  225 +}
  226 +body.category1 #assets_menu_list { background-image: url(/images/top-bar/assets-menu-bg-laranja.gif) }
  227 +body.category2 #assets_menu_list { background-image: url(/images/top-bar/assets-menu-bg-verde.gif) }
  228 +body.category3 #assets_menu_list { background-image: url(/images/top-bar/assets-menu-bg-lilas.gif) }
  229 +body.category4 #assets_menu_list { background-image: url(/images/top-bar/assets-menu-bg-vermelho.gif) }
  230 +
  231 +#assets_menu ul {
  232 + margin: 0px;
  233 + padding: 0px;
  234 + overflow: hidden;
  235 + height: 56px;
  236 + width: 170px;
  237 + max-width: 165px;
  238 +}
  239 +
  240 +#assets_menu li {
  241 + margin: 0px;
  242 + padding: 1px 0px 0px 0px;
  243 + list-style: none;
  244 +}
  245 +
  246 +#assets_menu a {
  247 + font-size: 12px;
  248 + font-weight: bold;
  249 + text-decoration: none;
  250 + color: #B8CFE7;
  251 + display: block;
  252 + padding-left: 0px;
  253 + height: 18px;
  254 +}
  255 +body.category1 #assets_menu a { color: #FDD79E }
  256 +body.category2 #assets_menu a { color: #C4F099 }
  257 +body.category3 #assets_menu a { color: #D6BFD3 }
  258 +body.category4 #assets_menu a { color: #F79494 }
  259 +#assets_menu a:hover {
  260 + background: #3465A4;
  261 + color: #FFF;
  262 +}
  263 +body.category1 #assets_menu a:hover { background: #F57900; color: #FFF }
  264 +body.category2 #assets_menu a:hover { background: #61B60E; color: #FFF }
  265 +body.category3 #assets_menu a:hover { background: #75507B; color: #FFF }
  266 +body.category4 #assets_menu a:hover { background: #CC0000; color: #FFF }
  267 +
  268 +#assets_menu a span {
  269 + display: block;
  270 + width: 18px;
  271 + height: 18px;
  272 + float: left;
  273 + background-repeat: no-repeat;
  274 + background-position: 50% 50%;
  275 + margin-right: 2px;
  276 + opacity: 0.7;
  277 + filter: alpha(opacity=70);
  278 +}
  279 +#assets_menu a:hover span {
  280 + opacity: 1;
  281 + filter: alpha(opacity=100);
  282 +}
  283 +
  284 +
... ...