Commit ce7f6650c39076f15473f018dc407f9440802847
Exists in
staging
and in
1 other branch
merge with master
Showing
179 changed files
with
927 additions
and
4295 deletions
Show diff stats
Too many changes.
To preserve performance only 100 of 179 files displayed.
| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | +class ActivitiesCounterCacheJob | |
| 2 | + | |
| 3 | + def perform | |
| 4 | + person_activities_counts = ApplicationRecord.connection.execute("SELECT profiles.id, count(action_tracker.id) as count FROM profiles LEFT OUTER JOIN action_tracker ON profiles.id = action_tracker.user_id WHERE (action_tracker.created_at >= #{ApplicationRecord.connection.quote(ActionTracker::Record::RECENT_DELAY.days.ago.to_s(:db))}) AND ( (profiles.type = 'Person' ) ) GROUP BY profiles.id;") | |
| 5 | + organization_activities_counts = ApplicationRecord.connection.execute("SELECT profiles.id, count(action_tracker.id) as count FROM profiles LEFT OUTER JOIN action_tracker ON profiles.id = action_tracker.target_id WHERE (action_tracker.created_at >= #{ApplicationRecord.connection.quote(ActionTracker::Record::RECENT_DELAY.days.ago.to_s(:db))}) AND ( (profiles.type = 'Community' OR profiles.type = 'Enterprise' OR profiles.type = 'Organization' ) ) GROUP BY profiles.id;") | |
| 6 | + activities_counts = person_activities_counts.entries + organization_activities_counts.entries | |
| 7 | + activities_counts.each do |count| | |
| 8 | + update_sql = ApplicationRecord.__send__(:sanitize_sql, ["UPDATE profiles SET activities_count=? WHERE profiles.id=?;", count['count'].to_i, count['id'] ], '') | |
| 9 | + ApplicationRecord.connection.execute(update_sql) | |
| 10 | + end | |
| 11 | + Delayed::Job.enqueue(ActivitiesCounterCacheJob.new, {:priority => -3, :run_at => 1.day.from_now}) | |
| 12 | + end | |
| 13 | + | |
| 14 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | +class CreateThumbnailsJob < Struct.new(:class_name, :file_id) | |
| 2 | + def perform | |
| 3 | + return unless class_name.constantize.exists?(file_id) | |
| 4 | + file = class_name.constantize.find(file_id) | |
| 5 | + file.create_thumbnails | |
| 6 | + article = Article.where(:image_id => file_id).first | |
| 7 | + if article | |
| 8 | + article.touch | |
| 9 | + end | |
| 10 | + end | |
| 11 | +end | ... | ... |
app/models/application_record.rb
| 1 | 1 | class ApplicationRecord < ActiveRecord::Base |
| 2 | 2 | |
| 3 | - self.abstract_class = true | |
| 4 | - | |
| 5 | - def self.postgresql? | |
| 6 | - self.connection.adapter_name == 'PostgreSQL' | |
| 7 | - end | |
| 3 | + self.abstract_class = true | |
| 4 | + self.store_full_sti_class = true | |
| 8 | 5 | |
| 9 | 6 | # an ActionView instance for rendering views on models |
| 10 | 7 | def self.action_view |
| ... | ... | @@ -25,7 +22,7 @@ class ApplicationRecord < ActiveRecord::Base |
| 25 | 22 | alias :meta_cache_key :cache_key |
| 26 | 23 | def cache_key |
| 27 | 24 | key = [Noosfero::VERSION, meta_cache_key] |
| 28 | - key.unshift(ApplicationRecord.connection.schema_search_path) if ApplicationRecord.postgresql? | |
| 25 | + key.unshift ApplicationRecord.connection.schema_search_path | |
| 29 | 26 | key.join('/') |
| 30 | 27 | end |
| 31 | 28 | ... | ... |
app/models/block.rb
| ... | ... | @@ -76,6 +76,17 @@ class Block < ApplicationRecord |
| 76 | 76 | true |
| 77 | 77 | end |
| 78 | 78 | |
| 79 | + def visible_to_user?(user) | |
| 80 | + visible = self.display_to_user?(user) | |
| 81 | + if self.owner.kind_of?(Profile) | |
| 82 | + visible &= self.owner.display_info_to?(user) | |
| 83 | + visible &= (self.visible? || user && user.has_permission?(:edit_profile_design, self.owner)) | |
| 84 | + elsif self.owner.kind_of?(Environment) | |
| 85 | + visible &= (self.visible? || user && user.has_permission?(:edit_environment_design, self.owner)) | |
| 86 | + end | |
| 87 | + visible | |
| 88 | + end | |
| 89 | + | |
| 79 | 90 | def display_to_user?(user) |
| 80 | 91 | display_user == 'all' || (user.nil? && display_user == 'not_logged') || (user && display_user == 'logged') || (user && display_user == 'followers' && user.follows?(owner)) |
| 81 | 92 | end |
| ... | ... | @@ -314,6 +325,14 @@ class Block < ApplicationRecord |
| 314 | 325 | self.observers << block |
| 315 | 326 | end |
| 316 | 327 | |
| 328 | + def api_content | |
| 329 | + nil | |
| 330 | + end | |
| 331 | + | |
| 332 | + def display_api_content_by_default? | |
| 333 | + false | |
| 334 | + end | |
| 335 | + | |
| 317 | 336 | private |
| 318 | 337 | |
| 319 | 338 | def home_page_path | ... | ... |
app/models/raw_html_block.rb
app/models/recent_documents_block.rb
| ... | ... | @@ -29,4 +29,12 @@ class RecentDocumentsBlock < Block |
| 29 | 29 | def self.expire_on |
| 30 | 30 | { :profile => [:article], :environment => [:article] } |
| 31 | 31 | end |
| 32 | + | |
| 33 | + def api_content | |
| 34 | + Noosfero::API::Entities::ArticleBase.represent(docs).as_json | |
| 35 | + end | |
| 36 | + | |
| 37 | + def display_api_content_by_default? | |
| 38 | + false | |
| 39 | + end | |
| 32 | 40 | end | ... | ... |
app/views/admin_panel/set_portal_community.html.erb
| ... | ... | @@ -9,7 +9,7 @@ |
| 9 | 9 | <% end %> |
| 10 | 10 | <% end %> |
| 11 | 11 | <% else %> |
| 12 | - <%= _('Portal identifier: %s') % link_to(@portal_community.identifier, @portal_community.url) %> | |
| 12 | + <%= _('Portal identifier: %s').html_safe % link_to(@portal_community.identifier, @portal_community.url) %> | |
| 13 | 13 | |
| 14 | 14 | <% button_bar do %> |
| 15 | 15 | <%if @portal_community.environment.enabled?('use_portal_community') %> | ... | ... |
config/application.rb
| 1 | -require File.expand_path('../boot', __FILE__) | |
| 1 | +require_relative 'boot' | |
| 2 | 2 | |
| 3 | 3 | require 'rails/all' |
| 4 | 4 | require 'active_support/dependencies' |
| 5 | 5 | |
| 6 | -# FIXME this silences the warnings about Rails 2.3-style plugins under | |
| 7 | -# vendor/plugins, which are deprecated. Hiding those warnings makes it easier | |
| 8 | -# to work for now, but we should really look at putting those plugins away. | |
| 6 | +# Silence Rails 5 deprecation warnings | |
| 9 | 7 | ActiveSupport::Deprecation.silenced = true |
| 10 | 8 | |
| 11 | 9 | Bundler.require(:default, :assets, Rails.env) |
| 10 | +$: << File.expand_path('../lib', File.dirname(__FILE__)) | |
| 11 | + | |
| 12 | +require_dependency 'noosfero' | |
| 13 | +require_dependency 'noosfero/plugin' | |
| 14 | +require_dependency 'noosfero/multi_tenancy' | |
| 12 | 15 | |
| 13 | 16 | module Noosfero |
| 14 | 17 | class Application < Rails::Application |
| 15 | 18 | |
| 16 | - require 'noosfero/plugin' | |
| 17 | - | |
| 18 | 19 | # The plugin xss_terminator(located in vendor/plugins/xss_terminator) and the helper |
| 19 | 20 | # SanitizeHelper(located in app/helpers/sanitize_helper.rb) use |
| 20 | 21 | # ALLOWED_TAGS and ALLOWED_ATTRIBUTES to make a sanitize with html. |
| ... | ... | @@ -30,9 +31,6 @@ module Noosfero |
| 30 | 31 | config.action_view.sanitized_allowed_tags = ALLOWED_TAGS |
| 31 | 32 | config.action_view.sanitized_allowed_attributes = ALLOWED_ATTRIBUTES |
| 32 | 33 | |
| 33 | - require 'noosfero/multi_tenancy' | |
| 34 | - config.middleware.use Noosfero::MultiTenancy::Middleware | |
| 35 | - | |
| 36 | 34 | config.action_controller.include_all_helpers = false |
| 37 | 35 | |
| 38 | 36 | # Settings in config/environments/* take precedence over those specified here. |
| ... | ... | @@ -40,10 +38,11 @@ module Noosfero |
| 40 | 38 | # -- all .rb files in that directory are automatically loaded. |
| 41 | 39 | |
| 42 | 40 | # Custom directories with classes and modules you want to be autoloadable. |
| 43 | - config.autoload_paths += %W( #{config.root.join('app', 'sweepers')} ) | |
| 44 | - config.autoload_paths += Dir["#{config.root}/lib"] | |
| 45 | - config.autoload_paths += Dir["#{config.root}/app/controllers/**/"] | |
| 46 | - config.autoload_paths += %W( #{config.root.join('test', 'mocks', Rails.env)} ) | |
| 41 | + config.autoload_paths << config.root.join('lib') | |
| 42 | + config.autoload_paths << config.root.join('app/jobs') | |
| 43 | + config.autoload_paths << config.root.join('app/sweepers') | |
| 44 | + config.autoload_paths.concat Dir["#{config.root}/app/controllers/**/"] | |
| 45 | + config.autoload_paths << config.root.join('test', 'mocks', Rails.env) | |
| 47 | 46 | |
| 48 | 47 | # Only load the plugins named here, in the order given (default is alphabetical). |
| 49 | 48 | # :all can be used as a placeholder for all plugins not explicitly named. |
| ... | ... | @@ -121,7 +120,8 @@ module Noosfero |
| 121 | 120 | |
| 122 | 121 | config.eager_load = true |
| 123 | 122 | |
| 124 | - Noosfero::Plugin.setup(config) | |
| 123 | + config.middleware.use Noosfero::MultiTenancy::Middleware | |
| 125 | 124 | |
| 125 | + Noosfero::Plugin.setup(config) | |
| 126 | 126 | end |
| 127 | 127 | end | ... | ... |
config/environment.rb
| 1 | -# Load the rails application | |
| 2 | -require File.expand_path('../application', __FILE__) | |
| 1 | +require_relative 'application' | |
| 3 | 2 | |
| 4 | -#FIXME Necessary hack to avoid the need of downgrading rubygems on rails 2.3.5 | |
| 5 | -# http://stackoverflow.com/questions/5564251/uninitialized-constant-activesupportdependenciesmutex | |
| 6 | -require 'thread' | |
| 7 | - | |
| 8 | -# Uncomment below to force Rails into production mode when | |
| 9 | -# you don't control web/app server and can't set it the proper way | |
| 10 | -#ENV['RAILS_ENV'] ||= 'production' | |
| 11 | - | |
| 12 | -# extra directories for controllers organization | |
| 13 | -extra_controller_dirs = %w[ | |
| 14 | -].map {|item| Rails.root.join(item) } | |
| 15 | - | |
| 16 | -# Add new inflection rules using the following format | |
| 17 | -# (all these examples are active by default): | |
| 18 | -# Inflector.inflections do |inflect| | |
| 19 | -# inflect.plural /^(ox)$/i, '\1en' | |
| 20 | -# inflect.singular /^(ox)en/i, '\1' | |
| 21 | -# inflect.irregular 'person', 'people' | |
| 22 | -# inflect.uncountable %w( fish sheep ) | |
| 23 | -# end | |
| 24 | - | |
| 25 | -# Include your application configuration below | |
| 26 | - | |
| 27 | -ActiveRecord::Base.store_full_sti_class = true | |
| 28 | - | |
| 29 | -#FIXME: Probably act_as_taggable_on is not being loaded or this should be on another place | |
| 30 | -#Tag.hierarchical = true | |
| 31 | - | |
| 32 | -# several local libraries | |
| 33 | -require_dependency 'noosfero' | |
| 34 | -#FIXME: error when call lib/sqlite_extention | |
| 35 | -#require 'sqlite_extension' | |
| 3 | +Noosfero::Application.initialize! | |
| 36 | 4 | |
| 37 | 5 | # load a local configuration if present, but not under test environment. |
| 38 | -if !['test', 'cucumber'].include?(ENV['RAILS_ENV']) | |
| 6 | +if ENV['RAILS_ENV'].in? %w[test cucumber] | |
| 39 | 7 | localconfigfile = Rails.root.join('config', 'local.rb') |
| 40 | - if File.exists?(localconfigfile) | |
| 41 | - require localconfigfile | |
| 42 | - end | |
| 8 | + require localconfigfile if File.exists? localconfigfile | |
| 43 | 9 | end |
| 44 | 10 | |
| 45 | -Noosfero::Application.initialize! | ... | ... |
| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | +require 'pp' | |
| 2 | + | |
| 3 | +# third-party libraries | |
| 4 | +require 'will_paginate' | |
| 5 | +require 'will_paginate/array' | |
| 6 | +require 'nokogiri' | |
| 7 | + | |
| 8 | +# dependencies at vendor, firstly loaded on Gemfile | |
| 9 | +vendor = Dir.glob('vendor/{,plugins/}*') - ['vendor/plugins'] | |
| 10 | +vendor.each do |dir| | |
| 11 | + init_rb = "#{Rails.root}/#{dir}/init.rb" | |
| 12 | + require init_rb if File.file? init_rb | |
| 13 | +end | |
| 14 | + | |
| 15 | +# extensions | |
| 16 | +require 'extensions' | |
| 17 | + | |
| 18 | +# locally-developed modules | |
| 19 | +require 'acts_as_filesystem' | |
| 20 | +require 'acts_as_having_settings' | |
| 21 | +require 'acts_as_having_boxes' | |
| 22 | +require 'acts_as_having_image' | |
| 23 | +require 'acts_as_having_posts' | |
| 24 | +require 'acts_as_customizable' | |
| 25 | +require 'route_if' | |
| 26 | +require 'maybe_add_http' | |
| 27 | +require 'set_profile_region_from_city_state' | |
| 28 | +require 'authenticated_system' | |
| 29 | +require 'needs_profile' | |
| 30 | +require 'white_list_filter' | |
| 31 | + | ... | ... |
config/initializers/dependencies.rb
| ... | ... | @@ -1,28 +0,0 @@ |
| 1 | -require 'pp' | |
| 2 | - | |
| 3 | -# third-party libraries | |
| 4 | -require 'will_paginate' | |
| 5 | -require 'will_paginate/array' | |
| 6 | -require 'nokogiri' | |
| 7 | - | |
| 8 | -# dependencies at vendor, firstly loaded on Gemfile | |
| 9 | -vendor = Dir.glob('vendor/{,plugins/}*') - ['vendor/plugins'] | |
| 10 | -vendor.each do |dir| | |
| 11 | - init_rb = "#{Rails.root}/#{dir}/init.rb" | |
| 12 | - require init_rb if File.file? init_rb | |
| 13 | -end | |
| 14 | - | |
| 15 | -# locally-developed modules | |
| 16 | -require 'acts_as_filesystem' | |
| 17 | -require 'acts_as_having_settings' | |
| 18 | -require 'acts_as_having_boxes' | |
| 19 | -require 'acts_as_having_image' | |
| 20 | -require 'acts_as_having_posts' | |
| 21 | -require 'acts_as_customizable' | |
| 22 | -require 'route_if' | |
| 23 | -require 'maybe_add_http' | |
| 24 | -require 'set_profile_region_from_city_state' | |
| 25 | -require 'authenticated_system' | |
| 26 | -require 'needs_profile' | |
| 27 | -require 'white_list_filter' | |
| 28 | - |
config/initializers/plugins.rb
lib/activities_counter_cache_job.rb
| ... | ... | @@ -1,14 +0,0 @@ |
| 1 | -class ActivitiesCounterCacheJob | |
| 2 | - | |
| 3 | - def perform | |
| 4 | - person_activities_counts = ApplicationRecord.connection.execute("SELECT profiles.id, count(action_tracker.id) as count FROM profiles LEFT OUTER JOIN action_tracker ON profiles.id = action_tracker.user_id WHERE (action_tracker.created_at >= #{ApplicationRecord.connection.quote(ActionTracker::Record::RECENT_DELAY.days.ago.to_s(:db))}) AND ( (profiles.type = 'Person' ) ) GROUP BY profiles.id;") | |
| 5 | - organization_activities_counts = ApplicationRecord.connection.execute("SELECT profiles.id, count(action_tracker.id) as count FROM profiles LEFT OUTER JOIN action_tracker ON profiles.id = action_tracker.target_id WHERE (action_tracker.created_at >= #{ApplicationRecord.connection.quote(ActionTracker::Record::RECENT_DELAY.days.ago.to_s(:db))}) AND ( (profiles.type = 'Community' OR profiles.type = 'Enterprise' OR profiles.type = 'Organization' ) ) GROUP BY profiles.id;") | |
| 6 | - activities_counts = person_activities_counts.entries + organization_activities_counts.entries | |
| 7 | - activities_counts.each do |count| | |
| 8 | - update_sql = ApplicationRecord.__send__(:sanitize_sql, ["UPDATE profiles SET activities_count=? WHERE profiles.id=?;", count['count'].to_i, count['id'] ], '') | |
| 9 | - ApplicationRecord.connection.execute(update_sql) | |
| 10 | - end | |
| 11 | - Delayed::Job.enqueue(ActivitiesCounterCacheJob.new, {:priority => -3, :run_at => 1.day.from_now}) | |
| 12 | - end | |
| 13 | - | |
| 14 | -end |
lib/acts_as_customizable.rb
lib/acts_as_filesystem.rb
| ... | ... | @@ -33,7 +33,7 @@ module ActsAsFileSystem |
| 33 | 33 | module ClassMethods |
| 34 | 34 | |
| 35 | 35 | def build_ancestry(parent_id = nil, ancestry = '') |
| 36 | - ApplicationRecord.transaction do | |
| 36 | + ActiveRecord::Base.transaction do | |
| 37 | 37 | self.base_class.where(parent_id: parent_id).each do |node| |
| 38 | 38 | node.update_column :ancestry, ancestry |
| 39 | 39 | |
| ... | ... | @@ -263,5 +263,5 @@ module ActsAsFileSystem |
| 263 | 263 | end |
| 264 | 264 | end |
| 265 | 265 | |
| 266 | -ApplicationRecord.extend ActsAsFileSystem::ActsMethods | |
| 266 | +ActiveRecord::Base.extend ActsAsFileSystem::ActsMethods | |
| 267 | 267 | ... | ... |
lib/acts_as_having_boxes.rb
lib/acts_as_having_image.rb
lib/acts_as_having_posts.rb
lib/acts_as_having_settings.rb
lib/code_numbering.rb
lib/create_thumbnails_job.rb
| ... | ... | @@ -1,11 +0,0 @@ |
| 1 | -class CreateThumbnailsJob < Struct.new(:class_name, :file_id) | |
| 2 | - def perform | |
| 3 | - return unless class_name.constantize.exists?(file_id) | |
| 4 | - file = class_name.constantize.find(file_id) | |
| 5 | - file.create_thumbnails | |
| 6 | - article = Article.where(:image_id => file_id).first | |
| 7 | - if article | |
| 8 | - article.touch | |
| 9 | - end | |
| 10 | - end | |
| 11 | -end |
lib/delayed_attachment_fu.rb
| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | +ActiveRecord::Calculations.class_eval do | |
| 2 | + def count_with_distinct column_name=self.primary_key | |
| 3 | + if column_name | |
| 4 | + distinct.count_without_distinct column_name | |
| 5 | + else | |
| 6 | + count_without_distinct | |
| 7 | + end | |
| 8 | + end | |
| 9 | + alias_method_chain :count, :distinct | |
| 10 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | + | |
| 2 | +# on STI classes tike Article and Profile, plugins' extensions | |
| 3 | +# on associations should be reflected on descendants | |
| 4 | +module ActiveRecord | |
| 5 | + module Reflection | |
| 6 | + | |
| 7 | + class << self | |
| 8 | + | |
| 9 | + def add_reflection_with_descendants(ar, name, reflection) | |
| 10 | + self.add_reflection_without_descendants ar, name, reflection | |
| 11 | + ar.descendants.each do |k| | |
| 12 | + k._reflections.merge!(name.to_s => reflection) | |
| 13 | + end if ar.base_class == ar | |
| 14 | + end | |
| 15 | + | |
| 16 | + alias_method_chain :add_reflection, :descendants | |
| 17 | + | |
| 18 | + end | |
| 19 | + end | |
| 20 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,39 @@ |
| 1 | +class Integer | |
| 2 | + def to_humanreadable | |
| 3 | + value = self | |
| 4 | + if value < 1023 | |
| 5 | + return "%i bytes" % value | |
| 6 | + end | |
| 7 | + value /= 1024 | |
| 8 | + | |
| 9 | + if value < 1023 | |
| 10 | + return "%1.1f KB" % value | |
| 11 | + end | |
| 12 | + value /= 1024 | |
| 13 | + | |
| 14 | + if value < 1023 | |
| 15 | + return "%1.1f MB" % value | |
| 16 | + end | |
| 17 | + value /= 1024 | |
| 18 | + | |
| 19 | + if value < 1023 | |
| 20 | + return "%1.1f GB" % value | |
| 21 | + end | |
| 22 | + value /= 1024 | |
| 23 | + | |
| 24 | + if value < 1023 | |
| 25 | + return "%1.1f TB" % value | |
| 26 | + end | |
| 27 | + value /= 1024 | |
| 28 | + | |
| 29 | + if value < 1023 | |
| 30 | + return "%1.1f PB" % value | |
| 31 | + end | |
| 32 | + value /= 1024 | |
| 33 | + | |
| 34 | + if value < 1023 | |
| 35 | + return "%1.1f EB" % value | |
| 36 | + end | |
| 37 | + value /= 1024 | |
| 38 | + end | |
| 39 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,93 @@ |
| 1 | +# encoding: utf-8 | |
| 2 | + | |
| 3 | +class String | |
| 4 | + | |
| 5 | + TRANSLITERATIONS = { | |
| 6 | + [ 'Á', 'À', 'À', 'Â', 'Ã', 'Ä', 'Å' ] => 'A', | |
| 7 | + [ 'á', 'à', 'à', 'â', 'ã', 'ä', 'å' ,'ª' ] => 'a', | |
| 8 | + [ 'É', 'È', 'Ê', 'Ë' ] => 'E', | |
| 9 | + [ 'é', 'è', 'ê', 'ë' ] => 'e', | |
| 10 | + [ 'Í', 'Ì', 'Î', 'Ï' ] => 'I', | |
| 11 | + [ 'í', 'ì', 'î', 'ï' ] => 'i', | |
| 12 | + [ 'Ó', 'Ò', 'Ô', 'Ö', 'Õ', 'º' ] => 'O', | |
| 13 | + [ 'ó', 'ò', 'ô', 'ö', 'õ', 'º' ] => 'o', | |
| 14 | + [ 'Ú', 'Ù', 'Û', 'Ü' ] => 'U', | |
| 15 | + [ 'ú', 'ù', 'û', 'ü' ] => 'u', | |
| 16 | + [ 'ß' ] => 'ss', | |
| 17 | + [ 'Ç' ] => 'C', | |
| 18 | + [ 'ç' ] => 'c', | |
| 19 | + [ 'Ñ' ] => 'N', | |
| 20 | + [ 'ñ' ] => 'n', | |
| 21 | + [ 'Ÿ' ] => 'Y', | |
| 22 | + [ 'ÿ' ] => 'y', | |
| 23 | +# Cyrillic alphabet transliteration | |
| 24 | + [ 'а', 'А' ] => 'a', | |
| 25 | + [ 'б', 'Б' ] => 'b', | |
| 26 | + [ 'в', 'В' ] => 'v', | |
| 27 | + [ 'г', 'Г' ] => 'g', | |
| 28 | + [ 'д', 'Д' ] => 'd', | |
| 29 | + [ 'е', 'Е' ] => 'e', | |
| 30 | + [ 'ё', 'Ё' ] => 'yo', | |
| 31 | + [ 'ж', 'Ж' ] => 'zh', | |
| 32 | + [ 'з', 'З' ] => 'z', | |
| 33 | + [ 'и', 'И' ] => 'i', | |
| 34 | + [ 'й', 'Й' ] => 'y', | |
| 35 | + [ 'к', 'К' ] => 'k', | |
| 36 | + [ 'л', 'Л' ] => 'l', | |
| 37 | + [ 'м', 'М' ] => 'm', | |
| 38 | + [ 'н', 'Н' ] => 'n', | |
| 39 | + [ 'о', 'О' ] => 'o', | |
| 40 | + [ 'п', 'П' ] => 'p', | |
| 41 | + [ 'р', 'Р' ] => 'r', | |
| 42 | + [ 'с', 'С' ] => 's', | |
| 43 | + [ 'т', 'Т' ] => 't', | |
| 44 | + [ 'у', 'У' ] => 'u', | |
| 45 | + [ 'ф', 'Ф' ] => 'f', | |
| 46 | + [ 'х', 'Х' ] => 'h', | |
| 47 | + [ 'ц', 'Ц' ] => 'ts', | |
| 48 | + [ 'ч', 'Ч' ] => 'ch', | |
| 49 | + [ 'ш', 'Ш' ] => 'sh', | |
| 50 | + [ 'щ', 'Щ' ] => 'sch', | |
| 51 | + [ 'э', 'Э' ] => 'e', | |
| 52 | + [ 'ю', 'Ю' ] => 'yu', | |
| 53 | + [ 'я', 'Я' ] => 'ya', | |
| 54 | + [ 'ы', 'Ы' ] => 'i', | |
| 55 | + [ 'ь', 'Ь' ] => '', | |
| 56 | + [ 'ъ', 'Ъ' ] => '', | |
| 57 | +# Ukrainian lovely letters | |
| 58 | + [ 'і', 'І' ] => 'i', | |
| 59 | + [ 'ї', 'Ї' ] => 'yi', | |
| 60 | + [ 'є', 'Є' ] => 'ye', | |
| 61 | + [ 'ґ', 'Ґ' ] => 'g', | |
| 62 | + } | |
| 63 | + | |
| 64 | + # transliterate a string (assumed to contain UTF-8 data) | |
| 65 | + # into ASCII by replacing non-ascii characters to their | |
| 66 | + # ASCII. | |
| 67 | + # | |
| 68 | + # The transliteration is, of course, lossy, and its performance is poor. | |
| 69 | + # Don't abuse this method. | |
| 70 | + def transliterate | |
| 71 | + | |
| 72 | + new = self.dup | |
| 73 | + TRANSLITERATIONS.each { |from,to| | |
| 74 | + from.each { |seq| | |
| 75 | + new.gsub!(seq, to) | |
| 76 | + } | |
| 77 | + } | |
| 78 | + new | |
| 79 | + end | |
| 80 | + | |
| 81 | + def to_slug | |
| 82 | + transliterate.downcase.gsub(/[^[[:word:]]~\s:;+=_."'`-]/, '').gsub(/[\s:;+=_"'`-]+/, '-').gsub(/-$/, '').gsub(/^-/, '').to_s | |
| 83 | + end | |
| 84 | + | |
| 85 | + def to_css_class | |
| 86 | + underscore.dasherize.gsub('/','_') | |
| 87 | + end | |
| 88 | + | |
| 89 | + def fix_i18n | |
| 90 | + self.sub('{fn} ', '') | |
| 91 | + end | |
| 92 | + | |
| 93 | +end | ... | ... |
lib/noosfero.rb
| 1 | -# encoding: utf-8 | |
| 1 | +require_relative 'noosfero/version' | |
| 2 | +require_relative 'noosfero/constants' | |
| 2 | 3 | |
| 3 | 4 | module Noosfero |
| 4 | 5 | |
| ... | ... | @@ -106,6 +107,3 @@ module Noosfero |
| 106 | 107 | |
| 107 | 108 | end |
| 108 | 109 | |
| 109 | -require 'noosfero/version' | |
| 110 | -require 'noosfero/constants' | |
| 111 | -require 'noosfero/core_ext' | ... | ... |
lib/noosfero/api/api.rb
lib/noosfero/api/entities.rb
| ... | ... | @@ -88,6 +88,7 @@ module Noosfero |
| 88 | 88 | root 'blocks', 'block' |
| 89 | 89 | expose :id, :type, :settings, :position, :enabled |
| 90 | 90 | expose :mirror, :mirror_block_id, :title |
| 91 | + expose :api_content, if: lambda { |object, options| options[:display_api_content] || object.display_api_content_by_default? } | |
| 91 | 92 | end |
| 92 | 93 | |
| 93 | 94 | class Box < Entity | ... | ... |
lib/noosfero/api/helpers.rb
| 1 | 1 | require 'grape' |
| 2 | +require 'base64' | |
| 3 | +require 'tempfile' | |
| 2 | 4 | require_relative '../../find_by_contents' |
| 3 | 5 | |
| 4 | - module Noosfero; | |
| 5 | - module API | |
| 6 | - module APIHelpers | |
| 6 | +module Noosfero; | |
| 7 | + module API | |
| 8 | + module APIHelpers | |
| 7 | 9 | PRIVATE_TOKEN_PARAM = :private_token |
| 8 | 10 | DEFAULT_ALLOWED_PARAMETERS = [:parent_id, :from, :until, :content_type, :author_id, :identifier, :archived] |
| 9 | 11 | |
| ... | ... | @@ -255,7 +257,7 @@ require_relative '../../find_by_contents' |
| 255 | 257 | else |
| 256 | 258 | created_at = scope.find(reference_id).created_at |
| 257 | 259 | scope.send("#{params.key?(:oldest) ? 'older_than' : 'younger_than'}", created_at) |
| 258 | - end | |
| 260 | + end | |
| 259 | 261 | end |
| 260 | 262 | |
| 261 | 263 | def by_categories(scope, params) |
| ... | ... | @@ -412,6 +414,30 @@ require_relative '../../find_by_contents' |
| 412 | 414 | not_found! if Noosfero::API::API.endpoint_unavailable?(self, @environment) |
| 413 | 415 | end |
| 414 | 416 | |
| 417 | + def asset_with_image params | |
| 418 | + if params.has_key? :image_builder | |
| 419 | + asset_api_params = params | |
| 420 | + asset_api_params[:image_builder] = base64_to_uploadedfile(asset_api_params[:image_builder]) | |
| 421 | + return asset_api_params | |
| 422 | + end | |
| 423 | + params | |
| 424 | + end | |
| 425 | + | |
| 426 | + def base64_to_uploadedfile(base64_image) | |
| 427 | + tempfile = base64_to_tempfile base64_image | |
| 428 | + converted_image = base64_image | |
| 429 | + converted_image[:tempfile] = tempfile | |
| 430 | + return {uploaded_data: ActionDispatch::Http::UploadedFile.new(converted_image)} | |
| 431 | + end | |
| 432 | + | |
| 433 | + def base64_to_tempfile base64_image | |
| 434 | + base64_img_str = base64_image[:tempfile] | |
| 435 | + decoded_base64_str = Base64.decode64(base64_img_str) | |
| 436 | + tempfile = Tempfile.new(base64_image[:filename]) | |
| 437 | + tempfile.write(decoded_base64_str.encode("ascii-8bit").force_encoding("utf-8")) | |
| 438 | + tempfile.rewind | |
| 439 | + tempfile | |
| 440 | + end | |
| 415 | 441 | private |
| 416 | 442 | |
| 417 | 443 | def parser_params(params) | ... | ... |
lib/noosfero/api/v1/articles.rb
| ... | ... | @@ -56,7 +56,7 @@ module Noosfero |
| 56 | 56 | post ':id' do |
| 57 | 57 | article = environment.articles.find(params[:id]) |
| 58 | 58 | return forbidden! unless article.allow_edit?(current_person) |
| 59 | - article.update_attributes!(params[:article]) | |
| 59 | + article.update_attributes!(asset_with_image(params[:article])) | |
| 60 | 60 | present_partial article, :with => Entities::Article |
| 61 | 61 | end |
| 62 | 62 | ... | ... |
| ... | ... | @@ -0,0 +1,17 @@ |
| 1 | +module Noosfero | |
| 2 | + module API | |
| 3 | + module V1 | |
| 4 | + | |
| 5 | + class Blocks < Grape::API | |
| 6 | + resource :blocks do | |
| 7 | + get ':id' do | |
| 8 | + block = Block.find(params["id"]) | |
| 9 | + return forbidden! unless block.visible_to_user?(current_person) | |
| 10 | + present block, :with => Entities::Block, display_api_content: true | |
| 11 | + end | |
| 12 | + end | |
| 13 | + end | |
| 14 | + | |
| 15 | + end | |
| 16 | + end | |
| 17 | +end | ... | ... |
lib/noosfero/api/v1/people.rb
| ... | ... | @@ -55,11 +55,10 @@ module Noosfero |
| 55 | 55 | post ':id' do |
| 56 | 56 | authenticate! |
| 57 | 57 | return forbidden! if current_person.id.to_s != params[:id] |
| 58 | - current_person.update_attributes!(params[:person]) | |
| 58 | + current_person.update_attributes!(asset_with_image(params[:person])) | |
| 59 | 59 | present current_person, :with => Entities::Person, :current_person => current_person |
| 60 | 60 | end |
| 61 | - | |
| 62 | - # Example Request: | |
| 61 | + | |
| 63 | 62 | # POST api/v1/people?person[login]=some_login&person[password]=some_password&person[name]=Jack |
| 64 | 63 | # for each custom field for person, add &person[field_name]=field_value to the request |
| 65 | 64 | desc "Create person" |
| ... | ... | @@ -76,7 +75,7 @@ module Noosfero |
| 76 | 75 | params[:person][:custom_values][key]=params[:person].delete(key) if Person.custom_fields(environment).any?{|cf| cf.name==key} |
| 77 | 76 | end |
| 78 | 77 | |
| 79 | - user = User.build(user_data, params[:person], environment) | |
| 78 | + user = User.build(user_data, asset_with_image(params[:person]), environment) | |
| 80 | 79 | |
| 81 | 80 | begin |
| 82 | 81 | user.signup! | ... | ... |
lib/noosfero/core_ext.rb
lib/noosfero/core_ext/active_record/calculations.rb
lib/noosfero/core_ext/active_record/reflection.rb
| ... | ... | @@ -1,20 +0,0 @@ |
| 1 | - | |
| 2 | -# on STI classes tike Article and Profile, plugins' extensions | |
| 3 | -# on associations should be reflected on descendants | |
| 4 | -module ActiveRecord | |
| 5 | - module Reflection | |
| 6 | - | |
| 7 | - class << self | |
| 8 | - | |
| 9 | - def add_reflection_with_descendants(ar, name, reflection) | |
| 10 | - self.add_reflection_without_descendants ar, name, reflection | |
| 11 | - ar.descendants.each do |k| | |
| 12 | - k._reflections.merge!(name.to_s => reflection) | |
| 13 | - end if ar.base_class == ar | |
| 14 | - end | |
| 15 | - | |
| 16 | - alias_method_chain :add_reflection, :descendants | |
| 17 | - | |
| 18 | - end | |
| 19 | - end | |
| 20 | -end |
lib/noosfero/core_ext/integer.rb
| ... | ... | @@ -1,39 +0,0 @@ |
| 1 | -class Integer | |
| 2 | - def to_humanreadable | |
| 3 | - value = self | |
| 4 | - if value < 1023 | |
| 5 | - return "%i bytes" % value | |
| 6 | - end | |
| 7 | - value /= 1024 | |
| 8 | - | |
| 9 | - if value < 1023 | |
| 10 | - return "%1.1f KB" % value | |
| 11 | - end | |
| 12 | - value /= 1024 | |
| 13 | - | |
| 14 | - if value < 1023 | |
| 15 | - return "%1.1f MB" % value | |
| 16 | - end | |
| 17 | - value /= 1024 | |
| 18 | - | |
| 19 | - if value < 1023 | |
| 20 | - return "%1.1f GB" % value | |
| 21 | - end | |
| 22 | - value /= 1024 | |
| 23 | - | |
| 24 | - if value < 1023 | |
| 25 | - return "%1.1f TB" % value | |
| 26 | - end | |
| 27 | - value /= 1024 | |
| 28 | - | |
| 29 | - if value < 1023 | |
| 30 | - return "%1.1f PB" % value | |
| 31 | - end | |
| 32 | - value /= 1024 | |
| 33 | - | |
| 34 | - if value < 1023 | |
| 35 | - return "%1.1f EB" % value | |
| 36 | - end | |
| 37 | - value /= 1024 | |
| 38 | - end | |
| 39 | -end |
lib/noosfero/core_ext/string.rb
| ... | ... | @@ -1,93 +0,0 @@ |
| 1 | -# encoding: utf-8 | |
| 2 | - | |
| 3 | -class String | |
| 4 | - | |
| 5 | - TRANSLITERATIONS = { | |
| 6 | - [ 'Á', 'À', 'À', 'Â', 'Ã', 'Ä', 'Å' ] => 'A', | |
| 7 | - [ 'á', 'à', 'à', 'â', 'ã', 'ä', 'å' ,'ª' ] => 'a', | |
| 8 | - [ 'É', 'È', 'Ê', 'Ë' ] => 'E', | |
| 9 | - [ 'é', 'è', 'ê', 'ë' ] => 'e', | |
| 10 | - [ 'Í', 'Ì', 'Î', 'Ï' ] => 'I', | |
| 11 | - [ 'í', 'ì', 'î', 'ï' ] => 'i', | |
| 12 | - [ 'Ó', 'Ò', 'Ô', 'Ö', 'Õ', 'º' ] => 'O', | |
| 13 | - [ 'ó', 'ò', 'ô', 'ö', 'õ', 'º' ] => 'o', | |
| 14 | - [ 'Ú', 'Ù', 'Û', 'Ü' ] => 'U', | |
| 15 | - [ 'ú', 'ù', 'û', 'ü' ] => 'u', | |
| 16 | - [ 'ß' ] => 'ss', | |
| 17 | - [ 'Ç' ] => 'C', | |
| 18 | - [ 'ç' ] => 'c', | |
| 19 | - [ 'Ñ' ] => 'N', | |
| 20 | - [ 'ñ' ] => 'n', | |
| 21 | - [ 'Ÿ' ] => 'Y', | |
| 22 | - [ 'ÿ' ] => 'y', | |
| 23 | -# Cyrillic alphabet transliteration | |
| 24 | - [ 'а', 'А' ] => 'a', | |
| 25 | - [ 'б', 'Б' ] => 'b', | |
| 26 | - [ 'в', 'В' ] => 'v', | |
| 27 | - [ 'г', 'Г' ] => 'g', | |
| 28 | - [ 'д', 'Д' ] => 'd', | |
| 29 | - [ 'е', 'Е' ] => 'e', | |
| 30 | - [ 'ё', 'Ё' ] => 'yo', | |
| 31 | - [ 'ж', 'Ж' ] => 'zh', | |
| 32 | - [ 'з', 'З' ] => 'z', | |
| 33 | - [ 'и', 'И' ] => 'i', | |
| 34 | - [ 'й', 'Й' ] => 'y', | |
| 35 | - [ 'к', 'К' ] => 'k', | |
| 36 | - [ 'л', 'Л' ] => 'l', | |
| 37 | - [ 'м', 'М' ] => 'm', | |
| 38 | - [ 'н', 'Н' ] => 'n', | |
| 39 | - [ 'о', 'О' ] => 'o', | |
| 40 | - [ 'п', 'П' ] => 'p', | |
| 41 | - [ 'р', 'Р' ] => 'r', | |
| 42 | - [ 'с', 'С' ] => 's', | |
| 43 | - [ 'т', 'Т' ] => 't', | |
| 44 | - [ 'у', 'У' ] => 'u', | |
| 45 | - [ 'ф', 'Ф' ] => 'f', | |
| 46 | - [ 'х', 'Х' ] => 'h', | |
| 47 | - [ 'ц', 'Ц' ] => 'ts', | |
| 48 | - [ 'ч', 'Ч' ] => 'ch', | |
| 49 | - [ 'ш', 'Ш' ] => 'sh', | |
| 50 | - [ 'щ', 'Щ' ] => 'sch', | |
| 51 | - [ 'э', 'Э' ] => 'e', | |
| 52 | - [ 'ю', 'Ю' ] => 'yu', | |
| 53 | - [ 'я', 'Я' ] => 'ya', | |
| 54 | - [ 'ы', 'Ы' ] => 'i', | |
| 55 | - [ 'ь', 'Ь' ] => '', | |
| 56 | - [ 'ъ', 'Ъ' ] => '', | |
| 57 | -# Ukrainian lovely letters | |
| 58 | - [ 'і', 'І' ] => 'i', | |
| 59 | - [ 'ї', 'Ї' ] => 'yi', | |
| 60 | - [ 'є', 'Є' ] => 'ye', | |
| 61 | - [ 'ґ', 'Ґ' ] => 'g', | |
| 62 | - } | |
| 63 | - | |
| 64 | - # transliterate a string (assumed to contain UTF-8 data) | |
| 65 | - # into ASCII by replacing non-ascii characters to their | |
| 66 | - # ASCII. | |
| 67 | - # | |
| 68 | - # The transliteration is, of course, lossy, and its performance is poor. | |
| 69 | - # Don't abuse this method. | |
| 70 | - def transliterate | |
| 71 | - | |
| 72 | - new = self.dup | |
| 73 | - TRANSLITERATIONS.each { |from,to| | |
| 74 | - from.each { |seq| | |
| 75 | - new.gsub!(seq, to) | |
| 76 | - } | |
| 77 | - } | |
| 78 | - new | |
| 79 | - end | |
| 80 | - | |
| 81 | - def to_slug | |
| 82 | - transliterate.downcase.gsub(/[^[[:word:]]~\s:;+=_."'`-]/, '').gsub(/[\s:;+=_"'`-]+/, '-').gsub(/-$/, '').gsub(/^-/, '').to_s | |
| 83 | - end | |
| 84 | - | |
| 85 | - def to_css_class | |
| 86 | - underscore.dasherize.gsub('/','_') | |
| 87 | - end | |
| 88 | - | |
| 89 | - def fix_i18n | |
| 90 | - self.sub('{fn} ', '') | |
| 91 | - end | |
| 92 | - | |
| 93 | -end |
lib/noosfero/multi_tenancy.rb
| ... | ... | @@ -12,14 +12,13 @@ module Noosfero |
| 12 | 12 | def self.db_by_host=(host) |
| 13 | 13 | if host != @db_by_host |
| 14 | 14 | @db_by_host = host |
| 15 | - ApplicationRecord.connection.schema_search_path = self.mapping[host] | |
| 15 | + ActiveRecord::Base.connection.schema_search_path = self.mapping[host] | |
| 16 | 16 | end |
| 17 | 17 | end |
| 18 | 18 | |
| 19 | 19 | def self.setup!(host) |
| 20 | - if Noosfero::MultiTenancy.on? and ApplicationRecord.postgresql? | |
| 21 | - Noosfero::MultiTenancy.db_by_host = host | |
| 22 | - end | |
| 20 | + return unless Noosfero::MultiTenancy.on? | |
| 21 | + Noosfero::MultiTenancy.db_by_host = host | |
| 23 | 22 | end |
| 24 | 23 | |
| 25 | 24 | class Middleware | ... | ... |
lib/noosfero/unicorn.rb
| ... | ... | @@ -7,11 +7,11 @@ GC.respond_to?(:copy_on_write_friendly=) and |
| 7 | 7 | GC.copy_on_write_friendly = true |
| 8 | 8 | |
| 9 | 9 | before_fork do |server, worker| |
| 10 | - ApplicationRecord.connection.disconnect! if defined?(ApplicationRecord) | |
| 10 | + ActiveRecord::Base.connection.disconnect! if defined? ActiveRecord::Base | |
| 11 | 11 | end |
| 12 | 12 | |
| 13 | 13 | after_fork do |server, worker| |
| 14 | - ApplicationRecord.establish_connection if defined?(ApplicationRecord) | |
| 14 | + ActiveRecord::Base.establish_connection if defined? ActiveRecord::Base | |
| 15 | 15 | end |
| 16 | 16 | |
| 17 | 17 | # load local configuration file, if it exists | ... | ... |
lib/postgresql_attachment_fu.rb
| ... | ... | @@ -9,12 +9,12 @@ module PostgresqlAttachmentFu |
| 9 | 9 | module InstanceMethods |
| 10 | 10 | def full_filename(thumbnail = nil) |
| 11 | 11 | file_system_path = (thumbnail ? thumbnail_class : self).attachment_options[:path_prefix].to_s |
| 12 | - file_system_path = File.join(file_system_path, ApplicationRecord.connection.schema_search_path) if ApplicationRecord.postgresql? and Noosfero::MultiTenancy.on? | |
| 12 | + file_system_path = File.join(file_system_path, ActiveRecord::Base.connection.schema_search_path) if Noosfero::MultiTenancy.on? | |
| 13 | 13 | Rails.root.join(file_system_path, *partitioned_path(thumbnail_name_for(thumbnail))).to_s |
| 14 | 14 | end |
| 15 | 15 | end |
| 16 | 16 | |
| 17 | 17 | end |
| 18 | 18 | |
| 19 | -ApplicationRecord.extend PostgresqlAttachmentFu::ClassMethods | |
| 19 | +ActiveRecord::Base.extend PostgresqlAttachmentFu::ClassMethods | |
| 20 | 20 | ... | ... |
lib/split_datetime.rb
lib/sqlite_extension.rb
| ... | ... | @@ -1,28 +0,0 @@ |
| 1 | -if ApplicationRecord.connection.adapter_name.downcase == 'sqlite' | |
| 2 | - | |
| 3 | - database = ApplicationRecord.connection.raw_connection | |
| 4 | - | |
| 5 | - database.create_function('pow', 2, 1) do |func, base, exponent| | |
| 6 | - func.set_result(base.to_f ** exponent.to_f) | |
| 7 | - end | |
| 8 | - | |
| 9 | - database.create_function('sqrt', 1, 1) do |func, value| | |
| 10 | - func.set_result(Math.sqrt(value)) | |
| 11 | - end | |
| 12 | - | |
| 13 | - database.create_function('radians', 1, 1) do |func, value| | |
| 14 | - func.set_result(value.to_f * Math::PI / 180.0) | |
| 15 | - end | |
| 16 | - | |
| 17 | - database.create_function('spheric_distance', 5, 1) do |func, lat1, long1, lat2, long2, radius| | |
| 18 | - func.set_result( | |
| 19 | - radius.to_f * Math.acos( | |
| 20 | - [1, | |
| 21 | - Math.cos(lat1.to_f) * Math.cos(long1.to_f) * Math.cos(lat2.to_f) * Math.cos(long2.to_f) + | |
| 22 | - Math.cos(lat1.to_f) * Math.sin(long1.to_f) * Math.cos(lat2.to_f) * Math.sin(long2.to_f) + | |
| 23 | - Math.sin(lat1.to_f) * Math.sin(lat2.to_f) | |
| 24 | - ].min | |
| 25 | - ) | |
| 26 | - ) | |
| 27 | - end | |
| 28 | -end |
lib/tasks/backup.rake
| ... | ... | @@ -115,7 +115,7 @@ end |
| 115 | 115 | |
| 116 | 116 | desc 'Removes emails from database' |
| 117 | 117 | task 'restore:remove_emails' => :environment do |
| 118 | - connection = ApplicationRecord.connection | |
| 118 | + connection = ActiveRecord::Base.connection | |
| 119 | 119 | [ |
| 120 | 120 | "UPDATE users SET email = concat('user', id, '@localhost.localdomain')", |
| 121 | 121 | "UPDATE environments SET contact_email = concat('environment', id, '@localhost.localdomain')", | ... | ... |
lib/tasks/multitenancy.rake
| 1 | 1 | namespace :multitenancy do |
| 2 | 2 | |
| 3 | 3 | task :create => :environment do |
| 4 | - db_envs = ApplicationRecord.configurations.keys.select{ |k| k.match(/_development$|_production$|_test$/) } | |
| 4 | + db_envs = ActiveRecord::Base.configurations.keys.select{ |k| k.match(/_development$|_production$|_test$/) } | |
| 5 | 5 | cd Rails.root.join('config', 'environments'), :verbose => true |
| 6 | 6 | file_envs = Dir.glob "{*_development.rb,*_production.rb,*_test.rb}" |
| 7 | 7 | (db_envs.map{ |e| e + '.rb' } - file_envs).each { |env| ln_s env.split('_').last, env } |
| 8 | 8 | end |
| 9 | 9 | |
| 10 | 10 | task :remove => :environment do |
| 11 | - db_envs = ApplicationRecord.configurations.keys.select{ |k| k.match(/_development$|_production$|_test$/) } | |
| 11 | + db_envs = ActiveRecord::Base.configurations.keys.select{ |k| k.match(/_development$|_production$|_test$/) } | |
| 12 | 12 | cd Rails.root.join('config', 'environments'), :verbose => true |
| 13 | 13 | file_envs = Dir.glob "{*_development.rb,*_production.rb,*_test.rb}" |
| 14 | 14 | (file_envs - db_envs.map{ |e| e + '.rb' }).each { |env| safe_unlink env } |
| ... | ... | @@ -19,7 +19,7 @@ end |
| 19 | 19 | namespace :db do |
| 20 | 20 | |
| 21 | 21 | task :migrate_other_environments => :environment do |
| 22 | - envs = ApplicationRecord.configurations.keys.select{ |k| k.match(/_#{Rails.env}$/) } | |
| 22 | + envs = ActiveRecord::Base.configurations.keys.select{ |k| k.match(/_#{Rails.env}$/) } | |
| 23 | 23 | envs.each do |e| |
| 24 | 24 | puts "*** Migrating #{e}" if Rake.application.options.trace |
| 25 | 25 | system "rake db:migrate RAILS_ENV=#{e} SCHEMA=/dev/null" | ... | ... |
lib/upload_sanitizer.rb
plugins/admin_notifications/lib/admin_notifications_plugin/notifications_user.rb
plugins/admin_notifications/models/admin_notifications_plugin/notification.rb
plugins/admin_notifications/views/admin_notifications_plugin_public/notifications_with_popup.html.erb
| ... | ... | @@ -9,12 +9,12 @@ |
| 9 | 9 | </div> |
| 10 | 10 | </div> |
| 11 | 11 | <div class="notification-message notification-with-title-message"> |
| 12 | - <%= AdminNotificationsPlugin::NotificationHelper.substitute_variables(notification.message, current_user) %> | |
| 12 | + <%= AdminNotificationsPlugin::NotificationHelper.substitute_variables(notification.message, current_user).html_safe %> | |
| 13 | 13 | </div> |
| 14 | 14 | <% else %> |
| 15 | 15 | <div class="<%= notification.type.gsub("AdminNotificationsPlugin::", "").downcase %> notification notification-without-title" data-notification="<%=notification.id%>"> |
| 16 | 16 | <div class="notification-message"> |
| 17 | - <%= AdminNotificationsPlugin::NotificationHelper.substitute_variables(notification.message, current_user) %> | |
| 17 | + <%= AdminNotificationsPlugin::NotificationHelper.substitute_variables(notification.message, current_user).html_safe %> | |
| 18 | 18 | </div> |
| 19 | 19 | </div> |
| 20 | 20 | <% end %> | ... | ... |
plugins/admin_notifications/views/shared/_notifications_list.html.erb
| ... | ... | @@ -23,7 +23,7 @@ |
| 23 | 23 | <% @notifications.each do |notification| %> |
| 24 | 24 | <div class="notification-line"> |
| 25 | 25 | <div class="notification-message"> |
| 26 | - <%= truncate(notification.message, length: 50) %> | |
| 26 | + <%= truncate(notification.message.html_safe, length: 50) %> | |
| 27 | 27 | </div> |
| 28 | 28 | <div class="notification-action"> |
| 29 | 29 | <% if notification.active? %> | ... | ... |
plugins/admin_notifications/views/shared/show_notification.html.erb
| ... | ... | @@ -22,7 +22,7 @@ |
| 22 | 22 | <% @notifications.each do |notification| %> |
| 23 | 23 | <div class="<%= notification.type.gsub("AdminNotificationsPlugin::", "").downcase %> notification" data-notification="<%=notification.id%>" notification-display-popup="<%=notification.display_popup?%>"> |
| 24 | 24 | <div class="notification-message"> |
| 25 | - <%= AdminNotificationsPlugin::NotificationHelper.substitute_variables(notification.message, current_user) %> | |
| 25 | + <%= AdminNotificationsPlugin::NotificationHelper.substitute_variables(notification.message, current_user).html_safe %> | |
| 26 | 26 | </div> |
| 27 | 27 | <% if logged_in? %> |
| 28 | 28 | <div class="notification-close" title="<%= _('Do not show anymore') %>"></div> | ... | ... |
plugins/breadcrumbs/lib/breadcrumbs_plugin/content_breadcrumbs_block.rb
| ... | ... | @@ -22,70 +22,8 @@ class BreadcrumbsPlugin::ContentBreadcrumbsBlock < Block |
| 22 | 22 | _('This block displays breadcrumb trail.') |
| 23 | 23 | end |
| 24 | 24 | |
| 25 | - def page_trail(page, params={}) | |
| 26 | - links = [] | |
| 27 | - if page | |
| 28 | - links = page.ancestors.reverse.map { |p| { :name => p.title, :url => p.url } } | |
| 29 | - links << { :name => page.title, :url => page.url } | |
| 30 | - elsif params[:controller] == 'cms' | |
| 31 | - id = params[:id] || params[:parent_id] | |
| 32 | - links = page_trail(Article.find(id)) if id | |
| 33 | - links << { :name => cms_action(params[:action]), :url => params } if show_cms_action | |
| 34 | - elsif (params[:controller] == 'profile' || params[:controller] == 'events') | |
| 35 | - links << { :name => _('Profile'), :url => {:controller=> 'profile', :action =>'index', :profile =>params[:profile]}} | |
| 36 | - links << { :name => profile_action(params[:action]), :url => params } unless params[:action] == 'index' | |
| 37 | - end | |
| 38 | - links | |
| 39 | - end | |
| 40 | - | |
| 41 | - def trail(page, profile=nil, params={}) | |
| 42 | - links = page_trail(page, params) | |
| 43 | - if profile && !links.empty? && show_profile | |
| 44 | - [ {:name => profile.name, :url => profile.url} ] + links | |
| 45 | - else | |
| 46 | - links | |
| 47 | - end | |
| 48 | - end | |
| 49 | - | |
| 50 | - def content(args={}) | |
| 51 | - block = self | |
| 52 | - ret = (proc do | |
| 53 | - trail = block.trail(@page, @profile, params) | |
| 54 | - if !trail.empty? | |
| 55 | - separator = content_tag('span', ' > ', :class => 'separator') | |
| 56 | - | |
| 57 | - breadcrumb = trail.map do |t| | |
| 58 | - link_to(t[:name], t[:url], :class => 'item') | |
| 59 | - end.join(separator) | |
| 60 | - | |
| 61 | - if block.show_section_name | |
| 62 | - section_name = block.show_profile ? trail.second[:name] : trail.first[:name] | |
| 63 | - breadcrumb << content_tag('div', section_name, :class => 'section-name') | |
| 64 | - end | |
| 65 | - | |
| 66 | - breadcrumb.html_safe | |
| 67 | - else | |
| 68 | - '' | |
| 69 | - end | |
| 70 | - end) | |
| 71 | - ret | |
| 72 | - end | |
| 73 | - | |
| 74 | 25 | def cacheable? |
| 75 | 26 | false |
| 76 | 27 | end |
| 77 | 28 | |
| 78 | - protected | |
| 79 | - | |
| 80 | - CMS_ACTIONS = {:edit => c_('Edit'), :upload_files => _('Upload Files'), :new => c_('New')} | |
| 81 | - PROFILE_ACTIONS = {:members => _('Members'), :events => _('Events')} | |
| 82 | - | |
| 83 | - def cms_action(action) | |
| 84 | - CMS_ACTIONS[action.to_sym] || action | |
| 85 | - end | |
| 86 | - | |
| 87 | - def profile_action(action) | |
| 88 | - PROFILE_ACTIONS[action.to_sym] || action | |
| 89 | - end | |
| 90 | - | |
| 91 | 29 | end | ... | ... |
| ... | ... | @@ -0,0 +1,43 @@ |
| 1 | +module BreadcrumbsPluginHelper | |
| 2 | + | |
| 3 | + def action(action) | |
| 4 | + { :edit => c_('Edit'), | |
| 5 | + :upload_files => _('Upload Files'), | |
| 6 | + :new => c_('New'), | |
| 7 | + :members => _('Members'), | |
| 8 | + :events => _('Events') | |
| 9 | + }[action.to_sym] || action | |
| 10 | + end | |
| 11 | + | |
| 12 | + def page_trail(page) | |
| 13 | + links = [] | |
| 14 | + page.ancestors.reverse.each do |p| | |
| 15 | + links << { :name => p.title, :url => p.url } | |
| 16 | + end | |
| 17 | + links << { :name => page.title, :url => page.url } | |
| 18 | + links | |
| 19 | + end | |
| 20 | + | |
| 21 | + def trail(block, page, profile=nil, params={}) | |
| 22 | + links = [] | |
| 23 | + if page | |
| 24 | + links += page_trail(page) | |
| 25 | + elsif params[:controller] == 'cms' && (id = params[:id] || params[:parent_id]) | |
| 26 | + links += page_trail(Article.find(id)) | |
| 27 | + if block.show_cms_action | |
| 28 | + links << { :name => action(params[:action]), :url => params } | |
| 29 | + end | |
| 30 | + elsif (params[:controller] == 'profile' || params[:controller] == 'events') | |
| 31 | + _params = {:controller=> 'profile', :action =>'index', :profile => params[:profile]} | |
| 32 | + links << { :name => _('Profile'), :url => _params } | |
| 33 | + unless params[:action] == 'index' | |
| 34 | + links << { :name => action(params[:action]), :url => params } | |
| 35 | + end | |
| 36 | + end | |
| 37 | + if !links.empty? && profile && block.show_profile | |
| 38 | + links.unshift({:name => profile.name, :url => profile.url}) | |
| 39 | + end | |
| 40 | + links | |
| 41 | + end | |
| 42 | + | |
| 43 | +end | ... | ... |
plugins/breadcrumbs/test/unit/breadcrumbs_plugin_helper_test.rb
0 → 100644
| ... | ... | @@ -0,0 +1,66 @@ |
| 1 | +require 'test_helper' | |
| 2 | + | |
| 3 | +class BreadcrumbsPluginHelperTest < ActionView::TestCase | |
| 4 | + include BreadcrumbsPluginHelper | |
| 5 | + | |
| 6 | + def setup | |
| 7 | + @block = BreadcrumbsPlugin::ContentBreadcrumbsBlock.new | |
| 8 | + @profile = fast_create(Community) | |
| 9 | + @folder = fast_create(Folder, :profile_id => @profile.id) | |
| 10 | + @article = fast_create(Folder, :profile_id => @profile.id, :parent_id => @folder.id) | |
| 11 | + @params = {} | |
| 12 | + end | |
| 13 | + | |
| 14 | + attr_reader :params | |
| 15 | + | |
| 16 | + should 'return path of links to reach a page' do | |
| 17 | + links = [{:name => @folder.name, :url => @folder.url}, {:name => @article.name, :url => @article.url}] | |
| 18 | + assert_equal links, page_trail(@article) | |
| 19 | + end | |
| 20 | + | |
| 21 | + should 'return path of links when current page is at cms controller' do | |
| 22 | + params = {:controller => 'cms', :action => 'edit', :id => @article.id} | |
| 23 | + links = [{:name => @folder.name, :url => @folder.url}, {:name => @article.name, :url => @article.url}, {:url=>params, :name=>"Edit"}] | |
| 24 | + assert_equal links, trail(@block, nil, nil, params) | |
| 25 | + end | |
| 26 | + | |
| 27 | + should 'not return cms action link when show_cms_action is false' do | |
| 28 | + params = {:controller => 'cms', :action => 'edit', :id => @article.id} | |
| 29 | + links = [{:name => @folder.name, :url => @folder.url}, {:name => @article.name, :url => @article.url}] | |
| 30 | + @block.show_cms_action = false | |
| 31 | + assert_equal links, trail(@block, nil, nil, params) | |
| 32 | + end | |
| 33 | + | |
| 34 | + should 'include profile page link on path of links to reach a profile controller page' do | |
| 35 | + params = {:controller => 'profile', :action => 'members', :profile => @profile.identifier} | |
| 36 | + links = [{:name => 'Profile', :url => {:controller => 'profile', :action => 'index', :profile => @profile.identifier}}, {:name => 'Members', :url => {:controller=>'profile', :action=>'members', :profile=> @profile.identifier}}] | |
| 37 | + assert_equal links, trail(@block, nil, nil, params) | |
| 38 | + end | |
| 39 | + | |
| 40 | + should 'include only the profile page link on path links when profile action is index' do | |
| 41 | + params = {:controller => 'profile', :action => 'index', :profile => @profile.identifier} | |
| 42 | + links = [{:name => 'Profile', :url => {:controller => 'profile', :action => 'index', :profile => @profile.identifier}}] | |
| 43 | + assert_equal links, trail(@block, nil, nil, params) | |
| 44 | + end | |
| 45 | + | |
| 46 | + should 'profile page be the ancestor page of event profile page calendar' do | |
| 47 | + params = {:controller => 'profile', :action => 'events', :profile => @profile.identifier} | |
| 48 | + links = [{:name => 'Profile', :url => {:controller => 'profile', :action => 'index', :profile => @profile.identifier}}, {:name => 'Events', :url => {:controller=>'profile', :action=>'events', :profile=> @profile.identifier}}] | |
| 49 | + assert_equal links, trail(@block, nil, nil, params) | |
| 50 | + end | |
| 51 | + | |
| 52 | + should 'include profile link on path of links to reach a page' do | |
| 53 | + links = [{:name => @profile.name, :url => @profile.url}, {:name => @folder.name, :url => @folder.url}, {:name => @article.name, :url => @article.url}] | |
| 54 | + assert_equal links, trail(@block, @article, @profile) | |
| 55 | + end | |
| 56 | + | |
| 57 | + should 'not include profile link on path of links when show_profile is false' do | |
| 58 | + links = [{:name => @folder.name, :url => @folder.url}, {:name => @article.name, :url => @article.url}] | |
| 59 | + @block.show_profile = false | |
| 60 | + assert_equal links, trail(@block, @article, @profile) | |
| 61 | + end | |
| 62 | + | |
| 63 | + should 'not include profile link on path of links when trail is empty' do | |
| 64 | + assert_equal [], trail(@block, nil, @profile) | |
| 65 | + end | |
| 66 | +end | ... | ... |
plugins/breadcrumbs/test/unit/content_breadcrumbs_block_test.rb
| ... | ... | @@ -6,14 +6,8 @@ class ContentBreadcrumbsBlockTest < ActiveSupport::TestCase |
| 6 | 6 | |
| 7 | 7 | def setup |
| 8 | 8 | @block = BreadcrumbsPlugin::ContentBreadcrumbsBlock.new |
| 9 | - @profile = fast_create(Community) | |
| 10 | - @folder = fast_create(Folder, :profile_id => @profile.id) | |
| 11 | - @article = fast_create(Folder, :profile_id => @profile.id, :parent_id => @folder.id) | |
| 12 | - @params = {} | |
| 13 | 9 | end |
| 14 | 10 | |
| 15 | - attr_reader :params | |
| 16 | - | |
| 17 | 11 | should 'has a description' do |
| 18 | 12 | assert_not_equal Block.description, BreadcrumbsPlugin::ContentBreadcrumbsBlock.description |
| 19 | 13 | end |
| ... | ... | @@ -22,60 +16,28 @@ class ContentBreadcrumbsBlockTest < ActiveSupport::TestCase |
| 22 | 16 | assert @block.help |
| 23 | 17 | end |
| 24 | 18 | |
| 25 | - should 'return path of links to reach a page' do | |
| 26 | - links = [{:name => @folder.name, :url => @folder.url}, {:name => @article.name, :url => @article.url}] | |
| 27 | - assert_equal links, @block.page_trail(@article) | |
| 28 | - end | |
| 29 | - | |
| 30 | - should 'return path of links when current page is at cms controller' do | |
| 31 | - params = {:controller => 'cms', :action => 'edit', :id => @article.id} | |
| 32 | - links = [{:name => @folder.name, :url => @folder.url}, {:name => @article.name, :url => @article.url}, {:url=>{:controller=>"cms", :action=>"edit", :id=>@article.id}, :name=>"Edit"}] | |
| 33 | - assert_equal links, @block.page_trail(nil, params) | |
| 34 | - end | |
| 35 | - | |
| 36 | - should 'not return cms action link when show_cms_action is false' do | |
| 37 | - params = {:controller => 'cms', :action => 'edit', :id => @article.id} | |
| 38 | - links = [{:name => @folder.name, :url => @folder.url}, {:name => @article.name, :url => @article.url}] | |
| 39 | - @block.show_cms_action = false | |
| 40 | - assert_equal links, @block.page_trail(nil, params) | |
| 41 | - end | |
| 42 | - | |
| 43 | - should 'include profile page link on path of links to reach a profile controller page' do | |
| 44 | - params = {:controller => 'profile', :action => 'members', :profile => @profile.identifier} | |
| 45 | - links = [{:name => 'Profile', :url => {:controller => 'profile', :action => 'index', :profile => @profile.identifier}}, {:name => 'Members', :url => {:controller=>'profile', :action=>'members', :profile=> @profile.identifier}}] | |
| 46 | - assert_equal links, @block.page_trail(nil, params) | |
| 47 | - end | |
| 48 | 19 | |
| 49 | - should 'include only the profile page link on path links when profile action is index' do | |
| 50 | - params = {:controller => 'profile', :action => 'index', :profile => @profile.identifier} | |
| 51 | - links = [{:name => 'Profile', :url => {:controller => 'profile', :action => 'index', :profile => @profile.identifier}}] | |
| 52 | - assert_equal links, @block.page_trail(nil, params) | |
| 20 | + should 'not be cacheable' do | |
| 21 | + refute @block.cacheable? | |
| 53 | 22 | end |
| 54 | 23 | |
| 55 | - should 'profile page be the ancestor page of event profile page calendar' do | |
| 56 | - params = {:controller => 'profile', :action => 'events', :profile => @profile.identifier} | |
| 57 | - links = [{:name => 'Profile', :url => {:controller => 'profile', :action => 'index', :profile => @profile.identifier}}, {:name => 'Events', :url => {:controller=>'profile', :action=>'events', :profile=> @profile.identifier}}] | |
| 58 | - assert_equal links, @block.page_trail(nil, params) | |
| 59 | - end | |
| 24 | +end | |
| 60 | 25 | |
| 61 | - should 'include profile link on path of links to reach a page' do | |
| 62 | - links = [{:name => @profile.name, :url => @profile.url}, {:name => @folder.name, :url => @folder.url}, {:name => @article.name, :url => @article.url}] | |
| 63 | - assert_equal links, @block.trail(@article, @profile) | |
| 64 | - end | |
| 26 | +require 'boxes_helper' | |
| 65 | 27 | |
| 66 | - should 'not include profile link on path of links when show_profile is false' do | |
| 67 | - links = [{:name => @folder.name, :url => @folder.url}, {:name => @article.name, :url => @article.url}] | |
| 68 | - @block.show_profile = false | |
| 69 | - assert_equal links, @block.trail(@article, @profile) | |
| 70 | - end | |
| 28 | +class ContentBreadcrumbsBlockViewTest < ActionView::TestCase | |
| 29 | + include BoxesHelper | |
| 71 | 30 | |
| 72 | - should 'not include profile link on path of links when trail is empty' do | |
| 73 | - assert_equal [], @block.trail(nil, @profile) | |
| 31 | + def setup | |
| 32 | + @block = BreadcrumbsPlugin::ContentBreadcrumbsBlock.new | |
| 33 | + @profile = fast_create(Community) | |
| 34 | + @folder = fast_create(Folder, :profile_id => @profile.id) | |
| 35 | + @article = fast_create(Folder, :profile_id => @profile.id, :parent_id => @folder.id) | |
| 74 | 36 | end |
| 75 | 37 | |
| 76 | 38 | should 'render trail if there is links to show' do |
| 77 | 39 | @page = @article |
| 78 | - trail = instance_eval(&@block.content) | |
| 40 | + trail = render_block_content(@block) | |
| 79 | 41 | assert_match /#{@profile.name}/, trail |
| 80 | 42 | assert_match /#{@folder.name}/, trail |
| 81 | 43 | assert_match /#{@page.name}/, trail |
| ... | ... | @@ -83,11 +45,6 @@ class ContentBreadcrumbsBlockTest < ActiveSupport::TestCase |
| 83 | 45 | |
| 84 | 46 | should 'render nothing if there is no links to show' do |
| 85 | 47 | @page = nil |
| 86 | - assert_equal '', instance_eval(&@block.content) | |
| 87 | - end | |
| 88 | - | |
| 89 | - should 'not be cacheable' do | |
| 90 | - refute @block.cacheable? | |
| 48 | + assert_equal '', render_block_content(@block) | |
| 91 | 49 | end |
| 92 | - | |
| 93 | 50 | end | ... | ... |
| ... | ... | @@ -0,0 +1 @@ |
| 1 | +== link_to link[:name], link[:url], :class => 'item' | ... | ... |
plugins/breadcrumbs/views/blocks/content_breadcrumbs.slim
0 → 100644
| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | +- extend BreadcrumbsPluginHelper | |
| 2 | + | |
| 3 | +- links = trail(block, @page, @profile, params).flatten | |
| 4 | +- unless links.empty? | |
| 5 | + == render :partial => 'blocks/link', :collection => links, :as => 'link', :spacer_template => 'blocks/separator' | |
| 6 | + - if block.show_section_name | |
| 7 | + div class='section-name' | |
| 8 | + - if block.show_profile | |
| 9 | + = links.second[:name] | |
| 10 | + - else | |
| 11 | + = links.first[:name] | ... | ... |
plugins/display_content/lib/display_content_block.rb
| ... | ... | @@ -161,7 +161,7 @@ class DisplayContentBlock < Block |
| 161 | 161 | read_more_section = content_tag('div', link_to(_('Read more'), item.url), :class => 'read_more') |
| 162 | 162 | end |
| 163 | 163 | when 'body' |
| 164 | - content_sections += (block.display_section?(section) ? (content_tag('div', item.body ,:class => 'body')) : '' ) | |
| 164 | + content_sections += (block.display_section?(section) ? (content_tag('div', item.body.html_safe ,:class => 'body')) : '' ) | |
| 165 | 165 | when 'image' |
| 166 | 166 | image_section = image_tag item.image.public_filename if item.image |
| 167 | 167 | if !image_section.blank? | ... | ... |
plugins/event/lib/event_plugin/event_block.rb
| 1 | 1 | class EventPlugin::EventBlock < Block |
| 2 | - include DatesHelper | |
| 3 | - | |
| 4 | 2 | attr_accessible :all_env_events, :limit, :future_only, :date_distance_limit |
| 5 | 3 | |
| 6 | 4 | settings_items :all_env_events, :type => :boolean, :default => false |
| ... | ... | @@ -49,38 +47,6 @@ class EventPlugin::EventBlock < Block |
| 49 | 47 | event_list |
| 50 | 48 | end |
| 51 | 49 | |
| 52 | - def content(args={}) | |
| 53 | - block = self | |
| 54 | - proc do | |
| 55 | - render( | |
| 56 | - :file => 'blocks/event', | |
| 57 | - :locals => { :block => block } | |
| 58 | - ) | |
| 59 | - end | |
| 60 | - end | |
| 61 | - | |
| 62 | - def human_time_left(days_left) | |
| 63 | - months_left = (days_left/30.0).round | |
| 64 | - if days_left <= -60 | |
| 65 | - n_('One month ago', '%d months ago', -months_left) % -months_left | |
| 66 | - elsif days_left < 0 | |
| 67 | - n_('Yesterday', '%d days ago', -days_left) % -days_left | |
| 68 | - elsif days_left == 0 | |
| 69 | - _("Today") | |
| 70 | - elsif days_left < 60 | |
| 71 | - n_('Tomorrow', '%d days left to start', days_left) % days_left | |
| 72 | - else | |
| 73 | - n_('One month left to start', '%d months left to start', months_left) % months_left | |
| 74 | - end | |
| 75 | - end | |
| 76 | - | |
| 77 | - def date_to_html(date) | |
| 78 | - content_tag(:span, show_day_of_week(date, true), :class => 'week-day') + | |
| 79 | - content_tag(:span, month_name(date.month, true), :class => 'month') + | |
| 80 | - content_tag(:span, date.day.to_s, :class => 'day') + | |
| 81 | - content_tag(:span, date.year.to_s, :class => 'year') | |
| 82 | - end | |
| 83 | - | |
| 84 | 50 | def self.expire_on |
| 85 | 51 | { :profile => [:article], :environment => [:article] } |
| 86 | 52 | end | ... | ... |
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | +module EventPlugin::EventBlockHelper | |
| 2 | + include DatesHelper | |
| 3 | + | |
| 4 | + def date_to_html(date) | |
| 5 | + content_tag(:span, show_day_of_week(date, true), :class => 'week-day') + | |
| 6 | + content_tag(:span, month_name(date.month, true), :class => 'month') + | |
| 7 | + content_tag(:span, date.day.to_s, :class => 'day') + | |
| 8 | + content_tag(:span, date.year.to_s, :class => 'year') | |
| 9 | + end | |
| 10 | + | |
| 11 | + def human_time_left(days_left) | |
| 12 | + months_left = (days_left/30.0).round | |
| 13 | + if days_left <= -60 | |
| 14 | + n_('One month ago', '%d months ago', -months_left) % -months_left | |
| 15 | + elsif days_left < 0 | |
| 16 | + n_('Yesterday', '%d days ago', -days_left) % -days_left | |
| 17 | + elsif days_left == 0 | |
| 18 | + _("Today") | |
| 19 | + elsif days_left < 60 | |
| 20 | + n_('Tomorrow', '%d days left to start', days_left) % days_left | |
| 21 | + else | |
| 22 | + n_('One month left to start', '%d months left to start', months_left) % months_left | |
| 23 | + end | |
| 24 | + end | |
| 25 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,34 @@ |
| 1 | +require 'test_helper' | |
| 2 | + | |
| 3 | +class EventBlockHelperTest < ActionView::TestCase | |
| 4 | + include EventPlugin::EventBlockHelper | |
| 5 | + | |
| 6 | + should 'write formatable data in html' do | |
| 7 | + html = '<span class="week-day">Tue</span>'+ | |
| 8 | + '<span class="month">Sep</span>'+ | |
| 9 | + '<span class="day">27</span>'+ | |
| 10 | + '<span class="year">1983</span>' | |
| 11 | + | |
| 12 | + assert_equal html, date_to_html(Date.new 1983, 9, 27) | |
| 13 | + end | |
| 14 | + | |
| 15 | + should 'say human left time for an event' do | |
| 16 | + assert_match /Tomorrow/, human_time_left(1) | |
| 17 | + assert_match /5 days left/, human_time_left(5) | |
| 18 | + assert_match /30 days left/, human_time_left(30) | |
| 19 | + assert_match /2 months left/, human_time_left(60) | |
| 20 | + assert_match /3 months left/, human_time_left(85) | |
| 21 | + end | |
| 22 | + | |
| 23 | + should 'say human past time for an event' do | |
| 24 | + assert_match /Yesterday/, human_time_left(-1) | |
| 25 | + assert_match /5 days ago/, human_time_left(-5) | |
| 26 | + assert_match /30 days ago/, human_time_left(-30) | |
| 27 | + assert_match /2 months ago/, human_time_left(-60) | |
| 28 | + assert_match /3 months ago/, human_time_left(-85) | |
| 29 | + end | |
| 30 | + | |
| 31 | + should 'say human present time for an event' do | |
| 32 | + assert_match /Today/, human_time_left(0) | |
| 33 | + end | |
| 34 | +end | ... | ... |
plugins/event/test/unit/event_block_test.rb
| ... | ... | @@ -77,35 +77,6 @@ class EventBlockTest < ActiveSupport::TestCase |
| 77 | 77 | assert_equal 2, @block.events.length |
| 78 | 78 | end |
| 79 | 79 | |
| 80 | - should 'say human left time for an event' do | |
| 81 | - assert_match /Tomorrow/, @block.human_time_left(1) | |
| 82 | - assert_match /5 days left/, @block.human_time_left(5) | |
| 83 | - assert_match /30 days left/, @block.human_time_left(30) | |
| 84 | - assert_match /2 months left/, @block.human_time_left(60) | |
| 85 | - assert_match /3 months left/, @block.human_time_left(85) | |
| 86 | - end | |
| 87 | - | |
| 88 | - should 'say human past time for an event' do | |
| 89 | - assert_match /Yesterday/, @block.human_time_left(-1) | |
| 90 | - assert_match /5 days ago/, @block.human_time_left(-5) | |
| 91 | - assert_match /30 days ago/, @block.human_time_left(-30) | |
| 92 | - assert_match /2 months ago/, @block.human_time_left(-60) | |
| 93 | - assert_match /3 months ago/, @block.human_time_left(-85) | |
| 94 | - end | |
| 95 | - | |
| 96 | - should 'say human present time for an event' do | |
| 97 | - assert_match /Today/, @block.human_time_left(0) | |
| 98 | - end | |
| 99 | - | |
| 100 | - should 'write formatable data in html' do | |
| 101 | - html = '<span class="week-day">Tue</span>'+ | |
| 102 | - '<span class="month">Sep</span>'+ | |
| 103 | - '<span class="day">27</span>'+ | |
| 104 | - '<span class="year">1983</span>' | |
| 105 | - | |
| 106 | - assert_equal html, @block.date_to_html(Date.new 1983, 9, 27) | |
| 107 | - end | |
| 108 | - | |
| 109 | 80 | should 'show unlimited time distance events' do |
| 110 | 81 | @block.box.owner = @env |
| 111 | 82 | @block.all_env_events = true | ... | ... |
plugins/event/views/blocks/event.html.erb
| 1 | +<% extend EventPlugin::EventBlockHelper %> | |
| 2 | + | |
| 1 | 3 | <%= block_title(block.title, block.subtitle) %> |
| 2 | 4 | |
| 3 | 5 | <ul class="events"> |
| ... | ... | @@ -10,7 +12,7 @@ |
| 10 | 12 | :event => event, |
| 11 | 13 | :block => block, |
| 12 | 14 | :time_class => days_left < 0 ? 'past' : 'future', |
| 13 | - :time_left_str => block.human_time_left(days_left) | |
| 15 | + :time_left_str => human_time_left(days_left) | |
| 14 | 16 | } |
| 15 | 17 | ) |
| 16 | 18 | %> | ... | ... |
plugins/event/views/event_plugin/event_block_item.html.erb
| 1 | 1 | <% |
| 2 | + extend EventPlugin::EventBlockHelper | |
| 3 | + | |
| 2 | 4 | # compute layout values |
| 3 | 5 | ev_days_tag = '' |
| 4 | 6 | if event.duration > 1 |
| ... | ... | @@ -18,7 +20,7 @@ |
| 18 | 20 | <%= |
| 19 | 21 | link_to(safe_join([ |
| 20 | 22 | content_tag('time', |
| 21 | - block.date_to_html(event.start_date), | |
| 23 | + date_to_html(event.start_date), | |
| 22 | 24 | :itemprop => 'startDate', |
| 23 | 25 | :datetime => show_date(event.start_date), |
| 24 | 26 | :class => 'date ' + img_class, :style => bg, | ... | ... |
plugins/ldap/lib/ldap_plugin.rb
| ... | ... | @@ -53,7 +53,7 @@ class LdapPlugin < Noosfero::Plugin |
| 53 | 53 | return nil if attrs.nil? |
| 54 | 54 | |
| 55 | 55 | user_login = get_login(attrs, ldap.attr_login, login) |
| 56 | - user = User.find_or_initialize_by_login(user_login) | |
| 56 | + user = User.find_or_initialize_by(login: user_login) | |
| 57 | 57 | return nil if !user.new_record? && !user.activated? |
| 58 | 58 | |
| 59 | 59 | user.login = user_login | ... | ... |
plugins/profile_members_headlines/lib/profile_members_headlines_block.rb
| ... | ... | @@ -35,12 +35,4 @@ class ProfileMembersHeadlinesBlock < Block |
| 35 | 35 | result.select{ |p| p.has_headline? }.slice(0..limit-1) |
| 36 | 36 | end |
| 37 | 37 | |
| 38 | - def content(args={}) | |
| 39 | - block = self | |
| 40 | - members = authors_list | |
| 41 | - proc do | |
| 42 | - render :file => 'blocks/headlines', :locals => { :block => block, :members => members } | |
| 43 | - end | |
| 44 | - end | |
| 45 | - | |
| 46 | 38 | end | ... | ... |
plugins/profile_members_headlines/test/unit/profile_members_headlines_block_test.rb
| 1 | 1 | require 'test_helper' |
| 2 | +require 'boxes_helper' | |
| 2 | 3 | |
| 3 | 4 | class ProfileMembersHeadlinesBlockTest < ActiveSupport::TestCase |
| 4 | 5 | |
| 5 | 6 | include Noosfero::Plugin::HotSpot |
| 7 | + include BoxesHelper | |
| 6 | 8 | |
| 7 | 9 | def setup |
| 8 | 10 | @environment = fast_create(Environment) |
| ... | ... | @@ -32,8 +34,8 @@ class ProfileMembersHeadlinesBlockTest < ActiveSupport::TestCase |
| 32 | 34 | block = ProfileMembersHeadlinesBlock.create |
| 33 | 35 | block.stubs(:owner).returns(community) |
| 34 | 36 | |
| 35 | - self.expects(:render).with(:file => 'blocks/headlines', :locals => { :block => block, :members => []}).returns('file-without-authors-and-headlines') | |
| 36 | - assert_equal 'file-without-authors-and-headlines', instance_eval(&block.content) | |
| 37 | + self.expects(:render).with(:template => 'blocks/profile_members_headlines', :locals => { :block => block }).returns('file-without-authors-and-headlines') | |
| 38 | + assert_equal 'file-without-authors-and-headlines', render_block_content(block) | |
| 37 | 39 | end |
| 38 | 40 | |
| 39 | 41 | should 'display headlines file' do |
| ... | ... | @@ -41,8 +43,8 @@ class ProfileMembersHeadlinesBlockTest < ActiveSupport::TestCase |
| 41 | 43 | block.stubs(:owner).returns(community) |
| 42 | 44 | blog = fast_create(Blog, :profile_id => member1.id) |
| 43 | 45 | post = fast_create(TinyMceArticle, :name => 'headlines', :profile_id => member1.id, :parent_id => blog.id) |
| 44 | - self.expects(:render).with(:file => 'blocks/headlines', :locals => { :block => block, :members => []}).returns('file-with-authors-and-headlines') | |
| 45 | - assert_equal 'file-with-authors-and-headlines', instance_eval(&block.content) | |
| 46 | + self.expects(:render).with(:template => 'blocks/profile_members_headlines', :locals => { :block => block }).returns('file-with-authors-and-headlines') | |
| 47 | + assert_equal 'file-with-authors-and-headlines', render_block_content(block) | |
| 46 | 48 | end |
| 47 | 49 | |
| 48 | 50 | should 'select only authors with articles and selected roles to display' do | ... | ... |
plugins/profile_members_headlines/views/blocks/headlines.html.erb
| ... | ... | @@ -1,39 +0,0 @@ |
| 1 | -<%= block_title(block.title, block.subtitle) %> | |
| 2 | - | |
| 3 | -<% unless members.empty? %> | |
| 4 | - <div class='headlines-container'> | |
| 5 | - <% members.each do |member| %> | |
| 6 | - <div> | |
| 7 | - <% headline = member.headline %> | |
| 8 | - <%= link_to_profile(profile_image(member, :big) + content_tag(:p, member.short_name), member.identifier, {:class => 'author'}) %> | |
| 9 | - <div class='post'> | |
| 10 | - <h4><%= link_to(headline.title, headline.url, :class => 'title') %></h4> | |
| 11 | - <div class='lead'> | |
| 12 | - <%= headline.short_lead %> | |
| 13 | - </div> | |
| 14 | - <div class='date'> | |
| 15 | - <%= show_date(headline.published_at) %> | |
| 16 | - </div> | |
| 17 | - <div class='tags'> | |
| 18 | - <%= safe_join(headline.tags.map { |t| link_to(t, :controller => 'profile', :profile => member.identifier, :action => 'tags', :id => t.name ) }, "\n") %> | |
| 19 | - </div> | |
| 20 | - </div> | |
| 21 | - </div> | |
| 22 | - <% end %> | |
| 23 | - </div> | |
| 24 | - <% if block.navigation %> | |
| 25 | - <div class='headlines-block-pager'> | |
| 26 | - </div> | |
| 27 | - <% end %> | |
| 28 | - | |
| 29 | - <script> | |
| 30 | - (function($) { | |
| 31 | - var options = {fx: 'fade', pause: 1, fastOnEvent: 1, timeout: <%= block.interval * 1000 %>}; | |
| 32 | - options.pager = '#block-<%= block.id %> .headlines-block-pager'; | |
| 33 | - $('#block-<%= block.id %> .headlines-container').cycle(options); | |
| 34 | - })(jQuery); | |
| 35 | - </script> | |
| 36 | -<% else %> | |
| 37 | - <em><%= _('No headlines to be shown.') %></em> | |
| 38 | -<% end %> | |
| 39 | - |
plugins/profile_members_headlines/views/blocks/profile_members_headlines.html.erb
0 → 100644
| ... | ... | @@ -0,0 +1,40 @@ |
| 1 | +<%= block_title(block.title, block.subtitle) %> | |
| 2 | +<% members = block.authors_list %> | |
| 3 | + | |
| 4 | +<% unless members.empty? %> | |
| 5 | + <div class='headlines-container'> | |
| 6 | + <% members.each do |member| %> | |
| 7 | + <div> | |
| 8 | + <% headline = member.headline %> | |
| 9 | + <%= link_to_profile(profile_image(member, :big) + content_tag(:p, member.short_name), member.identifier, {:class => 'author'}) %> | |
| 10 | + <div class='post'> | |
| 11 | + <h4><%= link_to(headline.title, headline.url, :class => 'title') %></h4> | |
| 12 | + <div class='lead'> | |
| 13 | + <%= headline.short_lead %> | |
| 14 | + </div> | |
| 15 | + <div class='date'> | |
| 16 | + <%= show_date(headline.published_at) %> | |
| 17 | + </div> | |
| 18 | + <div class='tags'> | |
| 19 | + <%= safe_join(headline.tags.map { |t| link_to(t, :controller => 'profile', :profile => member.identifier, :action => 'tags', :id => t.name ) }, "\n") %> | |
| 20 | + </div> | |
| 21 | + </div> | |
| 22 | + </div> | |
| 23 | + <% end %> | |
| 24 | + </div> | |
| 25 | + <% if block.navigation %> | |
| 26 | + <div class='headlines-block-pager'> | |
| 27 | + </div> | |
| 28 | + <% end %> | |
| 29 | + | |
| 30 | + <script> | |
| 31 | + (function($) { | |
| 32 | + var options = {fx: 'fade', pause: 1, fastOnEvent: 1, timeout: <%= block.interval * 1000 %>}; | |
| 33 | + options.pager = '#block-<%= block.id %> .headlines-block-pager'; | |
| 34 | + $('#block-<%= block.id %> .headlines-container').cycle(options); | |
| 35 | + })(jQuery); | |
| 36 | + </script> | |
| 37 | +<% else %> | |
| 38 | + <em><%= _('No headlines to be shown.') %></em> | |
| 39 | +<% end %> | |
| 40 | + | ... | ... |
plugins/recent_content/lib/recent_content_block.rb
| ... | ... | @@ -33,7 +33,7 @@ class RecentContentBlock < Block |
| 33 | 33 | end |
| 34 | 34 | |
| 35 | 35 | def parents |
| 36 | - self.holder.articles.where(type: 'Blog') | |
| 36 | + self.holder.nil? ? [] : self.holder.articles.where(type: 'Blog') | |
| 37 | 37 | end |
| 38 | 38 | |
| 39 | 39 | def root |
| ... | ... | @@ -48,4 +48,12 @@ class RecentContentBlock < Block |
| 48 | 48 | attr == self.presentation_mode |
| 49 | 49 | end |
| 50 | 50 | |
| 51 | + def api_content | |
| 52 | + children = self.articles_of_folder(self.root, self.total_items) | |
| 53 | + Noosfero::API::Entities::ArticleBase.represent(children).as_json | |
| 54 | + end | |
| 55 | + | |
| 56 | + def display_api_content_by_default? | |
| 57 | + false | |
| 58 | + end | |
| 51 | 59 | end | ... | ... |
plugins/recent_content/test/unit/recent_content_block_test.rb
| ... | ... | @@ -100,7 +100,7 @@ class RecentContentBlockViewTest < ActionView::TestCase |
| 100 | 100 | block.presentation_mode = 'title_only' |
| 101 | 101 | |
| 102 | 102 | ActionView::Base.any_instance.expects(:block_title).returns("Block Title") |
| 103 | - ActionView::Base.any_instance.expects(:profile).returns(profile) | |
| 103 | + ActionView::Base.any_instance.stubs(:profile).returns(profile) | |
| 104 | 104 | |
| 105 | 105 | content = render_block_content(block) |
| 106 | 106 | |
| ... | ... | @@ -118,7 +118,7 @@ class RecentContentBlockViewTest < ActionView::TestCase |
| 118 | 118 | block.presentation_mode = 'title_and_abstract' |
| 119 | 119 | |
| 120 | 120 | ActionView::Base.any_instance.expects(:block_title).returns("Block Title") |
| 121 | - ActionView::Base.any_instance.expects(:profile).returns(profile) | |
| 121 | + ActionView::Base.any_instance.stubs(:profile).returns(profile) | |
| 122 | 122 | |
| 123 | 123 | content = render_block_content(block) |
| 124 | 124 | |
| ... | ... | @@ -136,10 +136,35 @@ class RecentContentBlockViewTest < ActionView::TestCase |
| 136 | 136 | block.presentation_mode = '' |
| 137 | 137 | |
| 138 | 138 | ActionView::Base.any_instance.expects(:block_title).returns("Block Title") |
| 139 | - ActionView::Base.any_instance.expects(:profile).returns(profile) | |
| 139 | + ActionView::Base.any_instance.stubs(:profile).returns(profile) | |
| 140 | 140 | |
| 141 | 141 | content = render_block_content(block) |
| 142 | 142 | |
| 143 | 143 | assert_match /Block Title/, content |
| 144 | 144 | end |
| 145 | + | |
| 146 | + should 'return articles in api_content' do | |
| 147 | + profile = create_user('testuser').person | |
| 148 | + | |
| 149 | + root = fast_create(Blog, name: 'test-blog', profile_id: profile.id) | |
| 150 | + article = fast_create(TextArticle, parent_id: root.id, profile_id: profile.id) | |
| 151 | + | |
| 152 | + block = RecentContentBlock.new | |
| 153 | + block.stubs(:holder).returns(profile) | |
| 154 | + block.selected_folder = root.id | |
| 155 | + block.presentation_mode = '' | |
| 156 | + assert_equal [article.id], block.api_content['articles'].map {|a| a[:id]} | |
| 157 | + end | |
| 158 | + | |
| 159 | + should 'parents return an empty array for environment without portal community' do | |
| 160 | + environment = fast_create(Environment) | |
| 161 | + block = RecentContentBlock.new | |
| 162 | + box = mock() | |
| 163 | + block.stubs(:box).returns(box) | |
| 164 | + box.stubs(:owner).returns(environment) | |
| 165 | + | |
| 166 | + assert_nil environment.portal_community | |
| 167 | + assert_equal [], block.parents | |
| 168 | + end | |
| 169 | + | |
| 145 | 170 | end | ... | ... |
plugins/recent_content/views/blocks/recent_content.html.erb
| ... | ... | @@ -36,7 +36,9 @@ |
| 36 | 36 | <% end %> |
| 37 | 37 | </div> |
| 38 | 38 | <% end %> |
| 39 | - <%= link_to _('View All'), :profile => profile.identifier, :controller => 'content_viewer', :action => 'view_page', :page => block.root.path %> | |
| 39 | + <% if profile %> | |
| 40 | + <%= link_to _('View All'), :profile => profile.identifier, :controller => 'content_viewer', :action => 'view_page', :page => block.root.path %> | |
| 41 | + <% end %> | |
| 40 | 42 | </div> |
| 41 | 43 | <% else %> |
| 42 | 44 | <span class="alert-block"> | ... | ... |
plugins/site_tour/lib/site_tour_plugin/tour_block.rb
plugins/site_tour/test/unit/tour_block_test.rb
| ... | ... | @@ -3,6 +3,7 @@ require 'test_helper' |
| 3 | 3 | class TrackListBlockTest < ActionView::TestCase |
| 4 | 4 | |
| 5 | 5 | ActionView::Base.send :include, ApplicationHelper |
| 6 | + include BoxesHelper | |
| 6 | 7 | |
| 7 | 8 | def setup |
| 8 | 9 | @block = fast_create(SiteTourPlugin::TourBlock) |
| ... | ... | @@ -18,24 +19,24 @@ class TrackListBlockTest < ActionView::TestCase |
| 18 | 19 | |
| 19 | 20 | should 'render script tag in visualization mode' do |
| 20 | 21 | controller.expects(:boxes_editor?).returns(false) |
| 21 | - assert_tag_in_string instance_eval(&block.content), :tag => 'script' | |
| 22 | + assert_tag_in_string render_block_content(block), :tag => 'script' | |
| 22 | 23 | end |
| 23 | 24 | |
| 24 | 25 | should 'do not render script tag when editing' do |
| 25 | 26 | controller.expects(:boxes_editor?).returns(true) |
| 26 | 27 | controller.expects(:uses_design_blocks?).returns(true) |
| 27 | - assert_no_tag_in_string instance_eval(&block.content), :tag => 'script' | |
| 28 | + assert_no_tag_in_string render_block_content(block), :tag => 'script' | |
| 28 | 29 | end |
| 29 | 30 | |
| 30 | 31 | should 'display help button' do |
| 31 | 32 | controller.expects(:boxes_editor?).returns(false) |
| 32 | - assert_tag_in_string instance_eval(&block.content), :tag => 'a', :attributes => {:class => 'button icon-help with-text tour-button'} | |
| 33 | + assert_tag_in_string render_block_content(block), :tag => 'a', :attributes => {:class => 'button icon-help with-text tour-button'} | |
| 33 | 34 | end |
| 34 | 35 | |
| 35 | 36 | should 'do not display help button when display_button is false' do |
| 36 | 37 | block.display_button = false |
| 37 | 38 | controller.expects(:boxes_editor?).returns(false) |
| 38 | - assert_no_tag_in_string instance_eval(&block.content), :tag => 'a', :attributes => {:class => 'button icon-help with-text tour-button'} | |
| 39 | + assert_no_tag_in_string render_block_content(block), :tag => 'a', :attributes => {:class => 'button icon-help with-text tour-button'} | |
| 39 | 40 | end |
| 40 | 41 | |
| 41 | 42 | end | ... | ... |
plugins/sniffer/lib/sniffer_plugin/interests_block.rb
| ... | ... | @@ -16,22 +16,20 @@ class SnifferPlugin::InterestsBlock < Block |
| 16 | 16 | _("This block show interests of your profile or environment") |
| 17 | 17 | end |
| 18 | 18 | |
| 19 | - def content(args = {}) | |
| 20 | - block = self | |
| 19 | + def interests | |
| 20 | + results = nil | |
| 21 | 21 | profile = block.owner |
| 22 | - proc do | |
| 23 | - if block.owner.is_a?(Profile) | |
| 24 | - interests = profile.snnifer_opportunities | |
| 25 | - interests |= profile.inputs if sniffer.profile.enterprise? | |
| 26 | - else # Environment | |
| 27 | - interests = SnifferPlugin::Opportunity.product_categories.limit(5).order('created_at DESC').all | |
| 28 | - interests += Input.limit(5).order('created_at DESC').all | |
| 29 | - interests.sort{ |a, b| -1 * a.created_at.to_i <=> b.created_at.to_i } | |
| 30 | - end | |
| 31 | - | |
| 32 | - render :file => 'blocks/sniffer_plugin/interests_block', | |
| 33 | - :locals => {:block => block, :interests => interests} | |
| 22 | + | |
| 23 | + if profile.is_a?(Profile) | |
| 24 | + results = profile.snnifer_opportunities | |
| 25 | + results |= profile.inputs if sniffer.profile.enterprise? | |
| 26 | + else # Environment | |
| 27 | + results = SnifferPlugin::Opportunity.product_categories.limit(5).order('created_at DESC').all | |
| 28 | + results += Input.limit(5).order('created_at DESC').all | |
| 29 | + results.sort{ |a, b| -1 * a.created_at.to_i <=> b.created_at.to_i } | |
| 34 | 30 | end |
| 31 | + | |
| 32 | + return results | |
| 35 | 33 | end |
| 36 | 34 | |
| 37 | 35 | end | ... | ... |
| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | +<%= block_title block.title, block.subtitle %> | |
| 2 | + | |
| 3 | +<% if block.owner.is_a?(Profile) %> | |
| 4 | + <ul> | |
| 5 | + <% block.interests.each do |interest| %> | |
| 6 | + <li><%= interest.product_category.name %></li> | |
| 7 | + <% end %> | |
| 8 | + </ul> | |
| 9 | + | |
| 10 | + <div> | |
| 11 | + <% if logged_in? and (current_user.person.is_admin?(environment) or profile.admins.include?(current_user.person)) %> | |
| 12 | + <%= _('Edit %{inputs} and %{block.interests}') % { | |
| 13 | + :inputs => link_to(_("products' inputs"), :controller => :manage_products, :action => :index), | |
| 14 | + :interests => link_to(_('declared interests'), :controller => :sniffer_plugin_myprofile, :action => :edit), | |
| 15 | + } %> | |
| 16 | + <% end %> | |
| 17 | + </div> | |
| 18 | +<% else %> | |
| 19 | + <ul> | |
| 20 | + <% block.interests.each do |interest| %> | |
| 21 | + <li> | |
| 22 | + <% profile = interest.is_a?(SnifferPlugin::Opportunity) ? interest.profile : interest.product.enterprise %> | |
| 23 | + <%= _('%{interest} from %{profile}') % { | |
| 24 | + :interest => interest.product_category.name, | |
| 25 | + :profile => link_to_profile(profile.name, profile), | |
| 26 | + } %> | |
| 27 | + </li> | |
| 28 | + <% end %> | |
| 29 | + </ul> | |
| 30 | +<% end %> | |
| 31 | + | ... | ... |
plugins/sniffer/views/blocks/sniffer_plugin/interests_block.html.erb
| ... | ... | @@ -1,31 +0,0 @@ |
| 1 | -<%= block_title block.title, block.subtitle %> | |
| 2 | - | |
| 3 | -<% if block.owner.is_a?(Profile) %> | |
| 4 | - <ul> | |
| 5 | - <% interests.each do |interest| %> | |
| 6 | - <li><%= interest.product_category.name %></li> | |
| 7 | - <% end %> | |
| 8 | - </ul> | |
| 9 | - | |
| 10 | - <div> | |
| 11 | - <% if logged_in? and (current_user.person.is_admin?(environment) or profile.admins.include?(current_user.person)) %> | |
| 12 | - <%= _('Edit %{inputs} and %{interests}') % { | |
| 13 | - :inputs => link_to(_("products' inputs"), :controller => :manage_products, :action => :index), | |
| 14 | - :interests => link_to(_('declared interests'), :controller => :sniffer_plugin_myprofile, :action => :edit), | |
| 15 | - } %> | |
| 16 | - <% end %> | |
| 17 | - </div> | |
| 18 | -<% else %> | |
| 19 | - <ul> | |
| 20 | - <% interests.each do |interest| %> | |
| 21 | - <li> | |
| 22 | - <% profile = interest.is_a?(SnifferPlugin::Opportunity) ? interest.profile : interest.product.enterprise %> | |
| 23 | - <%= _('%{interest} from %{profile}') % { | |
| 24 | - :interest => interest.product_category.name, | |
| 25 | - :profile => link_to_profile(profile.name, profile), | |
| 26 | - } %> | |
| 27 | - </li> | |
| 28 | - <% end %> | |
| 29 | - </ul> | |
| 30 | -<% end %> | |
| 31 | - |
plugins/statistics/test/unit/statistics_block_test.rb
| 1 | 1 | require_relative '../test_helper' |
| 2 | + | |
| 2 | 3 | class StatisticsBlockTest < ActiveSupport::TestCase |
| 3 | 4 | |
| 4 | 5 | ['user_counter', 'tag_counter', 'comment_counter'].map do |counter| |
| ... | ... | @@ -140,6 +141,8 @@ class StatisticsBlockTest < ActiveSupport::TestCase |
| 140 | 141 | end |
| 141 | 142 | |
| 142 | 143 | should 'return the amount of visible environment products' do |
| 144 | + return unless defined? ProductsPlugin | |
| 145 | + | |
| 143 | 146 | b = StatisticsBlock.new |
| 144 | 147 | e = fast_create(Environment) |
| 145 | 148 | |
| ... | ... | @@ -160,6 +163,8 @@ class StatisticsBlockTest < ActiveSupport::TestCase |
| 160 | 163 | end |
| 161 | 164 | |
| 162 | 165 | should 'return the amount of visible enterprise products' do |
| 166 | + return unless defined? ProductsPlugin | |
| 167 | + | |
| 163 | 168 | b = StatisticsBlock.new |
| 164 | 169 | |
| 165 | 170 | e = fast_create(Enterprise) | ... | ... |
public/designs/themes/cube-responsive/bootstrap/_variables.scss
| ... | ... | @@ -1,864 +0,0 @@ |
| 1 | -// When true, asset path helpers are used, otherwise the regular CSS `url()` is used. | |
| 2 | -// When there no function is defined, `fn('')` is parsed as string that equals the right hand side | |
| 3 | -// NB: in Sass 3.3 there is a native function: function-exists(twbs-font-path) | |
| 4 | -$bootstrap-sass-asset-helper: (twbs-font-path("") != unquote('twbs-font-path("")')) !default; | |
| 5 | - | |
| 6 | -// | |
| 7 | -// Variables | |
| 8 | -// -------------------------------------------------- | |
| 9 | - | |
| 10 | - | |
| 11 | -//== Colors | |
| 12 | -// | |
| 13 | -//## Gray and brand colors for use across Bootstrap. | |
| 14 | - | |
| 15 | -$gray-base: #000 !default; | |
| 16 | -$gray-darker: lighten($gray-base, 13.5%) !default; // #222 | |
| 17 | -$gray-dark: lighten($gray-base, 20%) !default; // #333 | |
| 18 | -$gray: lighten($gray-base, 33.5%) !default; // #555 | |
| 19 | -$gray-light: lighten($gray-base, 46.7%) !default; // #777 | |
| 20 | -$gray-lighter: lighten($gray-base, 93.5%) !default; // #eee | |
| 21 | - | |
| 22 | -$brand-primary: darken(#428bca, 6.5%) !default; | |
| 23 | -$brand-success: #5cb85c !default; | |
| 24 | -$brand-info: #5bc0de !default; | |
| 25 | -$brand-warning: #f0ad4e !default; | |
| 26 | -$brand-danger: #d9534f !default; | |
| 27 | - | |
| 28 | - | |
| 29 | -//== Scaffolding | |
| 30 | -// | |
| 31 | -//## Settings for some of the most global styles. | |
| 32 | - | |
| 33 | -//** Background color for `<body>`. | |
| 34 | -$body-bg: #fff !default; | |
| 35 | -//** Global text color on `<body>`. | |
| 36 | -$text-color: $gray-dark !default; | |
| 37 | - | |
| 38 | -//** Global textual link color. | |
| 39 | -$link-color: $brand-primary !default; | |
| 40 | -//** Link hover color set via `darken()` function. | |
| 41 | -$link-hover-color: darken($link-color, 15%) !default; | |
| 42 | -//** Link hover decoration. | |
| 43 | -$link-hover-decoration: underline !default; | |
| 44 | - | |
| 45 | - | |
| 46 | -//== Typography | |
| 47 | -// | |
| 48 | -//## Font, line-height, and color for body text, headings, and more. | |
| 49 | - | |
| 50 | -$font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif !default; | |
| 51 | -$font-family-serif: Georgia, "Times New Roman", Times, serif !default; | |
| 52 | -//** Default monospace fonts for `<code>`, `<kbd>`, and `<pre>`. | |
| 53 | -$font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace !default; | |
| 54 | -$font-family-base: $font-family-sans-serif !default; | |
| 55 | - | |
| 56 | -$font-size-base: 14px !default; | |
| 57 | -$font-size-large: ceil(($font-size-base * 1.25)) !default; // ~18px | |
| 58 | -$font-size-small: ceil(($font-size-base * 0.85)) !default; // ~12px | |
| 59 | - | |
| 60 | -$font-size-h1: floor(($font-size-base * 2.6)) !default; // ~36px | |
| 61 | -$font-size-h2: floor(($font-size-base * 2.15)) !default; // ~30px | |
| 62 | -$font-size-h3: ceil(($font-size-base * 1.7)) !default; // ~24px | |
| 63 | -$font-size-h4: ceil(($font-size-base * 1.25)) !default; // ~18px | |
| 64 | -$font-size-h5: $font-size-base !default; | |
| 65 | -$font-size-h6: ceil(($font-size-base * 0.85)) !default; // ~12px | |
| 66 | - | |
| 67 | -//** Unit-less `line-height` for use in components like buttons. | |
| 68 | -$line-height-base: 1.428571429 !default; // 20/14 | |
| 69 | -//** Computed "line-height" (`font-size` * `line-height`) for use with `margin`, `padding`, etc. | |
| 70 | -$line-height-computed: floor(($font-size-base * $line-height-base)) !default; // ~20px | |
| 71 | - | |
| 72 | -//** By default, this inherits from the `<body>`. | |
| 73 | -$headings-font-family: inherit !default; | |
| 74 | -$headings-font-weight: 500 !default; | |
| 75 | -$headings-line-height: 1.1 !default; | |
| 76 | -$headings-color: inherit !default; | |
| 77 | - | |
| 78 | - | |
| 79 | -//== Iconography | |
| 80 | -// | |
| 81 | -//## Specify custom location and filename of the included Glyphicons icon font. Useful for those including Bootstrap via Bower. | |
| 82 | - | |
| 83 | -//** Load fonts from this directory. | |
| 84 | - | |
| 85 | -// [converter] Asset helpers such as Sprockets and Node.js Mincer do not resolve relative paths | |
| 86 | -$icon-font-path: if($bootstrap-sass-asset-helper, "bootstrap/", "../fonts/bootstrap/") !default; | |
| 87 | - | |
| 88 | -//** File name for all font files. | |
| 89 | -$icon-font-name: "glyphicons-halflings-regular" !default; | |
| 90 | -//** Element ID within SVG icon file. | |
| 91 | -$icon-font-svg-id: "glyphicons_halflingsregular" !default; | |
| 92 | - | |
| 93 | - | |
| 94 | -//== Components | |
| 95 | -// | |
| 96 | -//## Define common padding and border radius sizes and more. Values based on 14px text and 1.428 line-height (~20px to start). | |
| 97 | - | |
| 98 | -$padding-base-vertical: 6px !default; | |
| 99 | -$padding-base-horizontal: 12px !default; | |
| 100 | - | |
| 101 | -$padding-large-vertical: 10px !default; | |
| 102 | -$padding-large-horizontal: 16px !default; | |
| 103 | - | |
| 104 | -$padding-small-vertical: 5px !default; | |
| 105 | -$padding-small-horizontal: 10px !default; | |
| 106 | - | |
| 107 | -$padding-xs-vertical: 1px !default; | |
| 108 | -$padding-xs-horizontal: 5px !default; | |
| 109 | - | |
| 110 | -$line-height-large: 1.33 !default; | |
| 111 | -$line-height-small: 1.5 !default; | |
| 112 | - | |
| 113 | -$border-radius-base: 4px !default; | |
| 114 | -$border-radius-large: 6px !default; | |
| 115 | -$border-radius-small: 3px !default; | |
| 116 | - | |
| 117 | -//** Global color for active items (e.g., navs or dropdowns). | |
| 118 | -$component-active-color: #fff !default; | |
| 119 | -//** Global background color for active items (e.g., navs or dropdowns). | |
| 120 | -$component-active-bg: $brand-primary !default; | |
| 121 | - | |
| 122 | -//** Width of the `border` for generating carets that indicator dropdowns. | |
| 123 | -$caret-width-base: 4px !default; | |
| 124 | -//** Carets increase slightly in size for larger components. | |
| 125 | -$caret-width-large: 5px !default; | |
| 126 | - | |
| 127 | - | |
| 128 | -//== Tables | |
| 129 | -// | |
| 130 | -//## Customizes the `.table` component with basic values, each used across all table variations. | |
| 131 | - | |
| 132 | -//** Padding for `<th>`s and `<td>`s. | |
| 133 | -$table-cell-padding: 8px !default; | |
| 134 | -//** Padding for cells in `.table-condensed`. | |
| 135 | -$table-condensed-cell-padding: 5px !default; | |
| 136 | - | |
| 137 | -//** Default background color used for all tables. | |
| 138 | -$table-bg: transparent !default; | |
| 139 | -//** Background color used for `.table-striped`. | |
| 140 | -$table-bg-accent: #f9f9f9 !default; | |
| 141 | -//** Background color used for `.table-hover`. | |
| 142 | -$table-bg-hover: #f5f5f5 !default; | |
| 143 | -$table-bg-active: $table-bg-hover !default; | |
| 144 | - | |
| 145 | -//** Border color for table and cell borders. | |
| 146 | -$table-border-color: #ddd !default; | |
| 147 | - | |
| 148 | - | |
| 149 | -//== Buttons | |
| 150 | -// | |
| 151 | -//## For each of Bootstrap's buttons, define text, background and border color. | |
| 152 | - | |
| 153 | -$btn-font-weight: normal; | |
| 154 | - | |
| 155 | -$btn-default-color: #fff; | |
| 156 | -$btn-default-bg: $gray-light; | |
| 157 | -$btn-default-border: $btn-default-bg; | |
| 158 | - | |
| 159 | -$btn-primary-color: $btn-default-color; | |
| 160 | -$btn-primary-bg: $brand-primary; | |
| 161 | -$btn-primary-border: $btn-primary-bg; | |
| 162 | - | |
| 163 | -$btn-success-color: $btn-default-color; | |
| 164 | -$btn-success-bg: $brand-success; | |
| 165 | -$btn-success-border: $btn-success-bg; | |
| 166 | - | |
| 167 | -$btn-info-color: $btn-default-color; | |
| 168 | -$btn-info-bg: $brand-info; | |
| 169 | -$btn-info-border: $btn-info-bg; | |
| 170 | - | |
| 171 | -$btn-warning-color: $btn-default-color; | |
| 172 | -$btn-warning-bg: $brand-warning; | |
| 173 | -$btn-warning-border: $btn-warning-bg; | |
| 174 | - | |
| 175 | -$btn-danger-color: $btn-default-color; | |
| 176 | -$btn-danger-bg: $brand-danger; | |
| 177 | -$btn-danger-border: $btn-danger-bg; | |
| 178 | - | |
| 179 | -$btn-link-disabled-color: $gray-light; | |
| 180 | - | |
| 181 | - | |
| 182 | -//== Forms | |
| 183 | -// | |
| 184 | -//## | |
| 185 | - | |
| 186 | -//** `<input>` background color | |
| 187 | -$input-bg: #fff !default; | |
| 188 | -//** `<input disabled>` background color | |
| 189 | -$input-bg-disabled: $gray-lighter !default; | |
| 190 | - | |
| 191 | -//** Text color for `<input>`s | |
| 192 | -$input-color: $gray !default; | |
| 193 | -//** `<input>` border color | |
| 194 | -$input-border: #ccc !default; | |
| 195 | - | |
| 196 | -// TODO: Rename `$input-border-radius` to `$input-border-radius-base` in v4 | |
| 197 | -//** Default `.form-control` border radius | |
| 198 | -$input-border-radius: $border-radius-base !default; | |
| 199 | -//** Large `.form-control` border radius | |
| 200 | -$input-border-radius-large: $border-radius-large !default; | |
| 201 | -//** Small `.form-control` border radius | |
| 202 | -$input-border-radius-small: $border-radius-small !default; | |
| 203 | - | |
| 204 | -//** Border color for inputs on focus | |
| 205 | -$input-border-focus: #66afe9 !default; | |
| 206 | - | |
| 207 | -//** Placeholder text color | |
| 208 | -$input-color-placeholder: #999 !default; | |
| 209 | - | |
| 210 | -//** Default `.form-control` height | |
| 211 | -$input-height-base: ($line-height-computed + ($padding-base-vertical * 2) + 2) !default; | |
| 212 | -//** Large `.form-control` height | |
| 213 | -$input-height-large: (ceil($font-size-large * $line-height-large) + ($padding-large-vertical * 2) + 2) !default; | |
| 214 | -//** Small `.form-control` height | |
| 215 | -$input-height-small: (floor($font-size-small * $line-height-small) + ($padding-small-vertical * 2) + 2) !default; | |
| 216 | - | |
| 217 | -$legend-color: $gray-dark !default; | |
| 218 | -$legend-border-color: #e5e5e5 !default; | |
| 219 | - | |
| 220 | -//** Background color for textual input addons | |
| 221 | -$input-group-addon-bg: $gray-lighter !default; | |
| 222 | -//** Border color for textual input addons | |
| 223 | -$input-group-addon-border-color: $input-border !default; | |
| 224 | - | |
| 225 | -//** Disabled cursor for form controls and buttons. | |
| 226 | -$cursor-disabled: not-allowed !default; | |
| 227 | - | |
| 228 | - | |
| 229 | -//== Dropdowns | |
| 230 | -// | |
| 231 | -//## Dropdown menu container and contents. | |
| 232 | - | |
| 233 | -//** Background for the dropdown menu. | |
| 234 | -$dropdown-bg: #fff !default; | |
| 235 | -//** Dropdown menu `border-color`. | |
| 236 | -$dropdown-border: rgba(0,0,0,.15) !default; | |
| 237 | -//** Dropdown menu `border-color` **for IE8**. | |
| 238 | -$dropdown-fallback-border: #ccc !default; | |
| 239 | -//** Divider color for between dropdown items. | |
| 240 | -$dropdown-divider-bg: #e5e5e5 !default; | |
| 241 | - | |
| 242 | -//** Dropdown link text color. | |
| 243 | -$dropdown-link-color: $gray-dark !default; | |
| 244 | -//** Hover color for dropdown links. | |
| 245 | -$dropdown-link-hover-color: darken($gray-dark, 5%) !default; | |
| 246 | -//** Hover background for dropdown links. | |
| 247 | -$dropdown-link-hover-bg: #f5f5f5 !default; | |
| 248 | - | |
| 249 | -//** Active dropdown menu item text color. | |
| 250 | -$dropdown-link-active-color: $component-active-color !default; | |
| 251 | -//** Active dropdown menu item background color. | |
| 252 | -$dropdown-link-active-bg: $component-active-bg !default; | |
| 253 | - | |
| 254 | -//** Disabled dropdown menu item background color. | |
| 255 | -$dropdown-link-disabled-color: $gray-light !default; | |
| 256 | - | |
| 257 | -//** Text color for headers within dropdown menus. | |
| 258 | -$dropdown-header-color: $gray-light !default; | |
| 259 | - | |
| 260 | -//** Deprecated `$dropdown-caret-color` as of v3.1.0 | |
| 261 | -$dropdown-caret-color: #000 !default; | |
| 262 | - | |
| 263 | - | |
| 264 | -//-- Z-index master list | |
| 265 | -// | |
| 266 | -// Warning: Avoid customizing these values. They're used for a bird's eye view | |
| 267 | -// of components dependent on the z-axis and are designed to all work together. | |
| 268 | -// | |
| 269 | -// Note: These variables are not generated into the Customizer. | |
| 270 | - | |
| 271 | -$zindex-navbar: 1000 !default; | |
| 272 | -$zindex-dropdown: 1000 !default; | |
| 273 | -$zindex-popover: 1060 !default; | |
| 274 | -$zindex-tooltip: 1070 !default; | |
| 275 | -$zindex-navbar-fixed: 1030 !default; | |
| 276 | -$zindex-modal: 1040 !default; | |
| 277 | - | |
| 278 | - | |
| 279 | -//== Media queries breakpoints | |
| 280 | -// | |
| 281 | -//## Define the breakpoints at which your layout will change, adapting to different screen sizes. | |
| 282 | - | |
| 283 | -// Extra small screen / phone | |
| 284 | -//** Deprecated `$screen-xs` as of v3.0.1 | |
| 285 | -$screen-xs: 480px !default; | |
| 286 | -//** Deprecated `$screen-xs-min` as of v3.2.0 | |
| 287 | -$screen-xs-min: $screen-xs !default; | |
| 288 | -//** Deprecated `$screen-phone` as of v3.0.1 | |
| 289 | -$screen-phone: $screen-xs-min !default; | |
| 290 | - | |
| 291 | -// Small screen / tablet | |
| 292 | -//** Deprecated `$screen-sm` as of v3.0.1 | |
| 293 | -$screen-sm: 768px !default; | |
| 294 | -$screen-sm-min: $screen-sm !default; | |
| 295 | -//** Deprecated `$screen-tablet` as of v3.0.1 | |
| 296 | -$screen-tablet: $screen-sm-min !default; | |
| 297 | - | |
| 298 | -// Medium screen / desktop | |
| 299 | -//** Deprecated `$screen-md` as of v3.0.1 | |
| 300 | -$screen-md: 992px !default; | |
| 301 | -$screen-md-min: $screen-md !default; | |
| 302 | -//** Deprecated `$screen-desktop` as of v3.0.1 | |
| 303 | -$screen-desktop: $screen-md-min !default; | |
| 304 | - | |
| 305 | -// Large screen / wide desktop | |
| 306 | -//** Deprecated `$screen-lg` as of v3.0.1 | |
| 307 | -$screen-lg: 1200px !default; | |
| 308 | -$screen-lg-min: $screen-lg !default; | |
| 309 | -//** Deprecated `$screen-lg-desktop` as of v3.0.1 | |
| 310 | -$screen-lg-desktop: $screen-lg-min !default; | |
| 311 | - | |
| 312 | -// So media queries don't overlap when required, provide a maximum | |
| 313 | -$screen-xs-max: ($screen-sm-min - 1) !default; | |
| 314 | -$screen-sm-max: ($screen-md-min - 1) !default; | |
| 315 | -$screen-md-max: ($screen-lg-min - 1) !default; | |
| 316 | - | |
| 317 | - | |
| 318 | -//== Grid system | |
| 319 | -// | |
| 320 | -//## Define your custom responsive grid. | |
| 321 | - | |
| 322 | -//** Number of columns in the grid. | |
| 323 | -$grid-columns: 12 !default; | |
| 324 | -//** Padding between columns. Gets divided in half for the left and right. | |
| 325 | -$grid-gutter-width: 30px !default; | |
| 326 | -// Navbar collapse | |
| 327 | -//** Point at which the navbar becomes uncollapsed. | |
| 328 | -$grid-float-breakpoint: $screen-sm-min !default; | |
| 329 | -//** Point at which the navbar begins collapsing. | |
| 330 | -$grid-float-breakpoint-max: ($grid-float-breakpoint - 1) !default; | |
| 331 | - | |
| 332 | - | |
| 333 | -//== Container sizes | |
| 334 | -// | |
| 335 | -//## Define the maximum width of `.container` for different screen sizes. | |
| 336 | - | |
| 337 | -// Small screen / tablet | |
| 338 | -$container-tablet: (720px + $grid-gutter-width) !default; | |
| 339 | -//** For `$screen-sm-min` and up. | |
| 340 | -$container-sm: $container-tablet !default; | |
| 341 | - | |
| 342 | -// Medium screen / desktop | |
| 343 | -$container-desktop: (940px + $grid-gutter-width) !default; | |
| 344 | -//** For `$screen-md-min` and up. | |
| 345 | -$container-md: $container-desktop !default; | |
| 346 | - | |
| 347 | -// Large screen / wide desktop | |
| 348 | -$container-large-desktop: (1140px + $grid-gutter-width) !default; | |
| 349 | -//** For `$screen-lg-min` and up. | |
| 350 | -$container-lg: $container-large-desktop !default; | |
| 351 | - | |
| 352 | - | |
| 353 | -//== Navbar | |
| 354 | -// | |
| 355 | -//## | |
| 356 | - | |
| 357 | -// Basics of a navbar | |
| 358 | -$navbar-height: 50px !default; | |
| 359 | -$navbar-margin-bottom: $line-height-computed !default; | |
| 360 | -$navbar-border-radius: $border-radius-base !default; | |
| 361 | -$navbar-padding-horizontal: floor(($grid-gutter-width / 2)) !default; | |
| 362 | -$navbar-padding-vertical: (($navbar-height - $line-height-computed) / 2) !default; | |
| 363 | -$navbar-collapse-max-height: 340px !default; | |
| 364 | - | |
| 365 | -$navbar-default-color: white !default; | |
| 366 | -$navbar-default-bg: #2c3e50 !default; | |
| 367 | -$navbar-default-border: lighten($navbar-default-bg, 6.5%) !default; | |
| 368 | - | |
| 369 | -// Navbar links | |
| 370 | -$navbar-default-link-color: white !default; | |
| 371 | -$navbar-default-link-hover-color: #333 !default; | |
| 372 | -$navbar-default-link-hover-bg: transparent !default; | |
| 373 | -$navbar-default-link-active-color: #555 !default; | |
| 374 | -$navbar-default-link-active-bg: darken($navbar-default-bg, 6.5%) !default; | |
| 375 | -$navbar-default-link-disabled-color: #ccc !default; | |
| 376 | -$navbar-default-link-disabled-bg: transparent !default; | |
| 377 | - | |
| 378 | -// Navbar brand label | |
| 379 | -$navbar-default-brand-color: $navbar-default-link-color !default; | |
| 380 | -$navbar-default-brand-hover-color: darken($navbar-default-brand-color, 10%) !default; | |
| 381 | -$navbar-default-brand-hover-bg: transparent !default; | |
| 382 | - | |
| 383 | -// Navbar toggle | |
| 384 | -$navbar-default-toggle-hover-bg: #ddd !default; | |
| 385 | -$navbar-default-toggle-icon-bar-bg: #888 !default; | |
| 386 | -$navbar-default-toggle-border-color: #ddd !default; | |
| 387 | - | |
| 388 | - | |
| 389 | -// Inverted navbar | |
| 390 | -// Reset inverted navbar basics | |
| 391 | -$navbar-inverse-color: lighten($gray-light, 15%) !default; | |
| 392 | -$navbar-inverse-bg: #222 !default; | |
| 393 | -$navbar-inverse-border: darken($navbar-inverse-bg, 10%) !default; | |
| 394 | - | |
| 395 | -// Inverted navbar links | |
| 396 | -$navbar-inverse-link-color: lighten($gray-light, 15%) !default; | |
| 397 | -$navbar-inverse-link-hover-color: #fff !default; | |
| 398 | -$navbar-inverse-link-hover-bg: transparent !default; | |
| 399 | -$navbar-inverse-link-active-color: $navbar-inverse-link-hover-color !default; | |
| 400 | -$navbar-inverse-link-active-bg: darken($navbar-inverse-bg, 10%) !default; | |
| 401 | -$navbar-inverse-link-disabled-color: #444 !default; | |
| 402 | -$navbar-inverse-link-disabled-bg: transparent !default; | |
| 403 | - | |
| 404 | -// Inverted navbar brand label | |
| 405 | -$navbar-inverse-brand-color: $navbar-inverse-link-color !default; | |
| 406 | -$navbar-inverse-brand-hover-color: #fff !default; | |
| 407 | -$navbar-inverse-brand-hover-bg: transparent !default; | |
| 408 | - | |
| 409 | -// Inverted navbar toggle | |
| 410 | -$navbar-inverse-toggle-hover-bg: #333 !default; | |
| 411 | -$navbar-inverse-toggle-icon-bar-bg: #fff !default; | |
| 412 | -$navbar-inverse-toggle-border-color: #333 !default; | |
| 413 | - | |
| 414 | - | |
| 415 | -//== Navs | |
| 416 | -// | |
| 417 | -//## | |
| 418 | - | |
| 419 | -//=== Shared nav styles | |
| 420 | -$nav-link-padding: 10px 15px !default; | |
| 421 | -$nav-link-hover-bg: $gray-lighter !default; | |
| 422 | - | |
| 423 | -$nav-disabled-link-color: $gray-light !default; | |
| 424 | -$nav-disabled-link-hover-color: $gray-light !default; | |
| 425 | - | |
| 426 | -//== Tabs | |
| 427 | -$nav-tabs-border-color: #ddd !default; | |
| 428 | - | |
| 429 | -$nav-tabs-link-hover-border-color: $gray-lighter !default; | |
| 430 | - | |
| 431 | -$nav-tabs-active-link-hover-bg: $body-bg !default; | |
| 432 | -$nav-tabs-active-link-hover-color: $gray !default; | |
| 433 | -$nav-tabs-active-link-hover-border-color: #ddd !default; | |
| 434 | - | |
| 435 | -$nav-tabs-justified-link-border-color: #ddd !default; | |
| 436 | -$nav-tabs-justified-active-link-border-color: $body-bg !default; | |
| 437 | - | |
| 438 | -//== Pills | |
| 439 | -$nav-pills-border-radius: $border-radius-base !default; | |
| 440 | -$nav-pills-active-link-hover-bg: $component-active-bg !default; | |
| 441 | -$nav-pills-active-link-hover-color: $component-active-color !default; | |
| 442 | - | |
| 443 | - | |
| 444 | -//== Pagination | |
| 445 | -// | |
| 446 | -//## | |
| 447 | - | |
| 448 | -$pagination-color: $link-color !default; | |
| 449 | -$pagination-bg: #fff !default; | |
| 450 | -$pagination-border: #ddd !default; | |
| 451 | - | |
| 452 | -$pagination-hover-color: $link-hover-color !default; | |
| 453 | -$pagination-hover-bg: $gray-lighter !default; | |
| 454 | -$pagination-hover-border: #ddd !default; | |
| 455 | - | |
| 456 | -$pagination-active-color: #fff !default; | |
| 457 | -$pagination-active-bg: $brand-primary !default; | |
| 458 | -$pagination-active-border: $brand-primary !default; | |
| 459 | - | |
| 460 | -$pagination-disabled-color: $gray-light !default; | |
| 461 | -$pagination-disabled-bg: #fff !default; | |
| 462 | -$pagination-disabled-border: #ddd !default; | |
| 463 | - | |
| 464 | - | |
| 465 | -//== Pager | |
| 466 | -// | |
| 467 | -//## | |
| 468 | - | |
| 469 | -$pager-bg: $pagination-bg !default; | |
| 470 | -$pager-border: $pagination-border !default; | |
| 471 | -$pager-border-radius: 15px !default; | |
| 472 | - | |
| 473 | -$pager-hover-bg: $pagination-hover-bg !default; | |
| 474 | - | |
| 475 | -$pager-active-bg: $pagination-active-bg !default; | |
| 476 | -$pager-active-color: $pagination-active-color !default; | |
| 477 | - | |
| 478 | -$pager-disabled-color: $pagination-disabled-color !default; | |
| 479 | - | |
| 480 | - | |
| 481 | -//== Jumbotron | |
| 482 | -// | |
| 483 | -//## | |
| 484 | - | |
| 485 | -$jumbotron-padding: 30px !default; | |
| 486 | -$jumbotron-color: inherit !default; | |
| 487 | -$jumbotron-bg: $gray-lighter !default; | |
| 488 | -$jumbotron-heading-color: inherit !default; | |
| 489 | -$jumbotron-font-size: ceil(($font-size-base * 1.5)) !default; | |
| 490 | - | |
| 491 | - | |
| 492 | -//== Form states and alerts | |
| 493 | -// | |
| 494 | -//## Define colors for form feedback states and, by default, alerts. | |
| 495 | - | |
| 496 | -$state-success-text: #3c763d !default; | |
| 497 | -$state-success-bg: #dff0d8 !default; | |
| 498 | -$state-success-border: darken(adjust-hue($state-success-bg, -10), 5%) !default; | |
| 499 | - | |
| 500 | -$state-info-text: #31708f !default; | |
| 501 | -$state-info-bg: #d9edf7 !default; | |
| 502 | -$state-info-border: darken(adjust-hue($state-info-bg, -10), 7%) !default; | |
| 503 | - | |
| 504 | -$state-warning-text: #8a6d3b !default; | |
| 505 | -$state-warning-bg: #fcf8e3 !default; | |
| 506 | -$state-warning-border: darken(adjust-hue($state-warning-bg, -10), 5%) !default; | |
| 507 | - | |
| 508 | -$state-danger-text: #a94442 !default; | |
| 509 | -$state-danger-bg: #f2dede !default; | |
| 510 | -$state-danger-border: darken(adjust-hue($state-danger-bg, -10), 5%) !default; | |
| 511 | - | |
| 512 | - | |
| 513 | -//== Tooltips | |
| 514 | -// | |
| 515 | -//## | |
| 516 | - | |
| 517 | -//** Tooltip max width | |
| 518 | -$tooltip-max-width: 200px !default; | |
| 519 | -//** Tooltip text color | |
| 520 | -$tooltip-color: #fff !default; | |
| 521 | -//** Tooltip background color | |
| 522 | -$tooltip-bg: #000 !default; | |
| 523 | -$tooltip-opacity: .9 !default; | |
| 524 | - | |
| 525 | -//** Tooltip arrow width | |
| 526 | -$tooltip-arrow-width: 5px !default; | |
| 527 | -//** Tooltip arrow color | |
| 528 | -$tooltip-arrow-color: $tooltip-bg !default; | |
| 529 | - | |
| 530 | - | |
| 531 | -//== Popovers | |
| 532 | -// | |
| 533 | -//## | |
| 534 | - | |
| 535 | -//** Popover body background color | |
| 536 | -$popover-bg: #fff !default; | |
| 537 | -//** Popover maximum width | |
| 538 | -$popover-max-width: 276px !default; | |
| 539 | -//** Popover border color | |
| 540 | -$popover-border-color: rgba(0,0,0,.2) !default; | |
| 541 | -//** Popover fallback border color | |
| 542 | -$popover-fallback-border-color: #ccc !default; | |
| 543 | - | |
| 544 | -//** Popover title background color | |
| 545 | -$popover-title-bg: darken($popover-bg, 3%) !default; | |
| 546 | - | |
| 547 | -//** Popover arrow width | |
| 548 | -$popover-arrow-width: 10px !default; | |
| 549 | -//** Popover arrow color | |
| 550 | -$popover-arrow-color: $popover-bg !default; | |
| 551 | - | |
| 552 | -//** Popover outer arrow width | |
| 553 | -$popover-arrow-outer-width: ($popover-arrow-width + 1) !default; | |
| 554 | -//** Popover outer arrow color | |
| 555 | -$popover-arrow-outer-color: fade_in($popover-border-color, 0.05) !default; | |
| 556 | -//** Popover outer arrow fallback color | |
| 557 | -$popover-arrow-outer-fallback-color: darken($popover-fallback-border-color, 20%) !default; | |
| 558 | - | |
| 559 | - | |
| 560 | -//== Labels | |
| 561 | -// | |
| 562 | -//## | |
| 563 | - | |
| 564 | -//** Default label background color | |
| 565 | -$label-default-bg: $gray-light !default; | |
| 566 | -//** Primary label background color | |
| 567 | -$label-primary-bg: $brand-primary !default; | |
| 568 | -//** Success label background color | |
| 569 | -$label-success-bg: $brand-success !default; | |
| 570 | -//** Info label background color | |
| 571 | -$label-info-bg: $brand-info !default; | |
| 572 | -//** Warning label background color | |
| 573 | -$label-warning-bg: $brand-warning !default; | |
| 574 | -//** Danger label background color | |
| 575 | -$label-danger-bg: $brand-danger !default; | |
| 576 | - | |
| 577 | -//** Default label text color | |
| 578 | -$label-color: #fff !default; | |
| 579 | -//** Default text color of a linked label | |
| 580 | -$label-link-hover-color: #fff !default; | |
| 581 | - | |
| 582 | - | |
| 583 | -//== Modals | |
| 584 | -// | |
| 585 | -//## | |
| 586 | - | |
| 587 | -//** Padding applied to the modal body | |
| 588 | -$modal-inner-padding: 15px !default; | |
| 589 | - | |
| 590 | -//** Padding applied to the modal title | |
| 591 | -$modal-title-padding: 15px !default; | |
| 592 | -//** Modal title line-height | |
| 593 | -$modal-title-line-height: $line-height-base !default; | |
| 594 | - | |
| 595 | -//** Background color of modal content area | |
| 596 | -$modal-content-bg: #fff !default; | |
| 597 | -//** Modal content border color | |
| 598 | -$modal-content-border-color: rgba(0,0,0,.2) !default; | |
| 599 | -//** Modal content border color **for IE8** | |
| 600 | -$modal-content-fallback-border-color: #999 !default; | |
| 601 | - | |
| 602 | -//** Modal backdrop background color | |
| 603 | -$modal-backdrop-bg: #000 !default; | |
| 604 | -//** Modal backdrop opacity | |
| 605 | -$modal-backdrop-opacity: .5 !default; | |
| 606 | -//** Modal header border color | |
| 607 | -$modal-header-border-color: #e5e5e5 !default; | |
| 608 | -//** Modal footer border color | |
| 609 | -$modal-footer-border-color: $modal-header-border-color !default; | |
| 610 | - | |
| 611 | -$modal-lg: 900px !default; | |
| 612 | -$modal-md: 600px !default; | |
| 613 | -$modal-sm: 300px !default; | |
| 614 | - | |
| 615 | - | |
| 616 | -//== Alerts | |
| 617 | -// | |
| 618 | -//## Define alert colors, border radius, and padding. | |
| 619 | - | |
| 620 | -$alert-padding: 15px !default; | |
| 621 | -$alert-border-radius: $border-radius-base !default; | |
| 622 | -$alert-link-font-weight: bold !default; | |
| 623 | - | |
| 624 | -$alert-success-bg: $state-success-bg !default; | |
| 625 | -$alert-success-text: $state-success-text !default; | |
| 626 | -$alert-success-border: $state-success-border !default; | |
| 627 | - | |
| 628 | -$alert-info-bg: $state-info-bg !default; | |
| 629 | -$alert-info-text: $state-info-text !default; | |
| 630 | -$alert-info-border: $state-info-border !default; | |
| 631 | - | |
| 632 | -$alert-warning-bg: $state-warning-bg !default; | |
| 633 | -$alert-warning-text: $state-warning-text !default; | |
| 634 | -$alert-warning-border: $state-warning-border !default; | |
| 635 | - | |
| 636 | -$alert-danger-bg: $state-danger-bg !default; | |
| 637 | -$alert-danger-text: $state-danger-text !default; | |
| 638 | -$alert-danger-border: $state-danger-border !default; | |
| 639 | - | |
| 640 | - | |
| 641 | -//== Progress bars | |
| 642 | -// | |
| 643 | -//## | |
| 644 | - | |
| 645 | -//** Background color of the whole progress component | |
| 646 | -$progress-bg: #f5f5f5 !default; | |
| 647 | -//** Progress bar text color | |
| 648 | -$progress-bar-color: #fff !default; | |
| 649 | -//** Variable for setting rounded corners on progress bar. | |
| 650 | -$progress-border-radius: $border-radius-base !default; | |
| 651 | - | |
| 652 | -//** Default progress bar color | |
| 653 | -$progress-bar-bg: $brand-primary !default; | |
| 654 | -//** Success progress bar color | |
| 655 | -$progress-bar-success-bg: $brand-success !default; | |
| 656 | -//** Warning progress bar color | |
| 657 | -$progress-bar-warning-bg: $brand-warning !default; | |
| 658 | -//** Danger progress bar color | |
| 659 | -$progress-bar-danger-bg: $brand-danger !default; | |
| 660 | -//** Info progress bar color | |
| 661 | -$progress-bar-info-bg: $brand-info !default; | |
| 662 | - | |
| 663 | - | |
| 664 | -//== List group | |
| 665 | -// | |
| 666 | -//## | |
| 667 | - | |
| 668 | -//** Background color on `.list-group-item` | |
| 669 | -$list-group-bg: #fff !default; | |
| 670 | -//** `.list-group-item` border color | |
| 671 | -$list-group-border: #ddd !default; | |
| 672 | -//** List group border radius | |
| 673 | -$list-group-border-radius: $border-radius-base !default; | |
| 674 | - | |
| 675 | -//** Background color of single list items on hover | |
| 676 | -$list-group-hover-bg: #f5f5f5 !default; | |
| 677 | -//** Text color of active list items | |
| 678 | -$list-group-active-color: $component-active-color !default; | |
| 679 | -//** Background color of active list items | |
| 680 | -$list-group-active-bg: $component-active-bg !default; | |
| 681 | -//** Border color of active list elements | |
| 682 | -$list-group-active-border: $list-group-active-bg !default; | |
| 683 | -//** Text color for content within active list items | |
| 684 | -$list-group-active-text-color: lighten($list-group-active-bg, 40%) !default; | |
| 685 | - | |
| 686 | -//** Text color of disabled list items | |
| 687 | -$list-group-disabled-color: $gray-light !default; | |
| 688 | -//** Background color of disabled list items | |
| 689 | -$list-group-disabled-bg: $gray-lighter !default; | |
| 690 | -//** Text color for content within disabled list items | |
| 691 | -$list-group-disabled-text-color: $list-group-disabled-color !default; | |
| 692 | - | |
| 693 | -$list-group-link-color: #555 !default; | |
| 694 | -$list-group-link-hover-color: $list-group-link-color !default; | |
| 695 | -$list-group-link-heading-color: #333 !default; | |
| 696 | - | |
| 697 | - | |
| 698 | -//== Panels | |
| 699 | -// | |
| 700 | -//## | |
| 701 | - | |
| 702 | -$panel-bg: #fff !default; | |
| 703 | -$panel-body-padding: 15px !default; | |
| 704 | -$panel-heading-padding: 10px 15px !default; | |
| 705 | -$panel-footer-padding: $panel-heading-padding !default; | |
| 706 | -$panel-border-radius: $border-radius-base !default; | |
| 707 | - | |
| 708 | -//** Border color for elements within panels | |
| 709 | -$panel-inner-border: #ddd !default; | |
| 710 | -$panel-footer-bg: #f5f5f5 !default; | |
| 711 | - | |
| 712 | -$panel-default-text: $gray-dark !default; | |
| 713 | -$panel-default-border: #ddd !default; | |
| 714 | -$panel-default-heading-bg: #f5f5f5 !default; | |
| 715 | - | |
| 716 | -$panel-primary-text: #fff !default; | |
| 717 | -$panel-primary-border: $brand-primary !default; | |
| 718 | -$panel-primary-heading-bg: $brand-primary !default; | |
| 719 | - | |
| 720 | -$panel-success-text: $state-success-text !default; | |
| 721 | -$panel-success-border: $state-success-border !default; | |
| 722 | -$panel-success-heading-bg: $state-success-bg !default; | |
| 723 | - | |
| 724 | -$panel-info-text: $state-info-text !default; | |
| 725 | -$panel-info-border: $state-info-border !default; | |
| 726 | -$panel-info-heading-bg: $state-info-bg !default; | |
| 727 | - | |
| 728 | -$panel-warning-text: $state-warning-text !default; | |
| 729 | -$panel-warning-border: $state-warning-border !default; | |
| 730 | -$panel-warning-heading-bg: $state-warning-bg !default; | |
| 731 | - | |
| 732 | -$panel-danger-text: $state-danger-text !default; | |
| 733 | -$panel-danger-border: $state-danger-border !default; | |
| 734 | -$panel-danger-heading-bg: $state-danger-bg !default; | |
| 735 | - | |
| 736 | - | |
| 737 | -//== Thumbnails | |
| 738 | -// | |
| 739 | -//## | |
| 740 | - | |
| 741 | -//** Padding around the thumbnail image | |
| 742 | -$thumbnail-padding: 4px !default; | |
| 743 | -//** Thumbnail background color | |
| 744 | -$thumbnail-bg: $body-bg !default; | |
| 745 | -//** Thumbnail border color | |
| 746 | -$thumbnail-border: #ddd !default; | |
| 747 | -//** Thumbnail border radius | |
| 748 | -$thumbnail-border-radius: $border-radius-base !default; | |
| 749 | - | |
| 750 | -//** Custom text color for thumbnail captions | |
| 751 | -$thumbnail-caption-color: $text-color !default; | |
| 752 | -//** Padding around the thumbnail caption | |
| 753 | -$thumbnail-caption-padding: 9px !default; | |
| 754 | - | |
| 755 | - | |
| 756 | -//== Wells | |
| 757 | -// | |
| 758 | -//## | |
| 759 | - | |
| 760 | -$well-bg: #f5f5f5 !default; | |
| 761 | -$well-border: darken($well-bg, 7%) !default; | |
| 762 | - | |
| 763 | - | |
| 764 | -//== Badges | |
| 765 | -// | |
| 766 | -//## | |
| 767 | - | |
| 768 | -$badge-color: #fff !default; | |
| 769 | -//** Linked badge text color on hover | |
| 770 | -$badge-link-hover-color: #fff !default; | |
| 771 | -$badge-bg: $gray-light !default; | |
| 772 | - | |
| 773 | -//** Badge text color in active nav link | |
| 774 | -$badge-active-color: $link-color !default; | |
| 775 | -//** Badge background color in active nav link | |
| 776 | -$badge-active-bg: #fff !default; | |
| 777 | - | |
| 778 | -$badge-font-weight: bold !default; | |
| 779 | -$badge-line-height: 1 !default; | |
| 780 | -$badge-border-radius: 10px !default; | |
| 781 | - | |
| 782 | - | |
| 783 | -//== Breadcrumbs | |
| 784 | -// | |
| 785 | -//## | |
| 786 | - | |
| 787 | -$breadcrumb-padding-vertical: 8px !default; | |
| 788 | -$breadcrumb-padding-horizontal: 15px !default; | |
| 789 | -//** Breadcrumb background color | |
| 790 | -$breadcrumb-bg: #f5f5f5 !default; | |
| 791 | -//** Breadcrumb text color | |
| 792 | -$breadcrumb-color: #ccc !default; | |
| 793 | -//** Text color of current page in the breadcrumb | |
| 794 | -$breadcrumb-active-color: $gray-light !default; | |
| 795 | -//** Textual separator for between breadcrumb elements | |
| 796 | -$breadcrumb-separator: "/" !default; | |
| 797 | - | |
| 798 | - | |
| 799 | -//== Carousel | |
| 800 | -// | |
| 801 | -//## | |
| 802 | - | |
| 803 | -$carousel-text-shadow: 0 1px 2px rgba(0,0,0,.6) !default; | |
| 804 | - | |
| 805 | -$carousel-control-color: #fff !default; | |
| 806 | -$carousel-control-width: 15% !default; | |
| 807 | -$carousel-control-opacity: .5 !default; | |
| 808 | -$carousel-control-font-size: 20px !default; | |
| 809 | - | |
| 810 | -$carousel-indicator-active-bg: #fff !default; | |
| 811 | -$carousel-indicator-border-color: #fff !default; | |
| 812 | - | |
| 813 | -$carousel-caption-color: #fff !default; | |
| 814 | - | |
| 815 | - | |
| 816 | -//== Close | |
| 817 | -// | |
| 818 | -//## | |
| 819 | - | |
| 820 | -$close-font-weight: bold !default; | |
| 821 | -$close-color: #000 !default; | |
| 822 | -$close-text-shadow: 0 1px 0 #fff !default; | |
| 823 | - | |
| 824 | - | |
| 825 | -//== Code | |
| 826 | -// | |
| 827 | -//## | |
| 828 | - | |
| 829 | -$code-color: #c7254e !default; | |
| 830 | -$code-bg: #f9f2f4 !default; | |
| 831 | - | |
| 832 | -$kbd-color: #fff !default; | |
| 833 | -$kbd-bg: #333 !default; | |
| 834 | - | |
| 835 | -$pre-bg: #f5f5f5 !default; | |
| 836 | -$pre-color: $gray-dark !default; | |
| 837 | -$pre-border-color: #ccc !default; | |
| 838 | -$pre-scrollable-max-height: 340px !default; | |
| 839 | - | |
| 840 | - | |
| 841 | -//== Type | |
| 842 | -// | |
| 843 | -//## | |
| 844 | - | |
| 845 | -//** Horizontal offset for forms and lists. | |
| 846 | -$component-offset-horizontal: 180px !default; | |
| 847 | -//** Text muted color | |
| 848 | -$text-muted: $gray-light !default; | |
| 849 | -//** Abbreviations and acronyms border color | |
| 850 | -$abbr-border-color: $gray-light !default; | |
| 851 | -//** Headings small color | |
| 852 | -$headings-small-color: $gray-light !default; | |
| 853 | -//** Blockquote small color | |
| 854 | -$blockquote-small-color: $gray-light !default; | |
| 855 | -//** Blockquote font size | |
| 856 | -$blockquote-font-size: ($font-size-base * 1.25) !default; | |
| 857 | -//** Blockquote border color | |
| 858 | -$blockquote-border-color: $gray-lighter !default; | |
| 859 | -//** Page header border color | |
| 860 | -$page-header-border-color: $gray-lighter !default; | |
| 861 | -//** Width of horizontal description list titles | |
| 862 | -$dl-horizontal-offset: $component-offset-horizontal !default; | |
| 863 | -//** Horizontal line color. | |
| 864 | -$hr-border: $gray-lighter !default; |
public/designs/themes/cube-responsive/favicon.ico
No preview for this file type
public/designs/themes/cube-responsive/footer.html.erb
| ... | ... | @@ -1,9 +0,0 @@ |
| 1 | -<div class="container"> | |
| 2 | - <div id="footer-links"> | |
| 3 | - <%= link_to _('Manual'), '/doc', id: "link-to-doc", class: 'icon-help' %> | |
| 4 | - </div><!-- end id="footer-links" --> | |
| 5 | - <div id="copyright"> | |
| 6 | - <p><%= _('This social network uses <a href="http://noosfero.org/">Noosfero</a>, developed by %s and licensed under the <a href="http://www.gnu.org/licenses/agpl.html">GNU Affero General Public License</a> version 3 or any later version.') % link_to('Colivre', 'http://colivre.coop.br/') %></p> | |
| 7 | - </div><!-- end id="copyright" --> | |
| 8 | - <%= language_chooser(environment) %> | |
| 9 | -</div> |
public/designs/themes/cube-responsive/header.html.erb
| ... | ... | @@ -1,17 +0,0 @@ |
| 1 | -<header class="navbar" id="header-navbar"> | |
| 2 | - <div class="container"> | |
| 3 | - <%= theme_site_title %> | |
| 4 | - | |
| 5 | - <div class="clearfix"> | |
| 6 | - <button class="navbar-toggle" data-target=".navbar-ex1-collapse" data-toggle="collapse" type="button"> | |
| 7 | - <span class="sr-only">Toggle navigation</span> | |
| 8 | - <span class="fa fa-bars"></span> | |
| 9 | - </button> | |
| 10 | - | |
| 11 | - <%= theme_header_user_notices %> | |
| 12 | - | |
| 13 | - <%= theme_header_user_right_menu %> | |
| 14 | - <%= theme_header_not_user_right %> | |
| 15 | - </div> | |
| 16 | - </div> | |
| 17 | -</header> |
public/designs/themes/cube-responsive/header_not_user_right.html.erb
| ... | ... | @@ -1,8 +0,0 @@ |
| 1 | -<ul class="nav navbar-nav pull-right"> | |
| 2 | -<li> | |
| 3 | - <a href="/account/login" class="" id="link_login" onclick="return noosfero.modal.inline('#inlineLoginBox')"><i class="icon-menu-login"></i><strong>Entrar</strong></a> | |
| 4 | -</li> | |
| 5 | -<li> | |
| 6 | - <a href="/account/signup"><strong>Registre-se</strong></a> | |
| 7 | -</li> | |
| 8 | -</ul> |
public/designs/themes/cube-responsive/header_user_notices.html.erb
| ... | ... | @@ -1,181 +0,0 @@ |
| 1 | -<div class="nav-no-collapse navbar-left pull-left hidden-sm hidden-xs"> | |
| 2 | - <ul class="nav navbar-nav pull-left"> | |
| 3 | - <li> | |
| 4 | - <a class="btn" id="make-small-nav"> | |
| 5 | - <i><span class="fa fa-bars"></span></i> | |
| 6 | - </a> | |
| 7 | - </li> | |
| 8 | - <li class="dropdown hidden-xs"> | |
| 9 | - <a class="btn dropdown-toggle" data-target="#" data-toggle="dropdown"> | |
| 10 | - <i class="fa fa-bell"></i> | |
| 11 | - <span class="count">8</span> | |
| 12 | - </a> | |
| 13 | - <ul class="dropdown-menu notifications-list"> | |
| 14 | - <li class="pointer"> | |
| 15 | - <div class="pointer-inner"> | |
| 16 | - <div class="arrow"></div> | |
| 17 | - </div> | |
| 18 | - </li> | |
| 19 | - <li class="item-header">You have 6 new notifications</li> | |
| 20 | - <li class="item"> | |
| 21 | - <a href="#"> | |
| 22 | - <i class="fa fa-comment"></i> | |
| 23 | - <span class="content">New comment on ‘Awesome P...</span> | |
| 24 | - <span class="time"><i class="fa fa-clock-o"></i>13 min.</span> | |
| 25 | - </a> | |
| 26 | - </li> | |
| 27 | - <li class="item"> | |
| 28 | - <a href="#"> | |
| 29 | - <i class="fa fa-plus"></i> | |
| 30 | - <span class="content">New user registration</span> | |
| 31 | - <span class="time"><i class="fa fa-clock-o"></i>13 min.</span> | |
| 32 | - </a> | |
| 33 | - </li> | |
| 34 | - <li class="item"> | |
| 35 | - <a href="#"> | |
| 36 | - <i class="fa fa-envelope"></i> | |
| 37 | - <span class="content">New Message from George</span> | |
| 38 | - <span class="time"><i class="fa fa-clock-o"></i>13 min.</span> | |
| 39 | - </a> | |
| 40 | - </li> | |
| 41 | - <li class="item"> | |
| 42 | - <a href="#"> | |
| 43 | - <i class="fa fa-shopping-cart"></i> | |
| 44 | - <span class="content">New purchase</span> | |
| 45 | - <span class="time"><i class="fa fa-clock-o"></i>13 min.</span> | |
| 46 | - </a> | |
| 47 | - </li> | |
| 48 | - <li class="item"> | |
| 49 | - <a href="#"> | |
| 50 | - <i class="fa fa-eye"></i> | |
| 51 | - <span class="content">New order</span> | |
| 52 | - <span class="time"><i class="fa fa-clock-o"></i>13 min.</span> | |
| 53 | - </a> | |
| 54 | - </li> | |
| 55 | - <li class="item-footer"> | |
| 56 | - <a href="#"> | |
| 57 | - View all notifications | |
| 58 | - </a> | |
| 59 | - </li> | |
| 60 | - </ul> | |
| 61 | - </li> | |
| 62 | - <li class="dropdown hidden-xs"> | |
| 63 | - <a class="btn dropdown-toggle" data-target="#" data-toggle="dropdown"> | |
| 64 | - <i><span class="fa fa-envelope"></span></i> | |
| 65 | - <span class="count">16</span> | |
| 66 | - </a> | |
| 67 | - <ul class="dropdown-menu notifications-list messages-list"> | |
| 68 | - <li class="pointer"> | |
| 69 | - <div class="pointer-inner"> | |
| 70 | - <div class="arrow"></div> | |
| 71 | - </div> | |
| 72 | - </li> | |
| 73 | - <li class="item first-item"> | |
| 74 | - <a href="#"> | |
| 75 | - <img src="/designs/themes/cube-responsive-theme/images/samples/messages-photo-1.png" alt=""/> | |
| 76 | - <span class="content"> | |
| 77 | - <span class="content-headline"> | |
| 78 | - George Clooney | |
| 79 | - </span> | |
| 80 | - <span class="content-text"> | |
| 81 | - Look, just because I don't be givin' no man a foot massage don't make it | |
| 82 | - right for Marsellus to throw... | |
| 83 | - </span> | |
| 84 | - </span> | |
| 85 | - <span class="time"><i class="fa fa-clock-o"></i>13 min.</span> | |
| 86 | - </a> | |
| 87 | - </li> | |
| 88 | - <li class="item"> | |
| 89 | - <a href="#"> | |
| 90 | - <img src="/designs/themes/cube-responsive-theme/images/samples/messages-photo-2.png" alt=""/> | |
| 91 | - <span class="content"> | |
| 92 | - <span class="content-headline"> | |
| 93 | - Emma Watson | |
| 94 | - </span> | |
| 95 | - <span class="content-text"> | |
| 96 | - Look, just because I don't be givin' no man a foot massage don't make it | |
| 97 | - right for Marsellus to throw... | |
| 98 | - </span> | |
| 99 | - </span> | |
| 100 | - <span class="time"><i class="fa fa-clock-o"></i>13 min.</span> | |
| 101 | - </a> | |
| 102 | - </li> | |
| 103 | - <li class="item"> | |
| 104 | - <a href="#"> | |
| 105 | - <img src="/designs/themes/cube-responsive-theme/images/samples/messages-photo-3.png" alt=""/> | |
| 106 | - <span class="content"> | |
| 107 | - <span class="content-headline"> | |
| 108 | - Robert Downey Jr. | |
| 109 | - </span> | |
| 110 | - <span class="content-text"> | |
| 111 | - Look, just because I don't be givin' no man a foot massage don't make it | |
| 112 | - right for Marsellus to throw... | |
| 113 | - </span> | |
| 114 | - </span> | |
| 115 | - <span class="time"><i class="fa fa-clock-o"></i>13 min.</span> | |
| 116 | - </a> | |
| 117 | - </li> | |
| 118 | - <li class="item-footer"> | |
| 119 | - <a href="#"> | |
| 120 | - View all messages | |
| 121 | - </a> | |
| 122 | - </li> | |
| 123 | - </ul> | |
| 124 | - </li> | |
| 125 | - <li class="dropdown hidden-xs"> | |
| 126 | - <a class="btn dropdown-toggle" data-toggle="dropdown"> | |
| 127 | - New Item | |
| 128 | - <i class="fa fa-caret-down"></i> | |
| 129 | - </a> | |
| 130 | - <ul class="dropdown-menu"> | |
| 131 | - <li class="item"> | |
| 132 | - <a href="#"> | |
| 133 | - <i class="fa fa-archive"></i> | |
| 134 | - New Product | |
| 135 | - </a> | |
| 136 | - </li> | |
| 137 | - <li class="item"> | |
| 138 | - <a href="#"> | |
| 139 | - <i class="fa fa-shopping-cart"></i> | |
| 140 | - New Order | |
| 141 | - </a> | |
| 142 | - </li> | |
| 143 | - <li class="item"> | |
| 144 | - <a href="#"> | |
| 145 | - <i class="fa fa-sitemap"></i> | |
| 146 | - New Category | |
| 147 | - </a> | |
| 148 | - </li> | |
| 149 | - <li class="item"> | |
| 150 | - <a href="#"> | |
| 151 | - <i class="fa fa-file-text"></i> | |
| 152 | - New Page | |
| 153 | - </a> | |
| 154 | - </li> | |
| 155 | - </ul> | |
| 156 | - </li> | |
| 157 | - <li class="dropdown hidden-xs"> | |
| 158 | - <a class="btn dropdown-toggle" data-toggle="dropdown"> | |
| 159 | - English | |
| 160 | - <i class="fa fa-caret-down"></i> | |
| 161 | - </a> | |
| 162 | - <ul class="dropdown-menu"> | |
| 163 | - <li class="item"> | |
| 164 | - <a href="#"> | |
| 165 | - Spanish | |
| 166 | - </a> | |
| 167 | - </li> | |
| 168 | - <li class="item"> | |
| 169 | - <a href="#"> | |
| 170 | - German | |
| 171 | - </a> | |
| 172 | - </li> | |
| 173 | - <li class="item"> | |
| 174 | - <a href="#"> | |
| 175 | - Italian | |
| 176 | - </a> | |
| 177 | - </li> | |
| 178 | - </ul> | |
| 179 | - </li> | |
| 180 | - </ul> | |
| 181 | -</div> |
public/designs/themes/cube-responsive/header_user_right_menu.html.erb
| ... | ... | @@ -1,36 +0,0 @@ |
| 1 | -<div class="nav-no-collapse pull-right" id="header-nav"> | |
| 2 | - <ul class="nav navbar-nav pull-right"> | |
| 3 | - <li class="mobile-search"> | |
| 4 | - <a class="btn"> | |
| 5 | - <i class="fa fa-search"></i> | |
| 6 | - </a> | |
| 7 | - | |
| 8 | - <div class="drowdown-search"> | |
| 9 | - <form role="search"> | |
| 10 | - <div class="form-group"> | |
| 11 | - <input type="text" class="form-control" placeholder="Search..."> | |
| 12 | - <i class="fa fa-search nav-search-icon"></i> | |
| 13 | - </div> | |
| 14 | - </form> | |
| 15 | - </div> | |
| 16 | - | |
| 17 | - </li> | |
| 18 | - <li class="dropdown profile-dropdown"> | |
| 19 | - <a class="dropdown-toggle" data-target="#" data-toggle="dropdown"> | |
| 20 | - <img src="/designs/themes/cube-responsive-theme/images/samples/scarlet-159.png" alt=""/> | |
| 21 | - <span class="hidden-xs">Scarlett</span> <b class="caret"></b> | |
| 22 | - </a> | |
| 23 | - <ul class="dropdown-menu dropdown-menu-right"> | |
| 24 | - <li><a href="user-profile.html"><i class="fa fa-user"></i>Profile</a></li> | |
| 25 | - <li><a href="#"><i class="fa fa-cog"></i>Settings</a></li> | |
| 26 | - <li><a href="#"><i class="fa fa-envelope-o"></i>Messages</a></li> | |
| 27 | - <li><a href="#"><i class="fa fa-power-off"></i>Logout</a></li> | |
| 28 | - </ul> | |
| 29 | - </li> | |
| 30 | - <li class="hidden-xxs"> | |
| 31 | - <a class="btn"> | |
| 32 | - <i class="fa fa-power-off"></i> | |
| 33 | - </a> | |
| 34 | - </li> | |
| 35 | - </ul> | |
| 36 | -</div> |
public/designs/themes/cube-responsive/icons/16x16/actions/log-in.png
684 Bytes
public/designs/themes/cube-responsive/icons/16x16/actions/log-out.png
484 Bytes
public/designs/themes/cube-responsive/images/.DS_Store
No preview for this file type
public/designs/themes/cube-responsive/images/cube-logo-black.png
3.5 KB
public/designs/themes/cube-responsive/images/logo-black.png
3.5 KB
public/designs/themes/cube-responsive/images/logo-noosfero-header.png
6.21 KB
public/designs/themes/cube-responsive/images/logo-noosfero-no-text.png
9.03 KB
public/designs/themes/cube-responsive/images/logo-noosfero-raw.png
6.21 KB
public/designs/themes/cube-responsive/images/logo-noosfero.png
12.5 KB
public/designs/themes/cube-responsive/images/logo-noosfero.xcf
No preview for this file type
public/designs/themes/cube-responsive/images/logo-noosfero0.xcf
No preview for this file type
public/designs/themes/cube-responsive/images/logo-small.png
1.92 KB
public/designs/themes/cube-responsive/images/logo.png
3.4 KB