Partial sitemap
This commit is contained in:
1 parent
12f9f666eb
commit
db9c4c0e10
7 files changed
+390
-40
No files matched your search
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* jQuery Masonry v2.1.05
|
||||
* A dynamic layout plugin for jQuery
|
||||
* The flip-side of CSS Floats
|
||||
* http://masonry.desandro.com
|
||||
*
|
||||
* Licensed under the MIT license.
|
||||
* Copyright 2012 David DeSandro
|
||||
*/
|
||||
(function(a,b,c){"use strict";var d=b.event,e;d.special.smartresize={setup:function(){b(this).bind("resize",d.special.smartresize.handler)},teardown:function(){b(this).unbind("resize",d.special.smartresize.handler)},handler:function(a,c){var d=this,f=arguments;a.type="smartresize",e&&clearTimeout(e),e=setTimeout(function(){b.event.handle.apply(d,f)},c==="execAsap"?0:100)}},b.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execAsap"])},b.Mason=function(a,c){this.element=b(c),this._create(a),this._init()},b.Mason.settings={isResizable:!0,isAnimated:!1,animationOptions:{queue:!1,duration:500},gutterWidth:0,isRTL:!1,isFitWidth:!1,containerStyle:{position:"relative"}},b.Mason.prototype={_filterFindBricks:function(a){var b=this.options.itemSelector;return b?a.filter(b).add(a.find(b)):a},_getBricks:function(a){var b=this._filterFindBricks(a).css({position:"absolute"}).addClass("masonry-brick");return b},_create:function(c){this.options=b.extend(!0,{},b.Mason.settings,c),this.styleQueue=[];var d=this.element[0].style;this.originalStyle={height:d.height||""};var e=this.options.containerStyle;for(var f in e)this.originalStyle[f]=d[f]||"";this.element.css(e),this.horizontalDirection=this.options.isRTL?"right":"left",this.offset={x:parseInt(this.element.css("padding-"+this.horizontalDirection),10),y:parseInt(this.element.css("padding-top"),10)},this.isFluid=this.options.columnWidth&&typeof this.options.columnWidth=="function";var g=this;setTimeout(function(){g.element.addClass("masonry")},0),this.options.isResizable&&b(a).bind("smartresize.masonry",function(){g.resize()}),this.reloadItems()},_init:function(a){this._getColumns(),this._reLayout(a)},option:function(a,c){b.isPlainObject(a)&&(this.options=b.extend(!0,this.options,a))},layout:function(a,b){for(var c=0,d=a.length;c<d;c++)this._placeBrick(a[c]);var e={};e.height=Math.max.apply(Math,this.colYs);if(this.options.isFitWidth){var f=0;c=this.cols;while(--c){if(this.colYs[c]!==0)break;f++}e.width=(this.cols-f)*this.columnWidth-this.options.gutterWidth}this.styleQueue.push({$el:this.element,style:e});var g=this.isLaidOut?this.options.isAnimated?"animate":"css":"css",h=this.options.animationOptions,i;for(c=0,d=this.styleQueue.length;c<d;c++)i=this.styleQueue[c],i.$el[g](i.style,h);this.styleQueue=[],b&&b.call(a),this.isLaidOut=!0},_getColumns:function(){var a=this.options.isFitWidth?this.element.parent():this.element,b=a.width();this.columnWidth=this.isFluid?this.options.columnWidth(b):this.options.columnWidth||this.$bricks.outerWidth(!0)||b,this.columnWidth+=this.options.gutterWidth,this.cols=Math.floor((b+this.options.gutterWidth)/this.columnWidth),this.cols=Math.max(this.cols,1)},_placeBrick:function(a){var c=b(a),d,e,f,g,h;d=Math.ceil(c.outerWidth(!0)/this.columnWidth),d=Math.min(d,this.cols);if(d===1)f=this.colYs;else{e=this.cols+1-d,f=[];for(h=0;h<e;h++)g=this.colYs.slice(h,h+d),f[h]=Math.max.apply(Math,g)}var i=Math.min.apply(Math,f),j=0;for(var k=0,l=f.length;k<l;k++)if(f[k]===i){j=k;break}var m={top:i+this.offset.y};m[this.horizontalDirection]=this.columnWidth*j+this.offset.x,this.styleQueue.push({$el:c,style:m});var n=i+c.outerHeight(!0),o=this.cols+1-l;for(k=0;k<o;k++)this.colYs[j+k]=n},resize:function(){var a=this.cols;this._getColumns(),(this.isFluid||this.cols!==a)&&this._reLayout()},_reLayout:function(a){var b=this.cols;this.colYs=[];while(b--)this.colYs.push(0);this.layout(this.$bricks,a)},reloadItems:function(){this.$bricks=this._getBricks(this.element.children())},reload:function(a){this.reloadItems(),this._init(a)},appended:function(a,b,c){if(b){this._filterFindBricks(a).css({top:this.element.height()});var d=this;setTimeout(function(){d._appended(a,c)},1)}else this._appended(a,c)},_appended:function(a,b){var c=this._getBricks(a);this.$bricks=this.$bricks.add(c),this.layout(c,b)},remove:function(a){this.$bricks=this.$bricks.not(a),a.remove()},destroy:function(){this.$bricks.removeClass("masonry-brick").each(function(){this.style.position="",this.style.top="",this.style.left=""});var c=this.element[0].style;for(var d in this.originalStyle)c[d]=this.originalStyle[d];this.element.unbind(".masonry").removeClass("masonry").removeData("masonry"),b(a).unbind(".masonry")}},b.fn.imagesLoaded=function(a){function h(){a.call(c,d)}function i(a){var c=a.target;c.src!==f&&b.inArray(c,g)===-1&&(g.push(c),--e<=0&&(setTimeout(h),d.unbind(".imagesLoaded",i)))}var c=this,d=c.find("img").add(c.filter("img")),e=d.length,f="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",g=[];return e||h(),d.bind("load.imagesLoaded error.imagesLoaded",i).each(function(){var a=this.src;this.src=f,this.src=a}),c};var f=function(b){a.console&&a.console.error(b)};b.fn.masonry=function(a){if(typeof a=="string"){var c=Array.prototype.slice.call(arguments,1);this.each(function(){var d=b.data(this,"masonry");if(!d){f("cannot call methods on masonry prior to initialization; attempted to call method '"+a+"'");return}if(!b.isFunctiLine truncated
|
||||
@@ -570,53 +570,342 @@
|
||||
padding: 5px;
|
||||
}
|
||||
.popover-content {
|
||||
-webkit-border-radius: 0 0 3px 3px;
|
||||
-moz-border-radius: 0 0 3px 3px;
|
||||
border-radius: 0 0 3px 3px;
|
||||
border-radius: 3px;
|
||||
padding: 5px;
|
||||
}
|
||||
.popover-title {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/*show link and file*/
|
||||
.linkAndFile {
|
||||
.member td.teacher {
|
||||
/*background-color: #AF0045;
|
||||
border-left: 2px solid #AF0045;*/
|
||||
}
|
||||
.user-info .roles-nav {
|
||||
margin: 0;
|
||||
position: relative;
|
||||
clear: both;
|
||||
}
|
||||
.linkAndFile>div {
|
||||
margin-top: 20px;
|
||||
}
|
||||
.linkAndFile [class^="icons-"] {
|
||||
.user-info .roles-nav li {
|
||||
float: left;
|
||||
margin-top: 10px;
|
||||
list-style: none;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.linkAndFile .showLink, .linkAndFile .showFile {
|
||||
background-color: #ededed;
|
||||
padding: 5px;
|
||||
.user-info .roles-nav li a {
|
||||
text-indent: -9999px;
|
||||
display: block;
|
||||
height: 15px;
|
||||
width: 100px;
|
||||
margin-top: 3px;
|
||||
opacity: 0.3;
|
||||
-moz-opacity: 0.3;
|
||||
filter:alpha(opacity=3);
|
||||
}
|
||||
.user-info .roles-nav li:first-child a {
|
||||
border-radius: 0 0 0 4px;
|
||||
}
|
||||
.user-info .roles-nav li:last-child a {
|
||||
border-radius: 0 0 4px 0;
|
||||
}
|
||||
.user-info .roles-nav li hr {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 3px;
|
||||
margin: 0;
|
||||
border: none;
|
||||
display: none;
|
||||
}
|
||||
.user-info .roles-nav li.teacher a {
|
||||
background-color: #F36F08;
|
||||
}
|
||||
.user-info .roles-nav li.student a {
|
||||
background-color: #186AB6;
|
||||
}
|
||||
.user-info .roles-nav li.staff a {
|
||||
background-color: #139E2F;
|
||||
}
|
||||
.user-info .roles-nav li.active a {
|
||||
border-bottom: none;
|
||||
height: 18px;
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
-moz-opacity: 1;
|
||||
filter:alpha(opacity=10);
|
||||
}
|
||||
.user-info .roles-nav li.active hr {
|
||||
display: block;
|
||||
}
|
||||
.user-info-basic {
|
||||
padding: 20px;
|
||||
min-width: 220px;
|
||||
display: inline-block;
|
||||
float: left;
|
||||
}
|
||||
.user-info-roles {
|
||||
padding: 20px;
|
||||
}
|
||||
.user-avatar {
|
||||
overflow: hidden;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 5px;
|
||||
margin-left: 25px;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,.8);
|
||||
margin-right: 10px;
|
||||
}
|
||||
.linkAndFile .showLink a, .linkAndFile .showFile a {
|
||||
display: inline-block;
|
||||
margin: 5px 10px;
|
||||
.user-avatar .reflective {
|
||||
background-image: url(img/reflective.png);
|
||||
background-repeat: no-repeat;
|
||||
background-position: 0;
|
||||
height: 80px;
|
||||
width: 80px;
|
||||
position: absolute;
|
||||
}
|
||||
.linkAndFile>div>a:last-child {
|
||||
margin-right: 5px
|
||||
.user .user-avatar .reflective {
|
||||
background-image: url(img/reflective.png);
|
||||
background-repeat: no-repeat;
|
||||
background-position: 0 -20px;
|
||||
height: 80px;
|
||||
width: 80px;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
opacity: 0;
|
||||
-moz-opacity: 0;
|
||||
filter:alpha(opacity=0);
|
||||
}
|
||||
.news_paragraph p {
|
||||
line-height: 20px;
|
||||
.user:hover .user-avatar .reflective {
|
||||
background-position: 0 0;
|
||||
opacity: 1;
|
||||
-moz-opacity: 1;
|
||||
filter:alpha(opacity=10);
|
||||
}
|
||||
.nav-tabs>li>.edit, .nav-tabs>li>.edit:hover {
|
||||
background-color: #333;
|
||||
color: #FFF;
|
||||
padding-right: 12px;
|
||||
.user-name {
|
||||
font-size: 22px;
|
||||
line-height: 24px;
|
||||
color: #555;
|
||||
margin: 0 0 3px;
|
||||
font-family: Helvetica, "微軟正黑體";
|
||||
}
|
||||
.nav-tabs li .icons-pencil {
|
||||
float: right;
|
||||
.user-data {
|
||||
padding: 20px;
|
||||
position: relative;
|
||||
}
|
||||
.data-block hr {
|
||||
background-color: #666;
|
||||
height: 8px;
|
||||
border: none;
|
||||
margin: 0;
|
||||
border-radius: 5px 5px 0px 0px;
|
||||
-moz-border-radius: 5px 5px 0px 0px;
|
||||
-webkit-border-radius: 5px 5px 0px 0px;
|
||||
}
|
||||
.data-block .info_input {
|
||||
margin-bottom:50px;
|
||||
position:relative;
|
||||
padding: 10px;
|
||||
background-color: rgba(227,227,227,1);
|
||||
border-radius: 0px 0px 5px 5px;
|
||||
-moz-border-radius: 0px 0px 5px 5px;
|
||||
-webkit-border-radius: 0px 0px 5px 5px;
|
||||
-moz-box-shadow: 0px 1px 0px rgba(0,0,0,.3); /* Firefox */
|
||||
-webkit-box-shadow: 0px 1px 0px rgba(0,0,0,.3);/* Safari 和 Chrome */
|
||||
box-shadow: 0px 1px 0px rgba(0,0,0,.3); /* Opera 10.5 + */
|
||||
}
|
||||
.data-block .info_input table {
|
||||
width: 100%;
|
||||
}
|
||||
.data-block .info_input table .list_head td {
|
||||
border-bottom: 1px solid #AAA;
|
||||
}
|
||||
.teacher hr {
|
||||
background-color: #F36F08;
|
||||
}
|
||||
.student hr {
|
||||
background-color: #186AB6;
|
||||
}
|
||||
.staff hr {
|
||||
background-color: #139E2F;
|
||||
}
|
||||
.view-mode {
|
||||
margin: 4px 20px 0 0;
|
||||
}
|
||||
.view-mode i {
|
||||
font-size: 14px;
|
||||
line-height: 6px !important;
|
||||
}
|
||||
.member-abstract, .member-large {
|
||||
padding: 15px;
|
||||
}
|
||||
.member-abstract ul, .member-large ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.member-abstract>ul>li, .member-large>ul>li {
|
||||
margin: 5px;
|
||||
overflow: hidden;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,.3);
|
||||
}
|
||||
.member-abstract .user *, .member-large .user * {
|
||||
-webkit-transition: all .3s ease;
|
||||
-moz-transition: all .3s ease;
|
||||
-o-transition: all .3s ease;
|
||||
transition: all .3s ease;
|
||||
}
|
||||
.member-abstract .user, .member-large .user {
|
||||
background-color: #EDEDED;
|
||||
padding: 10px;
|
||||
position: relative;
|
||||
border-radius: 0 0 5px 5px;
|
||||
width: 360px;
|
||||
-webkit-transition: all .3s ease;
|
||||
-moz-transition: all .3s ease;
|
||||
-o-transition: all .3s ease;
|
||||
transition: all .3s ease;
|
||||
}
|
||||
.member-abstract .user:hover, .member-large .user:hover {
|
||||
background-color: #333333;
|
||||
}
|
||||
.member-abstract .user:hover .user-name, .member-large .user:hover .user-name {
|
||||
color: #DDD;
|
||||
}
|
||||
.member-abstract .user .user-meta {
|
||||
margin-left: 90px;
|
||||
}
|
||||
.member-abstract .user .user-title span {
|
||||
color: #5e5e5e;
|
||||
font-size: 13px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
.member-abstract .user:hover .user-title span {
|
||||
color: #AAA;
|
||||
}
|
||||
.member-abstract .user ul.user-itemborder {
|
||||
margin-top: 8px;
|
||||
border-top: 1px solid #D5D5D5;
|
||||
padding: 4px 0 0;
|
||||
}
|
||||
.nav-tabs li a {
|
||||
padding-right: 32px;
|
||||
.member-abstract .user ul.user-itemborder li, .member-abstract .user ul.user-itemborder li span {
|
||||
color: #333;
|
||||
}
|
||||
.member-abstract .user:hover ul.user-itemborder {
|
||||
color: #EDEDED;
|
||||
border-top: 1px solid #666;
|
||||
}
|
||||
.member-abstract .user:hover ul.user-itemborder li, .member-abstract .user:hover ul.user-itemborder li span {
|
||||
color: #EDEDED;
|
||||
}
|
||||
.member-abstract .user ul.user-itemborder li {
|
||||
width: 33%;
|
||||
font-size: 11px;
|
||||
text-align: center;
|
||||
}
|
||||
.member-abstract .user ul.user-itemborder li span {
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
padding-right: 5px;
|
||||
}
|
||||
.member-large .user {
|
||||
width: 80px;
|
||||
min-height: 125px;
|
||||
}
|
||||
.member-large .user-avatar {
|
||||
margin-right: 0;
|
||||
}
|
||||
.member-large .user-name {
|
||||
font-weight: bold;
|
||||
font-size: 13px;
|
||||
width: 80px;
|
||||
line-height: 18px;
|
||||
padding-top: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
.rolesTag {
|
||||
width: 100%;
|
||||
}
|
||||
.rolesTag td {
|
||||
height: 6px;
|
||||
background-color: #333;
|
||||
}
|
||||
.rolesTag td.teacher {
|
||||
background-color: #F38C08;
|
||||
}
|
||||
.rolesTag td.student {
|
||||
background-color: #186AB6;
|
||||
}
|
||||
.rolesTag td.staff {
|
||||
background-color: #139E2F;
|
||||
}
|
||||
.site-map {
|
||||
padding: 15px;
|
||||
}
|
||||
.site-map .map-block {
|
||||
width: 250px;
|
||||
min-height: 20px;
|
||||
border: 1px solid #dedede;
|
||||
background-color: #E6E6E6;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.site-map .map-block ul {
|
||||
margin: 0px;
|
||||
list-style: none;
|
||||
}
|
||||
.site-map .map-block li {
|
||||
font-size: 12px;
|
||||
background-color: #F7F7F7;
|
||||
padding: 5px 15px;
|
||||
border-top: 1px solid #FFF;
|
||||
border-bottom: 1px solid #dedede;
|
||||
}
|
||||
.site-map .map-block li:last-child {
|
||||
border-radius: 0 0 4px 4px;
|
||||
border-bottom: none;
|
||||
}
|
||||
.site-map .map-block li:hover a {;
|
||||
text-decoration: none;
|
||||
}
|
||||
.site-map .map-block li.disabled {
|
||||
color: #C9C9C9;
|
||||
}
|
||||
.site-map .map-block li.disabled .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;
|
||||
}
|
||||
.site-map .map-block h4 {
|
||||
line-height: 30px;
|
||||
padding: 0 15px;
|
||||
border-radius: 4px 4px 0 0;
|
||||
box-shadow: 0px 1px 2px #A8A8A8;
|
||||
position: relative;
|
||||
background-image: -moz-linear-gradient(top, #FCFCFC, #DFDFDF);
|
||||
background-image: -ms-linear-gradient(top, #FCFCFC, #DFDFDF);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#FCFCFC), to(#DFDFDF));
|
||||
background-image: -webkit-linear-gradient(top, #FCFCFC, #DFDFDF);
|
||||
background-image: -o-linear-gradient(top, #FCFCFC, #DFDFDF);
|
||||
background-image: linear-gradient(top, #FCFCFC, #DFDFDF);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FCFCFC', endColorstr='#DFDFDF', GradientType=0);
|
||||
}
|
||||
.onoff {
|
||||
display: block;
|
||||
background-color: #5EB92B;
|
||||
font-size: 9px;
|
||||
padding: 0px 10px;
|
||||
border-radius: 8px;
|
||||
line-height: 16px;
|
||||
height: 15px;
|
||||
color: #FFF;
|
||||
width: 38px;
|
||||
border: none;
|
||||
box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.5), 0 0 5px rgba(13, 75, 23, 0.5) inset;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -19,22 +19,28 @@ class Admin::SitesController < ApplicationController
|
||||
redirect_to :back
|
||||
end
|
||||
|
||||
def mail_setting
|
||||
|
||||
end
|
||||
|
||||
def site_info
|
||||
|
||||
end
|
||||
|
||||
def sitemap
|
||||
@items = get_homepage.children rescue []
|
||||
end
|
||||
|
||||
def sitemap_toggle
|
||||
@item = Item.find(params[:id])
|
||||
@item.sitemap_enabled = !@item.sitemap_enabled
|
||||
@item.save
|
||||
end
|
||||
|
||||
def system_info
|
||||
|
||||
end
|
||||
|
||||
def language
|
||||
|
||||
end
|
||||
|
||||
def mail_setting
|
||||
|
||||
end
|
||||
|
||||
def ui_theme
|
||||
|
||||
end
|
||||
|
||||
@@ -11,6 +11,7 @@ class Item
|
||||
field :enabled_for, :type => Array, :default => nil
|
||||
field :menu_enabled_for, :type => Array, :default => nil
|
||||
field :title, localize: true
|
||||
field :sitemap_enabled, :type => Boolean, :default => true
|
||||
|
||||
|
||||
validates_format_of :name, :with => /^[0-9a-zA-Z\-_]+$/
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<div class="map-block">
|
||||
<h4><%= sitemap_block.i18n_variable[I18n.locale] %></h4>
|
||||
<ul>
|
||||
<% sitemap_block.children.each do |child| %>
|
||||
<li class="clear">
|
||||
<%= child.i18n_variable[I18n.locale] %>
|
||||
<button id="<%= child.id %>" class="onoff pull-right">
|
||||
<%= child.sitemap_enabled ? t('on_cap') : t('off_cap') %>
|
||||
</button>
|
||||
</li>
|
||||
<% end if sitemap_block.children %>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -0,0 +1,30 @@
|
||||
<% content_for :side_bar do %>
|
||||
<%= render 'side_bar' %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="site-map">
|
||||
<%= render :partial => 'sitemap_block', :collection => @items %>
|
||||
</div>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "lib/jquery.masonry.min.js" %>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('.site-map').masonry({
|
||||
itemSelector: '.map-block',
|
||||
columnWidth: 260,
|
||||
isAnimated: true
|
||||
});
|
||||
});
|
||||
$(document).on('click', '.onoff', function () {
|
||||
$(this).parents("li").toggleClass("disabled");
|
||||
if($(this).parents("li").attr("class").indexOf("disabled") > 0){
|
||||
$(this).text('OFF')
|
||||
} else {
|
||||
$(this).text('ON')
|
||||
}
|
||||
$.getScript('admin_sites_path' + '/' + $(this).attr('id') + '/sitemap_toggle');
|
||||
});
|
||||
</script>
|
||||
<% end %>
|
||||
Reference in new issue
Block a user