diff --git a/Gemfile b/Gemfile index 7e6212e..a63c509 100644 --- a/Gemfile +++ b/Gemfile @@ -87,8 +87,11 @@ end #ask gem 'gotcha' -#desktop -gem 'angularjs-rails', '~> 1.2.20' -gem 'angular-ui-bootstrap-rails', '~> 0.11.0' -gem 'jquery_mousewheel_rails', '~> 3.1.11.3' +#caching observers +gem 'mongoid-observers' + +#desktop +# gem 'angularjs-rails', '~> 1.2.20' +# gem 'angular-ui-bootstrap-rails', '~> 0.11.0' +# gem 'jquery_mousewheel_rails', '~> 3.1.11.3' diff --git a/app/assets/images/google-message-background.jpg b/app/assets/images/google-message-background.jpg new file mode 100644 index 0000000..efb11ce Binary files /dev/null and b/app/assets/images/google-message-background.jpg differ diff --git a/app/assets/images/sign-in-with-google.png b/app/assets/images/sign-in-with-google.png deleted file mode 100644 index b20d378..0000000 Binary files a/app/assets/images/sign-in-with-google.png and /dev/null differ diff --git a/app/assets/stylesheets/group_page.css b/app/assets/stylesheets/group_page.css new file mode 100644 index 0000000..358927f --- /dev/null +++ b/app/assets/stylesheets/group_page.css @@ -0,0 +1,249 @@ +@charset "utf-8"; +body { + background: #f3f3f3; +} + +#main-wrap { + padding-top: 0; +} + +*, +*:before, +*:after { + box-sizing: border-box; +} + +.group-page {} + +.group-page-banner-image-wrap { + position: relative; + max-height: 280px; + overflow: hidden; +} + +.group-page-view-switch { + position: absolute; + right: 2rem; + top: 2rem; +} + +.group-page-banner-image { + max-width: 100%; + width: 100%; + height: auto; +} + +.group-page-bar { + overflow: hidden; + background: #171717; + padding: 20px 2rem; + text-align: center; +} + +.group-page-title { + padding: 6px 0; + color: #fff; + margin-bottom: 12px; +} + +.group-page-setion { + padding: 30px 2rem; + overflow: hidden; + max-width: 1350px; + margin: auto; +} + +.gorup-page-info-wrap { + display: block; + font-size: .9rem; + float: right; + padding: 5px .5rem; + border: 2px solid #cdcdcd; + cursor: pointer; +} + +.group-page-description-wrap { + clear: both; +} + +.gorup-page-info-wrap { + text-align: right; + margin-bottom: 10px; +} + +.group-page-status-wrap { + float: right; + font-size: 0.75rem; + color: #fff; + background: #1d9e20; + padding: 2px .4rem; + border-radius: .2rem; + margin-bottom: 10px; +} +.group-page-status-wrap.close-eye{ + background: #c71932; + margin-left: 5px; +} + +.group-page-description-wrap { + padding: 16px 1.2rem 16px; + margin-bottom: 15px; + box-shadow: inset 0 0 8px #aaa; + border-radius: .2rem; +} + +.group-page-description { + clear: both; + text-align: justify; +} + +.group-page-post { + clear: both; + text-align: center; + overflow: hidden; + margin-bottom: 40px; + background: #fff; + padding: 28px 1.5rem; + border-radius: .2rem; + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .2); +} + +.group-page-post-link{ + text-decoration: none; + color: #000; +} + +.group-page-post:hover { + box-shadow: 0 1px 25px 0 rgba(0, 0, 0, .2); +} + +.group-page-post-link:hover { + color: #000; + text-decoration: none; +} + +.group-page-post-image-wrap { + display: inline-block; + margin-bottom: 12px; +} + +.group-page-post-image { + max-width: 100%; + width: 100%; + margin-top: 12px; + /*border-radius: 50%;*/ + height: auto; +} + +.group-page-post-content { + margin-bottom: .5rem; +} + +.group-page-post-title { + font-weight: normal; + font-size: 1.5rem; + line-height: 1; + margin-bottom: 12px; +} + +.group-page-post-meta-wrap { + color: #aaa; +} + +.group-page-post-author, +.group-page-post-postdate { + margin-right: .5rem; +} +/* scroll view */ +.group-page.scroll { + padding-top: 7rem; +} +.group-page.scroll .group-page-banner-image-wrap { + height: 70px; + overflow: hidden; + position: fixed; + top: 0; +} + +.group-page.scroll .group-page-title { + margin-bottom: 0; +} + +.group-page.scroll .group-page-title { + font-size: 18px; +} + +.group-page.scroll .group-page-new-post { + margin-top: 6px; +} + +.group-page.scroll .group-page-new-post { + display: inline-block; + vertical-align: top; +} + +.group-page.scroll .group-page-view-switch { + position: static; + display: inline-block; + margin: 6px .5rem 0 0; +} + +.group-page.scroll .btn { + padding: 2px 5px; +} + +.group-page li a { + text-decoration: none; +} + +.group-page .group-page-feed-view .active { + color: #fff; +} +/* 600px */ + +@media screen and (min-width: 37.5rem) { + .group-page-post { + text-align: left; + margin-bottom: 15px; + } + .group-page-post-image-wrap { + float: left; + width: 12%; + margin-right: 4%; + min-width: 100px; + } + .group-page-post-content-wrap { + float: left; + width: 72%; + } + .group-page.scroll .group-page-view-switch { + margin: 6px .5rem 0 0; + } + .group-page.scroll .group-page-bar { + padding: 0 5rem 0 2rem; + position: fixed; + top: 70px; + width: 100%; + } +} +/* 760px */ + +@media screen and (min-width: 47.5rem) { + .group-page-post-content-wrap { + width: 80%; + } + .group-page-bar { + text-align: left; + } + .group-page-title { + float: left; + margin: 0; + padding: 0; + } + .group-page-new-post { + float: right; + } + .group-page-view-switch { + float: right; + } +} diff --git a/app/controllers/admin/groups_controller.rb b/app/controllers/admin/groups_controller.rb index e838d5e..c0b9381 100644 --- a/app/controllers/admin/groups_controller.rb +++ b/app/controllers/admin/groups_controller.rb @@ -1,9 +1,93 @@ class Admin::GroupsController < OrbitMemberController def index + @groups = current_user.groups + end + + def public_groups + @groups = Group.open end def categories + @categories = GroupCategory.all + end + + def newpost + @no_breadcrumb = true + uid = params[:group_id].split("-").last + @group = Group.find_by(:uid => uid) + @grouppost = GroupPost.new + end + + def createpost + uid = params[:group_id].split("-").last + group = Group.find_by(:uid => uid) + gp = GroupPost.new(post_params) + gp.group = group + gp.save + redirect_to admin_group_path(group) + end + + def showpost + + end + + def show + @no_breadcrumb = true + @no_filter = true + uid = params[:id].split("-").last + @group = Group.find_by(:uid => uid) + end + + def create_category + gc = GroupCategory.new(category_params) + gc.save + @categories = GroupCategory.all + render :partial => "group_categories" + end + + def create + group = Group.new(group_params) + group.save + redirect_to admin_groups_path + end + + def new + @group = Group.new + @categories = GroupCategory.all.collect{|gc| [gc.title,gc.id]} + @members = [] + MemberProfile.all.each do |mp| + user = mp.user rescue nil + if !user.nil? && user.id.to_s != current_user.id.to_s && user.user_name != "rulingcom" + avatar = (mp.avatar.thumb.url == "thumb_person.png" ? "/assets/thumb_person.png" : mp.avatar.thumb.url rescue "/assets/thumb_person.png") + @members << { + "id" => user.id.to_s, + "user_name" => (user.user_name rescue ""), + "avatar" => avatar, + "name" => (mp.name_translations rescue {"en" => "","zh_tw" => ""}) + } + end + end + end + + private + + def category_params + params.require(:category).permit! + end + + def post_params + p = params.require(:group_post).permit! + p["author"] = current_user.id + p + end + + def group_params + p = params.require(:group).permit! + p["user_ids"] << current_user.id.to_s + p["admins"] = [] + p["admins"] << current_user.id.to_s + p end end \ No newline at end of file diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 7bda6bf..b379f9b 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -27,7 +27,10 @@ class PagesController < ApplicationController def home @manifest = @key page = Page.first - impressionist(page) + Thread.new do + impressionist(page) + page.inc(view_count: 1) + end OrbitHelper.set_params params,current_user OrbitHelper.set_site_locale locale render :html => render_final_page("home",page,true).html_safe @@ -110,7 +113,10 @@ class PagesController < ApplicationController layout = true end - impressionist(page) + Thread.new do + impressionist(page) + page.inc(view_count: 1) + end render :html => render_final_page("#{module_app}/#{params[:target_action]}",page,layout).html_safe else render :file => "#{Rails.root}/public/404.html", :layout => false, :status => :not_found @@ -301,11 +307,11 @@ class PagesController < ApplicationController def render_final_page(original_view=get_view,page,layout) final_html_for_render = "" + if layout parts = $mobile.blank? ? (page.page_parts rescue []) : (page.mobile_page_parts rescue []) @part_partials = {} - parts.each do |part| subparts = part.sub_parts.asc(:created_at) partials = [] @@ -326,7 +332,10 @@ class PagesController < ApplicationController if @editmode partials << "
" + render_widget_for_frontend(subpart.module,subpart.widget_method,subpart.widget_type,subpart.id.to_s) + "
" else - partials << render_widget_for_frontend(subpart.module,subpart.widget_method,subpart.widget_type,subpart.id.to_s) + widget_html = Rails.cache.fetch("subpart_#{subpart.module}_#{subpart.id.to_s}_"+I18n.locale.to_s,{ race_condition_ttl: 2, expires_in: 5.minutes}) do + render_widget_for_frontend(subpart.module,subpart.widget_method,subpart.widget_type,subpart.id.to_s) + end + partials << widget_html end elsif subpart.kind == "text" if @editmode diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2c071be..9080750 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -76,94 +76,98 @@ module ApplicationHelper end def render_menu - # json_file = File.read(File.join(Rails.root, 'public', "menu.json")) - # @items = JSON.parse(json_file) - if $mobile.blank? - @pages = Page.root.sorted_published_child_pages - else - @pages = Page.root.sorted_published_child_pages_for_mobile - end + menu_html = Rails.cache.fetch(['main_menu',request.original_fullpath, I18n.locale], race_condition_ttl: 2.seconds) do + # json_file = File.read(File.join(Rails.root, 'public', "menu.json")) + # @items = JSON.parse(json_file) + if $mobile.blank? + @pages = Page.root.sorted_published_child_pages + else + @pages = Page.root.sorted_published_child_pages_for_mobile + end - def create_json(pages) - item = {} - pages.each do |page| - if page.child_page.size > 0 - if page.page_type == "page" - if $mobile.blank? - item["#{page.name}"] = {"url"=> "/#{locale.to_s}" + page.url, "children"=>create_json(page.sorted_published_child_pages), "target" => "_self"} - else - item["#{page.name}"] = {"url"=> "/#{locale.to_s}" + page.url, "children"=>create_json(page.sorted_published_child_pages_for_mobile), "target" => "_self"} + def create_json(pages) + item = {} + pages.each do |page| + if page.child_page.size > 0 + if page.page_type == "page" + if $mobile.blank? + item["#{page.name}"] = {"url"=> "/#{locale.to_s}" + page.url, "children"=>create_json(page.sorted_published_child_pages), "target" => "_self"} + else + item["#{page.name}"] = {"url"=> "/#{locale.to_s}" + page.url, "children"=>create_json(page.sorted_published_child_pages_for_mobile), "target" => "_self"} + end + elsif page.page_type == "link" + target = get_target(page.external_url) + if $mobile.blank? + item["#{page.name}"] = {"url"=> page.external_url, "children"=>create_json(page.sorted_published_child_pages), "target" => target} + else + item["#{page.name}"] = {"url"=> page.external_url, "children"=>create_json(page.sorted_published_child_pages_for_mobile), "target" => target} + end end - elsif page.page_type == "link" - target = get_target(page.external_url) - if $mobile.blank? - item["#{page.name}"] = {"url"=> page.external_url, "children"=>create_json(page.sorted_published_child_pages), "target" => target} - else - item["#{page.name}"] = {"url"=> page.external_url, "children"=>create_json(page.sorted_published_child_pages_for_mobile), "target" => target} + else + if page.page_type == "page" + item["#{page.name}"] = {"url"=> "/#{locale.to_s}" + page.url, "target" => "_self"} + elsif page.page_type == "link" + item["#{page.name}"] = {"url"=> page.external_url, "target" => get_target(page.external_url)} end end - else - if page.page_type == "page" - item["#{page.name}"] = {"url"=> "/#{locale.to_s}" + page.url, "target" => "_self"} - elsif page.page_type == "link" - item["#{page.name}"] = {"url"=> page.external_url, "target" => get_target(page.external_url)} + end + item + end + @items = create_json(@pages) + menu_file = File.open(File.join(Rails.root, 'app', 'templates', "#{@key}", "/home/menu.html.erb")) + doc = Nokogiri::HTML(menu_file, nil, "UTF-8") + menu_file.close + + temp = [] + @menus = [] + @menus_items = [] + + temp << doc.css("*[data-menu-level='0']") + temp << doc.css("*[data-menu-level='1']") + temp << doc.css("*[data-menu-level='2']") + + + temp[0] = temp[0].to_s.gsub(temp[1].to_s,"{{level}}") + temp[1] = temp[1].to_s.gsub(temp[2].to_s,"{{level}}") + temp[2] = temp[2].to_s + + + temp.each_with_index do |menu,i| + t = Nokogiri::HTML(menu, nil, "UTF-8") + a = t.css("*[data-menu-link='true']") + a[0]["href"] = "href_here" + a[0]["target"] = "target_here" + li = t.css("*[data-menu-level='#{i}'] > *") + @menus_items << li.to_html + ul = t.css("*[data-menu-level='#{i}']") + ul[0].inner_html = "{{here}}" + @menus << ul[0].to_html + end + + def create_menu(items,level) + html = "" + items.each do |key,item| + li = @menus_items[level].gsub("href_here",(item["url"] || "")) + li = li.gsub("{{link_name}}",(key || "")) + li = li.gsub("target_here",(item["target"] || "")) + li = request.original_fullpath == item['url'] ? li.gsub("{{active}}","active") : li.gsub("{{active}}","") + + if item["children"] && !item["children"].empty? + li = li.gsub("{{level}}",create_menu(item["children"],level + 1)) + else + li = li.gsub("{{level}}","") end + html = html + li end + html = @menus[level].gsub("{{here}}",html) + html = html.gsub("{{class_level}}",level.to_s) + html end - item - end - @items = create_json(@pages) - menu_file = File.open(File.join(Rails.root, 'app', 'templates', "#{@key}", "/home/menu.html.erb")) - doc = Nokogiri::HTML(menu_file, nil, "UTF-8") - menu_file.close - - temp = [] - @menus = [] - @menus_items = [] - - temp << doc.css("*[data-menu-level='0']") - temp << doc.css("*[data-menu-level='1']") - temp << doc.css("*[data-menu-level='2']") - - - temp[0] = temp[0].to_s.gsub(temp[1].to_s,"{{level}}") - temp[1] = temp[1].to_s.gsub(temp[2].to_s,"{{level}}") - temp[2] = temp[2].to_s - - - temp.each_with_index do |menu,i| - t = Nokogiri::HTML(menu, nil, "UTF-8") - a = t.css("*[data-menu-link='true']") - a[0]["href"] = "href_here" - a[0]["target"] = "target_here" - li = t.css("*[data-menu-level='#{i}'] > *") - @menus_items << li.to_html - ul = t.css("*[data-menu-level='#{i}']") - ul[0].inner_html = "{{here}}" - @menus << ul[0].to_html + h = create_menu(@items,0) + h.html_safe end - def create_menu(items,level) - html = "" - items.each do |key,item| - li = @menus_items[level].gsub("href_here",(item["url"] || "")) - li = li.gsub("{{link_name}}",(key || "")) - li = li.gsub("target_here",(item["target"] || "")) - li = request.original_fullpath == item['url'] ? li.gsub("{{active}}","active") : li.gsub("{{active}}","") - - if item["children"] && !item["children"].empty? - li = li.gsub("{{level}}",create_menu(item["children"],level + 1)) - else - li = li.gsub("{{level}}","") - end - html = html + li - end - html = @menus[level].gsub("{{here}}",html) - html = html.gsub("{{class_level}}",level.to_s) - html - end - h = create_menu(@items,0) - h.html_safe + menu_html end def render_view @@ -269,17 +273,18 @@ module ApplicationHelper doc.to_html.html_safe else unless data['impressionist'].blank? - impression = data['impressionist'].impressions.create - impression.user_id = request.session['user_id'] - impression.controller_name = params[:target_controller] - impression.action_name = params[:target_action] - impression.ip_address = request.remote_ip - impression.session_hash = request.session.id - impression.request_hash = @impressionist_hash - impression.referrer = request.referrer - impression.save - data['impressionist'].view_count = data['impressionist'].impressions.count - data['impressionist'].save + Thread.new do + impression = data['impressionist'].impressions.create + impression.user_id = request.session['user_id'] + impression.controller_name = params[:target_controller] + impression.action_name = params[:target_action] + impression.ip_address = request.remote_ip + impression.session_hash = request.session.id + impression.request_hash = @impressionist_hash + impression.referrer = request.referrer + impression.save + data['impressionist'].inc(view_count: 1) + end end wrap_elements = doc.css("*[data-list][data-level='0']") if wrap_elements.count == 0 diff --git a/app/helpers/orbit_backend_helper.rb b/app/helpers/orbit_backend_helper.rb index dc1e1b1..3ec9675 100644 --- a/app/helpers/orbit_backend_helper.rb +++ b/app/helpers/orbit_backend_helper.rb @@ -102,23 +102,29 @@ module OrbitBackendHelper end def display_visitors(options={}) - Impression.where(options).distinct(:request_hash).count + Impression.where(options).count end def display_visitors_today - display_visitors(created_at: {'$gte' => Time.now.beginning_of_day, '$lte' => Time.now}) + display_visitors(created_at: {'$gte' => Time.now.beginning_of_day}) end def display_visitors_this_week - display_visitors(created_at: {'$gte' => Time.now-7.days, '$lte' => Time.now}) + display_visitors(created_at: {'$gte' => Time.now.beginning_of_week}) end def display_visitors_this_month - display_visitors(created_at: {'$gte' => Time.now-30.days, '$lte' => Time.now}) + visitors_this_month = Rails.cache.fetch("visitors_this_month", expires_in: 1.day) do + display_visitors(created_at: {'$gte' => Time.now.beginning_of_month}) + end + visitors_this_month end def display_visitors_this_year - display_visitors(created_at: {'$gte' => Time.now-365.days, '$lte' => Time.now}) + visitors_this_year = Rails.cache.fetch("visitors_this_year", expires_in: 1.day) do + display_visitors(created_at: {'$gte' => Time.now.beginning_of_year}) + end + visitors_this_year end def get_month_traffic diff --git a/app/models/group.rb b/app/models/group.rb new file mode 100644 index 0000000..426f0ad --- /dev/null +++ b/app/models/group.rb @@ -0,0 +1,20 @@ +class Group + include Mongoid::Document + include Mongoid::Timestamps + include Slug + + field :title, as: :slug_title, type: String, localize: true + field :description, localize: true + field :admins, type: Array, default: [] + field :privacy, default: "closed" + mount_uploader :image, ImageUploader + + belongs_to :group_category + has_and_belongs_to_many :users + has_many :group_posts + + scope :closed, ->{ where(privacy: "closed") } + scope :open, ->{ where(privacy: "open") } + + +end \ No newline at end of file diff --git a/app/models/group_category.rb b/app/models/group_category.rb new file mode 100644 index 0000000..5a3e7a5 --- /dev/null +++ b/app/models/group_category.rb @@ -0,0 +1,8 @@ +class GroupCategory + include Mongoid::Document + include Mongoid::Timestamps + + field :title, localize: true + + has_many :groups +end \ No newline at end of file diff --git a/app/models/group_post.rb b/app/models/group_post.rb new file mode 100644 index 0000000..4177b46 --- /dev/null +++ b/app/models/group_post.rb @@ -0,0 +1,14 @@ +class GroupPost + include Mongoid::Document + include Mongoid::Timestamps + include Slug + + field :title, as: :slug_title, type: String + field :content + field :read_by, type: Array, default: [] + field :author, type: BSON::ObjectId + mount_uploader :image, ImageUploader + + belongs_to :group + +end \ No newline at end of file diff --git a/app/models/member_profile.rb b/app/models/member_profile.rb index 1e3680b..324f19b 100644 --- a/app/models/member_profile.rb +++ b/app/models/member_profile.rb @@ -52,6 +52,13 @@ class MemberProfile end end + def name_translations + { + "en" => "#{self.first_name_translations["en"]} #{self.last_name_translations["zh_tw"]}", + "zh_tw" => "#{self.last_name_translations["zh_tw"]} #{self.first_name_translations["zh_tw"]}" + } + end + def disable_role=(var) var[:id].each do |id,val| if (val=="true") diff --git a/app/models/module_app.rb b/app/models/module_app.rb index efee743..40d8ac0 100644 --- a/app/models/module_app.rb +++ b/app/models/module_app.rb @@ -15,6 +15,7 @@ class ModuleApp field :desktop_enabled, type: Boolean, default: false field :widget_settings field :store_permission_granted, type: Boolean, default: false + field :cache_models, type: Array, default: [] has_many :categories, dependent: :destroy, :autosave => true has_and_belongs_to_many :tags, dependent: :destroy, :autosave => true @@ -34,6 +35,7 @@ class ModuleApp self[:widget_methods] = reg.get_widget_methods self[:widget_settings] = reg.get_widget_settings self[:desktop_enabled] = reg.is_desktop_enabled + self[:cache_models] = reg.get_models_to_cache end def sub_managers diff --git a/app/models/orbit_observer.rb b/app/models/orbit_observer.rb new file mode 100644 index 0000000..92e1279 --- /dev/null +++ b/app/models/orbit_observer.rb @@ -0,0 +1,26 @@ +class OrbitObserver < Mongoid::Observer + models_to_cache = OrbitApp.get_models_for_caching + observe models_to_cache.keys + + def after_save(document) + clear_cache(document) + end + + def after_destroy(document) + clear_cache(document) + end + + def clear_cache(document) + model_module_hash = OrbitApp.get_model_hash_for_caching + case document.class.to_s + when 'Tag' + document.module_app.each do |module_app| + Rails.cache.delete_matched( /#{ module_app.key }/ ) + end + when 'Category' + Rails.cache.delete_matched( /#{ document.module_app.key }/ ) + else + Rails.cache.delete_matched( /#{model_module_hash[document.class.name.underscore.to_sym]}/ ) + end + end +end \ No newline at end of file diff --git a/app/models/page.rb b/app/models/page.rb index 539b2a7..aeea7fe 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -31,6 +31,15 @@ class Page belongs_to :parent_page, :class_name => 'Page', :inverse_of => :child_page before_create :assign_page_number + + after_save :clear_cache + after_destroy :clear_cache + + def clear_cache + I18n.available_locales.each do |locale| + Rails.cache.delete_matched( /main_menu/ ) + end + end def assign_page_number parent_page = self.parent_page diff --git a/app/models/sub_part.rb b/app/models/sub_part.rb index fb2c1e4..c2dd336 100644 --- a/app/models/sub_part.rb +++ b/app/models/sub_part.rb @@ -16,4 +16,11 @@ class SubPart belongs_to :page_part belongs_to :mobile_page_part + + after_save :clear_cache + after_destroy :clear_cache + + def clear_cache + Rails.cache.delete_matched( /#{self.id.to_s}/ ) + end end \ No newline at end of file diff --git a/app/models/user.rb b/app/models/user.rb index f11c615..fc44c65 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -20,6 +20,7 @@ class User belongs_to :workgroup has_many :authorizations belongs_to :member_profile + has_and_belongs_to_many :groups has_one :facebook, :autosave => true, :dependent => :destroy has_one :google, :autosave => true, :dependent => :destroy # has_one :desktop, :dependent => :destroy diff --git a/app/templates/orbit_bootstrap/assets/images/announcement-default.jpg b/app/templates/orbit_bootstrap/assets/images/announcement-default.jpg index 3307828..b6b82f0 100644 Binary files a/app/templates/orbit_bootstrap/assets/images/announcement-default.jpg and b/app/templates/orbit_bootstrap/assets/images/announcement-default.jpg differ diff --git a/app/templates/orbit_bootstrap/assets/javascripts/app.js b/app/templates/orbit_bootstrap/assets/javascripts/app.js index f806c79..139e974 100644 --- a/app/templates/orbit_bootstrap/assets/javascripts/app.js +++ b/app/templates/orbit_bootstrap/assets/javascripts/app.js @@ -1,108 +1,131 @@ -(function($) { +(function( $ ) { "use strict" function init() { - var doc = document; + var doc = document, + lang = doc.documentElement.lang; var orbit = { - // Cross browser add class function - addClass: function(el, className) { - if (el.classList) { - el.classList.add(className); - } else { - el.className += ' ' + className; - } - }, - // Cross browser has class function - hasClass: function(el, cls) { - return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1; - }, - // Add class name to the menu item when its children items are more than eight - addMegaDropdownClass: function(el, len) { - for (var i = 0; i < el.length; i++) { - if (el[i].children.length > len) { - orbit.addClass(el[i].parentNode, 'mega-dropdown'); + + helpers : { + // Cross-browser class manipulation + addClass: function( el, className ) { + if ( el.classList ) { + el.classList.add( className ); + } else { + el.className += " " + className; + } + }, + hasClass: function( el, cls ) { + return ( " " + el.className + " " ).indexOf( " " + cls + " " ) > -1; } - } - }, - // Append caret to menu item if it has dropdown - addCaret: function() { - var list = doc.querySelectorAll('.page_menu.level_2'); - for (var i = 0, len = list.length; i < len; i++) { - var node = doc.createElement('span'); - node.className = 'caret'; - list[i].parentNode.appendChild(node); - } - }, - // Add link and cursor class name on element that has data-link attribute - addLinkOnADBanner: function(els) { - $.each(els, function(i) { - if ($(this).data('link') !== "" && !$(this).hasClass('youtube')) { - $(this).on('click', function() { - var target = $(this).data('target'), - link = $(this).data('link'); - if (target === '_blank') { - window.open(link, target); - } else { - window.location.href = link; + }, + + plugins : { + // RWD image resize script + bullEye: function() { + $( ".bullseye" ).bullseye({ + fadeEffect: false + }); + } + }, + + nav : { + // Add class name to the menu item when its child items are more than 8 items + addMegaDropdownClass: function( els, len, className ) { + var els = doc.querySelectorAll( els ), + elsLen = els.length, + i = -1; + + if( elsLen > 1 ) { + for ( i = 0; i < elsLen; i++ ) { + if ( els[ i ].children.length > len ) { + this.helpers.addClass( els[ i ].parentNode, className || "mega-dropdown" ); + } } - }).addClass('cursor'); + } + }, + // Append caret to menu item if it has dropdown + addCaret: function() { + var els = doc.querySelectorAll( ".page_menu.level_2" ), + len = els.length, + i = -1; + + for ( i = 0; i < len; i++ ) { + var node = doc.createElement( "span" ); + node.className = "caret"; + els[ i ].parentNode.appendChild( node ); + } } - }); - }, - // Announcement text truncation - truncation: function(el, len) { - for (var i = 0; i < el.length; i++) { - if (el[i].firstChild !== null) { - if (el[i].firstChild.length > len) { - var newStr = el[i].firstChild.nodeValue, - newStr = newStr.substring(0, len) + '...' - el - .eq(i) - .text(newStr); + }, + + announcement: { + // Announcement text truncation + truncateAnnouncement: function( els, maxLen ) { + var els = doc.querySelectorAll( els ), + newTitle = ""; + i = -1, + elsLen = els.length; + + for( i = 0; i < elsLen; i ++ ) { + if ( els[ i ].firstChild !== null ) { + if( els[ i ].firstChild.length > maxLen ) { + newTitle = els[ i ].firstChild.textContent; + els[ i ].textContent = newTitle.substring( 0, maxLen ) + "..."; + } + } + } + } + }, + + // Add link and cursor class name on element that has data-link attribute + addLinkOnADBanner: function( els ) { + $.each( els, function() { + if ( $( this ).data( "link" ) !== "" && !$( this ).hasClass( "youtube" ) ) { + $( this ).on( "click", function() { + var target = $( this ).data( "target" ), + link = $( this ).data( "link" ); + if ( target === "_blank" ) { + window.open( link, target ); + } else { + window.location.href = link; + } + }).addClass( "cursor" ); + } + }); + }, + + // Sitemenu dropdown + sitemenuDropdown: function( els ) { + var els = doc.querySelectorAll(".sitemenu__list.level-2"), + len = els.length, + i = -1; + for ( i = 0; i < len; i++ ) { + if ( els[ i ].children.length ) { + var caret = doc.createElement( "span" ); + caret.className = "sitemenu___dropdown-toggle fa fa-caret-down"; + caret.setAttribute( "data-toggle", "dropdown" ); + + els[ i ].parentNode.insertBefore( caret, els[ i ] ); + this.helpers.addClass( els[ i ], "dropdown-menu" ); } } } - }, - // Sitemenu dropdown - sitemenuDropdown: function() { - var el = doc.querySelectorAll('.sitemenu__list.level-2'); - for (var i = 0, len = el.length; i < len; i++) { - if (el[i].hasChildNodes()) { - var caret = doc.createElement('span'); - caret.className = 'sitemenu___dropdown-toggle fa fa-caret-down'; - caret.setAttribute('data-toggle', 'dropdown'); - - el[i].parentNode.insertBefore(caret, el[i]); - orbit.addClass(el[i], 'dropdown-menu'); - } - } - } - } - - var plugin = { - // RWD image resize script - bullEye: function() { - $(".bullseye").bullseye({ - fadeEffect: false - }); - } } // Specific functions that will be running on homepage - if (doc.body.getAttribute('data-module') === 'home') { + if ( doc.body.getAttribute( "data-module" ) === "home" ) { } // Functions that will be running on every page orbit.sitemenuDropdown(); - plugin.bullEye(); + orbit.plugins.bullEye(); } - - $(document).ready(function($) { + $( document ).ready(function() { init(); }); -}(jQuery)); +}( jQuery )); diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/bootstrap/_mixins.scss b/app/templates/orbit_bootstrap/assets/stylesheets/bootstrap/_mixins.scss new file mode 100644 index 0000000..74ccf9f --- /dev/null +++ b/app/templates/orbit_bootstrap/assets/stylesheets/bootstrap/_mixins.scss @@ -0,0 +1,947 @@ +// +// Mixins +// -------------------------------------------------- + + +// Utilities +// ------------------------- + +// Clearfix +// Source: http://nicolasgallagher.com/micro-clearfix-hack/ +// +// For modern browsers +// 1. The space content is one way to avoid an Opera bug when the +// contenteditable attribute is included anywhere else in the document. +// Otherwise it causes space to appear at the top and bottom of elements +// that are clearfixed. +// 2. The use of `table` rather than `block` is only necessary if using +// `:before` to contain the top-margins of child elements. +@mixin clearfix() { + &:before, + &:after { + content: " "; // 1 + display: table; // 2 + } + &:after { + clear: both; + } +} + +// WebKit-style focus +@mixin tab-focus() { + // Default + outline: thin dotted; + // WebKit + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} + +// Center-align a block level element +@mixin center-block() { + display: block; + margin-left: auto; + margin-right: auto; +} + +// Sizing shortcuts +@mixin size($width, $height) { + width: $width; + height: $height; +} +@mixin square($size) { + @include size($size, $size); +} + +// Placeholder text +@mixin placeholder($color: $input-color-placeholder) { + &::-moz-placeholder { color: $color; // Firefox + opacity: 1; } // See https://github.com/twbs/bootstrap/pull/11526 + &:-ms-input-placeholder { color: $color; } // Internet Explorer 10+ + &::-webkit-input-placeholder { color: $color; } // Safari and Chrome +} + +// Text overflow +// Requires inline-block or block for proper styling +@mixin text-overflow() { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +// CSS image replacement +// +// Heads up! v3 launched with with only `.hide-text()`, but per our pattern for +// mixins being reused as classes with the same name, this doesn't hold up. As +// of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. Note +// that we cannot chain the mixins together in Less, so they are repeated. +// +// Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 + +// Deprecated as of v3.0.1 (will be removed in v4) +@mixin hide-text() { + font: #{0/0} a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} +// New mixin to use as of v3.0.1 +@mixin text-hide() { + @include hide-text(); +} + + + +// CSS3 PROPERTIES +// -------------------------------------------------- + +// Single side border-radius +@mixin border-top-radius($radius) { + border-top-right-radius: $radius; + border-top-left-radius: $radius; +} +@mixin border-right-radius($radius) { + border-bottom-right-radius: $radius; + border-top-right-radius: $radius; +} +@mixin border-bottom-radius($radius) { + border-bottom-right-radius: $radius; + border-bottom-left-radius: $radius; +} +@mixin border-left-radius($radius) { + border-bottom-left-radius: $radius; + border-top-left-radius: $radius; +} + +// Drop shadows +// +// Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's +// supported browsers that have box shadow capabilities now support the +// standard `box-shadow` property. +@mixin box-shadow($shadow...) { + -webkit-box-shadow: $shadow; // iOS <4.3 & Android <4.1 + box-shadow: $shadow; +} + +// Transitions +@mixin transition($transition...) { + -webkit-transition: $transition; + transition: $transition; +} +@mixin transition-property($transition-property...) { + -webkit-transition-property: $transition-property; + transition-property: $transition-property; +} +@mixin transition-delay($transition-delay) { + -webkit-transition-delay: $transition-delay; + transition-delay: $transition-delay; +} +@mixin transition-duration($transition-duration...) { + -webkit-transition-duration: $transition-duration; + transition-duration: $transition-duration; +} +@mixin transition-transform($transition...) { + -webkit-transition: -webkit-transform $transition; + -moz-transition: -moz-transform $transition; + -o-transition: -o-transform $transition; + transition: transform $transition; +} + +// Transformations +@mixin rotate($degrees) { + -webkit-transform: rotate($degrees); + -ms-transform: rotate($degrees); // IE9 only + transform: rotate($degrees); +} +@mixin scale($scale-args...) { + -webkit-transform: scale($scale-args); + -ms-transform: scale($scale-args); // IE9 only + transform: scale($scale-args); +} +@mixin translate($x, $y) { + -webkit-transform: translate($x, $y); + -ms-transform: translate($x, $y); // IE9 only + transform: translate($x, $y); +} +@mixin skew($x, $y) { + -webkit-transform: skew($x, $y); + -ms-transform: skewX($x) skewY($y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+ + transform: skew($x, $y); +} +@mixin translate3d($x, $y, $z) { + -webkit-transform: translate3d($x, $y, $z); + transform: translate3d($x, $y, $z); +} + +@mixin rotateX($degrees) { + -webkit-transform: rotateX($degrees); + -ms-transform: rotateX($degrees); // IE9 only + transform: rotateX($degrees); +} +@mixin rotateY($degrees) { + -webkit-transform: rotateY($degrees); + -ms-transform: rotateY($degrees); // IE9 only + transform: rotateY($degrees); +} +@mixin perspective($perspective) { + -webkit-perspective: $perspective; + -moz-perspective: $perspective; + perspective: $perspective; +} +@mixin perspective-origin($perspective) { + -webkit-perspective-origin: $perspective; + -moz-perspective-origin: $perspective; + perspective-origin: $perspective; +} +@mixin transform-origin($origin) { + -webkit-transform-origin: $origin; + -moz-transform-origin: $origin; + -ms-transform-origin: $origin; // IE9 only + transform-origin: $origin; +} + +// Animations +@mixin animation($animation) { + -webkit-animation: $animation; + animation: $animation; +} +@mixin animation-name($name) { + -webkit-animation-name: $name; + animation-name: $name; +} +@mixin animation-duration($duration) { + -webkit-animation-duration: $duration; + animation-duration: $duration; +} +@mixin animation-timing-function($timing-function) { + -webkit-animation-timing-function: $timing-function; + animation-timing-function: $timing-function; +} +@mixin animation-delay($delay) { + -webkit-animation-delay: $delay; + animation-delay: $delay; +} +@mixin animation-iteration-count($iteration-count) { + -webkit-animation-iteration-count: $iteration-count; + animation-iteration-count: $iteration-count; +} +@mixin animation-direction($direction) { + -webkit-animation-direction: $direction; + animation-direction: $direction; +} + +// Backface visibility +// Prevent browsers from flickering when using CSS 3D transforms. +// Default value is `visible`, but can be changed to `hidden` +@mixin backface-visibility($visibility){ + -webkit-backface-visibility: $visibility; + -moz-backface-visibility: $visibility; + backface-visibility: $visibility; +} + +// Box sizing +@mixin box-sizing($boxmodel) { + -webkit-box-sizing: $boxmodel; + -moz-box-sizing: $boxmodel; + box-sizing: $boxmodel; +} + +// User select +// For selecting text on the page +@mixin user-select($select) { + -webkit-user-select: $select; + -moz-user-select: $select; + -ms-user-select: $select; // IE10+ + user-select: $select; +} + +// Resize anything +@mixin resizable($direction) { + resize: $direction; // Options: horizontal, vertical, both + overflow: auto; // Safari fix +} + +// CSS3 Content Columns +@mixin content-columns($column-count, $column-gap: $grid-gutter-width) { + -webkit-column-count: $column-count; + -moz-column-count: $column-count; + column-count: $column-count; + -webkit-column-gap: $column-gap; + -moz-column-gap: $column-gap; + column-gap: $column-gap; +} + +// Optional hyphenation +@mixin hyphens($mode: auto) { + word-wrap: break-word; + -webkit-hyphens: $mode; + -moz-hyphens: $mode; + -ms-hyphens: $mode; // IE10+ + -o-hyphens: $mode; + hyphens: $mode; +} + +// Opacity +@mixin opacity($opacity) { + opacity: $opacity; + // IE8 filter + $opacity-ie: ($opacity * 100); + filter: #{alpha(opacity=$opacity-ie)}; +} + + + +// GRADIENTS +// -------------------------------------------------- + + + +// Horizontal gradient, from left to right +// +// Creates two color stops, start and end, by specifying a color and position for each color stop. +// Color stops are not available in IE9 and below. +@mixin gradient-horizontal($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) { + background-image: -webkit-linear-gradient(left, color-stop($start-color $start-percent), color-stop($end-color $end-percent)); // Safari 5.1-6, Chrome 10+ + background-image: linear-gradient(to right, $start-color $start-percent, $end-color $end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+ + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down +} + +// Vertical gradient, from top to bottom +// +// Creates two color stops, start and end, by specifying a color and position for each color stop. +// Color stops are not available in IE9 and below. +@mixin gradient-vertical($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) { + background-image: -webkit-linear-gradient(top, $start-color $start-percent, $end-color $end-percent); // Safari 5.1-6, Chrome 10+ + background-image: linear-gradient(to bottom, $start-color $start-percent, $end-color $end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+ + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down +} + +@mixin gradient-directional($start-color: #555, $end-color: #333, $deg: 45deg) { + background-repeat: repeat-x; + background-image: -webkit-linear-gradient($deg, $start-color, $end-color); // Safari 5.1-6, Chrome 10+ + background-image: linear-gradient($deg, $start-color, $end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+ +} +@mixin gradient-horizontal-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) { + background-image: -webkit-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color); + background-image: linear-gradient(to right, $start-color, $mid-color $color-stop, $end-color); + background-repeat: no-repeat; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down, gets no color-stop at all for proper fallback +} +@mixin gradient-vertical-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) { + background-image: -webkit-linear-gradient($start-color, $mid-color $color-stop, $end-color); + background-image: linear-gradient($start-color, $mid-color $color-stop, $end-color); + background-repeat: no-repeat; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down, gets no color-stop at all for proper fallback +} +@mixin gradient-radial($inner-color: #555, $outer-color: #333) { + background-image: -webkit-radial-gradient(circle, $inner-color, $outer-color); + background-image: radial-gradient(circle, $inner-color, $outer-color); + background-repeat: no-repeat; +} +@mixin gradient-striped($color: rgba(255,255,255,.15), $angle: 45deg) { + background-image: -webkit-linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent); + background-image: linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent); +} + +// Reset filters for IE +// +// When you need to remove a gradient background, do not forget to use this to reset +// the IE filter for IE9 and below. +@mixin reset-filter() { + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} + + + +// Retina images +// +// Short retina mixin for setting background-image and -size + +@mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) { + background-image: url(if($bootstrap-sass-asset-helper, twbs-image-path("#{$file-1x}"), "#{$file-1x}")); + + @media + only screen and (-webkit-min-device-pixel-ratio: 2), + only screen and ( min--moz-device-pixel-ratio: 2), + only screen and ( -o-min-device-pixel-ratio: 2/1), + only screen and ( min-device-pixel-ratio: 2), + only screen and ( min-resolution: 192dpi), + only screen and ( min-resolution: 2dppx) { + background-image: url(if($bootstrap-sass-asset-helper, twbs-image-path("#{$file-2x}"), "#{$file-2x}")); + background-size: $width-1x $height-1x; + } +} + + +// Responsive image +// +// Keep images from scaling beyond the width of their parents. + +@mixin img-responsive($display: block) { + display: $display; + max-width: 100%; // Part 1: Set a maximum relative to the parent + height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching +} + + +// COMPONENT MIXINS +// -------------------------------------------------- + +// Horizontal dividers +// ------------------------- +// Dividers (basically an hr) within dropdowns and nav lists +@mixin nav-divider($color: #e5e5e5) { + height: 1px; + margin: (($line-height-computed / 2) - 1) 0; + overflow: hidden; + background-color: $color; +} + +// Panels +// ------------------------- +@mixin panel-variant($border, $heading-text-color, $heading-bg-color, $heading-border) { + border-color: $border; + + & > .panel-heading { + color: $heading-text-color; + background-color: $heading-bg-color; + border-color: $heading-border; + + + .panel-collapse .panel-body { + border-top-color: $border; + } + } + & > .panel-footer { + + .panel-collapse .panel-body { + border-bottom-color: $border; + } + } +} + +// Alerts +// ------------------------- +@mixin alert-variant($background, $border, $text-color) { + background-color: $background; + border-color: $border; + color: $text-color; + + hr { + border-top-color: darken($border, 5%); + } + .alert-link { + color: darken($text-color, 10%); + } +} + +// Tables +// ------------------------- +@mixin table-row-variant($state, $background) { + // Exact selectors below required to override `.table-striped` and prevent + // inheritance to nested tables. + .table > thead > tr, + .table > tbody > tr, + .table > tfoot > tr { + > td.#{$state}, + > th.#{$state}, + &.#{$state} > td, + &.#{$state} > th { + background-color: $background; + } + } + + // Hover states for `.table-hover` + // Note: this is not available for cells or rows within `thead` or `tfoot`. + .table-hover > tbody > tr { + > td.#{$state}:hover, + > th.#{$state}:hover, + &.#{$state}:hover > td, + &.#{$state}:hover > th { + background-color: darken($background, 5%); + } + } +} + +// List Groups +// ------------------------- +@mixin list-group-item-variant($state, $background, $color) { + .list-group-item-#{$state} { + color: $color; + background-color: $background; + + // [converter] extracted a& to a.list-group-item-#{$state} + } + + a.list-group-item-#{$state} { + color: $color; + + .list-group-item-heading { color: inherit; } + + &:hover, + &:focus { + color: $color; + background-color: darken($background, 5%); + } + &.active, + &.active:hover, + &.active:focus { + color: #fff; + background-color: $color; + border-color: $color; + } + } +} + +// Button variants +// ------------------------- +// Easily pump out default styles, as well as :hover, :focus, :active, +// and disabled options for all buttons +@mixin button-variant($color, $background, $border) { + color: $color; + background-color: $background; + border-color: $border; + + &:hover, + &:focus, + &:active, + &.active { + color: $color; + background-color: darken($background, 8%); + border-color: darken($border, 12%); + } + .open & { &.dropdown-toggle { + color: $color; + background-color: darken($background, 8%); + border-color: darken($border, 12%); + } } + &:active, + &.active { + background-image: none; + } + .open & { &.dropdown-toggle { + background-image: none; + } } + &.disabled, + &[disabled], + fieldset[disabled] & { + &, + &:hover, + &:focus, + &:active, + &.active { + background-color: $background; + border-color: $border; + } + } + + .badge { + color: $background; + background-color: $color; + } +} + +// Button sizes +// ------------------------- +@mixin button-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) { + padding: $padding-vertical $padding-horizontal; + font-size: $font-size; + line-height: $line-height; + border-radius: $border-radius; +} + +// Pagination +// ------------------------- +@mixin pagination-size($padding-vertical, $padding-horizontal, $font-size, $border-radius) { + > li { + > a, + > span { + padding: $padding-vertical $padding-horizontal; + font-size: $font-size; + } + &:first-child { + > a, + > span { + @include border-left-radius($border-radius); + } + } + &:last-child { + > a, + > span { + @include border-right-radius($border-radius); + } + } + } +} + +// Labels +// ------------------------- +@mixin label-variant($color) { + background-color: $color; + &[href] { + &:hover, + &:focus { + background-color: darken($color, 10%); + } + } +} + +// Contextual backgrounds +// ------------------------- +// [converter] $parent hack +@mixin bg-variant($parent, $color) { + #{$parent} { + background-color: $color; + } + a#{$parent}:hover { + background-color: darken($color, 10%); + } +} + +// Typography +// ------------------------- +// [converter] $parent hack +@mixin text-emphasis-variant($parent, $color) { + #{$parent} { + color: $color; + } + a#{$parent}:hover { + color: darken($color, 10%); + } +} + +// Navbar vertical align +// ------------------------- +// Vertically center elements in the navbar. +// Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. +@mixin navbar-vertical-align($element-height) { + margin-top: (($navbar-height - $element-height) / 2); + margin-bottom: (($navbar-height - $element-height) / 2); +} + +// Progress bars +// ------------------------- +@mixin progress-bar-variant($color) { + background-color: $color; + .progress-striped & { + @include gradient-striped(); + } +} + +// Responsive utilities +// ------------------------- +// More easily include all the states for responsive-utilities.less. +// [converter] $parent hack +@mixin responsive-visibility($parent) { + #{$parent} { + display: block !important; + } + table#{$parent} { display: table; } + tr#{$parent} { display: table-row !important; } + th#{$parent}, + td#{$parent} { display: table-cell !important; } +} + +// [converter] $parent hack +@mixin responsive-invisibility($parent) { + #{$parent} { + display: none !important; + } +} + + +// Grid System +// ----------- + +// Centered container element +@mixin container-fixed() { + margin-right: auto; + margin-left: auto; + padding-left: ($grid-gutter-width / 2); + padding-right: ($grid-gutter-width / 2); + @include clearfix(); +} + +// Creates a wrapper for a series of columns +@mixin make-row($gutter: $grid-gutter-width) { + margin-left: ($gutter / -2); + margin-right: ($gutter / -2); + @include clearfix(); +} + +// Generate the extra small columns +@mixin make-xs-column($columns, $gutter: $grid-gutter-width) { + position: relative; + float: left; + width: percentage(($columns / $grid-columns)); + min-height: 1px; + padding-left: ($gutter / 2); + padding-right: ($gutter / 2); +} +@mixin make-xs-column-offset($columns) { + @media (min-width: $screen-xs-min) { + margin-left: percentage(($columns / $grid-columns)); + } +} +@mixin make-xs-column-push($columns) { + @media (min-width: $screen-xs-min) { + left: percentage(($columns / $grid-columns)); + } +} +@mixin make-xs-column-pull($columns) { + @media (min-width: $screen-xs-min) { + right: percentage(($columns / $grid-columns)); + } +} + + +// Generate the small columns +@mixin make-sm-column($columns, $gutter: $grid-gutter-width) { + position: relative; + min-height: 1px; + padding-left: ($gutter / 2); + padding-right: ($gutter / 2); + + @media (min-width: $screen-sm-min) { + float: left; + width: percentage(($columns / $grid-columns)); + } +} +@mixin make-sm-column-offset($columns) { + @media (min-width: $screen-sm-min) { + margin-left: percentage(($columns / $grid-columns)); + } +} +@mixin make-sm-column-push($columns) { + @media (min-width: $screen-sm-min) { + left: percentage(($columns / $grid-columns)); + } +} +@mixin make-sm-column-pull($columns) { + @media (min-width: $screen-sm-min) { + right: percentage(($columns / $grid-columns)); + } +} + + +// Generate the medium columns +@mixin make-md-column($columns, $gutter: $grid-gutter-width) { + position: relative; + min-height: 1px; + padding-left: ($gutter / 2); + padding-right: ($gutter / 2); + + @media (min-width: $screen-md-min) { + float: left; + width: percentage(($columns / $grid-columns)); + } +} +@mixin make-md-column-offset($columns) { + @media (min-width: $screen-md-min) { + margin-left: percentage(($columns / $grid-columns)); + } +} +@mixin make-md-column-push($columns) { + @media (min-width: $screen-md-min) { + left: percentage(($columns / $grid-columns)); + } +} +@mixin make-md-column-pull($columns) { + @media (min-width: $screen-md-min) { + right: percentage(($columns / $grid-columns)); + } +} + + +// Generate the large columns +@mixin make-lg-column($columns, $gutter: $grid-gutter-width) { + position: relative; + min-height: 1px; + padding-left: ($gutter / 2); + padding-right: ($gutter / 2); + + @media (min-width: $screen-lg-min) { + float: left; + width: percentage(($columns / $grid-columns)); + } +} +@mixin make-lg-column-offset($columns) { + @media (min-width: $screen-lg-min) { + margin-left: percentage(($columns / $grid-columns)); + } +} +@mixin make-lg-column-push($columns) { + @media (min-width: $screen-lg-min) { + left: percentage(($columns / $grid-columns)); + } +} +@mixin make-lg-column-pull($columns) { + @media (min-width: $screen-lg-min) { + right: percentage(($columns / $grid-columns)); + } +} + + +// Framework grid generation +// +// Used only by Bootstrap to generate the correct number of grid classes given +// any value of `$grid-columns`. + +// [converter] This is defined recursively in LESS, but Sass supports real loops +@mixin make-grid-columns() { + $list: ''; + $i: 1; + $list: ".col-xs-#{$i}, .col-sm-#{$i}, .col-md-#{$i}, .col-lg-#{$i}"; + @for $i from (1 + 1) through $grid-columns { + $list: "#{$list}, .col-xs-#{$i}, .col-sm-#{$i}, .col-md-#{$i}, .col-lg-#{$i}"; + } + #{$list} { + position: relative; + // Prevent columns from collapsing when empty + min-height: 1px; + // Inner gutter via padding + padding-left: ($grid-gutter-width / 2); + padding-right: ($grid-gutter-width / 2); + } +} + + +// [converter] This is defined recursively in LESS, but Sass supports real loops +@mixin float-grid-columns($class) { + $list: ''; + $i: 1; + $list: ".col-#{$class}-#{$i}"; + @for $i from (1 + 1) through $grid-columns { + $list: "#{$list}, .col-#{$class}-#{$i}"; + } + #{$list} { + float: left; + } +} + + +@mixin calc-grid-column($index, $class, $type) { + @if ($type == width) and ($index > 0) { + .col-#{$class}-#{$index} { + width: percentage(($index / $grid-columns)); + } + } + @if ($type == push) { + .col-#{$class}-push-#{$index} { + left: percentage(($index / $grid-columns)); + } + } + @if ($type == pull) { + .col-#{$class}-pull-#{$index} { + right: percentage(($index / $grid-columns)); + } + } + @if ($type == offset) { + .col-#{$class}-offset-#{$index} { + margin-left: percentage(($index / $grid-columns)); + } + } +} + +// [converter] This is defined recursively in LESS, but Sass supports real loops +@mixin loop-grid-columns($columns, $class, $type) { + @for $i from 0 through $columns { + @include calc-grid-column($i, $class, $type); + } +} + + +// Create grid for specific class +@mixin make-grid($class) { + @include float-grid-columns($class); + @include loop-grid-columns($grid-columns, $class, width); + @include loop-grid-columns($grid-columns, $class, pull); + @include loop-grid-columns($grid-columns, $class, push); + @include loop-grid-columns($grid-columns, $class, offset); +} + +// Form validation states +// +// Used in forms.less to generate the form validation CSS for warnings, errors, +// and successes. + +@mixin form-control-validation($text-color: #555, $border-color: #ccc, $background-color: #f5f5f5) { + // Color the label and help text + .help-block, + .control-label, + .radio, + .checkbox, + .radio-inline, + .checkbox-inline { + color: $text-color; + } + // Set the border and box shadow on specific inputs to match + .form-control { + border-color: $border-color; + @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work + &:focus { + border-color: darken($border-color, 10%); + $shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten($border-color, 20%); + @include box-shadow($shadow); + } + } + // Set validation states also for addons + .input-group-addon { + color: $text-color; + border-color: $border-color; + background-color: $background-color; + } + // Optional feedback icon + .form-control-feedback { + color: $text-color; + } +} + +// Form control focus state +// +// Generate a customized focus state and for any input with the specified color, +// which defaults to the `$input-focus-border` variable. +// +// We highly encourage you to not customize the default value, but instead use +// this to tweak colors on an as-needed basis. This aesthetic change is based on +// WebKit's default styles, but applicable to a wider range of browsers. Its +// usability and accessibility should be taken into account with any change. +// +// Example usage: change the default blue border and shadow to white for better +// contrast against a dark gray background. + +@mixin form-control-focus($color: $input-border-focus) { + $color-rgba: rgba(red($color), green($color), blue($color), .6); + &:focus { + border-color: $color; + outline: 0; + @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px $color-rgba); + } +} + +// Form control sizing +// +// Relative text size, padding, and border-radii changes for form controls. For +// horizontal sizing, wrap controls in the predefined grid classes. `` background color +$input-bg: #fff !default; +//** `` background color +$input-bg-disabled: $gray-lighter !default; + +//** Text color for ``s +$input-color: $gray !default; +//** `` border color +$input-border: #ccc !default; +//** `` border radius +$input-border-radius: $border-radius-base !default; +//** Border color for inputs on focus +$input-border-focus: #66afe9 !default; + +//** Placeholder text color +$input-color-placeholder: $gray-light !default; + +//** Default `.form-control` height +$input-height-base: ($line-height-computed + ($padding-base-vertical * 2) + 2) !default; +//** Large `.form-control` height +$input-height-large: (ceil($font-size-large * $line-height-large) + ($padding-large-vertical * 2) + 2) !default; +//** Small `.form-control` height +$input-height-small: (floor($font-size-small * $line-height-small) + ($padding-small-vertical * 2) + 2) !default; + +$legend-color: $gray-dark !default; +$legend-border-color: #e5e5e5 !default; + +//** Background color for textual input addons +$input-group-addon-bg: $gray-lighter !default; +//** Border color for textual input addons +$input-group-addon-border-color: $input-border !default; + + +//== Dropdowns +// +//## Dropdown menu container and contents. + +//** Background for the dropdown menu. +$dropdown-bg: #fff !default; +//** Dropdown menu `border-color`. +$dropdown-border: rgba(0,0,0,.15) !default; +//** Dropdown menu `border-color` **for IE8**. +$dropdown-fallback-border: #ccc !default; +//** Divider color for between dropdown items. +$dropdown-divider-bg: #e5e5e5 !default; + +//** Dropdown link text color. +$dropdown-link-color: $gray-dark !default; +//** Hover color for dropdown links. +$dropdown-link-hover-color: darken($gray-dark, 5%) !default; +//** Hover background for dropdown links. +$dropdown-link-hover-bg: #f5f5f5 !default; + +//** Active dropdown menu item text color. +$dropdown-link-active-color: $component-active-color !default; +//** Active dropdown menu item background color. +$dropdown-link-active-bg: $component-active-bg !default; + +//** Disabled dropdown menu item background color. +$dropdown-link-disabled-color: $gray-light !default; + +//** Text color for headers within dropdown menus. +$dropdown-header-color: $gray-light !default; + +// Note: Deprecated $dropdown-caret-color as of v3.1.0 +$dropdown-caret-color: #000 !default; + + +//-- Z-index master list +// +// Warning: Avoid customizing these values. They're used for a bird's eye view +// of components dependent on the z-axis and are designed to all work together. +// +// Note: These variables are not generated into the Customizer. + +$zindex-navbar: 1000 !default; +$zindex-dropdown: 1000 !default; +$zindex-popover: 1010 !default; +$zindex-tooltip: 1030 !default; +$zindex-navbar-fixed: 1030 !default; +$zindex-modal-background: 1040 !default; +$zindex-modal: 1050 !default; + + +//== Media queries breakpoints +// +//## Define the breakpoints at which your layout will change, adapting to different screen sizes. + +// Extra small screen / phone +// Note: Deprecated $screen-xs and $screen-phone as of v3.0.1 +$screen-xs: 480px !default; +$screen-xs-min: $screen-xs !default; +$screen-phone: $screen-xs-min !default; + +// Small screen / tablet +// Note: Deprecated $screen-sm and $screen-tablet as of v3.0.1 +$screen-sm: 768px !default; +$screen-sm-min: $screen-sm !default; +$screen-tablet: $screen-sm-min !default; + +// Medium screen / desktop +// Note: Deprecated $screen-md and $screen-desktop as of v3.0.1 +$screen-md: 992px !default; +$screen-md-min: $screen-md !default; +$screen-desktop: $screen-md-min !default; + +// Large screen / wide desktop +// Note: Deprecated $screen-lg and $screen-lg-desktop as of v3.0.1 +$screen-lg: 1200px !default; +$screen-lg-min: $screen-lg !default; +$screen-lg-desktop: $screen-lg-min !default; + +// So media queries don't overlap when required, provide a maximum +$screen-xs-max: ($screen-sm-min - 1) !default; +$screen-sm-max: ($screen-md-min - 1) !default; +$screen-md-max: ($screen-lg-min - 1) !default; + + +//== Grid system +// +//## Define your custom responsive grid. + +//** Number of columns in the grid. +$grid-columns: 12 !default; +//** Padding between columns. Gets divided in half for the left and right. +$grid-gutter-width: 30px !default; +// Navbar collapse +//** Point at which the navbar becomes uncollapsed. +$grid-float-breakpoint: $screen-sm-min !default; +//** Point at which the navbar begins collapsing. +$grid-float-breakpoint-max: ($grid-float-breakpoint - 1) !default; + + +//== Container sizes +// +//## Define the maximum width of `.container` for different screen sizes. + +// Small screen / tablet +$container-tablet: ((720px + $grid-gutter-width)) !default; +//** For `$screen-sm-min` and up. +$container-sm: $container-tablet !default; + +// Medium screen / desktop +$container-desktop: ((940px + $grid-gutter-width)) !default; +//** For `$screen-md-min` and up. +$container-md: $container-desktop !default; + +// Large screen / wide desktop +$container-large-desktop: ((1140px + $grid-gutter-width)) !default; +//** For `$screen-lg-min` and up. +$container-lg: $container-large-desktop !default; + + +//== Navbar +// +//## + +// Basics of a navbar +$navbar-height: 50px !default; +$navbar-margin-bottom: $line-height-computed !default; +$navbar-border-radius: $border-radius-base !default; +$navbar-padding-horizontal: floor(($grid-gutter-width / 2)) !default; +$navbar-padding-vertical: (($navbar-height - $line-height-computed) / 2) !default; +$navbar-collapse-max-height: 340px !default; + +$navbar-default-color: #777 !default; +$navbar-default-bg: #f8f8f8 !default; +$navbar-default-border: darken($navbar-default-bg, 6.5%) !default; + +// Navbar links +$navbar-default-link-color: #777 !default; +$navbar-default-link-hover-color: #333 !default; +$navbar-default-link-hover-bg: transparent !default; +$navbar-default-link-active-color: #555 !default; +$navbar-default-link-active-bg: darken($navbar-default-bg, 6.5%) !default; +$navbar-default-link-disabled-color: #ccc !default; +$navbar-default-link-disabled-bg: transparent !default; + +// Navbar brand label +$navbar-default-brand-color: $navbar-default-link-color !default; +$navbar-default-brand-hover-color: darken($navbar-default-brand-color, 10%) !default; +$navbar-default-brand-hover-bg: transparent !default; + +// Navbar toggle +$navbar-default-toggle-hover-bg: #ddd !default; +$navbar-default-toggle-icon-bar-bg: #888 !default; +$navbar-default-toggle-border-color: #ddd !default; + + +// Inverted navbar +// Reset inverted navbar basics +$navbar-inverse-color: $gray-light !default; +$navbar-inverse-bg: #222 !default; +$navbar-inverse-border: darken($navbar-inverse-bg, 10%) !default; + +// Inverted navbar links +$navbar-inverse-link-color: $gray-light !default; +$navbar-inverse-link-hover-color: #fff !default; +$navbar-inverse-link-hover-bg: transparent !default; +$navbar-inverse-link-active-color: $navbar-inverse-link-hover-color !default; +$navbar-inverse-link-active-bg: darken($navbar-inverse-bg, 10%) !default; +$navbar-inverse-link-disabled-color: #444 !default; +$navbar-inverse-link-disabled-bg: transparent !default; + +// Inverted navbar brand label +$navbar-inverse-brand-color: $navbar-inverse-link-color !default; +$navbar-inverse-brand-hover-color: #fff !default; +$navbar-inverse-brand-hover-bg: transparent !default; + +// Inverted navbar toggle +$navbar-inverse-toggle-hover-bg: #333 !default; +$navbar-inverse-toggle-icon-bar-bg: #fff !default; +$navbar-inverse-toggle-border-color: #333 !default; + + +//== Navs +// +//## + +//=== Shared nav styles +$nav-link-padding: 10px 15px !default; +$nav-link-hover-bg: $gray-lighter !default; + +$nav-disabled-link-color: $gray-light !default; +$nav-disabled-link-hover-color: $gray-light !default; + +$nav-open-link-hover-color: #fff !default; + +//== Tabs +$nav-tabs-border-color: #ddd !default; + +$nav-tabs-link-hover-border-color: $gray-lighter !default; + +$nav-tabs-active-link-hover-bg: $body-bg !default; +$nav-tabs-active-link-hover-color: $gray !default; +$nav-tabs-active-link-hover-border-color: #ddd !default; + +$nav-tabs-justified-link-border-color: #ddd !default; +$nav-tabs-justified-active-link-border-color: $body-bg !default; + +//== Pills +$nav-pills-border-radius: $border-radius-base !default; +$nav-pills-active-link-hover-bg: $component-active-bg !default; +$nav-pills-active-link-hover-color: $component-active-color !default; + + +//== Pagination +// +//## + +$pagination-color: $link-color !default; +$pagination-bg: #fff !default; +$pagination-border: #ddd !default; + +$pagination-hover-color: $link-hover-color !default; +$pagination-hover-bg: $gray-lighter !default; +$pagination-hover-border: #ddd !default; + +$pagination-active-color: #fff !default; +$pagination-active-bg: $brand-primary !default; +$pagination-active-border: $brand-primary !default; + +$pagination-disabled-color: $gray-light !default; +$pagination-disabled-bg: #fff !default; +$pagination-disabled-border: #ddd !default; + + +//== Pager +// +//## + +$pager-bg: $pagination-bg !default; +$pager-border: $pagination-border !default; +$pager-border-radius: 15px !default; + +$pager-hover-bg: $pagination-hover-bg !default; + +$pager-active-bg: $pagination-active-bg !default; +$pager-active-color: $pagination-active-color !default; + +$pager-disabled-color: $pagination-disabled-color !default; + + +//== Jumbotron +// +//## + +$jumbotron-padding: 30px !default; +$jumbotron-color: inherit !default; +$jumbotron-bg: $gray-lighter !default; +$jumbotron-heading-color: inherit !default; +$jumbotron-font-size: ceil(($font-size-base * 1.5)) !default; + + +//== Form states and alerts +// +//## Define colors for form feedback states and, by default, alerts. + +$state-success-text: #3c763d !default; +$state-success-bg: #dff0d8 !default; +$state-success-border: darken(adjust-hue($state-success-bg, -10), 5%) !default; + +$state-info-text: #31708f !default; +$state-info-bg: #d9edf7 !default; +$state-info-border: darken(adjust-hue($state-info-bg, -10), 7%) !default; + +$state-warning-text: #8a6d3b !default; +$state-warning-bg: #fcf8e3 !default; +$state-warning-border: darken(adjust-hue($state-warning-bg, -10), 5%) !default; + +$state-danger-text: #a94442 !default; +$state-danger-bg: #f2dede !default; +$state-danger-border: darken(adjust-hue($state-danger-bg, -10), 5%) !default; + + +//== Tooltips +// +//## + +//** Tooltip max width +$tooltip-max-width: 200px !default; +//** Tooltip text color +$tooltip-color: #fff !default; +//** Tooltip background color +$tooltip-bg: #000 !default; +$tooltip-opacity: .9 !default; + +//** Tooltip arrow width +$tooltip-arrow-width: 5px !default; +//** Tooltip arrow color +$tooltip-arrow-color: $tooltip-bg !default; + + +//== Popovers +// +//## + +//** Popover body background color +$popover-bg: #fff !default; +//** Popover maximum width +$popover-max-width: 276px !default; +//** Popover border color +$popover-border-color: rgba(0,0,0,.2) !default; +//** Popover fallback border color +$popover-fallback-border-color: #ccc !default; + +//** Popover title background color +$popover-title-bg: darken($popover-bg, 3%) !default; + +//** Popover arrow width +$popover-arrow-width: 10px !default; +//** Popover arrow color +$popover-arrow-color: #fff !default; + +//** Popover outer arrow width +$popover-arrow-outer-width: ($popover-arrow-width + 1) !default; +//** Popover outer arrow color +$popover-arrow-outer-color: fadein($popover-border-color, 5%) !default; +//** Popover outer arrow fallback color +$popover-arrow-outer-fallback-color: darken($popover-fallback-border-color, 20%) !default; + + +//== Labels +// +//## + +//** Default label background color +$label-default-bg: $gray-light !default; +//** Primary label background color +$label-primary-bg: $brand-primary !default; +//** Success label background color +$label-success-bg: $brand-success !default; +//** Info label background color +$label-info-bg: $brand-info !default; +//** Warning label background color +$label-warning-bg: $brand-warning !default; +//** Danger label background color +$label-danger-bg: $brand-danger !default; + +//** Default label text color +$label-color: #fff !default; +//** Default text color of a linked label +$label-link-hover-color: #fff !default; + + +//== Modals +// +//## + +//** Padding applied to the modal body +$modal-inner-padding: 20px !default; + +//** Padding applied to the modal title +$modal-title-padding: 15px !default; +//** Modal title line-height +$modal-title-line-height: $line-height-base !default; + +//** Background color of modal content area +$modal-content-bg: #fff !default; +//** Modal content border color +$modal-content-border-color: rgba(0,0,0,.2) !default; +//** Modal content border color **for IE8** +$modal-content-fallback-border-color: #999 !default; + +//** Modal backdrop background color +$modal-backdrop-bg: #000 !default; +//** Modal backdrop opacity +$modal-backdrop-opacity: .5 !default; +//** Modal header border color +$modal-header-border-color: #e5e5e5 !default; +//** Modal footer border color +$modal-footer-border-color: $modal-header-border-color !default; + +$modal-lg: 900px !default; +$modal-md: 600px !default; +$modal-sm: 300px !default; + + +//== Alerts +// +//## Define alert colors, border radius, and padding. + +$alert-padding: 15px !default; +$alert-border-radius: $border-radius-base !default; +$alert-link-font-weight: bold !default; + +$alert-success-bg: $state-success-bg !default; +$alert-success-text: $state-success-text !default; +$alert-success-border: $state-success-border !default; + +$alert-info-bg: $state-info-bg !default; +$alert-info-text: $state-info-text !default; +$alert-info-border: $state-info-border !default; + +$alert-warning-bg: $state-warning-bg !default; +$alert-warning-text: $state-warning-text !default; +$alert-warning-border: $state-warning-border !default; + +$alert-danger-bg: $state-danger-bg !default; +$alert-danger-text: $state-danger-text !default; +$alert-danger-border: $state-danger-border !default; + + +//== Progress bars +// +//## + +//** Background color of the whole progress component +$progress-bg: #f5f5f5 !default; +//** Progress bar text color +$progress-bar-color: #fff !default; + +//** Default progress bar color +$progress-bar-bg: $brand-primary !default; +//** Success progress bar color +$progress-bar-success-bg: $brand-success !default; +//** Warning progress bar color +$progress-bar-warning-bg: $brand-warning !default; +//** Danger progress bar color +$progress-bar-danger-bg: $brand-danger !default; +//** Info progress bar color +$progress-bar-info-bg: $brand-info !default; + + +//== List group +// +//## + +//** Background color on `.list-group-item` +$list-group-bg: #fff !default; +//** `.list-group-item` border color +$list-group-border: #ddd !default; +//** List group border radius +$list-group-border-radius: $border-radius-base !default; + +//** Background color of single list elements on hover +$list-group-hover-bg: #f5f5f5 !default; +//** Text color of active list elements +$list-group-active-color: $component-active-color !default; +//** Background color of active list elements +$list-group-active-bg: $component-active-bg !default; +//** Border color of active list elements +$list-group-active-border: $list-group-active-bg !default; +$list-group-active-text-color: lighten($list-group-active-bg, 40%) !default; + +$list-group-link-color: #555 !default; +$list-group-link-heading-color: #333 !default; + + +//== Panels +// +//## + +$panel-bg: #fff !default; +$panel-body-padding: 15px !default; +$panel-border-radius: $border-radius-base !default; + +//** Border color for elements within panels +$panel-inner-border: #ddd !default; +$panel-footer-bg: #f5f5f5 !default; + +$panel-default-text: $gray-dark !default; +$panel-default-border: #ddd !default; +$panel-default-heading-bg: #f5f5f5 !default; + +$panel-primary-text: #fff !default; +$panel-primary-border: $brand-primary !default; +$panel-primary-heading-bg: $brand-primary !default; + +$panel-success-text: $state-success-text !default; +$panel-success-border: $state-success-border !default; +$panel-success-heading-bg: $state-success-bg !default; + +$panel-info-text: $state-info-text !default; +$panel-info-border: $state-info-border !default; +$panel-info-heading-bg: $state-info-bg !default; + +$panel-warning-text: $state-warning-text !default; +$panel-warning-border: $state-warning-border !default; +$panel-warning-heading-bg: $state-warning-bg !default; + +$panel-danger-text: $state-danger-text !default; +$panel-danger-border: $state-danger-border !default; +$panel-danger-heading-bg: $state-danger-bg !default; + + +//== Thumbnails +// +//## + +//** Padding around the thumbnail image +$thumbnail-padding: 4px !default; +//** Thumbnail background color +$thumbnail-bg: $body-bg !default; +//** Thumbnail border color +$thumbnail-border: #ddd !default; +//** Thumbnail border radius +$thumbnail-border-radius: $border-radius-base !default; + +//** Custom text color for thumbnail captions +$thumbnail-caption-color: $text-color !default; +//** Padding around the thumbnail caption +$thumbnail-caption-padding: 9px !default; + + +//== Wells +// +//## + +$well-bg: #f5f5f5 !default; +$well-border: darken($well-bg, 7%) !default; + + +//== Badges +// +//## + +$badge-color: #fff !default; +//** Linked badge text color on hover +$badge-link-hover-color: #fff !default; +$badge-bg: $gray-light !default; + +//** Badge text color in active nav link +$badge-active-color: $link-color !default; +//** Badge background color in active nav link +$badge-active-bg: #fff !default; + +$badge-font-weight: bold !default; +$badge-line-height: 1 !default; +$badge-border-radius: 10px !default; + + +//== Breadcrumbs +// +//## + +$breadcrumb-padding-vertical: 8px !default; +$breadcrumb-padding-horizontal: 15px !default; +//** Breadcrumb background color +$breadcrumb-bg: #f5f5f5 !default; +//** Breadcrumb text color +$breadcrumb-color: #ccc !default; +//** Text color of current page in the breadcrumb +$breadcrumb-active-color: $gray-light !default; +//** Textual separator for between breadcrumb elements +$breadcrumb-separator: "/" !default; + + +//== Carousel +// +//## + +$carousel-text-shadow: 0 1px 2px rgba(0,0,0,.6) !default; + +$carousel-control-color: #fff !default; +$carousel-control-width: 15% !default; +$carousel-control-opacity: .5 !default; +$carousel-control-font-size: 20px !default; + +$carousel-indicator-active-bg: #fff !default; +$carousel-indicator-border-color: #fff !default; + +$carousel-caption-color: #fff !default; + + +//== Close +// +//## + +$close-font-weight: bold !default; +$close-color: #000 !default; +$close-text-shadow: 0 1px 0 #fff !default; + + +//== Code +// +//## + +$code-color: #c7254e !default; +$code-bg: #f9f2f4 !default; + +$kbd-color: #fff !default; +$kbd-bg: #333 !default; + +$pre-bg: #f5f5f5 !default; +$pre-color: $gray-dark !default; +$pre-border-color: #ccc !default; +$pre-scrollable-max-height: 340px !default; + + +//== Type +// +//## + +//** Text muted color +$text-muted: $gray-light !default; +//** Abbreviations and acronyms border color +$abbr-border-color: $gray-light !default; +//** Headings small color +$headings-small-color: $gray-light !default; +//** Blockquote small color +$blockquote-small-color: $gray-light !default; +//** Blockquote font size +$blockquote-font-size: ($font-size-base * 1.25) !default; +//** Blockquote border color +$blockquote-border-color: $gray-lighter !default; +//** Page header border color +$page-header-border-color: $gray-lighter !default; + + +//== Miscellaneous +// +//## + +//** Horizontal line color. +$hr-border: $gray-lighter !default; + +//** Horizontal offset for forms and lists. +$component-offset-horizontal: 180px !default; diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_global.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_global.scss index 19a568a..3e6534b 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_global.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_global.scss @@ -1,3 +1,7 @@ +@charset "utf-8"; +@import "../initial"; +@import "variables"; + html { font-size: 100%; } diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_mixins.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_mixins.scss index 1322e93..65324cf 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_mixins.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_mixins.scss @@ -1,4 +1,5 @@ // Set Triangle +@import "variables"; @mixin arrow($direction, $width, $height, $color) { width: 0px; height: 0px; diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_orbitbar-override.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_orbitbar-override.scss index 67f2955..14900e1 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_orbitbar-override.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_orbitbar-override.scss @@ -1,3 +1,5 @@ +@charset "utf-8"; +@import "variables"; $theme-white: #fff; $orbit-bg-color: #333; $orbit-bg-hover-color: #0095CF; diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_pagination.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_pagination.scss index b4660e4..b1595ef 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_pagination.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_pagination.scss @@ -1,3 +1,5 @@ +@charset "utf-8"; +@import "variables"; .pagination { li { a { diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_unity.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_unity.scss index 2ee41c6..5bee26f 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_unity.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_unity.scss @@ -1,3 +1,5 @@ +@charset "utf-8"; +@import "variables"; // Title .unity-title { margin: 0.5em 0; diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/init.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/init.scss new file mode 100644 index 0000000..ba687b7 --- /dev/null +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/init.scss @@ -0,0 +1,4 @@ +@import "bootstrap/mixins"; +@import "bootstrap/variables"; +@import "base/mixins"; +@import "base/variables"; diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/initial.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/initial.scss new file mode 100644 index 0000000..694cb99 --- /dev/null +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/initial.scss @@ -0,0 +1,6 @@ +@import url("http://fonts.googleapis.com/css?family=Droid+Sans:400,700"); +@import "bootstrap/mixins"; +@import "bootstrap/variables"; +@import "base/mixins"; +@import "base/variables"; +@import "base/unity"; \ No newline at end of file diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/layout/content.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/layout/content.scss index e344ca4..73a3a3d 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/layout/content.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/layout/content.scss @@ -1,3 +1,6 @@ +@charset "utf-8"; +@import "../initial"; + .layout-content { min-height: 600px; margin-bottom: 2em; diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/layout/footer.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/layout/footer.scss index 193f7d4..01324d0 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/layout/footer.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/layout/footer.scss @@ -1,3 +1,6 @@ +@charset "utf-8"; +@import "../initial"; + .layout-footer { padding: 2em 0; color: #999999; diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/layout/header.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/layout/header.scss index 7c70d3a..8e022f4 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/layout/header.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/layout/header.scss @@ -1,3 +1,6 @@ +@charset "utf-8"; +@import "../initial"; + .layout-header { position: relative; margin-bottom: 0; diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/layout/slide.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/layout/slide.scss index 54c3aaa..26d2dac 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/layout/slide.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/layout/slide.scss @@ -1,3 +1,6 @@ +@charset "utf-8"; +@import "../initial"; + .layout-slide { position: relative; margin-bottom: 2rem; diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/ad_banner.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/ad_banner.scss index 0ffcda1..9bef0ac 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/ad_banner.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/ad_banner.scss @@ -1,15 +1,21 @@ -@charset 'utf-8'; +@charset "utf-8"; +@import "../initial"; + // // Widget // + // Widget // ## gerenral styles .w-ad-banner { position: relative; + .cursor { cursor: pointer; } } + + // Widget 1 .ad-banner-widget-1 { .w-ad-banner__wrap { @@ -23,124 +29,138 @@ height: auto; } .w-ad-banner__caption { - z-index: 200; - padding: .5em 1em; - color: $theme-white; background: $theme-color-main; + color: $theme-white; + z-index: 200; + padding: 0.5em 1em; + h2 { font-family: $main-font; font-size: $w-caption-font-size; - margin: .5em 0; + margin: 0.5em 0; } + p { font-family: $main-font; font-size: $w-caption-desc; } + } .w-ad-banner__pager { + @include list-reset(); position: absolute; - z-index: 120; + right: 1em; top: 1em; - right: 1em; - @include list-reset(); + z-index: 200; + li { display: inline-block; } + a { - display: inline-block; - width: .8em; - height: .8em; - margin-right: .25em; - opacity: .5; - border-radius: 50%; background: $theme-color-main; + display: inline-block; + margin-right: 0.25em; + width: 0.8em; + height: 0.8em; + border-radius: 50%; + opacity: 0.5; } - .active-slide a { + + .active-slide a{ opacity: 1; } } } -// Widget 2 -.ad-banner-widget-2 { - .w-ad-banner__wrap { - width: 100%; - } - .w-ad-banner__slide { - width: 100%; - } - .w-ad-banner__image { - width: 100%; - height: auto; - } - .youtube, - .cycle-youtube { - width: 100%; - height: 100%; - } - object, - embed { - width: 100%; - height: 100%; - } - .w-ad-banner__pager { - position: absolute; - z-index: 102; - right: 1em; - bottom: 1em; - @include list-reset(); - li { - display: inline-block; - } - a { - display: inline-block; - width: .8em; - height: .8em; - margin-right: .25em; - opacity: .5; - border-radius: 50%; - background: $theme-color-main; - } - .active-slide a { - opacity: 1; - } - } -} -// Widget 3 -.ad-banner-widget-3 { - .w-ad-banner__wrap { - width: 100%; - } - .w-ad-banner__slide { - width: 100%; - } - .w-ad-banner__image { - width: 100%; - height: auto; - } - .w-ad-banner__pager { - position: absolute; - z-index: 120; - right: 1em; - bottom: 1em; - @include list-reset(); - li { - display: inline-block; - } - a { - display: inline-block; - width: .8em; - height: .8em; - margin-right: .25em; - opacity: .5; - border-radius: 50%; - background: $theme-color-main; - } - .active-slide a { - opacity: 1; - } - } -} -.cycle-slide-active { - z-index: 101 !important; -} +// Widget 2 +.ad-banner-widget-2 { + .w-ad-banner__wrap { + width: 100%; + } + .w-ad-banner__slide { + width: 100%; + } + .w-ad-banner__image { + width: 100%; + height: auto; + } + .youtube { + } + .youtube, .cycle-youtube { + width: 100%; + height: 100%; + } + object, embed{ + width: 100%; + height: 100%; + } + .w-ad-banner__pager { + @include list-reset(); + position: absolute; + right: 1em; + bottom: 1em; + z-index: 102; + + li { + display: inline-block; + } + + a { + background: $theme-color-main; + display: inline-block; + margin-right: 0.25em; + width: 0.8em; + height: 0.8em; + border-radius: 50%; + opacity: 0.5; + } + + .active-slide a{ + opacity: 1; + } + } +} + + +// Widget 3 +.ad-banner-widget-3 { + .w-ad-banner__wrap { + width: 100%; + } + .w-ad-banner__slide { + width: 100%; + } + .w-ad-banner__image { + width: 100%; + height: auto; + } + .w-ad-banner__pager { + @include list-reset(); + position: absolute; + right: 1em; + bottom: 1em; + z-index: 200; + + li { + display: inline-block; + } + + a { + background: $theme-color-main; + display: inline-block; + margin-right: 0.25em; + width: 0.8em; + height: 0.8em; + border-radius: 50%; + opacity: 0.5; + } + .active-slide a{ + opacity: 1; + } + } +} + +.cycle-slide-active{ + z-index: 101 !important; +} \ No newline at end of file diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/announcement.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/announcement.scss index 75e1c19..a5918d0 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/announcement.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/announcement.scss @@ -1,352 +1,374 @@ -@charset 'utf-8'; +@charset "utf-8"; +@import "../initial"; + // // Widget // + // Announcement widget // ## Gerneral styles for widgets .w-annc { - .w-annc__widget-title { - @extend .unity-title; - } - .w-annc__list { - margin: 0; - padding: 0; - list-style: none; - } - .w-annc__item { - margin-bottom: 30px; - } - .label { - font-size: .75rem; - font-weight: normal; - } - .w-annc__meta { - .w-annc__status-wrap, .w-annc__postdate-wrap, .w-annc__category-wrap { - font-size: .8125em; - font-weight: normal; - display: inline-block; - margin-right: .2em; - color: $theme-gray; + .w-annc__widget-title { + @extend .unity-title; } - i { - color: $theme-gray; + .w-annc__list { + margin: 0; + padding: 0; + list-style: none; } - } - .status-top { - background: $theme-color-second; - } - .status-hot { - background: $theme-color-third; - } - .w-annc__subtitle { - font-size: .8125em; - color: $theme-gray; - } - .w-annc__entry-title { - margin-bottom: 10px; - } - .w-annc__title { - font-family: $sub-font; - font-size: .8125rem; - text-decoration: none; - color: $theme-color-main; - &:hover { - color: darken($theme-color-main, 10%); + .w-annc__item { + margin-bottom: 30px; + } + .label { + font-size: 0.75rem; + font-weight: normal; + } + .w-annc__meta { + .w-annc__status-wrap, + .w-annc__postdate-wrap, + .w-annc__category-wrap { + display: inline-block; + margin-right: 0.2em; + font-size: 0.8125em; + color: $theme-gray; + font-weight: normal; + } + i { + color: $theme-gray; + } + } + .status-top { + background: $theme-color-second; + } + .status-hot { + background: $theme-color-third; + } + .w-annc__subtitle { + font-size: 0.8125em; + color: $theme-gray; + } + .w-annc__entry-title { + margin-bottom: 10px; + } + .w-annc__title { + font-family: $sub-font; + color: $theme-color-main; + text-decoration: none; + font-size: 0.8125rem; + &:hover { + color: darken($theme-color-main, 10%); + } } - } } + // Widget-1 .widget-announcement-1 { - .w-annc__img-wrap { - height: 200px; - margin: 0 0 1em 0; - } - .w-annc__title { - font-family: $main-font; - font-size: 1.2rem; - line-height: 1.3; - } + .w-annc__img-wrap { + height: 200px; + margin: 0 0 1em 0; + } + .w-annc__title { + font-family: $main-font; + line-height: 1.3; + font-size: 1.2rem; + } } + // Widget-2 .widget-announcement-2 { - .w-annc__img-wrap { - height: 200px; - margin: 0 0 1em 0; - } - .w-annc__title { - font-family: $main-font; - font-size: 1.2rem; - line-height: 1.3; - } + .w-annc__img-wrap { + height: 200px; + margin: 0 0 1em 0; + } + .w-annc__title { + font-family: $main-font; + line-height: 1.3; + font-size: 1.2rem; + } } + // Widget-3 .widget-announcement-3 { - .w-annc__img-wrap { - height: 200px; - margin: 0 0 1em; - } - .w-annc__title { - font-family: $main-font; - font-size: 1.2rem; - line-height: 1.3; - } + .w-annc__img-wrap { + height: 200px; + margin: 0 0 1em 0; + } + .w-annc__title { + font-family: $main-font; + line-height: 1.3; + font-size: 1.2rem; + } } + // Widget-4 .widget-announcement-4 { - .w-annc__title { - font-family: $main-font; - font-size: 1.2rem; - line-height: 1.3; - } - .w-annc__list > .w-annc__item:nth-child(3n+1) { - clear: both; - } - .w-annc__img-wrap { - height: 200px; - margin: 0 0 1em; - } + .w-annc__title { + font-family: $main-font; + line-height: 1.3; + font-size: 1.2rem; + } + .w-annc__list > .w-annc__item:nth-child(3n+1) { + clear: both; + } + .w-annc__img-wrap { + height: 200px; + margin: 0 0 1em 0; + } } + // Widget-5 .widget-announcement-5 { - .w-annc__title { - font-family: $main-font; - font-size: 1.2rem; - line-height: 1.3; - } - .w-annc__item { - margin-bottom: 1em; - padding-bottom: 1em; - border-bottom: 1px dashed lighten($theme-gray, 65%); - } + .w-annc__title { + font-family: $main-font; + line-height: 1.3; + font-size: 1.2rem; + } + .w-annc__item { + border-bottom: 1px dashed lighten($theme-gray, 65%); + padding-bottom: 1em; + margin-bottom: 1em; + } } + // Widget-6 .widget-announcement-6 { - .w-annc__item { - margin-bottom: .8em; - padding-bottom: .8em; - border-bottom: 1px dashed lighten($theme-gray, 65%); - } - .w-annc__entry-title { - margin: 0; - } - .w-annc__category-wrap, - .w-annc__status, - .w-annc__title, - .w-annc__postdate-wrap { - font-size: .8125rem; - } - .w-annc__status { - display: inline-block; - } + .w-annc__item { + margin-bottom: 0.8em; + padding-bottom: 0.8em; + border-bottom: 1px dashed lighten($theme-gray, 65%); + } + .w-annc__entry-title { + margin: 0; + } + .w-annc__category-wrap, + .w-annc__status, + .w-annc__title, + .w-annc__postdate-wrap { + font-size: 0.8125rem; + } + .w-annc__status { + display: inline-block; + } } + // Widget-7 .widget-announcement-7 { - .w-annc__item { - margin-bottom: .8em; - padding-bottom: .8em; - border-bottom: 1px dashed lighten($theme-gray, 65%); - } - .w-annc__entry-title { - margin: 0; - } - .w-annc__category-wrap, - .w-annc__status, - .w-annc__title, - .w-annc__postdate-wrap { - font-size: .75rem; - } - .w-annc__status { - display: inline-block; - } + .w-annc__item { + margin-bottom: 0.8em; + padding-bottom: 0.8em; + border-bottom: 1px dashed lighten($theme-gray, 65%); + } + .w-annc__entry-title { + margin: 0; + } + .w-annc__category-wrap, + .w-annc__status, + .w-annc__title, + .w-annc__postdate-wrap { + font-size: 0.75rem; + } + .w-annc__status { + display: inline-block; + } } + // Widget-8 // ## Table .widget-announcement-8 { - .w-annc__th { - font-size: .8125em; - color: $theme-white; - border: 0; - background: $theme-color-main; - } - .w-annc__status { - font-size: .75rem; - display: inline-block; - } - td { - font-size: .8125em; - } - a:hover { - text-decoration: none; - } + .w-annc__th { + color: #fff; + background: $theme-color-main; + font-size: 0.8125em; + border: none; + } + .w-annc__status { + display: inline-block; + font-size: 0.75rem; + } + td { + font-size: 0.8125em; + } + a:hover { + text-decoration: none; + } } + // Widget-9 // ## Table .widget-announcement-9 { - .w-annc__th { - font-size: .8125em; - color: $theme-white; - border: 0; - background: $theme-color-main; - } - .w-annc__status { - font-size: .75rem; - display: inline-block; - } - td { - font-size: .8125em; - } - a:hover { - text-decoration: none; - } + .w-annc__th { + color: #fff; + background: $theme-color-main; + font-size: 0.8125em; + border: none; + } + .w-annc__status { + display: inline-block; + font-size: 0.75rem; + } + td { + font-size: 0.8125em; + } + a:hover { + text-decoration: none; + } } + // Widget-10 .widget-announcement-10 { - .w-annc__item { - margin-bottom: .8em; - padding-bottom: .8em; - border-bottom: 1px dashed lighten($theme-gray, 65%); - } - .w-annc__entry-title { - margin: 0; - } - .w-annc__postdate-wrap { - font-size: .8125em; - } - .w-annc__status { - font-size: .75rem; - display: inline-block; - } + .w-annc__item { + margin-bottom: 0.8em; + padding-bottom: 0.8em; + border-bottom: 1px dashed lighten($theme-gray, 65%); + } + .w-annc__entry-title { + margin: 0; + } + .w-annc__postdate-wrap { + font-size: 0.8125em; + } + .w-annc__status { + display: inline-block; + font-size: 0.75rem; + } } + // Widget-11 // ## Table .widget-announcement-11 { - .w-annc__th { - font-size: .8125em; - color: $theme-white; - border: 0; - background: $theme-color-main; - } - .w-annc__status { - font-size: .75rem; - display: inline-block; - } - td { - font-size: .8125em; - } - a:hover { - text-decoration: none; - } + .w-annc__th { + color: #fff; + background: $theme-color-main; + font-size: 0.8125em; + border: none; + } + .w-annc__status { + display: inline-block; + font-size: 0.75rem; + } + td { + font-size: 0.8125em; + } + a:hover { + text-decoration: none; + } } + // Widget-12 .widget-announcement-12 { - .w-annc__list { - padding: 0 15px; - } - .w-annc__img-wrap { - height: 300px; - margin-bottom: 15px; - @media (min-width: $screen-md) { - height: 200px; - margin-bottom: 0; + .w-annc__list { + padding: 0 15px; } - } - .w-annc__item { - margin-bottom: .8em; - padding-bottom: .8em; - border-bottom: 1px dashed lighten($theme-gray, 65%); - } - .w-annc__entry-title { - margin: 0 0 10px 0; - @media (min-width: $screen-md) { - margin-bottom: 0; + .w-annc__img-wrap { + height: 300px; + margin-bottom: 15px; + @media (min-width: $screen-md) { + height: 200px; + margin-bottom: 0; + } + } + .w-annc__item { + margin-bottom: 0.8em; + padding-bottom: 0.8em; + border-bottom: 1px dashed lighten($theme-gray, 65%); + } + .w-annc__entry-title { + margin: 0 0 10px 0; + @media (min-width: $screen-md) { + margin-bottom: 0; + } + } + .w-annc__postdate-wrap { + font-size: 0.8125em; + } + .w-annc__status { + display: inline-block; + } + .w-annc__postdate { + font-size: 0.8125rem; } - } - .w-annc__postdate-wrap { - font-size: .8125em; - } - .w-annc__status { - display: inline-block; - } - .w-annc__postdate { - font-size: .8125rem; - } } + // Announcement index // ## General style for index pages .i-annc { - .i-annc__page-title { - @extend .unity-title; - } - .i-annc__list { - margin: 0; - padding: 0; - list-style: none; - } - .status-top { - background: $theme-color-second; - } - .status-hot { - background: $theme-color-third; - } - .w-annc__widget-title { - @extend .unity-title; - } - .i-annc__item { - margin-bottom: 30px; - } - .i-annc__img { - width: 100%; - max-width: 100%; - height: auto; - } - .label { - font-size: .75rem; - font-weight: normal; - } - .i-annc__meta { - .i-annc__status-wrap, .i-annc__postdate-wrap, .i-annc__category-wrap { - font-size: .8125em; - font-weight: normal; - display: inline-block; - margin-right: .2em; - color: $theme-gray; + .i-annc__page-title { + @extend .unity-title; } - i { - color: $theme-gray; + .i-annc__list { + margin: 0; + padding: 0; + list-style: none; } - } - .i-annc__subtitle { - font-size: .8125em; - color: $theme-gray; - } - .i-annc__entry-title { - margin-bottom: 10px; - } - .i-annc__title { - font-family: $sub-font; - font-size: .8125rem; - text-decoration: none; - color: $theme-color-main; - &:hover { - color: darken($theme-color-main, 10%); + .status-top { + background: $theme-color-second; + } + .status-hot { + background: $theme-color-third; + } + .w-annc__widget-title { + @extend .unity-title; + } + .i-annc__item { + margin-bottom: 30px; + } + .i-annc__img { + width: 100%; + max-width: 100%; + height: auto; + } + .label { + font-size: 0.75rem; + font-weight: normal; + } + .i-annc__meta { + .i-annc__status-wrap, + .i-annc__postdate-wrap, + .i-annc__category-wrap { + display: inline-block; + margin-right: 0.2em; + font-size: 0.8125em; + color: $theme-gray; + font-weight: normal; + } + i { + color: $theme-gray; + } + } + .i-annc__subtitle { + font-size: 0.8125em; + color: $theme-gray; + } + .i-annc__entry-title { + margin-bottom: 10px; + } + .i-annc__title { + font-family: $sub-font; + color: $theme-color-main; + text-decoration: none; + font-size: 0.8125rem; + &:hover { + color: darken($theme-color-main, 10%); + } } - } } + // Index-1 .index-announcement-1 { - .i-annc__th { - font-size: .8125em; - color: $theme-white; - border: 0; - background: $theme-color-main; - } - td { - font-size: .8125rem; - } - .i-annc__title:hover { - text-decoration: none; - } + .i-annc__th { + color: #fff; + background: $theme-color-main; + font-size: 0.8125em; + border: none; + } + td { + font-size: 0.8125rem; + } + .i-annc__title:hover { + text-decoration: none; + } } + // Index-2 .index-announcement-2, .index-announcement-3 { @@ -359,115 +381,74 @@ line-height: 1.3; } } + // Announcement show .s-annc { - .s-annc__show-title { - @extend .unity-title; - } - .s-annc__meta-wrap { - border-bottom: 1px solid $theme-gray-light; - @include clearfix; - .s-annc__meta--item { - font-size: .875rem; - float: left; - margin-right: 1em; - margin-bottom: .6em; - i { - color: darken($theme-gray-light, 10%); - } + .s-annc__show-title { + @extend .unity-title; } - .s-annc__tag-wrap { - position: relative; - float: none; - clear: both; - margin-right: 0; - padding-left: 1.6em; - i { - position: absolute; - top: 7px; - left: 0; - } + .s-annc__meta-wrap { + border-bottom: 1px solid $theme-gray-light; + @include clearfix; + .s-annc__meta--item { + font-size: 0.875rem; + margin-right: 1em; + margin-bottom: 0.6em; + float: left; + i { + color: darken($theme-gray-light, 10%); + } + } + .s-annc__tag-wrap { + position: relative; + margin-right: 0; + padding-left: 1.6em; + clear: both; + float: none; + i { + position: absolute; + top: 7px; + left: 0; + } + } + .s-annc__tag-wrap { + .s-annc__tag { + font-weight: normal; + } + } } - .s-annc__tag-wrap { - .s-annc__tag { - font-weight: normal; - } + .s-annc__post-wrap { + @include clearfix; + margin-bottom: 2em; } - } - .s-annc__post-wrap { - margin-bottom: 2em; - @include clearfix; - } - .s-annc__related-wrap { - padding-top: 1em; - border-top: 1px dotted $theme-gray-light; - } - .s-annc__related-file { - margin-bottom: 15px; - } - .s-annc__related-file, - .s-annc__related-link { - padding-bottom: 6px; - padding-left: 1.6em; - i { - float: left; - margin: 8px 0 0 -1.6em; - color: darken($theme-gray-light, 10%); + .s-annc__related-wrap { + padding-top: 1em; + border-top: 1px dotted $theme-gray-light; } - } - .s-annc__related-link-list, - .s-annc__related-file-list { - display: inline-block; - } - .s-annc__flie-title { - overflow: hidden; - max-width: 9.375rem; - white-space: nowrap; - text-overflow: ellipsis; - } -} -// -// Widget -// -// Admission widget -// ## Gerneral styles for widgets -// Widget-8 -// ## Table -.widget-admission-1 { - .w-adm__th { - font-size: .8125em; - color: $theme-white; - border: 0; - background: $theme-color-main; - } - .w-adm__status { - font-size: .75rem; - display: inline-block; - } - td { - font-size: .8125em; - } - a:hover { - text-decoration: none; - } -} -// ## Table -.widget-admission-1 { - .w-adm__th { - font-size: .8125em; - color: $theme-white; - border: 0; - background: $theme-color-main; - } - .w-adm__status { - font-size: .75rem; - display: inline-block; - } - td { - font-size: .8125em; - } - a:hover { - text-decoration: none; - } -} + .s-annc__related-file { + margin-bottom: 15px; + } + .s-annc__related-file, + .s-annc__related-link { + padding-bottom: 6px; + padding-left: 1.6em; + i { + margin: 8px 0 0 -1.6em; + float: left; + color: darken($theme-gray-light, 10%); + } + a { + } + } + .s-annc__related-link-list, + .s-annc__related-file-list { + display: inline-block; + } + .s-annc__flie-title { + max-width: 9.375rem; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } +} \ No newline at end of file diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/archives.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/archives.scss index f4604d4..6090cc8 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/archives.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/archives.scss @@ -1,5 +1,5 @@ @charset "utf-8"; - +@import "../initial"; // // Widget // diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/faq.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/faq.scss index a461207..c37b142 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/faq.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/faq.scss @@ -1,3 +1,6 @@ +@charset "utf-8"; +@import "../initial"; + // Faqs MODULES .widget-faqs { &.widget1 { diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/gallery.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/gallery.scss index c70ded9..0719259 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/gallery.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/gallery.scss @@ -1,3 +1,6 @@ +@charset "utf-8"; +@import "../initial"; + // Gallery MODULES .widget-gallery { .widget-title { diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/member.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/member.scss index d834296..9d084b3 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/member.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/member.scss @@ -1,3 +1,6 @@ +@charset "utf-8"; +@import "../initial"; + // Member index page .index-member { .index-title { diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/menu.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/menu.scss index e72d08f..ea4c4ec 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/menu.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/menu.scss @@ -1,3 +1,6 @@ +@charset "utf-8"; +@import "../initial"; + .modules-menu { font-family: $sub-font; max-height: none; diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/personal_plugin.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/personal_plugin.scss index 635d222..21cfaa3 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/personal_plugin.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/personal_plugin.scss @@ -1,3 +1,5 @@ +@charset "utf-8"; + .plugin-show-table th{ text-align: right; min-width: 80px; diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/web_resource.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/web_resource.scss index 1eb82c7..9b55084 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/web_resource.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/web_resource.scss @@ -1,3 +1,6 @@ +@charset "utf-8"; +@import "../initial"; + // Link MODULES .widget-link { // 在 layout-content 下的樣式 diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/template.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/template.scss index 446566c..006f71d 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/template.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/template.scss @@ -1,18 +1,15 @@ // Base -@import "bootstrap/mixins"; -@import "bootstrap/variables"; -@import "base/mixins"; -@import "base/variables"; -@import "base/unity"; @import "base/pagination"; @import "base/orbitbar-override"; @import "base/global"; + // Layout @import "layout/header"; @import "layout/slide"; @import "layout/content"; @import "layout/footer"; -// // Modules + +// Modules @import "modules/menu"; @import "modules/ad_banner"; @import "modules/announcement"; @@ -22,7 +19,7 @@ @import "modules/archives"; @import "modules/member"; @import "modules/personal_plugin"; + // Widget @import "widget/breadcrumb"; @import "widget/sitemenu"; - diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/widget/breadcrumb.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/widget/breadcrumb.scss index eb4a2fc..cb80c3d 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/widget/breadcrumb.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/widget/breadcrumb.scss @@ -1,3 +1,6 @@ +@charset "utf-8"; +@import "../initial"; + .widget-breadcrumb { &.widget1 { li { diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/widget/sitemenu.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/widget/sitemenu.scss index 3cbae28..95aeaa6 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/widget/sitemenu.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/widget/sitemenu.scss @@ -1,53 +1,55 @@ -.sitemenu-wrap { - padding: 10px 0; - @include clearfix; - .sitemenu__title { - display: none; - } - .sitemenu__list { - margin: 0; - padding: 0; - list-style: none; - } - .sitemenu__item.level-1 { - font-size: 0.8125rem; - position: relative; - float: left; - margin-right: 1%; - margin-bottom: 12px; - padding: 8px .8em; - padding-bottom: 8px; - color: $theme-white; - border-radius: .2em; - background: $theme-color-second; - &:hover { - background: darken($theme-color-second, 10%); - } - } - .sitemenu__link.level-1 { - margin-right: .25rem; - color: $theme-white; - } - .sitemenu___dropdown-toggle { - font-size: 0.75rem; - padding: 2px .3125rem; - cursor: pointer; - } - // sitemenu dropdown - .sitemenu__list.dropdown-menu { - min-width: 100%; - margin-top: 4px; - border: none; - border-radius: .2em; - background: $theme-color-main; - } - .sitemenu__link.level-2 { - color: $theme-white; - font-size: 0.8125rem; - padding: 4px 0.625rem; - &:hover { - background: lighten($theme-color-second, 5%); - } - } -} +@charset "utf-8"; +@import "../initial"; +.sitemenu-wrap { + padding: 10px 0; + @include clearfix; + .sitemenu__title { + display: none; + } + .sitemenu__list { + margin: 0; + padding: 0; + list-style: none; + } + .sitemenu__item.level-1 { + font-size: 0.8125rem; + position: relative; + float: left; + margin-right: 1%; + margin-bottom: 12px; + padding: 8px .8em; + padding-bottom: 8px; + color: #fff; + border-radius: .2em; + background: $theme-color-second; + &:hover { + background: darken($theme-color-second, 10%); + } + } + .sitemenu__link.level-1 { + margin-right: .25rem; + color: #fff; + } + .sitemenu___dropdown-toggle { + font-size: 0.75rem; + padding: 2px .3125rem; + cursor: pointer; + } + // sitemenu dropdown + .sitemenu__list.dropdown-menu { + min-width: 100%; + margin-top: 4px; + border: none; + border-radius: .2em; + background: $theme-color-main; + } + .sitemenu__link.level-2 { + color: #fff; + font-size: 0.8125rem; + padding: 4px 0.625rem; + &:hover { + background: lighten($theme-color-second, 5%); + } + } +} \ No newline at end of file diff --git a/app/templates/orbit_bootstrap/home/footer.html.erb b/app/templates/orbit_bootstrap/home/footer.html.erb index 110eb8f..02ea45b 100644 --- a/app/templates/orbit_bootstrap/home/footer.html.erb +++ b/app/templates/orbit_bootstrap/home/footer.html.erb @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/app/templates/orbit_bootstrap/home/index.html.erb b/app/templates/orbit_bootstrap/home/index.html.erb index 086ef7f..5146865 100644 --- a/app/templates/orbit_bootstrap/home/index.html.erb +++ b/app/templates/orbit_bootstrap/home/index.html.erb @@ -6,7 +6,7 @@ <%= render_orbit_bar %> <%= render_header %> -
+
diff --git a/app/templates/orbit_bootstrap/home/page.html.erb b/app/templates/orbit_bootstrap/home/page.html.erb index 3ebedc4..e12c1d8 100644 --- a/app/templates/orbit_bootstrap/home/page.html.erb +++ b/app/templates/orbit_bootstrap/home/page.html.erb @@ -6,18 +6,20 @@ <%= render_orbit_bar %> <%= render_header %> -
+
- + +
-
+
<%= yield %>
-
+
+
<%= render_footer %> diff --git a/app/templates/orbit_bootstrap/modules/announcement/_annc_widget1.html.erb b/app/templates/orbit_bootstrap/modules/announcement/_annc_widget1.html.erb index d509065..74e741c 100644 --- a/app/templates/orbit_bootstrap/modules/announcement/_annc_widget1.html.erb +++ b/app/templates/orbit_bootstrap/modules/announcement/_annc_widget1.html.erb @@ -1,11 +1,11 @@ -
+

