diff --git a/app/assets/javascripts/lib/jquery.masonry.min.js b/app/assets/javascripts/lib/jquery.masonry.min.js new file mode 100644 index 00000000..67be9886 --- /dev/null +++ b/app/assets/javascripts/lib/jquery.masonry.min.js @@ -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;cdiv { - 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; } diff --git a/app/controllers/admin/sites_controller.rb b/app/controllers/admin/sites_controller.rb index 1a19aebd..723266a2 100644 --- a/app/controllers/admin/sites_controller.rb +++ b/app/controllers/admin/sites_controller.rb @@ -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 diff --git a/app/models/item.rb b/app/models/item.rb index 60f737fe..0785b989 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -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\-_]+$/ diff --git a/app/views/admin/sites/_sitemap_block.html.erb b/app/views/admin/sites/_sitemap_block.html.erb new file mode 100644 index 00000000..1981117c --- /dev/null +++ b/app/views/admin/sites/_sitemap_block.html.erb @@ -0,0 +1,13 @@ +
+

<%= sitemap_block.i18n_variable[I18n.locale] %>

+ +
\ No newline at end of file diff --git a/app/views/admin/sites/sitemap.html.erb b/app/views/admin/sites/sitemap.html.erb new file mode 100644 index 00000000..a7ded89b --- /dev/null +++ b/app/views/admin/sites/sitemap.html.erb @@ -0,0 +1,30 @@ +<% content_for :side_bar do %> + <%= render 'side_bar' %> +<% end %> + + +
+ <%= render :partial => 'sitemap_block', :collection => @items %> +
+ +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "lib/jquery.masonry.min.js" %> + +<% end %> \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 40e82749..4b657270 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -114,11 +114,12 @@ Orbit::Application.routes.draw do get 'add_attribute_field' end resources :sites do - get 'site_info' - get 'system_info' - get 'language' get 'mail_setting' + get 'site_info' + get 'sitemap' + get 'system_info' get 'ui_theme' + put 'sitemap_toggle', :on => :member end resources :snippets resources :tags