Sitemap with main
This commit is contained in:
		
							parent
							
								
									38804bd118
								
							
						
					
					
						commit
						934b515914
					
				|  | @ -862,6 +862,12 @@ | |||
| 	padding: 5px 15px; | ||||
| 	border-top: 1px solid #FFF; | ||||
| 	border-bottom: 1px solid #dedede; | ||||
| 	display: table; | ||||
| 	width: 100%; | ||||
| } | ||||
| .site-map .map-block li span { | ||||
| 	width: 170px; | ||||
| 	display: block; | ||||
| } | ||||
| .site-map .map-block li:last-child { | ||||
| 	border-radius: 0 0 4px 4px; | ||||
|  | @ -879,8 +885,9 @@ | |||
| 	color: #CACACA; | ||||
| } | ||||
| .site-map .map-block h4 { | ||||
| 	line-height: 30px; | ||||
| 	padding: 0 15px; | ||||
| 	line-height: 18px; | ||||
| 	min-height: 20px; | ||||
| 	padding: 5px 15px; | ||||
| 	border-radius: 4px 4px 0 0; | ||||
| 	box-shadow: 0px 1px 2px #A8A8A8; | ||||
| 	position: relative; | ||||
|  | @ -893,6 +900,20 @@ | |||
| 	background-repeat: repeat-x; | ||||
| 	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FCFCFC', endColorstr='#DFDFDF', GradientType=0); | ||||
| } | ||||
| .site-map .map-block h4 span { | ||||
| 	width: 170px; | ||||
| 	display: block; | ||||
| } | ||||
| .site-map .map-block h4 .onoff { | ||||
| } | ||||
| .site-map .disabled h4 { | ||||
| 	color: #CACACA; | ||||
| } | ||||
| .site-map .disabled h4 .onoff { | ||||
|     box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.5), 0 0 5px rgba(0,0,0,.2) inset; | ||||
| 	background-color: #9C9C9C; | ||||
| 	color: #CACACA; | ||||
| } | ||||
| .onoff { | ||||
| 	display: block; | ||||
| 	background-color: #5EB92B; | ||||
|  |  | |||
|  | @ -35,6 +35,12 @@ class Admin::SitesController < ApplicationController | |||
|     @item = Item.find(params[:id]) | ||||
|     @item.sitemap_enabled = !@item.sitemap_enabled | ||||
|     @item.save | ||||
|     if params[:parent] | ||||
|       @item.children.each do |child|     | ||||
|         child.sitemap_enabled = @item.sitemap_enabled | ||||
|         child.save | ||||
|       end | ||||
|     end | ||||
|     render :nothing => true | ||||
|   end | ||||
| 
 | ||||
|  |  | |||
|  | @ -25,6 +25,7 @@ class Page < Item | |||
|   protected | ||||
|    | ||||
|   def create_parts | ||||
|     if self.new_record? || self.design.changed? | ||||
|       page_design = self.design | ||||
|       parent = self.parent | ||||
|       menu_part = parent.page_parts.detect{|page_part| page_part.kind.eql?('public_r_tag') && page_part.public_r_tag.eql?('sub_menu') && page_part.public_r_tag_object_id.eql?(parent.id.to_s)} if parent | ||||
|  | @ -42,5 +43,6 @@ class Page < Item | |||
|         end | ||||
|       end | ||||
|     end | ||||
|   end | ||||
|    | ||||
| end | ||||
|  |  | |||
|  | @ -1,12 +1,13 @@ | |||
| <div class="map-block"> | ||||
|   <h4><%= sitemap_block.i18n_variable[I18n.locale] %><button class="onoff pull-right"><%= sitemap_block.sitemap_enabled ? t('on_upcase') : t('off_upcase') %></button></h4> | ||||
| <div class="map-block <%= 'disabled' if !sitemap_block.sitemap_enabled  %>"> | ||||
|   <h4> | ||||
|     <button id="<%= sitemap_block.id %>" class="onoff pull-right"><%= sitemap_block.sitemap_enabled ? t('on_upcase') : t('off_upcase') %></button> | ||||
|     <span><%= sitemap_block.i18n_variable[I18n.locale] %></span> | ||||
|   </h4> | ||||
|   <ul> | ||||
|   	<% sitemap_block.children.each do |child| %> | ||||
|       <li class="clear <%= 'disabled' if !child.sitemap_enabled  %>"> | ||||
|       	<%= child.i18n_variable[I18n.locale] %> | ||||
|       	<button id="<%= child.id %>" class="onoff pull-right"> | ||||
|       		<%= child.sitemap_enabled ? t('on_upcase') : t('off_upcase') %> | ||||
|       	</button> | ||||
|       	<button id="<%= child.id %>" class="onoff pull-right" disabled="<%= 'disabled' if !sitemap_block.sitemap_enabled %>" ><%= child.sitemap_enabled ? t('on_upcase') : t('off_upcase') %></button> | ||||
|         <span><%= child.i18n_variable[I18n.locale] %></span> | ||||
|       </li> | ||||
|     <% end if sitemap_block.children %> | ||||
|   </ul> | ||||
|  |  | |||
|  | @ -32,11 +32,14 @@ | |||
|             $(this).text("<%= t('off_upcase') %>") | ||||
|             $(this).parents(".map-block").find('li').addClass('disabled') | ||||
|             $(this).parents(".map-block").find('button').text("<%= t('off_upcase') %>") | ||||
|             $(this).parents(".map-block").find('li button').attr('disabled', 'disabled') | ||||
|           } else { | ||||
|             $(this).text("<%= t('on_upcase') %>") | ||||
|             $(this).parents(".map-block").find('li').removeClass('disabled') | ||||
|             $(this).parents(".map-block").find('button').text("<%= t('on_upcase') %>") | ||||
|             $(this).parents(".map-block").find('li button').removeAttr("disabled") | ||||
|           }  | ||||
|           $.getScript('<%= admin_sites_path %>' + '/' + $(this).attr('id') + '/sitemap_toggle?parent=true'); | ||||
|         }); | ||||
|     </script> | ||||
| <% end %> | ||||
		Loading…
	
		Reference in New Issue