{{widget-title}}

  • -
    - {{img_description}} +
    + {{img_description}}
    diff --git a/app/templates/orbit_bootstrap/modules/announcement/_annc_widget12.html.erb b/app/templates/orbit_bootstrap/modules/announcement/_annc_widget12.html.erb index b14158b..07bdcc2 100644 --- a/app/templates/orbit_bootstrap/modules/announcement/_annc_widget12.html.erb +++ b/app/templates/orbit_bootstrap/modules/announcement/_annc_widget12.html.erb @@ -1,21 +1,21 @@ -
    +

    {{widget-title}}

    - {{main_picture_description}} + {{main_picture_description}}
    -
      +
      • -
        -

        +
        +

        {{status}} {{title}}

        -

        • -
          - {{img_description}} +
          + {{img_description}}
          diff --git a/app/templates/orbit_bootstrap/modules/announcement/_annc_widget3.html.erb b/app/templates/orbit_bootstrap/modules/announcement/_annc_widget3.html.erb index 9d773f1..580a093 100644 --- a/app/templates/orbit_bootstrap/modules/announcement/_annc_widget3.html.erb +++ b/app/templates/orbit_bootstrap/modules/announcement/_annc_widget3.html.erb @@ -23,8 +23,8 @@

          {{subtitle}}

          -
          - {{img_description}} +
          + {{img_description}}
        diff --git a/app/templates/orbit_bootstrap/modules/announcement/_annc_widget4.html.erb b/app/templates/orbit_bootstrap/modules/announcement/_annc_widget4.html.erb index af6b742..5c6baee 100644 --- a/app/templates/orbit_bootstrap/modules/announcement/_annc_widget4.html.erb +++ b/app/templates/orbit_bootstrap/modules/announcement/_annc_widget4.html.erb @@ -1,11 +1,11 @@ -
        +

        {{widget-title}}

        -
          -
        • +
            +
          • - {{img_description}} + {{img_description}}
            diff --git a/app/templates/orbit_bootstrap/modules/announcement/annc_index3.html.erb b/app/templates/orbit_bootstrap/modules/announcement/annc_index3.html.erb index ac3d9be..44dd8d9 100644 --- a/app/templates/orbit_bootstrap/modules/announcement/annc_index3.html.erb +++ b/app/templates/orbit_bootstrap/modules/announcement/annc_index3.html.erb @@ -27,4 +27,4 @@
        -{{pagination_goes_here}} +{{pagination_goes_here}} \ No newline at end of file diff --git a/app/templates/orbit_bootstrap/modules/announcement/info.json b/app/templates/orbit_bootstrap/modules/announcement/info.json index 50ce44c..688368a 100644 --- a/app/templates/orbit_bootstrap/modules/announcement/info.json +++ b/app/templates/orbit_bootstrap/modules/announcement/info.json @@ -11,7 +11,7 @@ { "filename" : "annc_index2", "name" : { - "zh_tw" : "2. 右圖左文 ( 模組標題, 圖片, 狀態, 日期, 類別, 標題, 副標題 )", + "zh_tw" : "2. 左圖右文 ( 模組標題, 圖片, 狀態, 日期, 類別, 標題, 副標題 )", "en" : "2. Balanced Image + Text(Right) (widget-title, image, status, postdate, category, title, subtitle)" }, "thumbnail" : "annc_index2_thumbs.png" @@ -19,7 +19,7 @@ { "filename" : "annc_index3", "name" : { - "zh_tw" : "3. 右文左圖 ( 模組標題, 狀態, 日期, 類別, 標題, 副標題, 圖片 )", + "zh_tw" : "3. 右圖左文 ( 模組標題, 狀態, 日期, 類別, 標題, 副標題, 圖片 )", "en" : "3. Balanced Image + Text(left) (widget-title, status, postdate, category, title, subtitle, image)" }, "thumbnail" : "annc_index3_thumbs.png" @@ -121,14 +121,6 @@ "en" : "12. 1 Image + Title List (widget-title, status, title, postdate)" }, "thumbnail" : "annc_widget12_thumbs.png" - }, - { - "filename" : "admission_widget1", - "name" : { - "zh_tw" : "招生模組: 1. 標準表格列表 ( 模組標題, 類別, 標題, 檔案下載, 超連結 )", - "en" : "Admission: 1. Standard Table List (widget-title, category, title, attatchment, link)" - }, - "thumbnail" : "admission_widget1_thumbs.png" } ] } \ No newline at end of file diff --git a/app/templates/orbit_bootstrap/partial/_head.html.erb b/app/templates/orbit_bootstrap/partial/_head.html.erb index 259e6ab..11d6eb4 100644 --- a/app/templates/orbit_bootstrap/partial/_head.html.erb +++ b/app/templates/orbit_bootstrap/partial/_head.html.erb @@ -3,11 +3,11 @@ <%= favicon_link_tag (current_site.favicon.blank? ? 'favicon.ico' : current_site.favicon.url) %> <%= render_site_title %> - <%= stylesheet_link_tag "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css"%> - <%= stylesheet_link_tag "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap.min.css"%> + <%= stylesheet_link_tag "//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css"%> + <%= stylesheet_link_tag "//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap.min.css"%> <%= stylesheet_link_tag "template/template"%> - <%= javascript_include_tag "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.min.js"%> - <%= javascript_include_tag "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/js/bootstrap.min.js"%> + <%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.min.js"%> + <%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/js/bootstrap.min.js"%> <%= javascript_include_tag "plugin/modernizr"%> <%= javascript_include_tag "plugin/jquery-bullseye-min"%> <%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/jquery.cycle2/20140415/jquery.cycle2.min.js"%> diff --git a/app/views/admin/groups/_group.html.erb b/app/views/admin/groups/_group.html.erb new file mode 100644 index 0000000..6c63166 --- /dev/null +++ b/app/views/admin/groups/_group.html.erb @@ -0,0 +1,42 @@ +<% + current_user_is_group_admin = group.admins.include?(current_user.id.to_s) ? true : false + if !current_user_is_group_admin + current_user_is_group_member = group.users.include?(current_user) ? true : false + else + current_user_is_group_member = true + end +%> +
      • +
        + +

        ">

        +
        + <%= link_to(content_tag(:i, nil, :class => 'icon-edit'),"#",:class=>"edit" ) if current_user_is_group_admin %> +
        + <%= image_tag(group.image) %> +
        +
        +

        <%= link_to group.title, admin_group_path(group) %>

        + <% + author = "" + group.admins.each_with_index do |admin,i| + user = User.find(admin) rescue nil + if !user.nil? + author = author + (user.member_profile.name == "" ? user.user_name : user.member_profile.name rescue "") + author = author + ", " if i != group.admins.count - 1 + end + end + %> +
        Admin : <%= author %>
        +
        +
          +
        • + Privacy : + "><%= group.privacy %> +
        • +
        • + <%= group.description %> +
        • +
        +
        +
      • \ No newline at end of file diff --git a/app/views/admin/groups/_group_categories.html.erb b/app/views/admin/groups/_group_categories.html.erb new file mode 100644 index 0000000..b9d103d --- /dev/null +++ b/app/views/admin/groups/_group_categories.html.erb @@ -0,0 +1,5 @@ +<% @categories.each do |cat| %> +
        + <%= cat.title_translations["en"] %> / <%= cat.title_translations["zh_tw"] %> +
        +<% end %> \ No newline at end of file diff --git a/app/views/admin/groups/_group_form.html.erb b/app/views/admin/groups/_group_form.html.erb new file mode 100644 index 0000000..a649d73 --- /dev/null +++ b/app/views/admin/groups/_group_form.html.erb @@ -0,0 +1,164 @@ +<% content_for :page_specific_css do %> + <%= stylesheet_link_tag "lib/main-forms" %> + <%= stylesheet_link_tag "lib/fileupload" %> + <%= stylesheet_link_tag "lib/main-list" %> + <%= stylesheet_link_tag "select2/select2" %> + +<% end %> +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "lib/bootstrap-fileupload" %> + <%= javascript_include_tag "lib/file-type" %> + <%= javascript_include_tag "lib/module-area" %> + <%= javascript_include_tag "select2/select2.min" %> +<% end %> + +
        + + + + +
        + + +
        + + +
        + +
        + <%= f.select :group_category_id, @categories %> +
        +
        + +
        + +
        +
        +
        + <% if @group.image.file %> + <%= image_tag @group.image %> + <% else %> + + <% end %> +
        +
        + + <%= t(:select_image) %> + <%= t(:change) %> + <%= f.file_field :image %> + + <%= t(:cancel) %> +
        + +
        +
        +
        +
        + +
        + +
        + Open + Closed +
        +
        +
        + +
        + +
        +
        + +
        +
        + + + + + +
        + + <% @site_in_use_locales.each_with_index do |locale, i| %> + +
        "> + + +
        + +
        + <%= f.fields_for :title_translations do |f| %> + <%= f.text_field locale, class: "input-block-level", placeholder: t(:title), value: (@group.title_translations[locale] rescue nil) %> + <% end %> +
        +
        + + +
        + +
        +
        + <%= f.fields_for :description_translations do |f| %> + <%= f.text_area locale, rows: 2, class: "input-block-level", value: (@group.description_translations[locale] rescue nil) %> + <% end %> +
        +
        +
        +
        + <% end %> +
        +
        + + +
        + <%= f.submit t('submit'), class: 'btn btn-primary' %> + <%= link_to t('cancel'), admin_groups_path, :class=>"btn" %> +
        + + + + diff --git a/app/views/admin/groups/_post.html.erb b/app/views/admin/groups/_post.html.erb new file mode 100644 index 0000000..3dd2f2f --- /dev/null +++ b/app/views/admin/groups/_post.html.erb @@ -0,0 +1,36 @@ + +
        +
        + <% if !post.image.nil? %> + <%= post.title %> + <% else %> + Post image + <% end %> +
        +
        +

        + <%= post.title %> +

        +
        + <% content = strip_tags post.content %> + <%= content[0..250] %> + <%= "..." if content.length > 350 %> +
        + +
        +
        +
        \ No newline at end of file diff --git a/app/views/admin/groups/_post_form.html.erb b/app/views/admin/groups/_post_form.html.erb new file mode 100644 index 0000000..ef73c89 --- /dev/null +++ b/app/views/admin/groups/_post_form.html.erb @@ -0,0 +1,81 @@ +<% content_for :page_specific_css do %> + <%= stylesheet_link_tag "lib/main-forms" %> + <%= stylesheet_link_tag "lib/fileupload" %> + <%= stylesheet_link_tag "lib/main-list" %> +<% end %> +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "lib/bootstrap-fileupload" %> + <%= javascript_include_tag "lib/file-type" %> + <%= javascript_include_tag "lib/module-area" %> +<% end %> +
        + + + + +
        + + +
        + +
        + +
        +
        +
        + <% if @grouppost.image.file %> + <%= image_tag @grouppost.image %> + <% else %> + + <% end %> +
        +
        + + <%= t(:select_image) %> + <%= t(:change) %> + <%= f.file_field :image %> + + <%= t(:cancel) %> +
        + +
        +
        +
        +
        +
        +
        + + + +
        + + +
        + +
        + <%= f.text_field :title, class: "input-block-level", placeholder: t(:title), value: (@grouppost.title rescue nil) %> +
        +
        + + +
        + +
        +
        + <%= f.cktext_area :content, rows: 2, class: "input-block-level", value: (@grouppost.content rescue nil) %> +
        +
        +
        + +
        +
        + + +
        + <%= f.submit t('submit'), class: 'btn btn-primary' %> + <%= link_to t('cancel'), admin_groups_path, :class=>"btn" %> +
        \ No newline at end of file diff --git a/app/views/admin/groups/categories.html.erb b/app/views/admin/groups/categories.html.erb index 1eab51a..ce368ad 100644 --- a/app/views/admin/groups/categories.html.erb +++ b/app/views/admin/groups/categories.html.erb @@ -1 +1,83 @@ -this is category. \ No newline at end of file +
        + <%= render :partial => "group_categories" %> +
        ++ + + + \ No newline at end of file diff --git a/app/views/admin/groups/index.html.erb b/app/views/admin/groups/index.html.erb index ebc19ee..b14c207 100644 --- a/app/views/admin/groups/index.html.erb +++ b/app/views/admin/groups/index.html.erb @@ -1 +1,17 @@ -this is my group page \ No newline at end of file +<% content_for :page_specific_css do -%> + + <%= stylesheet_link_tag "lib/wrap-nav" %> + <%= stylesheet_link_tag "lib/main-list" %> + <%= stylesheet_link_tag "lib/filter" %> + <%= stylesheet_link_tag "lib/member" %> + +<% end -%> +<% content_for :page_specific_javascript do -%> + <%= javascript_include_tag "lib/jquery.lite.image.resize.js" %> + <%= javascript_include_tag "lib/member/list-view.js" %> +<% end -%> +
        +
          + <%= render :partial=>"group",:collection=> @groups %> +
        +
        \ No newline at end of file diff --git a/app/views/admin/groups/new.html.erb b/app/views/admin/groups/new.html.erb new file mode 100644 index 0000000..e0e867f --- /dev/null +++ b/app/views/admin/groups/new.html.erb @@ -0,0 +1,5 @@ +<%= form_for @group, :url => admin_groups_path, :html => { :multipart => true , :class=>"form-horizontal main-forms"} do |f| %> +
        + <%= render :partial => "group_form", locals: {f: f} %> +
        +<% end %> \ No newline at end of file diff --git a/app/views/admin/groups/newpost.html.erb b/app/views/admin/groups/newpost.html.erb new file mode 100644 index 0000000..ec91e4f --- /dev/null +++ b/app/views/admin/groups/newpost.html.erb @@ -0,0 +1,5 @@ +<%= form_for @grouppost, :url => admin_group_createpost_path(@group), :html => { :multipart => true , :class=>"form-horizontal main-forms"} do |f| %> +
        + <%= render :partial => "post_form", locals: {f: f} %> +
        +<% end %> \ No newline at end of file diff --git a/app/views/admin/groups/public_groups.html.erb b/app/views/admin/groups/public_groups.html.erb new file mode 100644 index 0000000..216ea65 --- /dev/null +++ b/app/views/admin/groups/public_groups.html.erb @@ -0,0 +1,15 @@ +<% content_for :page_specific_css do -%> + <%= stylesheet_link_tag "lib/wrap-nav" %> + <%= stylesheet_link_tag "lib/main-list" %> + <%= stylesheet_link_tag "lib/filter" %> + <%= stylesheet_link_tag "lib/member" %> +<% end -%> +<% content_for :page_specific_javascript do -%> + <%= javascript_include_tag "lib/jquery.lite.image.resize.js" %> + <%= javascript_include_tag "lib/member/list-view.js" %> +<% end -%> +
        +
          + <%= render :partial=>"group",:collection=> @groups %> +
        +
        \ No newline at end of file diff --git a/app/views/admin/groups/show.html.erb b/app/views/admin/groups/show.html.erb new file mode 100644 index 0000000..1853d04 --- /dev/null +++ b/app/views/admin/groups/show.html.erb @@ -0,0 +1,75 @@ +<% content_for :page_specific_css do -%> + <%= stylesheet_link_tag "group_page" %> +<% end -%> + +
        +
        + <%= @group.title %> +
          +
        • +
        • +
        +
        +
        +

        <%= @group.title %>

        + New Post +
        + +
        +
        + + Info + + +
        + <%= render :partial => "post", :collection => @group.group_posts.desc(:created_at) %> +
        +
        + + diff --git a/app/views/admin/groups/showpost.html.erb b/app/views/admin/groups/showpost.html.erb new file mode 100644 index 0000000..5adc4b3 --- /dev/null +++ b/app/views/admin/groups/showpost.html.erb @@ -0,0 +1 @@ +this is post for <%= params[:id] %> \ No newline at end of file diff --git a/app/views/admin/members/_side_bar.html.erb b/app/views/admin/members/_side_bar.html.erb index 32a197b..97539fc 100644 --- a/app/views/admin/members/_side_bar.html.erb +++ b/app/views/admin/members/_side_bar.html.erb @@ -9,6 +9,9 @@ <%= content_tag :li, :class => active_for_controllers('members','roles','member_infos') do -%> <%= link_to( ( content_tag(:span, content_tag(:i, nil, :class => 'icons-user'))), admin_members_path) %> <% end -%> + <%= content_tag :li, :class => active_for_controllers('groups') do -%> + <%= link_to( ( content_tag(:span, content_tag(:i, nil, :class => 'icons-layout'))), admin_groups_path) %> + <% end -%> <% if (current_user.is_admin? rescue false) %> <%= content_tag :li, :class => active_for_controllers('plugins') do -%> <%= link_to( ( content_tag(:span, content_tag(:i, nil, :class => 'icons-graduation'))),admin_personal_plugins_path) %> @@ -16,10 +19,8 @@ <%= content_tag :li, :class => active_for_controllers('plugins') do -%> <%= link_to( ( content_tag(:span, content_tag(:i, nil, :class => 'icons-pie'))), '#') %> <% end -%> - <%= content_tag :li, :class => active_for_controllers('groups') do -%> - <%= link_to( ( content_tag(:span, content_tag(:i, nil, :class => 'icons-layout'))), admin_groups_path) %> - <% end -%> - <% end -%> + <% end -%> + <% end -%>
    @@ -36,6 +37,15 @@ <%= content_tag :li, link_to((content_tag(:span, t(:unapproved_members) + " (" + User.unapproved.count.to_s + ")")), admin_members_unapproved_members_path), :class => active_for_action('members', 'unapproved_members') if (current_user.is_admin? rescue nil) %> <% end -%>
    + -
    diff --git a/app/views/layouts/member.html.erb b/app/views/layouts/member.html.erb index 36097d4..5a065b9 100644 --- a/app/views/layouts/member.html.erb +++ b/app/views/layouts/member.html.erb @@ -15,8 +15,12 @@ <%= render_orbit_bar unless @no_orbit_bar %> <%= render :partial => 'admin/members/side_bar' unless @no_side_bar %>
    + <% unless @no_filter && @no_breadcrumb %>
    -
    + <% unless @no_filter %> +
    + <% end %> + <% unless @no_breadcrumb %> + <% end %> <%= yield :right_nav %>
    + <% end %> <%= yield %> <%= javascript_include_tag "lib/pageslide.js" %>
    diff --git a/app/views/orbit_bar/index.html.erb b/app/views/orbit_bar/index.html.erb index d433b4e..18613e3 100644 --- a/app/views/orbit_bar/index.html.erb +++ b/app/views/orbit_bar/index.html.erb @@ -61,7 +61,7 @@
  • - + <%= t(:member_) %>
  • diff --git a/config/application.rb b/config/application.rb index 126131f..ef1fd0f 100644 --- a/config/application.rb +++ b/config/application.rb @@ -37,5 +37,7 @@ module Orbit # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de + + config.mongoid.observers = :orbit_observer end end diff --git a/config/routes.rb b/config/routes.rb index 11b6b5a..0a197dd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -122,9 +122,13 @@ Orbit::Application.routes.draw do # GROUPS START HERE get "groups/categories" => 'groups#categories' + post "groups/create_category" => 'groups#create_category' + get "groups/public" => 'groups#public_groups' + get "posts/:id" => 'groups#showpost' - resources :groups do - + resources :groups do + get "newpost" => 'groups#newpost' + post "createpost" => 'groups#createpost' end diff --git a/downloaded_extensions.rb b/downloaded_extensions.rb deleted file mode 100644 index e69de29..0000000 diff --git a/downloaded_extensions.rb.lock b/downloaded_extensions.rb.lock new file mode 100644 index 0000000..83f331d --- /dev/null +++ b/downloaded_extensions.rb.lock @@ -0,0 +1,7 @@ +GEM + specs: + +PLATFORMS + ruby + +DEPENDENCIES diff --git a/lib/orbit_app/module/registration.rb b/lib/orbit_app/module/registration.rb index 25f6f1b..ae8b9fd 100644 --- a/lib/orbit_app/module/registration.rb +++ b/lib/orbit_app/module/registration.rb @@ -40,7 +40,7 @@ module OrbitApp end class RegisteredModule - attr_reader :name,:key,:base_path, :module_label,:widget_methods,:authorizable_models,:is_authorizable, :data_count, :widget_settings, :icon_class_no_sidebar,:desktop_enabled + attr_reader :name,:key,:base_path, :module_label,:widget_methods,:authorizable_models,:is_authorizable, :data_count, :widget_settings, :icon_class_no_sidebar,:desktop_enabled, :models_to_cache def initialize(name,&block) @name = name @@ -48,6 +48,7 @@ module OrbitApp @side_bar = nil @module_label = @name @widget_methods = [] + @models_to_cache = [] @widget_settings = {} @is_taggable = false @authorizable_models = [] @@ -93,6 +94,14 @@ module OrbitApp @widget_settings = settings.first end + def models_to_cache(models) + @models_to_cache = models + end + + def get_models_to_cache + @models_to_cache + end + def get_widget_settings @widget_settings end diff --git a/lib/orbit_app/register_module.rb b/lib/orbit_app/register_module.rb index 7c62298..2342a36 100644 --- a/lib/orbit_app/register_module.rb +++ b/lib/orbit_app/register_module.rb @@ -21,6 +21,23 @@ module OrbitApp end end + def get_models_for_caching + @models_for_caching = {} + ModuleApp.all.each do |ma| + # models.concat(ma.cache_models) + ma.cache_models.each do |cm| + @models_for_caching[cm] = ma.key + end + end + @models_for_caching[:tag] = "Tag" + @models_for_caching[:category] = "Category" + return @models_for_caching + end + + def get_model_hash_for_caching + @models_for_caching + end + def check_module_permissions store_token = Site.first.store_token rescue nil module_apps = ModuleApp.all diff --git a/lib/orbit_model/impression.rb b/lib/orbit_model/impression.rb index 0856e80..3de4ce2 100644 --- a/lib/orbit_model/impression.rb +++ b/lib/orbit_model/impression.rb @@ -4,7 +4,7 @@ module OrbitModel include Impressionist::Impressionable base.extend ClassMethods - base.is_impressionable :counter_cache => true, :column_name => :view_count, :unique => :all + base.is_impressionable :counter_cache => false base.field :view_count, :type => Integer, :default => 0 end