Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --cc Gemfile
- index 9777628,ac78c37..fbf08e5
- --- a/Gemfile
- +++ b/Gemfile
- @@@ -61,12 -29,10 +61,12 @@@ group :production d
- end
- group :test do
- + gem 'spring'
- + gem 'spring-commands-testunit'
- + gem 'rspec', '~> 2.14.0'
- + gem 'rspec-rails', '~> 2.14.1'
- + gem 'mocha', '~> 1.1.0', :require => false
- gem 'test-unit' if RUBY_VERSION >= '2.2.0'
- - gem 'rspec', '~> 2.10.0'
- - gem 'rspec-rails', '~> 2.10.1'
- - gem 'mocha', '~> 1.1.0', require: false
- end
- group :cucumber do
- diff --cc app/controllers/application_controller.rb
- index adc9d9b,8e90268..1e63ee3
- --- a/app/controllers/application_controller.rb
- +++ b/app/controllers/application_controller.rb
- @@@ -9,7 -9,7 +9,8 @@@ class ApplicationController < ActionCon
- before_filter :allow_cross_domain_access
- before_filter :login_required, :if => :private_environment?
- before_filter :verify_members_whitelist, :if => [:private_environment?, :user]
- + before_filter :redirect_to_current_user
- + around_filter :set_time_zone
- def verify_members_whitelist
- render_access_denied unless user.is_admin? || environment.in_whitelist?(user)
- @@@ -196,23 -179,8 +197,24 @@@
- include SearchTermHelper
- + private
- +
- + def autocomplete asset, scope, query, paginate_options={:page => 1}, options={:field => 'name'}
- + plugins.dispatch_first(:autocomplete, asset, scope, query, paginate_options, options) ||
- + fallback_autocomplete(asset, scope, query, paginate_options, options)
- + end
- +
- + def fallback_autocomplete asset, scope, query, paginate_options, options
- + field = options[:field]
- + query = query.downcase
- + scope.where([
- + "LOWER(#{field}) ILIKE ? OR #{field}) ILIKE ?", "#{query}%", "% #{query}%"
- + ])
- + {:results => scope.paginate(paginate_options)}
- + end
- +
- def find_by_contents(asset, context, scope, query, paginate_options={:page => 1}, options={})
- + scope = scope.with_templates(options[:template_id]) unless options[:template_id].blank?
- search = plugins.dispatch_first(:find_by_contents, asset, scope, query, paginate_options, options)
- register_search_term(query, scope.count, search[:results].count, context, asset)
- search
- diff --cc app/helpers/application_helper.rb
- index d72a340,27c63f4..6601a4d
- --- a/app/helpers/application_helper.rb
- +++ b/app/helpers/application_helper.rb
- @@@ -693,6 -707,24 +710,24 @@@ module ApplicationHelpe
- javascript_include_tag script if script
- end
- + def template_path
- + if profile.nil?
- + "/designs/templates/#{environment.layout_template}"
- + else
- + "/designs/templates/#{profile.layout_template}"
- + end
- + end
- +
- + def template_javascript_src
- + script = File.join template_path, '/javascripts/template.js'
- + script if File.exists? File.join(Rails.root, 'public', script)
- + end
- +
- - def templete_javascript_ng
- ++ def template_javascript_ng
- + script = template_javascript_src
- + javascript_include_tag script if script
- + end
- +
- def file_field_or_thumbnail(label, image, i)
- display_form_field label, (
- render :partial => (image && image.valid? ? 'shared/show_thumbnail' : 'shared/change_image'),
- diff --cc app/helpers/layout_helper.rb
- index bf61b41,1139aba..a5d859a
- --- a/app/helpers/layout_helper.rb
- +++ b/app/helpers/layout_helper.rb
- @@@ -29,7 -28,7 +29,7 @@@ module LayoutHelpe
- end
- def noosfero_javascript
- - plugins_javascripts = @plugins.map { |plugin| [plugin.js_files].flatten.map { |js| plugin.class.public_path(js, true) } }.flatten
- - plugins_javascripts = @plugins.flat_map{ |plugin| Array.wrap(plugin.js_files).map{ |js| plugin.class.public_path(js, true) } }.flatten
- ++ plugins_javascripts = @plugins.flat_map{ |plugin| Array.wrap(plugin.js_files).map{ |js| plugin.class.public_path(js, true) } }
- output = ''
- output += render 'layouts/javascript'
- @@@ -39,7 -38,8 +39,8 @@@
- output += theme_javascript_ng.to_s
- output += javascript_tag 'render_all_jquery_ui_widgets()'
- - output += javascript_tag 'render_all_jquery_ui_widgets()'
- - output += templete_javascript_ng.to_s
- ++ output += template_javascript_ng.to_s
- +
- output
- end
- diff --cc app/helpers/plugins_helper.rb
- index c9a53f6,4b3074a..089042d
- --- a/app/helpers/plugins_helper.rb
- +++ b/app/helpers/plugins_helper.rb
- @@@ -8,43 -6,11 +8,46 @@@ module PluginsHelpe
- end
- end
- - def plugins_article_toolbar_actions
- - @plugins.dispatch(:article_toolbar_actions, @page).collect { |content| instance_exec(&content) }.join ""
- - end
- -
- + def plugins_catalog_search_extras_begin
- + @plugins.dispatch(:catalog_search_extras_begin).map do |content|
- + instance_exec(&content)
- + end.join
- + end
- +
- + def plugins_catalog_search_extras_end
- + @plugins.dispatch(:catalog_search_extras_end).map do |content|
- + instance_exec(&content)
- + end.join
- + end
- +
- + def plugins_catalog_autocomplete_item_extras product
- + @plugins.dispatch(:catalog_autocomplete_item_extras, product).map do |content|
- + instance_exec(&content)
- + end.join
- + end
- +
- + def plugins_search_order asset
- + @plugins.dispatch_first :search_order, asset
- + end
- +
- + def plugins_search_pre_contents
- + @plugins.dispatch(:search_pre_contents).map do |content|
- + instance_exec(&content)
- + end.join
- + end
- -
- ++
- + def plugins_search_post_contents
- + @plugins.dispatch(:search_post_contents).map do |content|
- + instance_exec(&content)
- + end.join
- + end
- +
- + def plugins_toolbar_actions_for_article(article)
- + toolbar_actions = Array.wrap(@plugins.dispatch(:article_extra_toolbar_buttons, article))
- + toolbar_actions.each do |action|
- + [:title, :url, :icon].each { |param| raise "No #{param} was passed as parameter for #{action}" unless action.has_key?(param) }
- + end
- + end
- +
- end
- +
- diff --cc app/models/article.rb
- index d619e5f,6899eac..4a92b23
- --- a/app/models/article.rb
- +++ b/app/models/article.rb
- @@@ -5,11 -5,10 +5,11 @@@ class Article < ActiveRecord::Bas
- :allow_members_to_edit, :translation_of_id, :language,
- :license_id, :parent_id, :display_posts_in_current_language,
- :category_ids, :posts_per_page, :moderate_comments,
- - :accept_comments, :feed, :published, :source,
- + :accept_comments, :feed, :published, :source, :source_name,
- :highlighted, :notify_comments, :display_hits, :slug,
- :external_feed_builder, :display_versions, :external_link,
- - :image_builder, :show_to_followers
- + :image_builder, :show_to_followers, :published_at,
- + :author, :created_by, :last_changed_by
- acts_as_having_image
- @@@ -729,8 -724,9 +740,9 @@@
- paragraphs.empty? ? '' : paragraphs.first.to_html
- end
- - def lead
- - abstract.blank? ? automatic_abstract : abstract.html_safe
- + def lead(length = nil)
- - content = abstract.blank? ? first_paragraph.html_safe : abstract.html_safe
- ++ content = abstract.blank? ? automatic_abstract.html_safe : abstract.html_safe
- + length.present? ? content.truncate(length) : content
- end
- def short_lead
- @@@ -785,7 -781,9 +797,10 @@@
- end
- def first_image
- - img = Nokogiri::HTML.fragment(self.abstract.to_s).css('img[src]').first || Nokogiri::HTML.fragment(self.body.to_s).search('img').first
- + img = ( image.present? && { 'src' => image.public_filename } ) ||
- - Nokogiri::HTML.fragment(self.lead.to_s).css('img[src]').first ||
- ++ # automatic_abstract conflict, this leads to infinite loop
- ++ #Nokogiri::HTML.fragment(self.lead.to_s).css('img[src]').first ||
- + Nokogiri::HTML.fragment(self.body.to_s).search('img').first
- img.nil? ? '' : img['src']
- end
- diff --cc app/models/profile.rb
- index 14f5953,7c5a0e9..9ed7136
- --- a/app/models/profile.rb
- +++ b/app/models/profile.rb
- @@@ -318,11 -333,13 +337,13 @@@ class Profile < ActiveRecord::Bas
- end
- validates_presence_of :identifier, :name
- - validates_format_of :identifier, :with => IDENTIFIER_FORMAT, :if => lambda { |profile| !profile.identifier.blank? }
- - validates_exclusion_of :identifier, :in => RESERVED_IDENTIFIERS
- - validates_uniqueness_of :identifier, :scope => :environment_id
- - validates_length_of :nickname, :maximum => 16, :allow_nil => true
- + validates_length_of :nickname, :maximum => 40, :allow_nil => true
- validate :valid_template
- + validate :valid_identifier
- +
- + def valid_identifier
- + errors.add(:identifier, _('is not available.')) unless Profile.is_available?(identifier, environment, id)
- + end
- def valid_template
- if template_id.present? && template && !template.is_template
- diff --cc app/views/blocks/profile_info_actions/_join_leave_community.html.erb
- index 1ecd22e,787a8eb..949d9fa
- --- a/app/views/blocks/profile_info_actions/_join_leave_community.html.erb
- +++ b/app/views/blocks/profile_info_actions/_join_leave_community.html.erb
- @@@ -1,21 -1,27 +1,21 @@@
- - <div class='join-leave-button'>
- + <div class='join-leave-button require-login-popup'>
- - <% if logged_in? %>
- - <% if profile.members.include?(user) %>
- + <% if logged_in? and not profile.already_request_membership? user %>
- + <% if user.in? profile.members %>
- <%= button(:delete, content_tag('span', _('Leave community')), profile.leave_url,
- - :class => 'leave-community',
- - :title => _("Leave community"),
- - :style => 'position: relative;') %>
- - <%= button(:add, content_tag('span', _('Join')), profile.join_url,
- - :class => 'join-community',
- - :title => _("Join community"),
- - :style => 'position: relative; display: none;') %>
- + class: 'leave-community',
- + title: _("Leave community"),
- + style: 'position: relative;') %>
- + <%= button(:add, content_tag('span', _('Join this community')), profile.join_url,
- + class: 'join-community',
- + title: _("Join community"),
- + style: 'position: relative; display: none;') %>
- <% else %>
- - <% unless profile.already_request_membership?(user) %>
- - <%= button(:delete, content_tag('span', _('Leave community')), profile.leave_url,
- - :class => 'leave-community',
- - :title => _("Leave community"),
- - :style => 'position: relative; display: none;') %>
- - <%= button(:add, content_tag('span', _('Join')), profile.join_url,
- - :class => 'join-community',
- - :title => _("Join community"),
- - :style => 'position: relative;') %>
- - <% end %>
- + <%= button :add, _('Join this community'), profile.join_not_logged_url, title: _('Join this community'), class: 'join-community' %>
- <% end %>
- - <% else %>
- - <%= button(:add, _('Join'), profile.join_not_logged_url, :title => _('Join this community')) %>
- <% end %>
- </div>
- +
- +<%= javascript_tag do %>
- + noosfero.add_and_join.locales.leaveConfirmation = <%= (_("Please confirm to leave the community '%{name}'") % {name: profile.name}).to_json %>
- +<% end %>
- +
- diff --cc app/views/box_organizer/edit.html.erb
- index f9b9619,031946b..f866ba9
- --- a/app/views/box_organizer/edit.html.erb
- +++ b/app/views/box_organizer/edit.html.erb
- @@@ -3,14 -3,8 +3,8 @@@
- <%= form_tag(:action => 'save', :id => @block.id) do %>
- - <%= labelled_form_field(_('Custom title for this block: '), text_field(:block, :title, :maxlength => 20)) %>
- + <%= labelled_form_field(_('Custom title for this block: '), text_field(:block, :title, :maxlength => 25)) %>
- - <% if environment.admins.include?(user) %>
- - <div class="fixed_block">
- - <%= labelled_check_box(_("Fixed"), "block[fixed]", value = "1", checked = @block.fixed) %>
- - </div>
- - <% end %>
- -
- <%= render :partial => partial_for_class(@block.class) %>
- <div class="display">
- diff --cc app/views/cms/_forum.html.erb
- index 20f8495,621d78e..cd1430e
- --- a/app/views/cms/_forum.html.erb
- +++ b/app/views/cms/_forum.html.erb
- @@@ -2,9 -2,11 +2,11 @@@
- <h1><%= _('My Forum') %></h1>
- + <%= required_fields_message %>
- +
- <%= render :file => 'shared/tiny_mce' %>
- -<%= required f.text_field(:name, :size => '64', :maxlength => 150, :onchange => "updateUrlField(this, 'article_slug')") %>
- +<%= required f.text_field(:name, :size => '64', :maxlength => 150, :onchange => "updateUrlField(this, '#article_slug')") %>
- <%= render :partial => 'general_fields' %>
- diff --cc app/views/cms/suggest_an_article.html.erb
- index 507a6e3,885db31..156ad4a
- --- a/app/views/cms/suggest_an_article.html.erb
- +++ b/app/views/cms/suggest_an_article.html.erb
- @@@ -20,7 -21,7 +21,7 @@@
- <%= hidden_field_tag('back_to', @back_to) %>
- - <%= render 'shared/captcha' %>
- - <%= recaptcha_tags(:display => { :theme => 'clean' }, :ajax => true) unless logged_in? %>
- ++ <%= render 'shared/captcha' unless logged_in? %>
- <% button_bar do %>
- <%= submit_button :save, _('Save') %>
- diff --cc app/views/content_viewer/_article_toolbar.html.erb
- index dd2b438,2dbc1ee..a3aa490
- --- a/app/views/content_viewer/_article_toolbar.html.erb
- +++ b/app/views/content_viewer/_article_toolbar.html.erb
- @@@ -55,9 -62,9 +62,9 @@@
- <% if @page.blog? and !@page.image.nil? %>
- <div class="blog-cover"><%= image_tag(@page.image.public_filename())%></div>
- <% end %>
- - <%= link_to(image_tag('/images/icons-mime/rss-feed.png'), @page.feed.url, :class => 'blog-feed-link') if @page.has_posts? && @page.feed %>
- + <%= button_without_text('feed', _('RSS feed'), @page.feed.url, :class => 'blog-feed-link') if @page.has_posts? && @page.feed %>
- <%= @plugins.dispatch(:article_header_extra_contents, @page).collect { |content| instance_exec(&content) }.join("") %>
- - <%= article_title(@page, :no_link => true) %>
- + <%= render :partial => 'article_title', :locals => {:no_link => true} %>
- <%= article_translations(@page) %>
- </div>
- </div>
- diff --cc app/views/search/_search_content.html.erb
- index d993ffe,c226a98..1332651
- --- a/app/views/search/_search_content.html.erb
- +++ b/app/views/search/_search_content.html.erb
- @@@ -1,15 -1,10 +1,19 @@@
- <div id='search-content'>
- + <div class='total'>
- + <%= _('Total of %s results ') % @searches[@asset][:results].total_entries.inspect %>
- + </div>
- +
- -<%= display_results(@searches, @asset) %>
- -<% if params[:display] != 'map' %>
- - <%= pagination_links @searches[@asset][:results] %>
- -<% end %>
- + <%= plugins_search_pre_contents %>
- +
- + <% if @asset == :products %>
- + <% @show_supplier = true %>
- + <%= render 'search_products_content' %>
- + <% else %>
- + <%= display_results(@searches, @asset) %>
- + <% if params[:display] != 'map' %>
- + <%= pagination_links @searches[@asset][:results] %>
- + <% end %>
- + <% end %>
- +
- + <%= plugins_search_post_contents %>
- </div>
- diff --cc app/views/search/_search_form.html.erb
- index 3e7dfa1,6ca673f..e1c9c31
- --- a/app/views/search/_search_form.html.erb
- +++ b/app/views/search/_search_form.html.erb
- @@@ -3,18 -3,20 +3,23 @@@
- <%= form_tag( { :controller => 'search', :action => @asset ? @asset : 'index', :asset => nil, :category_path => ( @category ? @category.path : nil ) },
- :method => 'get', :class => 'search_form' ) do %>
- <div id='search-header'>
- + <h1><%= _('Searches') %></h1>
- <%= assets_menu(@asset) %>
- <%= filters(@asset) %>
- + <div class="clear"></div>
- + </div>
- +
- + <div id='search-subheader'>
- + <%= assets_submenu(@asset) %>
- </div>
- - <div class="search-field">
- - <span class="formfield">
- - <%= search_input_with_suggestions('query', @asset, @query, {:id => 'search-input', :size => 50, :placeholder => hint}) %>
- - </span>
- - <%= submit_button(:search, _('Search')) %>
- + <div id='search-box' class="search-field form-group">
- + <div class="formfield input-group">
- + <%= search_input_with_suggestions('query', @asset, @query, {:id => 'search-input', :size => 50, :placeholder => hint}) %>
- + <span class="input-group-btn">
- + <%= submit_button :search, _('Search'), size: 'default' %>
- + </span>
- + </div>
- </div>
- <%= render :partial => 'search_form_extra_fields' %>
- diff --cc app/views/shared/_captcha.html.erb
- index 98bfdf1,0000000..2aea0de
- mode 100644,000000..100644
- --- a/app/views/shared/_captcha.html.erb
- +++ b/app/views/shared/_captcha.html.erb
- @@@ -1,4 -1,0 +1,4 @@@
- - <%= recaptcha_tags :ajax => true, :display => {:theme => 'clean'} %>
- ++<%= recaptcha_tags ajax: true, display: {theme: 'clean'} %>
- +
- +<%= hidden_captcha_field %>
- +
- diff --cc config/environments/production.rb
- index ce2af54,058171f..58e6675
- --- a/config/environments/production.rb
- +++ b/config/environments/production.rb
- @@@ -8,9 -8,9 +8,6 @@@ Noosfero::Application.configure d
- # Full error reports are disabled and caching is turned on
- # config.action_controller.perform_caching = true
- -- # Enable Rails's static asset server (Apache or nginx should do this)
- -- config.serve_static_assets = true
- --
- # Compress JavaScripts and CSS
- config.assets.compress = true
- @@@ -23,10 -23,6 +20,11 @@@
- File.basename file
- end.compact
- + # fallback to assets pipeline if a precompiled asset is missed
- - config.assets.digest = true
- ++ config.serve_static_assets = true
- ++ config.assets.compile = true
- + config.assets.cache_store = :assets_live_compile_store
- +
- # Defaults to nil and saved in location specified by config.assets.prefix
- # config.assets.manifest = YOUR_PATH
- diff --cc config/routes.rb
- index 82c5563,76ca289..522c063
- --- a/config/routes.rb
- +++ b/config/routes.rb
- @@@ -59,48 -55,38 +59,48 @@@ Noosfero::Application.routes.draw d
- # search
- match 'search(/:action(/*category_path))', :controller => 'search'
- + ######################################################
- + # plugin routes
- + # need to come first as 'plugin' will become the :profile parameter when custom domains are used
- + ######################################################
- + plugins_routes = File.join(File.dirname(__FILE__) + '/../lib/noosfero/plugin/routes.rb')
- + eval(IO.read(plugins_routes), binding, plugins_routes)
- +
- # events
- - match 'profile(/:profile)/events_by_day', :controller => 'events', :action => 'events_by_day', :profile => /#{Noosfero.identifier_format}/
- - match 'profile(/:profile)/events_by_month', :controller => 'events', :action => 'events_by_month', :profile => /#{Noosfero.identifier_format}/
- - match 'profile(/:profile)/events/:year/:month/:day', :controller => 'events', :action => 'events', :year => /\d*/, :month => /\d*/, :day => /\d*/, :profile => /#{Noosfero.identifier_format}/
- - match 'profile(/:profile)/events/:year/:month', :controller => 'events', :action => 'events', :year => /\d*/, :month => /\d*/, :profile => /#{Noosfero.identifier_format}/
- - match 'profile(/:profile)/events', :controller => 'events', :action => 'events', :profile => /#{Noosfero.identifier_format}/
- - match 'profile/:profile/events_by_day', :controller => 'events', :action => 'events_by_day', :profile => /#{Noosfero.identifier_format_in_url}/
- - match 'profile/:profile/events_by_month', :controller => 'events', :action => 'events_by_month', :profile => /#{Noosfero.identifier_format_in_url}/
- - match 'profile/:profile/events/:year/:month/:day', :controller => 'events', :action => 'events', :year => /\d*/, :month => /\d*/, :day => /\d*/, :profile => /#{Noosfero.identifier_format_in_url}/
- - match 'profile/:profile/events/:year/:month', :controller => 'events', :action => 'events', :year => /\d*/, :month => /\d*/, :profile => /#{Noosfero.identifier_format_in_url}/
- - match 'profile/:profile/events', :controller => 'events', :action => 'events', :profile => /#{Noosfero.identifier_format_in_url}/
- ++ match 'profile(/:profile)/events_by_day', :controller => 'events', :action => 'events_by_day', :profile => /#{Noosfero.identifier_format_in_url}/
- ++ match 'profile(/:profile)/events_by_month', :controller => 'events', :action => 'events_by_month', :profile => /#{Noosfero.identifier_format_in_url}/
- ++ match 'profile(/:profile)/events/:year/:month/:day', :controller => 'events', :action => 'events', :year => /\d*/, :month => /\d*/, :day => /\d*/, :profile => /#{Noosfero.identifier_format_in_url}/
- ++ match 'profile(/:profile)/events/:year/:month', :controller => 'events', :action => 'events', :year => /\d*/, :month => /\d*/, :profile => /#{Noosfero.identifier_format_in_url}/
- ++ match 'profile(/:profile)/events', :controller => 'events', :action => 'events', :profile => /#{Noosfero.identifier_format_in_url}/
- # catalog
- - match 'profile(/:profile)/catalog(/:action(/:id))', :controller => :catalog, :profile => /#{Noosfero.identifier_format}/, :as => :catalog
- - match 'catalog/:profile', :controller => 'catalog', :action => 'index', :profile => /#{Noosfero.identifier_format_in_url}/, :as => :catalog
- ++ match 'profile(/:profile)/catalog(/:action(/:id))', :controller => :catalog, :profile => /#{Noosfero.identifier_format_in_url}/, :as => :catalog
- + # DEPRECATED
- - match 'catalog(/:profile)', :controller => :catalog, :action => :index, :profile => /#{Noosfero.identifier_format}/, :as => :catalog
- ++ match 'catalog(/:profile)', :controller => :catalog, :action => :index, :profile => /#{Noosfero.identifier_format_in_url}/, :as => :catalog
- # invite
- - match 'profile(/:profile)/invite/friends', :controller => 'invite', :action => 'invite_friends', :profile => /#{Noosfero.identifier_format}/
- - match 'profile(/:profile)/invite/:action', :controller => 'invite', :profile => /#{Noosfero.identifier_format}/
- - match 'profile/:profile/invite/friends', :controller => 'invite', :action => 'invite_friends', :profile => /#{Noosfero.identifier_format_in_url}/
- - match 'profile/:profile/invite/:action', :controller => 'invite', :profile => /#{Noosfero.identifier_format_in_url}/
- ++ match 'profile(/:profile)/invite/friends', :controller => 'invite', :action => 'invite_friends', :profile => /#{Noosfero.identifier_format_in_url}/
- ++ match 'profile(/:profile)/invite/:action', :controller => 'invite', :profile => /#{Noosfero.identifier_format_in_url}/
- # feeds per tag
- - match 'profile(/:profile)/tags/:id/feed', :controller => 'profile', :action =>'tag_feed', :id => /.+/, :profile => /#{Noosfero.identifier_format}/, :as => :tag_feed
- - match 'profile/:profile/tags/:id/feed', :controller => 'profile', :action =>'tag_feed', :id => /.+/, :profile => /#{Noosfero.identifier_format_in_url}/, :as => :tag_feed
- ++ match 'profile(/:profile)/tags/:id/feed', :controller => 'profile', :action =>'tag_feed', :id => /.+/, :profile => /#{Noosfero.identifier_format_in_url}/, :as => :tag_feed
- # profile tags
- - match 'profile(/:profile)/tags/:id', :controller => 'profile', :action => 'content_tagged', :id => /.+/, :profile => /#{Noosfero.identifier_format}/
- - match 'profile(/:profile)/tags(/:id)', :controller => 'profile', :action => 'tags', :profile => /#{Noosfero.identifier_format}/
- - match 'profile/:profile/tags/:id', :controller => 'profile', :action => 'content_tagged', :id => /.+/, :profile => /#{Noosfero.identifier_format_in_url}/
- - match 'profile/:profile/tags(/:id)', :controller => 'profile', :action => 'tags', :profile => /#{Noosfero.identifier_format_in_url}/
- ++ match 'profile(/:profile)/tags/:id', :controller => 'profile', :action => 'content_tagged', :id => /.+/, :profile => /#{Noosfero.identifier_format_in_url}/
- ++ match 'profile(/:profile)/tags(/:id)', :controller => 'profile', :action => 'tags', :profile => /#{Noosfero.identifier_format_in_url}/
- # profile search
- - match 'profile(/:profile)/search', :controller => 'profile_search', :action => 'index', :profile => /#{Noosfero.identifier_format}/
- - match 'profile/:profile/search', :controller => 'profile_search', :action => 'index', :profile => /#{Noosfero.identifier_format_in_url}/
- ++ match 'profile(/:profile)/search', :controller => 'profile_search', :action => 'index', :profile => /#{Noosfero.identifier_format_in_url}/
- # comments
- - match 'profile(/:profile)/comment/:action/:id', :controller => 'comment', :profile => /#{Noosfero.identifier_format}/
- - match 'profile/:profile/comment/:action/:id', :controller => 'comment', :profile => /#{Noosfero.identifier_format_in_url}/
- ++ match 'profile(/:profile)/comment/:action/:id', :controller => 'comment', :profile => /#{Noosfero.identifier_format_in_url}/
- # public profile information
- - match 'profile/:profile(/:action(/:id))', :controller => 'profile', :action => 'index', :id => /[^\/]*/, :profile => /#{Noosfero.identifier_format}/, :as => :profile
- - match 'profile/(/:action(/:id))', :controller => 'profile', :action => 'index', :id => /[^\/]*/, :profile => /#{Noosfero.identifier_format}/, :as => :profile
- + match 'profile/:profile(/:action(/:id))', :controller => 'profile', :action => 'index', :id => /[^\/]*/, :profile => /#{Noosfero.identifier_format_in_url}/, :as => :profile
- ++ match 'profile/(/:action(/:id))', :controller => 'profile', :action => 'index', :id => /[^\/]*/, :profile => /#{Noosfero.identifier_format_in_url}/, :as => :profile
- # contact
- - match 'contact(/:profile)/:action(/:id)', :controller => 'contact', :action => 'index', :id => /.*/, :profile => /#{Noosfero.identifier_format}/
- - match 'contact/:profile/:action(/:id)', :controller => 'contact', :action => 'index', :id => /.*/, :profile => /#{Noosfero.identifier_format_in_url}/
- ++ match 'contact(/:profile)/:action(/:id)', :controller => 'contact', :action => 'index', :id => /.*/, :profile => /#{Noosfero.identifier_format_in_url}/
- # map balloon
- match 'map_balloon/:action/:id', :controller => 'map_balloon', :id => /.*/
- @@@ -112,8 -98,9 +112,8 @@@
- ## Controllers that are profile-specific (for profile admins )
- ######################################################
- # profile customization - "My profile"
- - match 'myprofile(/:profile)/:controller(/:action(/:id))', :controller => Noosfero.pattern_for_controllers_in_directory('my_profile'), :profile => /#{Noosfero.identifier_format}/, :as => :myprofile
- - match 'myprofile(/:profile)', :controller => 'profile_editor', :action => 'index', :profile => /#{Noosfero.identifier_format}/
- - match 'myprofile/:profile', :controller => 'profile_editor', :action => 'index', :profile => /#{Noosfero.identifier_format_in_url}/
- - match 'myprofile/:profile/:controller(/:action(/:id))', :controller => Noosfero.pattern_for_controllers_in_directory('my_profile'), :profile => /#{Noosfero.identifier_format_in_url}/, :as => :myprofile
- -
- ++ match 'myprofile(/:profile)/:controller(/:action(/:id))', :controller => Noosfero.pattern_for_controllers_in_directory('my_profile'), :profile => /#{Noosfero.identifier_format_in_url}/, :as => :myprofile
- ++ match 'myprofile(/:profile)', :controller => 'profile_editor', :action => 'index', :profile => /#{Noosfero.identifier_format_in_url}/
- ######################################################
- ## Controllers that are used by environment admin
- diff --cc db/migrate/20140820173129_create_chat_messages.rb
- index 0000000,6193098..33623d6
- mode 000000,100644..100644
- --- a/db/migrate/20140820173129_create_chat_messages.rb
- +++ b/db/migrate/20140820173129_create_chat_messages.rb
- @@@ -1,0 -1,15 +1,18 @@@
- + class CreateChatMessages < ActiveRecord::Migration
- + def up
- + create_table :chat_messages do |t|
- + t.integer :to_id
- + t.integer :from_id
- + t.string :body
- +
- + t.timestamps
- + end
- ++ add_index :chat_messages, :from_id
- ++ add_index :chat_messages, :to_id
- ++ add_index :chat_messages, :created_at
- + end
- +
- + def down
- + drop_table :chat_messages
- + end
- + end
- diff --cc db/schema.rb
- index 403fd6d,b2e1c73..e0ade14
- --- a/db/schema.rb
- +++ b/db/schema.rb
- @@@ -199,37 -203,7 +202,43 @@@ ActiveRecord::Schema.define(:version =
- t.integer "position"
- end
- - add_index "boxes", ["owner_id", "owner_type"], :name => "index_boxes_on_owner_type_and_owner_id"
- + add_index "boxes", ["owner_type", "owner_id"], :name => "index_boxes_on_owner_type_and_owner_id"
- +
- ++ create_table "br_nivel2", :id => false, :force => true do |t|
- ++ t.string "cidade"
- ++ t.float "lat"
- ++ t.float "lng"
- ++ end
- ++
- + create_table "bsc_plugin_contracts", :force => true do |t|
- + t.string "client_name"
- + t.integer "client_type"
- + t.integer "business_type"
- + t.string "state"
- + t.string "city"
- + t.integer "status", :default => 0
- + t.integer "number_of_producers", :default => 0
- + t.datetime "supply_start"
- + t.datetime "supply_end"
- + t.text "annotations"
- + t.integer "bsc_id"
- + t.datetime "created_at"
- + t.datetime "updated_at"
- + end
- +
- + create_table "bsc_plugin_contracts_enterprises", :id => false, :force => true do |t|
- + t.integer "contract_id"
- + t.integer "enterprise_id"
- + end
- +
- + create_table "bsc_plugin_sales", :force => true do |t|
- + t.integer "product_id", :null => false
- + t.integer "contract_id", :null => false
- + t.integer "quantity", :null => false
- + t.decimal "price"
- + t.datetime "created_at"
- + t.datetime "updated_at"
- + end
- create_table "categories", :force => true do |t|
- t.string "name"
- @@@ -274,50 -245,17 +283,54 @@@
- end
- create_table "chat_messages", :force => true do |t|
- - t.integer "to_id"
- - t.integer "from_id", :null => false
- - t.integer "to_id", :null => false
- + t.integer "from_id"
- - t.string "body"
- ++ t.integer "to_id"
- + t.text "body"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
- + add_index "chat_messages", ["created_at"], :name => "index_chat_messages_on_created_at"
- + add_index "chat_messages", ["from_id"], :name => "index_chat_messages_on_from_id"
- + add_index "chat_messages", ["to_id"], :name => "index_chat_messages_on_to_id"
- +
- + create_table "comment_classification_plugin_comment_label_user", :force => true do |t|
- + t.integer "profile_id"
- + t.integer "comment_id"
- + t.integer "label_id"
- + t.datetime "created_at"
- + t.datetime "updated_at"
- + end
- +
- + create_table "comment_classification_plugin_comment_status_user", :force => true do |t|
- + t.integer "profile_id"
- + t.integer "comment_id"
- + t.integer "status_id"
- + t.text "reason"
- + t.datetime "created_at"
- + t.datetime "updated_at"
- + end
- +
- + create_table "comment_classification_plugin_labels", :force => true do |t|
- + t.string "name"
- + t.string "color"
- + t.boolean "enabled", :default => true
- + t.integer "owner_id"
- + t.string "owner_type"
- + t.datetime "created_at"
- + t.datetime "updated_at"
- + end
- +
- + create_table "comment_classification_plugin_statuses", :force => true do |t|
- + t.string "name"
- + t.boolean "enabled", :default => true
- + t.boolean "enable_reason", :default => true
- + t.integer "owner_id"
- + t.string "owner_type"
- + t.datetime "created_at"
- + t.datetime "updated_at"
- + end
- +
- create_table "comments", :force => true do |t|
- t.string "title"
- t.text "body"
- @@@ -332,7 -270,7 +345,8 @@@
- t.string "source_type"
- t.string "user_agent"
- t.string "referrer"
- + t.integer "group_id"
- + t.text "settings"
- end
- add_index "comments", ["source_id", "spam"], :name => "index_comments_on_source_id_and_spam"
- @@@ -468,14 -324,14 +482,15 @@@
- t.text "terms_of_use_acceptance_text"
- t.datetime "created_at"
- t.datetime "updated_at"
- + t.text "send_email_plugin_allow_to"
- - t.integer "reports_lower_bound", :default => 0, :null => false
- + t.integer "reports_lower_bound", :default => 0, :null => false
- - t.string "redirection_after_login", :default => "keep_on_same_page"
- - t.text "signup_welcome_text"
- t.string "languages"
- t.string "default_language"
- + t.string "redirection_after_login", :default => "keep_on_same_page"
- + t.text "signup_welcome_text"
- t.string "noreply_email"
- t.string "redirection_after_signup", :default => "keep_on_same_page"
- + t.string "date_format", :default => "month_name_with_year"
- end
- create_table "external_feeds", :force => true do |t|
- @@@ -937,25 -529,23 +953,26 @@@
- t.date "birth_date"
- t.integer "preferred_domain_id"
- t.datetime "updated_at"
- - t.boolean "visible", :default => true
- + t.boolean "visible", :default => true
- t.integer "image_id"
- - t.boolean "validated", :default => true
- + t.integer "bsc_id"
- + t.string "company_name"
- + t.boolean "validated", :default => true
- t.string "cnpj"
- t.string "national_region_code"
- - t.boolean "is_template", :default => false
- + t.boolean "is_template", :default => false
- t.integer "template_id"
- t.string "redirection_after_login"
- - t.integer "friends_count", :default => 0, :null => false
- - t.integer "members_count", :default => 0, :null => false
- - t.integer "activities_count", :default => 0, :null => false
- + t.integer "friends_count", :default => 0, :null => false
- + t.integer "members_count", :default => 0, :null => false
- + t.integer "activities_count", :default => 0, :null => false
- t.string "personal_website"
- t.string "jabber_id"
- + t.string "usp_id"
- t.integer "welcome_page_id"
- - t.boolean "allow_members_to_invite", :default => true
- - t.boolean "invite_friends_only", :default => false
- - t.boolean "secret", :default => false
- + t.boolean "allow_members_to_invite", :default => true
- + t.boolean "invite_friends_only", :default => false
- ++ t.boolean "secret", :default => false
- end
- add_index "profiles", ["activities_count"], :name => "index_profiles_on_activities_count"
- @@@ -1010,15 -596,13 +1027,16 @@@
- t.boolean "is_global"
- end
- + add_index "role_assignments", ["accessor_id", "accessor_type"], :name => "index_role_assignments_on_accessor_id_and_accessor_type"
- + add_index "role_assignments", ["resource_id", "resource_type"], :name => "index_role_assignments_on_resource_id_and_resource_type"
- +
- create_table "roles", :force => true do |t|
- t.string "name"
- + t.text "permissions"
- t.string "key"
- t.boolean "system", :default => false
- - t.text "permissions"
- t.integer "environment_id"
- + t.integer "profile_id"
- end
- create_table "scraps", :force => true do |t|
- @@@ -1183,8 -691,9 +1201,10 @@@
- t.datetime "created_at"
- t.string "target_type"
- t.integer "image_id"
- + t.integer "bsc_id"
- - t.boolean "spam", :default => false
- + t.boolean "spam", :default => false
- + t.integer "responsible_id"
- + t.integer "closed_by_id"
- end
- add_index "tasks", ["requestor_id"], :name => "index_tasks_on_requestor_id"
- diff --cc lib/noosfero.rb
- index 0fbe10b,b1ae492..23f3036
- --- a/lib/noosfero.rb
- +++ b/lib/noosfero.rb
- @@@ -54,9 -54,15 +54,15 @@@ module Noosfer
- end
- def self.identifier_format
- - '[a-z0-9][a-z0-9~.]*([_\-][a-z0-9~.]+)*'
- + '[a-z0-9][a-z0-9~.]*([_\-][a-z0-9~.|:*]+)*'
- end
- + # All valid identifiers, plus ~ meaning "the current user". See
- + # ApplicationController#redirect_to_current_user
- + def self.identifier_format_in_url
- + "(#{identifier_format}|~)"
- + end
- +
- def self.default_hostname
- Environment.table_exists? && Environment.default ? Environment.default.default_hostname : 'localhost'
- end
- diff --cc lib/noosfero/plugin.rb
- index f410b71,4d33221..e810252
- --- a/lib/noosfero/plugin.rb
- +++ b/lib/noosfero/plugin.rb
- @@@ -10,6 -9,10 +10,10 @@@ class Noosfero::Plugi
- self.context = context
- end
- + def environment
- - context.environment if self.context
- ++ context.send :environment if self.context
- + end
- +
- class << self
- include Noosfero::Plugin::ParentMethods
- diff --cc lib/noosfero/plugin/hot_spot/definitions.rb
- index 81feb72,0000000..f20961a
- mode 100644,000000..100644
- --- a/lib/noosfero/plugin/hot_spot/definitions.rb
- +++ b/lib/noosfero/plugin/hot_spot/definitions.rb
- @@@ -1,529 -1,0 +1,549 @@@
- +
- +module Noosfero
- + class Plugin
- + module HotSpot
- + module Definitions
- +
- + # -> Adds buttons to the control panel
- + # returns = { :title => title, :icon => icon, :url => url }
- + # title = name that will be displayed.
- + # icon = css class name (for customized icons include them in a css file).
- + # url = url or route to which the button will redirect.
- + # html_options = aditional html options.
- + def control_panel_buttons
- + nil
- + end
- +
- + # -> Customize profile block design and behavior
- + # (overwrites profile_image_link function)
- + # returns = lambda block that creates html code.
- + def profile_image_link(profile, size, tag, extra_info)
- + nil
- + end
- +
- + # -> Adds tabs to the profile
- + # returns = { :title => title, :id => id, :content => content, :start => start }
- + # title = name that will be displayed.
- + # id = div id.
- + # content = lambda block that creates html code.
- + # start = boolean that specifies if the tab must come before noosfero tabs (optional).
- + def profile_tabs
- + nil
- + end
- +
- + # -> Adds new block types in profile
- + # returs = class implements Block
- + def profile_blocks(profile)
- + nil
- + end
- +
- + # -> Adds plugin-specific content types to CMS
- + # returns = [ContentClass1, ContentClass2, ...]
- + def content_types
- + nil
- + end
- +
- + # -> Adds tabs to the products
- + # returns = { :title => title, :id => id, :content => content }
- + # title = name that will be displayed.
- + # id = div id.
- + # content = lambda block that creates html code.
- + def product_tabs product
- + nil
- + end
- +
- + # -> Adds content to calalog item
- + # returns = lambda block that creates html code
- + def catalog_item_extras(item)
- + nil
- + end
- +
- + # -> Allows to add content to the beginning of the catalog top bar
- + # returns = lambda block that creates array of html codes
- + def catalog_search_extras_begin
- + nil
- + end
- +
- + # -> Allows to add content to the endof the catalog top bar
- + # returns = lambda block that creates array of html codes
- + def catalog_search_extras_end
- + nil
- + end
- +
- + # -> Adds content to add to each autocompleted item on search
- + # returns = lambda block that creates html code
- + def catalog_autocomplete_item_extras product
- + nil
- + end
- +
- ++ # -> Filters the types of organizations that are shown on manage organizations
- ++ # returns a scope filtered by the specified type
- ++ def filter_manage_organization_scope type
- ++ nil
- ++ end
- ++
- ++ # -> Add new options for manage organization filters
- ++ # returns an array of new options
- ++ # i.e [[_('Type'), 'type'], [_('Type2'), 'type2']]
- ++ def organization_types_filter_options
- ++ nil
- ++ end
- ++
- + # -> Adds content to profile editor info and settings
- + # returns = lambda block that creates html code or raw rhtml/html.erb
- + def profile_editor_extras
- + nil
- + end
- +
- + # -> Adds content to catalog list item
- + # returns = lambda block that creates html code
- + def catalog_list_item_extras(item)
- + nil
- + end
- +
- + # -> Adds content to products info
- + # returns = lambda block that creates html code
- + def product_info_extras(product)
- + nil
- + end
- +
- + # -> Adds content to products on asset list
- + # returns = lambda block that creates html code
- + def asset_product_extras(product)
- + nil
- + end
- +
- + # -> Adds a property to the product on asset products
- + # returns = {:name => name, :content => content}
- + # name = Name of the property
- + # content = lambda block that creates an html
- + def asset_product_properties(product)
- + nil
- + end
- +
- + # -> Adds content to the beginning of the page
- + # returns = lambda block that creates html code or raw rhtml/html.erb
- + def body_beginning
- + nil
- + end
- +
- + # -> Adds content to the ending of the page
- + # returns = lambda block that creates html code or raw rhtml/html.erb
- + def body_ending
- + nil
- + end
- +
- + # -> Adds content to the ending of the page head
- + # returns = lambda block that creates html code or raw rhtml/html.erb
- + def head_ending
- + nil
- + end
- +
- + # -> Adds plugins' javascript files to application
- + # returns = ['example1.js', 'javascripts/example2.js', 'example3.js']
- + def js_files
- + []
- + end
- +
- + # -> Adds stuff in user data hash
- + # returns = { :some_data => some_value, :another_data => another_value }
- + def user_data_extras
- + {}
- + end
- +
- + # -> Parse and possibly make changes of content (article, block, etc) during HTML rendering
- + # returns = content as string after parser and changes
- + def parse_content(html, source)
- + [html, source]
- + end
- +
- + # -> Adds links to the admin panel
- + # returns = {:title => title, :url => url}
- + # title = name that will be displayed in the link
- + # url = url or route to which the link will redirect to.
- + def admin_panel_links
- + nil
- + end
- +
- + # -> Adds buttons to manage members page
- + # returns = { :title => title, :icon => icon, :url => url }
- + # title = name that will be displayed.
- + # icon = css class name (for customized icons include them in a css file).
- + # url = url or route to which the button will redirect.
- + def manage_members_extra_buttons
- + nil
- + end
- +
- + # This method will be called just before a comment is saved to the database.
- + #
- + # It can modify the comment in several ways. In special, a plugin can call
- + # reject! on the comment and that will cause the comment to not be saved.
- + #
- + # example:
- + #
- + # def filter_comment(comment)
- + # if user_not_logged_in
- + # comment.reject!
- + # end
- + # end
- + #
- + def filter_comment(comment)
- + end
- +
- + # Define custom logic to filter loaded comments.
- + #
- + # Example:
- + #
- + # def unavailable_comments(scope)
- + # scope.without_spams
- + # end
- + #
- + def unavailable_comments(scope)
- + scope
- + end
- +
- + # -> Allows plugins to check weather object is a spam
- + def check_for_spam(object)
- + end
- +
- + # -> Allows plugins to know when an object is marked as a spam
- + def marked_as_spam(object)
- + end
- +
- + # -> Allows plugins to know when an object is marked as a ham
- + def marked_as_ham(object)
- + end
- +
- + # Adds extra actions for comments
- + # returns = list of hashes or lambda block that creates a list of hashes
- + # example:
- + #
- + # def comment_actions(comment)
- + # [{:link => link_to_function(...)}]
- + # end
- + #
- + def comment_actions(comment)
- + nil
- + end
- +
- + # This method is called when the user click on comment actions menu.
- + # returns = list or lambda block that return ids of enabled menu items for comments
- + # example:
- + #
- + # def check_comment_actions(comment)
- + # ['#action1', '#action2']
- + # end
- + #
- + def check_comment_actions(comment)
- + []
- + end
- +
- - # -> Adds aditional actions to article
- - # returns = lambda block that creates html code
- - def article_toolbar_actions article
- - nil
- ++ # -> Adds aditional action buttons to article
- ++ # returns = { :title => title, :icon => icon, :url => url, :html_options => {} }
- ++ # title = name that will be displayed.
- ++ # icon = css class name (for customized icons include them in a css file).
- ++ # url = url or route to which the button will redirect.
- ++ # html_options = Html options for customization
- ++ #
- ++ # Multiple values could be passed as parameter.
- ++ # returns = [{:title => title, :icon => icon}, {:title => title, :icon => icon}]
- ++ def article_extra_toolbar_buttons(article)
- ++ []
- + end
- +
- + # -> Adds aditional content to article
- + # returns = lambda block that creates html code
- + def article_extra_contents(article)
- + nil
- + end
- +
- + # -> Adds adicional fields to a view
- + # returns = proc block that creates html code
- + def upload_files_extra_fields(article)
- + nil
- + end
- +
- + # -> Adds fields to the signup form
- + # returns = proc that creates html code
- + def signup_extra_contents
- + nil
- + end
- +
- + # -> Adds adicional content to profile info
- + # returns = lambda block that creates html code
- + def profile_info_extra_contents
- + nil
- + end
- +
- + # -> Removes the invite friend button from the friends controller
- + # returns = boolean
- + def remove_invite_friends_button
- + nil
- + end
- +
- + # -> Extends organization list of members
- + # returns = An instance of ActiveRecord::NamedScope::Scope retrieved through
- + # Person.members_of method.
- + def organization_members(organization)
- + nil
- + end
- +
- + # -> Extends person memberships list
- + # returns = An instance of ActiveRecord::NamedScope::Scope retrived through
- + # Person.memberships_of method.
- + def person_memberships(person)
- + nil
- + end
- +
- + # -> Extends person permission access
- + # returns = boolean
- + def has_permission?(person, permission, target)
- + nil
- + end
- +
- + # -> Adds hidden_fields to the new community view
- + # returns = {key => value}
- + def new_community_hidden_fields
- + nil
- + end
- +
- + # -> Adds hidden_fields to the enterprise registration view
- + # returns = {key => value}
- + def enterprise_registration_hidden_fields
- + nil
- + end
- +
- + # -> Add an alternative authentication method.
- + # Your plugin have to make the access control and return the logged user.
- + # returns = User
- + def alternative_authentication
- + nil
- + end
- +
- + # -> Adds adicional link to make the user authentication
- + # returns = lambda block that creates html code
- + def alternative_authentication_link
- + nil
- + end
- +
- + # -> Allow or not user registration
- + # returns = boolean
- + def allow_user_registration
- + true
- + end
- +
- + # -> Allow or not password recovery by users
- + # returns = boolean
- + def allow_password_recovery
- + true
- + end
- +
- + # -> Adds fields to the login form
- + # returns = proc that creates html code
- + def login_extra_contents
- + nil
- + end
- +
- + # -> Adds adicional content to comment form
- + # returns = lambda block that creates html code
- + def comment_form_extra_contents(args)
- + nil
- + end
- +
- + # -> Adds adicional content to article header
- + # returns = lambda block that creates html code
- + def article_header_extra_contents(article)
- + nil
- + end
- +
- + # -> Adds adittional content to comment visualization
- + # returns = lambda block that creates html code
- + def comment_extra_contents(args)
- + nil
- + end
- +
- + # This method is called when the user clicks to send a comment.
- + # A plugin can add new content to comment form and this method can process the params sent to avoid creating field on core tables.
- + # returns = params after processed by plugins
- + # example:
- + #
- + # def process_extra_comment_params(params)
- + # params.delete(:extra_field)
- + # end
- + #
- + def process_extra_comment_params(params)
- + params
- + end
- +
- + # -> Auto complete search
- + # returns = {:results => [a, b, c, ...], ...}
- + # P.S.: The plugin might add other informations on the return hash for its
- + # own use in specific views
- + def autocomplete asset, scope, query, paginate_options={:page => 1}, options={:field => 'name'}
- + end
- +
- + # -> Specify order options for the search engine
- + # returns = { select_options: [['Name', 'key'], ['Name2', 'key2']] }
- + def search_order asset
- + nil
- + end
- +
- + # -> Add column before search results
- + # returns = lambda block that creates html code
- + def search_pre_contents
- + nil
- + end
- +
- + # -> Add content after search results
- + # returns = lambda block that creates html code
- + def search_post_contents
- + nil
- + end
- +
- + # -> Finds objects by their contents
- + # returns = {:results => [a, b, c, ...], ...}
- + # P.S.: The plugin might add other informations on the return hash for its
- + # own use in specific views
- + def find_by_contents(asset, scope, query, paginate_options={}, options={})
- + scope = scope.like_search(query, options) unless query.blank?
- + scope = scope.send(options[:filter]) unless options[:filter].blank?
- + {:results => scope.paginate(paginate_options)}
- + end
- +
- + # -> Suggests terms based on asset and query
- + # returns = [a, b, c, ...]
- + def find_suggestions(query, context, asset, options={:limit => 5})
- + context.search_terms.
- + where(:asset => asset).
- + where("search_terms.term like ?", "%#{query}%").
- + where('search_terms.score > 0').
- + order('search_terms.score DESC').
- + limit(options[:limit]).map(&:term)
- + end
- +
- + # -> Adds aditional fields for change_password
- + # returns = [{:field => 'field1', :name => 'field 1 name', :model => 'person'}, {...}]
- + def change_password_fields
- + nil
- + end
- +
- + # -> Perform extra transactions related to profile in profile editor
- + # returns = true in success or raise and exception if it could not update the data
- + def profile_editor_transaction_extras
- + nil
- + end
- +
- + # -> Return a list of hashs with the needed information to create optional fields
- + # returns = a list of hashs as {:name => "string", :label => "string", :object_name => :key, :method => :key}
- + def extra_optional_fields
- + []
- + end
- +
- + # -> Adds css class to <html> tag
- + # returns = ['class1', 'class2']
- + def html_tag_classes
- + nil
- + end
- +
- + # -> Adds additional blocks to profiles and environments.
- + # Your plugin must implements a class method called 'extra_blocks'
- + # that returns a hash with the following syntax.
- + # {
- + # 'block_name' =>
- + # {
- + # :type => 'for which holder the block will be available',
- + # :position => 'where the block could be displayed'
- + # }
- + # }
- + #
- + # Where:
- + #
- + # - block_name: Name of the new block added to the blocks list
- + # - type: Might have some of the values
- + # - 'environment' or Environment: If the block is available only for Environment models
- + # - 'community' or Community: If the block is available only for Community models
- + # - 'enterprise' or Enterprise: If the block is available only for Enterprise models
- + # - 'person' or Person: If the block is available only for Person models
- + # - nil: If no type parameter is passed the block will be available for all types
- + # - position: Is the layout position of the block. It should be:
- + # - '1' or 1: Area 1 of layout
- + # - '2' or 2: Area 2 of layout
- + # - '3' or 3: Area 3 of layout
- + # - nil: If no position parameter is passed the block will be available for all positions
- + #
- + # OBS: Area 1 is where stay the main content of layout. Areas 2 and 3 are the sides of layout.
- + #
- + # examples:
- + #
- + # def extra_blocks(params)
- + # {
- + # #Display 'CustomBlock1' only for 'Person' on position '1'
- + # CustomBlock1 => {:type => 'person', :position => '1' },
- + #
- + # #Display 'CustomBlock2' only for 'Community' on position '2'
- + # CustomBlock2 => {:type => Community, :position => '2' },
- + #
- + # #Display 'CustomBlock3' only for 'Enterprise' on position '3'
- + # CustomBlock3 => {:type => 'enterprise', :position => 3 },
- + #
- + # #Display 'CustomBlock2' for 'Environment' and 'Person' on positions '1' and '3'
- + # CustomBlock4 => {:type => ['environment', Person], :position => ['1','3'] },
- + #
- + # #Display 'CustomBlock5' for all types and all positions
- + # CustomBlock5 => {},
- + # }
- + # end
- + #
- + # OBS: The default value is a empty hash.
- + def extra_blocks
- + {}
- + end
- +
- + def method_missing(method, *args, &block)
- + # This is a generic hotspot for all controllers on Noosfero.
- + # If any plugin wants to define filters to run on any controller, the name of
- + # the hotspot must be in the following form: <underscored_controller_name>_filters.
- + # Example: for ProfileController the hotspot is profile_controller_filters
- + #
- + # -> Adds a filter to a controller
- + # returns = { :type => type,
- + # :method_name => method_name,
- + # :options => {:opt1 => opt1, :opt2 => opt2},
- + # :block => Proc or lambda block}
- + # type = 'before_filter' or 'after_filter'
- + # method_name = The name of the filter
- + # option = Filter options, like :only or :except
- + # block = Block that the filter will call
- + if method.to_s =~ /^(.+)_controller_filters$/
- + []
- + # -> Removes the action button from the content
- + # returns = boolean
- + elsif method.to_s =~ /^content_remove_(#{content_actions.join('|')})$/
- + nil
- + # -> Expire the action button from the content
- + # returns = string with reason of expiration
- + elsif method.to_s =~ /^content_expire_(#{content_actions.join('|')})$/
- + nil
- + elsif self.context.respond_to? method, true
- + self.context.send method, *args, &block
- + else
- + super
- + end
- + end
- +
- + def respond_to_missing? method, include_private=true
- + self.context.respond_to? method, include_private or super
- + end
- +
- + private
- +
- + def content_actions
- + #FIXME 'new' and 'upload' only works for content_remove. It should work for
- + #content_expire too.
- + %w[edit delete spread locale suggest home new upload undo]
- + end
- +
- + end
- + end
- + end
- +end
- diff --cc plugins/bsc/lib/bsc_plugin.rb
- index 17eca13,17eca13..367298a
- --- a/plugins/bsc/lib/bsc_plugin.rb
- +++ b/plugins/bsc/lib/bsc_plugin.rb
- @@@ -43,7 -43,7 +43,7 @@@ class BscPlugin < Noosfero::Plugi
- end
- def profile_controller_filters
- -- if profile
- ++ if profile
- special_enterprise = profile.enterprise? && !profile.validated && profile.bsc
- is_member_of_any_bsc = is_member_of_any_bsc?(context.user)
- block = lambda {
- @@@ -72,7 -72,7 +72,7 @@@
- def profile_editor_controller_filters
- if context.user
- -- is_not_admin = !context.environment.admins.include?(context.user)
- ++ is_not_admin = !environment.admins.include?(context.user)
- [{ :type => 'before_filter',
- :method_name => 'bsc_destroy_access',
- :options => {:only => :destroy_profile},
- @@@ -124,7 -124,7 +124,7 @@@
- end
- def profile
- -- context.environment.profiles.find_by_identifier(context.params[:profile])
- ++ environment.profiles.find_by_identifier(context.params[:profile])
- end
- end
- diff --cc plugins/classify_members/lib/classify_members_plugin.rb
- index 6745b17,6745b17..a071545
- --- a/plugins/classify_members/lib/classify_members_plugin.rb
- +++ b/plugins/classify_members/lib/classify_members_plugin.rb
- @@@ -46,7 -46,7 +46,7 @@@ class ClassifyMembersPlugin < Noosfero:
- def settings
- @settings ||= Noosfero::Plugin::Settings.new(
- -- context.environment, ClassifyMembersPlugin
- ++ environment, ClassifyMembersPlugin
- )
- end
- diff --cc plugins/event/po/pt/event.po
- index acf8575,c0a79f9..83839f3
- --- a/plugins/event/po/pt/event.po
- +++ b/plugins/event/po/pt/event.po
- @@@ -5,9 -5,9 +5,9 @@@
- #
- msgid ""
- msgstr ""
- - "Project-Id-Version: 1.1~rc4\n"
- - "POT-Creation-Date: 2015-04-20 19:44-0300\n"
- - "PO-Revision-Date: 2015-04-24 08:50-0300\n"
- + "Project-Id-Version: 1.1-166-gaf47713\n"
- + "POT-Creation-Date: 2015-06-01 17:26-0300\n"
- -"PO-Revision-Date: 2015-01-30 00:18-0000\n"
- ++"PO-Revision-Date: 2015-06-20 20:08-0300\n"
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
- "Language-Team: LANGUAGE <LL@li.org>\n"
- "Language: \n"
- @@@ -92,16 -98,10 +98,10 @@@ msgstr "Limite de dias para mostrar
- msgid "Only show events in this interval of days."
- msgstr "Mostar somente os eventos nesse intervalo de dias"
- - #: plugins/event/views/event_plugin/event_block_item.html.erb:6
- - msgid "Duration: 1 day"
- - msgid_plural "Duration: %s days"
- - msgstr[0] "Duração: 1 dia"
- - msgstr[1] "Duração: %s dias"
- -
- -#~ msgid "Started one day ago."
- -#~ msgid_plural "Started %d days ago."
- -#~ msgstr[0] "Iniciou a Um dia atrás."
- -#~ msgstr[1] "Iniciou a %d dias atrás."
- +msgid "Started one day ago."
- +msgid_plural "Started %d days ago."
- +msgstr[0] "Iniciou ontem."
- +msgstr[1] "Iniciou há %d dias atrás."
- #~ msgid "I happens today."
- #~ msgstr "Acontece hoje."
- diff --cc plugins/google_cse/lib/google_cse_plugin.rb
- index bc91aed,bc91aed..5956caf
- --- a/plugins/google_cse/lib/google_cse_plugin.rb
- +++ b/plugins/google_cse/lib/google_cse_plugin.rb
- @@@ -9,7 -9,7 +9,7 @@@ class GoogleCsePlugin < Noosfero::Plugi
- end
- def google_id
- -- context.environment.settings[:google_cse_id]
- ++ environment.settings[:google_cse_id]
- end
- def self.results_url_path
- diff --cc plugins/google_cse/views/search-box.html.erb
- index 7e776ea,0000000..a56db3b
- mode 100644,000000..100644
- --- a/plugins/google_cse/views/search-box.html.erb
- +++ b/plugins/google_cse/views/search-box.html.erb
- @@@ -1,10 -1,0 +1,10 @@@
- +<script type="text/javascript">
- + jQuery(function($) {
- + $('<%= locals[:selector] %>')
- + .attr({'class': "cse-search-box", 'action': "<%= GoogleCsePlugin.results_url_path %>"})
- - .append('<input type="hidden" name="cx" value="<%= locals[:plugin].google_id %>" /><input type="hidden" name="cof" value="FORID:10" /><input type="hidden" name="ie" value="UTF-8" /><input type="hidden" name="siteurl" value="<%= context.environment.default_hostname %>">')
- ++ .append('<input type="hidden" name="cx" value="<%= locals[:plugin].google_id %>" /><input type="hidden" name="cof" value="FORID:10" /><input type="hidden" name="ie" value="UTF-8" /><input type="hidden" name="siteurl" value="<%= environment.default_hostname %>">')
- + .children("input[name='query']")
- + .attr('name', 'q')
- + .attr('id', 'q');
- + });
- +</script>
- diff --cc plugins/ldap/lib/ldap_plugin.rb
- index 4653e65,9dade30..dfdc39d
- --- a/plugins/ldap/lib/ldap_plugin.rb
- +++ b/plugins/ldap/lib/ldap_plugin.rb
- @@@ -21,7 -42,7 +42,7 @@@ class LdapPlugin < Noosfero::Plugi
- def alternative_authentication
- login = context.params[:user][:login]
- password = context.params[:user][:password]
- -- ldap = LdapAuthentication.new(context.environment.ldap_plugin_attributes)
- ++ ldap = LdapAuthentication.new(environment.ldap_plugin_attributes)
- user = User.find_or_initialize_by_login(login)
- @@@ -43,9 -64,14 +64,14 @@@
- user.activated_at = Time.now.utc
- user.activation_code = nil
- -- ldap = LdapAuthentication.new(context.environment.ldap_plugin_attributes)
- ++ ldap = LdapAuthentication.new(environment.ldap_plugin_attributes)
- begin
- - user = nil unless user.save
- + if user.save
- + user.activate
- + plugins.dispatch(:ldap_plugin_update_user, user, attrs)
- + else
- + user = nil
- + end
- rescue
- #User not saved
- end
- diff --cc plugins/metadata/lib/ext/product.rb
- index b1e18f2,11a7e69..a6ff72e
- --- a/plugins/metadata/lib/ext/product.rb
- +++ b/plugins/metadata/lib/ext/product.rb
- @@@ -3,22 -3,14 +3,22 @@@ require_dependency 'product
- class Product
- metadata_spec namespace: :og, tags: {
- - type: MetadataPlugin.og_types[:product] || :product,
- - url: proc{ |p, plugin| plugin.og_url_for p.url },
- + type: proc{ |p, plugin| plugin.context.params[:og_type] || MetadataPlugin.og_types[:product] || :product },
- + url: proc do |p, plugin|
- + url = p.url.merge! profile: p.profile.identifier, og_type: plugin.context.params[:og_type]
- + plugin.og_url_for url
- + end,
- gr_hascurrencyvalue: proc{ |p, plugin| p.price.to_f },
- gr_hascurrency: proc{ |p, plugin| p.environment.currency_unit },
- - title: proc{ |p, plugin| "#{p.name} - #{p.profile.name}" },
- + title: proc{ |p, plugin| "#{p.name} - #{p.profile.name}" if p },
- description: proc{ |p, plugin| ActionView::Base.full_sanitizer.sanitize p.description },
- - image: proc{ |p, plugin| "#{p.environment.top_url}#{p.image.public_filename}" if p.image },
- + image: proc do |p, plugin|
- + img = "#{p.environment.top_url}#{p.image.public_filename}" if p.image
- + img = "#{p.environment.top_url}#{p.profile.image.public_filename}" if img.blank? and p.profile.image
- + img ||= MetadataPlugin.config[:open_graph][:environment_logo] rescue nil if img.blank?
- + img
- + end,
- 'image:type' => proc{ |p, plugin| p.image.content_type if p.image },
- 'image:height' => proc{ |p, plugin| p.image.height if p.image },
- 'image:width' => proc{ |p, plugin| p.image.width if p.image },
- diff --cc plugins/open_graph/lib/open_graph_plugin/stories.rb
- index 1cb90a9,0000000..a5956ff
- mode 100644,000000..100644
- --- a/plugins/open_graph/lib/open_graph_plugin/stories.rb
- +++ b/plugins/open_graph/lib/open_graph_plugin/stories.rb
- @@@ -1,298 -1,0 +1,303 @@@
- +
- +class OpenGraphPlugin::Stories
- +
- + class_attribute :publishers
- + self.publishers = []
- +
- + def self.register_publisher publisher
- + self.publishers << publisher
- + end
- +
- + def self.publish record, stories
- + actor = User.current.person rescue nil
- + return unless actor
- +
- + self.publishers.each do |publisher|
- + publisher = publisher.delay unless Rails.env.development? or Rails.env.test?
- + publisher.publish_stories record, actor, stories
- + end
- + end
- +
- + Definitions = {
- + # needed a patch on UploadedFile: def notifiable?; true; end
- + add_a_document: {
- + action_tracker_verb: :create_article,
- + track_config: 'OpenGraphPlugin::ActivityTrackConfig',
- + action: :add,
- + object_type: :uploaded_file,
- + models: :UploadedFile,
- + on: :create,
- + criteria: proc do |article, actor|
- + article.is_a? UploadedFile
- + end,
- + publish_if: proc do |uploaded_file, actor|
- + # done in add_an_image
- + next false if uploaded_file.image?
- + uploaded_file.published?
- + end,
- + object_data_url: proc do |uploaded_file, actor|
- + uploaded_file.url.merge view: true
- + end,
- + },
- + add_an_image: {
- + # :upload_image verb can't be used as it uses the parent Gallery as target
- + # hooked via open_graph_attach_stories
- + action_tracker_verb: nil,
- + track_config: 'OpenGraphPlugin::ActivityTrackConfig',
- + action: :add,
- + object_type: :gallery_image,
- + models: :UploadedFile,
- + on: :create,
- + criteria: proc do |article, actor|
- + article.is_a? UploadedFile
- + end,
- + publish_if: proc do |uploaded_file, actor|
- + uploaded_file.image? and uploaded_file.parent.is_a? Gallery
- + end,
- + object_data_url: proc do |uploaded_file, actor|
- + uploaded_file.url.merge view: true
- + end,
- + },
- + create_an_article: {
- + action_tracker_verb: :create_article,
- + track_config: 'OpenGraphPlugin::ActivityTrackConfig',
- + action: :create,
- + object_type: :blog_post,
- + models: :Article,
- + on: :create,
- + criteria: proc do |article, actor|
- + article.parent.is_a? Blog
- + end,
- + publish_if: proc do |article, actor|
- + article.published?
- + end,
- + },
- + create_an_event: {
- + action_tracker_verb: :create_article,
- + track_config: 'OpenGraphPlugin::ActivityTrackConfig',
- + action: :create,
- + object_type: :event,
- + models: :Event,
- + on: :create,
- + criteria: proc do |article, actor|
- + article.is_a? Event
- + end,
- + publish_if: proc do |event, actor|
- + event.published?
- + end,
- + },
- + start_a_discussion: {
- + action_tracker_verb: :create_article,
- + track_config: 'OpenGraphPlugin::ActivityTrackConfig',
- + action: :start,
- + object_type: :forum,
- + models: :Article,
- + on: :create,
- + criteria: proc do |article, actor|
- + article.parent.is_a? Forum
- + end,
- + publish_if: proc do |article, actor|
- + article.published?
- + end,
- + object_data_url: proc do |article, actor|
- + article.url.merge og_type: "#{MetadataPlugin::og_types[:forum]}"
- + end,
- + },
- +
- + # these a published as passive to give focus to the enterprise
- +=begin
- + add_a_sse_product: {
- + action_tracker_verb: :create_product,
- + track_config: 'OpenGraphPlugin::ActivityTrackConfig',
- + action: :announce_new,
- + models: :Product,
- + on: :create,
- + object_type: :product,
- + publish_if: proc do |product, actor|
- + product.profile.public?
- + end,
- + },
- + update_a_sse_product: {
- + action_tracker_verb: :update_product,
- + track_config: 'OpenGraphPlugin::ActivityTrackConfig',
- + action: :announce_update,
- + object_type: :product,
- + models: :Product,
- + on: :update,
- + publish_if: proc do |product, actor|
- + product.profile.public?
- + end,
- + },
- +=end
- +
- + favorite_a_sse_initiative: {
- + action_tracker_verb: :favorite_enterprise,
- + track_config: 'OpenGraphPlugin::ActivityTrackConfig',
- + action: :favorite,
- + object_type: :favorite_enterprise,
- + models: :FavoriteEnterprisePerson,
- + on: :create,
- + object_actor: proc do |favorite_enterprise_person|
- + favorite_enterprise_person.person
- + end,
- + object_profile: proc do |favorite_enterprise_person|
- + favorite_enterprise_person.enterprise
- + end,
- + object_data_url: proc do |favorite_enterprise_person, actor|
- + self.og_profile_url favorite_enterprise_person.enterprise
- + end,
- + },
- +
- +=begin
- + comment_a_discussion: {
- + action_tracker_verb: nil,
- + action: :comment,
- + object_type: :forum,
- + models: :Comment,
- + on: :create,
- + criteria: proc do |comment, actor|
- + source, parent = comment.source, comment.source.parent
- + source.is_a? Article and parent.is_a? Forum
- + end,
- + publish_if: proc do |comment, actor|
- + comment.source.parent.published?
- + end,
- + },
- + comment_an_article: {
- + action_tracker_verb: nil,
- + action: :comment,
- + object_type: :blog_post,
- + models: :Comment,
- + on: :create,
- + criteria: proc do |comment, actor|
- + source, parent = comment.source, comment.source.parent
- + source.is_a? Article and parent.is_a? Blog
- + end,
- + publish_if: proc do |comment, actor|
- + comment.source.parent.published?
- + end,
- + },
- +=end
- +
- + make_friendship_with: {
- + action_tracker_verb: :new_friendship,
- + track_config: 'OpenGraphPlugin::ActivityTrackConfig',
- + action: :make_friendship,
- + object_type: :friend,
- + models: :Friendship,
- + on: :create,
- + custom_actor: proc do |friendship|
- + friendship.person
- + end,
- + object_actor: proc do |friendship|
- + friendship.person
- + end,
- + object_profile: proc do |friendship|
- + friendship.friend
- + end,
- + object_data_url: proc do |friendship, actor|
- + self.og_profile_url friendship.friend
- + end,
- + },
- +
- + # PASSIVE STORIES
- + announce_news_from_a_sse_initiative: {
- + action_tracker_verb: :create_article,
- + track_config: 'OpenGraphPlugin::EnterpriseTrackConfig',
- + action: :announce_news,
- + object_type: :enterprise,
- + passive: true,
- + models: :Article,
- + on: :create,
- + criteria: proc do |article, actor|
- + article.profile.enterprise?
- + end,
- + publish_if: proc do |article, actor|
- + article.published?
- + end,
- + },
- ++ # this does not work with the current interface as the product
- ++ # is created empty and then have a lot of updates
- ++=begin
- + announce_a_new_sse_product: {
- + action_tracker_verb: :create_product,
- + track_config: 'OpenGraphPlugin::EnterpriseTrackConfig',
- + action: :announce_new,
- + object_type: :product,
- + passive: true,
- + models: :Product,
- + on: :create,
- + criteria: proc do |product, actor|
- + product.profile.enterprise?
- + end,
- + },
- ++=end
- + announce_an_update_of_sse_product: {
- + action_tracker_verb: :update_product,
- + track_config: 'OpenGraphPlugin::EnterpriseTrackConfig',
- + action: :announce_update,
- + object_type: :product,
- + passive: true,
- + models: :Product,
- + on: :update,
- + criteria: proc do |product, actor|
- - product.profile.enterprise?
- ++ # only post from enterprises and products with images
- ++ product.profile.enterprise? and product.image.present?
- + end,
- + },
- +
- + announce_news_from_a_community: {
- + action_tracker_verb: :create_article,
- + track_config: 'OpenGraphPlugin::CommunityTrackConfig',
- + action: :announce_news,
- + object_type: :community,
- + passive: true,
- + models: :Article,
- + on: :create,
- + criteria: proc do |article, actor|
- + article.profile.community?
- + end,
- + publish_if: proc do |article, actor|
- + article.published?
- + end,
- + },
- +
- + }
- +
- + ValidObjectList = Definitions.map{ |story, data| data[:object_type] }.uniq
- + ValidActionList = Definitions.map{ |story, data| data[:action] }.uniq
- +
- + # TODO make this verification work
- + #raise "Each active story must use a unique object_type for configuration to work" if ValidObjectList.size < Definitions.size
- +
- + DefaultActions = ValidActionList.inject({}){ |h, a| h[a] = a; h }
- + DefaultObjects = ValidObjectList.inject({}){ |h, o| h[o] = o; h }
- +
- + TrackerStories = {}; Definitions.each do |story, data|
- + Array(data[:action_tracker_verb]).each do |verb|
- + next unless verb
- + TrackerStories[verb] ||= []
- + TrackerStories[verb] << story
- + end
- + end
- +
- + TrackConfigStories = {}; Definitions.each do |story, data|
- + Array(data[:track_config]).each do |track_config|
- + next unless track_config
- + TrackConfigStories[track_config] ||= []
- + TrackConfigStories[track_config] << [story, data]
- + end
- + end
- +
- + ModelStories = {}; Definitions.each do |story, data|
- + Array(data[:models]).each do |model|
- + ModelStories[model] ||= {}
- + Array(data[:on]).each do |on|
- + ModelStories[model][on] ||= []
- + ModelStories[model][on] << story
- + end
- + end
- + end
- +
- +end
- +
- diff --cc plugins/piwik/lib/piwik_plugin.rb
- index a7c3500,a7c3500..f0e162f
- --- a/plugins/piwik/lib/piwik_plugin.rb
- +++ b/plugins/piwik/lib/piwik_plugin.rb
- @@@ -14,8 -14,8 +14,8 @@@ class PiwikPlugin < Noosfero::Plugi
- end
- def body_ending
- -- domain = context.environment.piwik_domain
- -- site_id = context.environment.piwik_site_id
- ++ domain = environment.piwik_domain
- ++ site_id = environment.piwik_site_id
- unless domain.blank? || site_id.blank?
- expanded_template('tracking-code.rhtml',{:domain => domain, :site_id => site_id})
- end
- diff --cc plugins/require_auth_to_comment/lib/require_auth_to_comment_plugin.rb
- index 68d9443,8d8dbc3..0c37177
- --- a/plugins/require_auth_to_comment/lib/require_auth_to_comment_plugin.rb
- +++ b/plugins/require_auth_to_comment/lib/require_auth_to_comment_plugin.rb
- @@@ -23,7 -21,16 +23,16 @@@ class RequireAuthToCommentPlugin < Noos
- end
- def stylesheet?
- - true
- + !display_login_popup?
- + end
- +
- + def display_login_popup?
- - settings = Noosfero::Plugin::Settings.new(context.environment, self.class)
- ++ settings = Noosfero::Plugin::Settings.new(environment, self.class)
- + settings.require_type == 'display_login_popup'
- + end
- +
- + def self.require_type_default_setting
- + 'hide_button'
- end
- def js_files
- diff --cc plugins/shopping_cart/po/pt/shopping_cart.po
- index fd98eeb,109b9e7..b67eea7
- --- a/plugins/shopping_cart/po/pt/shopping_cart.po
- +++ b/plugins/shopping_cart/po/pt/shopping_cart.po
- @@@ -11,12 -11,12 +11,12 @@@
- #
- msgid ""
- msgstr ""
- - "Project-Id-Version: 1.0-690-gcb6e853\n"
- - "POT-Creation-Date: 2015-03-05 12:09-0300\n"
- - "PO-Revision-Date: 2015-06-12 11:29-0300\n"
- + "Project-Id-Version: 1.1-166-gaf47713\n"
- + "POT-Creation-Date: 2015-06-01 17:26-0300\n"
- -"PO-Revision-Date: 2015-02-23 11:36+0200\n"
- ++"PO-Revision-Date: 2015-06-20 20:13-0300\n"
- "Last-Translator: Michal Čihař <michal@cihar.com>\n"
- - "Language-Team: Portuguese <https://hosted.weblate.org/projects/noosfero"
- - "/plugin-shopping-cart/pt/>\n"
- + "Language-Team: Portuguese <https://hosted.weblate.org/projects/noosfero/"
- + "plugin-shopping-cart/pt/>\n"
- "Language: pt\n"
- "MIME-Version: 1.0\n"
- "Content-Type: text/plain; charset=UTF-8\n"
- diff --cc plugins/sniffer/po/pt/sniffer.po
- index d1ade72,ef50cfc..25047bf
- --- a/plugins/sniffer/po/pt/sniffer.po
- +++ b/plugins/sniffer/po/pt/sniffer.po
- @@@ -3,12 -3,12 +3,11 @@@
- # This file is distributed under the same license as the PACKAGE package.
- # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
- #
- --#, fuzzy
- msgid ""
- msgstr ""
- - "Project-Id-Version: 1.1~rc1-4309-g8df8054\n"
- - "POT-Creation-Date: 2015-05-07 12:03-0300\n"
- - "PO-Revision-Date: 2015-05-07 11:11-0300\n"
- + "Project-Id-Version: 1.1-166-gaf47713\n"
- + "POT-Creation-Date: 2015-06-01 17:26-0300\n"
- -"PO-Revision-Date: 2015-05-07 11:11-0300\n"
- ++"PO-Revision-Date: 2015-06-20 20:19-0300\n"
- "Last-Translator: daniel tygel <dtygel@eita.org.br>\n"
- "Language-Team: pt_BR <dtygel@eita.org.br>\n"
- "Language: \n"
- @@@ -120,8 -88,8 +87,8 @@@ msgid "
- "interests from our list."
- msgstr ""
- "Selecione aqui as categorias de produtos e serviços que você tem interesse "
- - "em comprar. Com isso, empreendimentos saberão suas necessidades e poderão te fazer ofertas."
- - "Digite e escolha quais são seus interesses."
- + "em comprar. Com isso, empreendimentos saberão suas necessidades e poderão te "
- -"fazer ofertas.Digite e escolha quais são seus interesses."
- ++"fazer ofertas. Digite e escolha quais são seus interesses."
- #: plugins/sniffer/views/sniffer_plugin_myprofile/edit.html.erb:12
- msgid "Type in a keyword"
- @@@ -131,18 -99,59 +98,60 @@@ msgstr "Escreva uma palavra chave
- msgid "Save"
- msgstr "Salvar"
- - #: plugins/sniffer/views/blocks/sniffer_plugin/interests_block.html.erb:12
- - msgid "Edit %{inputs} and %{interests}"
- - msgstr "Editar %{inputs} e %{interests}"
- + #: plugins/sniffer/views/sniffer_plugin_myprofile/edit.html.erb:18
- + #: plugins/sniffer/views/sniffer_plugin_myprofile/search.html.erb:27
- + msgid "Back to control panel"
- + msgstr "Voltar ao painel de controle"
- - #: plugins/sniffer/views/blocks/sniffer_plugin/interests_block.html.erb:13
- - msgid "products' inputs"
- - msgstr "Insumos de produtos"
- + #: plugins/sniffer/views/sniffer_plugin_myprofile/search.html.erb:11
- + msgid "Up to %s km from you. %s result(s) found."
- + msgstr ""
- - #: plugins/sniffer/views/blocks/sniffer_plugin/interests_block.html.erb:14
- - msgid "declared interests"
- - msgstr "interesses declarados"
- + #: plugins/sniffer/views/sniffer_plugin_myprofile/search.html.erb:22
- + msgid "Legend"
- + msgstr "Legenda"
- +
- + #: plugins/sniffer/views/sniffer_plugin_myprofile/search.html.erb:23
- + msgid "your enterprise"
- + msgstr "seu empreendimento"
- +
- + #: plugins/sniffer/views/sniffer_plugin_myprofile/search.html.erb:24
- + msgid "suppliers"
- + msgstr "fornecedores"
- +
- + #: plugins/sniffer/views/sniffer_plugin_myprofile/search.html.erb:25
- + msgid "consumers"
- + msgstr "consumidores"
- +
- + #: plugins/sniffer/views/sniffer_plugin_myprofile/search.html.erb:26
- + msgid "both"
- + msgstr "ambos"
- +
- + #: plugins/sniffer/views/sniffer_plugin_myprofile/_product_search_box.html.erb:9
- + msgid "Suppliers"
- + msgstr "Fornecedores"
- +
- + #: plugins/sniffer/views/sniffer_plugin_myprofile/_product_search_box.html.erb:14
- + msgid "Consumers"
- + msgstr "Consumidores"
- +
- + #: plugins/sniffer/views/sniffer_plugin_myprofile/_product_search_box.html.erb:19
- + msgid "Both"
- + msgstr ""
- +
- + #: plugins/sniffer/views/sniffer_plugin_myprofile/_product_search_box.html.erb:25
- + msgid "look for products..."
- + msgstr "buscar por produtos..."
- +
- + #: plugins/sniffer/views/sniffer_plugin_myprofile/_product_search_box.html.erb:54
- + msgid "Maximum distance:"
- + msgstr "Distância máxima:"
- +
- + #: plugins/sniffer/views/sniffer_plugin_myprofile/map_balloon.html.erb:12
- + msgid "Can supply"
- + msgstr "Fornece"
- +
- + #: plugins/sniffer/views/sniffer_plugin_myprofile/map_balloon.html.erb:22
- + msgid "May consum"
- + msgstr "Consome"
- +
- - #: plugins/sniffer/views/blocks/sniffer_plugin/interests_block.html.erb:23
- - msgid "%{interest} from %{profile}"
- - msgstr "%{interest} de %{profile}"
- diff --cc plugins/solr/lib/solr_plugin/base.rb
- index cbb17ff,0000000..6ac50de
- mode 100644,000000..100644
- --- a/plugins/solr/lib/solr_plugin/base.rb
- +++ b/plugins/solr/lib/solr_plugin/base.rb
- @@@ -1,197 -1,0 +1,199 @@@
- +# FIXME: module not being loaded
- +require 'solr_plugin'
- +
- +class SolrPlugin::Base < Noosfero::Plugin
- +
- + def stylesheet?
- + true
- + end
- +
- + def js_files
- + ['solr'].map{ |j| "javascripts/#{j}" }
- + end
- +
- + def catalog_find_by_contents asset, scope, query, paginate_options={}, options={}
- + klass = Product
- +
- + # Search for products -> considers the query and the filters:
- + params[:facet] = {}
- + params[:facet][:solr_plugin_f_category] = params[:category] if params[:category].present?
- + params[:facet][:solr_plugin_f_qualifier] = params[:qualifier] if params[:qualifier].present?
- + solr_options = build_solr_options asset, klass, scope, nil
- + solr_options[:all_facets] = false
- +
- + order = params[:order]
- + order = if order.blank? then :relevance else order.to_sym end
- + if sort = SortOptions[:catalog][order] rescue nil
- + solr_options.merge! (if query.blank? and sort[:empty_solr_opts] then sort[:empty_solr_opts] else sort[:solr_opts] end)
- + end
- + result = scope.find_by_contents query, paginate_options, solr_options
- +
- + # Preparing the filters -> they must always contain all filters for the specific query:
- + solr_options = build_solr_options asset, klass, scope, nil, ignore_filters: true
- + solr_options[:all_facets] = false
- + query = "" if result[:results].total_entries == 0
- + result_facets = scope.find_by_contents query, paginate_options, solr_options
- + facets = result_facets[:facets]['facet_fields'] || {}
- +
- + result[:categories] = facets['solr_plugin_f_category_facet'].to_a.map{ |name,count| ["#{name} (#{count})", name] }
- + result[:categories].sort!{ |a,b| a[0] <=> b[0] }
- + result[:qualifiers] = facets['solr_plugin_f_qualifier_facet'].to_a
- + result[:qualifiers] = Product.solr_plugin_f_qualifier_proc nil, result[:qualifiers]
- + result[:qualifiers].map!{ |id, name, count| ["#{name} (#{count})", id] }
- + result[:qualifiers].sort!{ |a,b| a[0] <=> b[0] }
- +
- + result
- + end
- +
- + def find_by_contents asset, scope, query, paginate_options={}, options={}
- + # The query in the catalog top bar is too specific and therefore must be treated differently
- + return catalog_find_by_contents asset, scope, query, paginate_options, options if asset == :catalog
- +
- + category = options.delete :category
- + filter = options.delete(:filter).to_s.to_sym
- + klass = asset_class asset
- +
- + solr_options = build_solr_options asset, klass, scope, category
- + solr_options.merge! sort_options asset, klass, filter
- + solr_options.merge! options
- ++ # We don't yet use the option to filter by template
- ++ solr_options.delete :template_id
- +
- + scope.find_by_contents query, paginate_options, solr_options
- + rescue Exception => e
- + # solr seaches depends on a constant translation of named scopes SQL's into solr filtered fields
- + # so while we can't keep up it core changes, report the error and use default like search
- + if Rails.env.production?
- + ExceptionNotifier.notify_exception e,
- + env: context.request.env, data: {message: "Solr search failed"}
- + super
- + else
- + raise
- + end
- + end
- +
- + def autocomplete asset, scope, query, paginate_options={}, options={}
- + solr_options = {}
- + solr_options.merge! paginate_options
- +
- + case asset
- + when :catalog
- + klass = Product
- + solr_options[:query_fields] = %w[solr_plugin_ac_name^100 solr_plugin_ac_category^90 solr_plugin_ac_supplier^80]
- + solr_options[:highlight] = {fields: 'name'}
- + solr_options[:filter_queries] = scopes_to_solr_options scope, klass, options
- + end
- + solr_options[:default_field] = 'ngramText'
- +
- + result = {results: scope.find_by_solr(query, solr_options).results}
- + result
- + end
- +
- + def search_order asset
- + case asset
- + when :catalog
- + {
- + select_options: SortOptions[:catalog].map do |key, options|
- + option = options[:option]
- + [_(option[0]), option[1]]
- + end,
- + }
- + end
- + end
- +
- + def search_pre_contents
- + lambda do
- + render 'solr_plugin/search/search_pre_contents'
- + end
- + end
- +
- + def search_post_contents
- + lambda do
- + render 'solr_plugin/search/search_post_contents'
- + end
- + end
- +
- + protected
- +
- + include SolrPlugin::SearchHelper
- +
- + def build_solr_options asset, klass, scope, category, options = {}
- + solr_options = {}
- +
- + selected_facets = if options[:ignore_filters] then {} else params[:facet] end
- + if klass.respond_to? :facets
- + solr_options.merge! klass.facets_find_options selected_facets
- + solr_options[:all_facets] = true
- + end
- +
- + solr_options[:filter_queries] ||= []
- + solr_options[:filter_queries] += solr_filters_queries asset, environment
- + solr_options[:filter_queries] << klass.facet_category_query.call(category) if category
- + solr_options[:filter_queries] += scopes_to_solr_options scope, klass, options
- +
- + solr_options[:boost_functions] ||= []
- + params[:order_by] = nil if params[:order_by] == 'none'
- + if params[:order_by]
- + order = SortOptions[asset][params[:order_by].to_sym]
- + raise "Unknown order by" if order.nil?
- + order[:solr_opts].each do |opt, value|
- + solr_options[opt] = value.is_a?(Proc) ? instance_eval(&value) : value
- + end
- + end
- +
- + solr_options
- + end
- +
- + def scopes_to_solr_options scope, klass = nil, options = {}
- + filter_queries = []
- + klass ||= scope.base_class
- + solr_fields = klass.configuration[:solr_fields].keys rescue []
- + scopes_applied = scope.scopes_applied.dup rescue [] #rescue association and class direct filtering
- +
- + scope.scope_attributes.each do |attr, value|
- + next if attr == 'type'
- + raise "Non-indexed attribute '#{attr}' speficied in scope_attributes" unless solr_fields.include? attr.to_sym
- +
- + # if the filter is present here, then prefer it
- + scopes_applied.reject!{ |name| name == attr.to_sym }
- +
- + filter_queries << "#{attr}:#{value}"
- + end
- +
- + scopes_applied.each do |name|
- + #next if name.to_s == options[:filter].to_s
- +
- + has_value = name === Hash
- + if has_value
- + name, args = name.keys.first, name.values.first
- + value = args.first
- + end
- +
- + related_field = nil
- + related_field = name if solr_fields.include? name
- + related_field = "solr_plugin_#{name}" if solr_fields.include? :"solr_plugin_#{name}"
- +
- + if has_value
- + if related_field
- + filter_queries << "#{related_field}:#{value}"
- + else
- + filter_queries << klass.send("solr_filter_#{name}", *args)
- + end
- + else
- + raise "Undeclared solr field for scope #{name}" if related_field.nil?
- + if related_field
- + filter_queries << "#{related_field}:true"
- + end
- + end
- + end
- +
- + filter_queries
- + end
- +
- + def sort_options asset, klass, filter
- + options = SolrPlugin::SearchHelper::SortOptions[asset]
- + options[filter][:solr_opts] || {} rescue {}
- + end
- +
- +end
- +
- diff --cc plugins/solr/po/pt/solr.po
- index 98768b5,688adc2..551143a
- --- a/plugins/solr/po/pt/solr.po
- +++ b/plugins/solr/po/pt/solr.po
- @@@ -11,12 -11,12 +11,12 @@@
- #
- msgid ""
- msgstr ""
- - "Project-Id-Version: 1.0-690-gcb6e853\n"
- - "POT-Creation-Date: 2015-03-05 12:10-0300\n"
- - "PO-Revision-Date: 2015-06-13 09:54-0300\n"
- + "Project-Id-Version: 1.1-166-gaf47713\n"
- + "POT-Creation-Date: 2015-06-01 17:26-0300\n"
- -"PO-Revision-Date: 2015-02-23 11:36+0200\n"
- ++"PO-Revision-Date: 2015-06-20 20:21-0300\n"
- "Last-Translator: Michal Čihař <michal@cihar.com>\n"
- - "Language-Team: Portuguese <https://hosted.weblate.org/projects/noosfero"
- - "/plugin-solr/pt/>\n"
- + "Language-Team: Portuguese <https://hosted.weblate.org/projects/noosfero/"
- + "plugin-solr/pt/>\n"
- "Language: pt\n"
- "MIME-Version: 1.0\n"
- "Content-Type: text/plain; charset=UTF-8\n"
- @@@ -102,15 -98,15 +102,15 @@@ msgstr "Mais próximo de mim
- msgid "Sort results by "
- msgstr "Ordenar resultados por "
- -#: plugins/solr/lib/solr_plugin/search_helper.rb:136
- -msgid "%s products offers found"
- -msgstr "%s ofertas de produtos encontrados"
- +#: plugins/solr/lib/solr_plugin/search_helper.rb:135
- +msgid "%s products and/or services found"
- +msgstr "%s produtos e/ou serviços encontrados"
- -#: plugins/solr/lib/solr_plugin/search_helper.rb:137
- -msgid "%s articles found"
- -msgstr "%s artigos encontrados"
- +#: plugins/solr/lib/solr_plugin/search_helper.rb:136
- +msgid "%s contents found"
- +msgstr "%s conteúdos encontrados"
- - #: plugins/solr/lib/solr_plugin/search_helper.rb:137
- + #: plugins/solr/lib/solr_plugin/search_helper.rb:138
- msgid "%s events found"
- msgstr "%s eventos encontrados"
- diff --cc plugins/solr/views/solr_plugin/search/_search_pre_contents.html.erb
- index c089fdc,0000000..2bf15b1
- mode 100644,000000..100644
- --- a/plugins/solr/views/solr_plugin/search/_search_pre_contents.html.erb
- +++ b/plugins/solr/views/solr_plugin/search/_search_pre_contents.html.erb
- @@@ -1,26 -1,0 +1,17 @@@
- +<div class="row">
- + <div class="col-lg-12 col-md-12 col-sm-12 text-left form-control-static">
- +
- - <div class="search-results-header-information">
- - <% if @searches[@asset][:results].total_entries > 0 %>
- - <%= label_total_found @asset, @searches[@asset][:results].total_entries %>
- - <% if params[:display] != 'map' %>
- - <span class="current-page"><%= _("Showing page %s of %s") % [@searches[@asset][:results].current_page, @searches[@asset][:results].total_pages] %></span>
- - <% end %>
- - <% end %>
- - </div>
- -
- + <%= facets_unselect_menu @asset %>
- + <div class="row hidden-md hidden-lg">
- + <div class="col-lg-12 col-md-12 col-sm-12">
- + <a href="#solr-left-menu" class="fa fa-angle-right btn btn-default" role="button" ><%= _('Show filters') %></a>
- + </div>
- + </div>
- +
- + </div>
- +</div>
- +
- +<div class="row">
- + <%= render 'solr_plugin/search/facets_column' %>
- + <div class="col-lg-9 col-md-8 col-sm-12 col-xs-12">
- +
- diff --cc public/designs/icons/tango/style.css
- index 3fe60fa,1fe4e21..f56d008
- --- a/public/designs/icons/tango/style.css
- +++ b/public/designs/icons/tango/style.css
- @@@ -118,9 -114,108 +118,111 @@@
- .icon-set-admin-role { background-image: url(mod/16x16/apps/user.png) }
- .icon-reset-admin-role { background-image: url(../../../images/icons-app/person-icon.png) }
- .icon-clock { background-image: url(Tango/16x16/actions/appointment.png) }
- +.icon-feed,
- +.icon-newrss-feed,
- +.icon-rss-feed { background-image: url(../../../images/icons-mime/rss-feed-16.png) }
- + .icon-fullscreen { background-image: url(Tango/16x16/actions/view-fullscreen.png) }
- +
- + /******************BIG ICONS************************/
- + .bigicon-embed { background-image: url(Tango/scalable/apps/utilities-terminal.svg) }
- + .bigicon-edit { background-image: url(Tango/scalable/apps/text-editor.svg) }
- + .bigicon-undo { background-image: url(Tango/scalable/actions/edit-undo.svg) }
- + .bigicon-home { background-image: url(Tango/scalable/actions/go-home.svg) }
- + .bigicon-home-not { background-image: url(mod/scalable/actions/go-home-not.svg) }
- + .bigicon-new,
- + .bigicon-suggest { background-image: url(Tango/scalable/actions/filenew.svg) }
- + .bigicon-close { background-image: url(Tango/scalable/actions/gtk-cancel.svg) }
- + .bigicon-newfolder { background-image: url(Tango/scalable/actions/folder-new.svg) }
- + .bigicon-folder { background-image: url(Tango/scalable/places/folder.svg) }
- + .bigicon-parent-folder { background-image: url(Tango/scalable/places/folder_home.svg) }
- + .bigicon-newblog { background-image: url(mod/scalable/apps/text-editor.svg) }
- + .bigicon-blog { background-image: url(mod/scalable/apps/text-editor.svg) }
- + .bigicon-save { background-image: url(Tango/scalable/actions/filesave.svg) }
- + .bigicon-send { background-image: url(Tango/scalable/actions/stock_mail-forward.svg) }
- + .bigicon-cancel { background-image: url(Tango/scalable/actions/gtk-cancel.svg) }
- + .bigicon-person { background-image: url(Tango/scalable/apps/system-config-users.svg) }
- + .bigicon-product { background-image: url(Tango/scalable/mimetypes/package.svg) }
- + .bigicon-delete { background-image: url(Tango/scalable/places/user-trash.svg) }
- + .bigicon-back { background-image: url(Tango/scalable/actions/back.svg) }
- + .bigicon-next { background-image: url(Tango/scalable/actions/go-next.svg) }
- + .bigicon-add { background-image: url(Tango/scalable/actions/add.svg) }
- + .bigicon-remove { background-image: url(Tango/scalable/actions/gtk-remove.svg) }
- + .bigicon-more { background-image: url(Tango/scalable/actions/add.svg) }
- + .bigicon-up { background-image: url(Tango/scalable/actions/go-up.svg) }
- + .bigicon-down { background-image: url(Tango/scalable/actions/go-down.svg) }
- + .bigicon-left { background-image: url(Tango/scalable/actions/go-previous.svg) }
- + .bigicon-right { background-image: url(Tango/scalable/actions/go-next.svg) }
- + .bigicon-up-disabled { background-image: url(Tango/scalable/actions/go-up.svg); opacity: 0.25; filter:alpha(opacity=25); }
- + .bigicon-down-disabled { background-image: url(Tango/scalable/actions/go-down.svg); opacity: 0.25; filter:alpha(opacity=25); }
- + .bigicon-left-disabled { background-image: url(Tango/scalable/actions/go-previous.svg); opacity: 0.25; filter:alpha(opacity=25); }
- + .bigicon-right-disabled { background-image: url(Tango/scalable/actions/go-next.svg); opacity: 0.25; filter:alpha(opacity=25); }
- + .bigicon-up-red { background-image: url(mod/scalable/actions/go-up-red.svg) }
- + .bigicon-forward { background-image: url(Tango/scalable/actions/go-next.svg) }
- + .bigicon-search { background-image: url(Tango/scalable/actions/search.svg) }
- + .bigicon-ok { background-image: url(Tango/scalable/actions/media-playback-start.svg) }
- + .bigicon-login { background-image: url(mod/scalable/actions/log-in.svg) }
- + .bigicon-help { background-image: url(Tango/scalable/apps/gnome-help.svg) }
- + .bigicon-help32on { background-image: url(Tango/scalable/apps/gnome-help.svg) }
- + .bigicon-help32off { background-image: url(mod/scalable/apps/gnome-help-red.svg) }
- + .bigicon-spread { background-image: url(mod/scalable/actions/spread.svg) }
- + .bigicon-todo { background-image: url(Tango/scalable/actions/stock_paste.svg) }
- + .bigicon-eyes { background-image: url(Tango/scalable/actions/find.svg) }
- + .bigicon-menu-home { background-image: url(Tango/scalable/actions/go-home.svg) }
- + .bigicon-menu-product { background-image: url(Tango/scalable/mimetypes/package.svg) }
- + .bigicon-menu-enterprise { background-image: url(Tango/scalable/actions/go-home.svg) }
- + .bigicon-menu-community { background-image: url(Tango/scalable/apps/system-config-users.svg) }
- + .bigicon-menu-ctrl-panel { background-image: url(Tango/scalable/categories/preferences-desktop.svg) }
- + .bigicon-menu-admin { background-image: url(Tango/scalable/categories/preferences-system.svg) }
- + .bigicon-menu-my-groups { background-image: url(Tango/scalable/apps/system-config-users.svg) }
- + .bigicon-menu-login { background-image: url(mod/scalable/actions/log-in.svg) }
- + .bigicon-menu-logout { background-image: url(mod/scalable/actions/log-out.svg) }
- + .bigicon-menu-search { background-image: url(Tango/scalable/actions/search.svg) }
- + .bigicon-menu-events { background-image: url(Tango/scalable/mimetypes/stock_calendar.svg) }
- + .bigicon-event { background-image: url(Tango/scalable/mimetypes/stock_calendar.svg) }
- + .bigicon-newevent { background-image: url(Tango/scalable/mimetypes/stock_calendar.svg) }
- + .bigicon-menu-articles { background-image: url(Tango/scalable/apps/text-editor.svg) }
- + .bigicon-menu-people { background-image: url(mod/scalable/apps/user.svg) }
- + .bigicon-menu-mail { background-image: url(Tango/scalable/apps/email.svg) }
- + .bigicon-upload-file { background-image: url(Tango/scalable/actions/filesave.svg) }
- + .bigicon-newupload-file { background-image: url(Tango/scalable/actions/filesave.svg) }
- + .bigicon-slideshow { background-image: url(Tango/scalable/mimetypes/x-office-presentation.svg) }
- + .bigicon-photos { background-image: url(Tango/scalable/devices/camera-photo.svg) }
- + .bigicon-vertical-toggle { background-image: url(Tango/scalable/actions/mail-send-receive.svg) }
- + .bigicon-text-html { background-image: url(Tango/scalable/mimetypes/text-html.svg) }
- + .bigicon-text-plain { background-image: url(Tango/scalable/mimetypes/text-x-generic.svg) }
- + .bigicon-image-svg-xml { background-image: url(Tango/scalable/mimetypes/image-x-generic.svg) }
- + .bigicon-application-octet-stream { background-image: url(Tango/scalable/mimetypes/binary.svg) }
- + .bigicon-application-x-gzip { background-image: url(Tango/scalable/mimetypes/gnome-mime-application-x-gzip.svg) }
- + .bigicon-application-postscript { background-image: url(Tango/scalable/mimetypes/gnome-mime-application-postscript.svg) }
- + .bigicon-application-pdf { background-image: url(Tango/scalable/mimetypes/gnome-mime-application-pdf.svg) }
- + .bigicon-application-ogg { background-image: url(Tango/scalable/mimetypes/gnome-mime-application-ogg.svg) }
- + .bigicon-video, .icon-video-mpeg { background-image: url(Tango/scalable/mimetypes/video-x-generic.svg) }
- + .bigicon-application-vnd-oasis-opendocument-text { background-image: url(Tango/scalable/mimetypes/gnome-mime-application-vnd.oasis.opendocument.text.svg) }
- + .bigicon-application-vnd-oasis-opendocument-spreadsheet { background-image: url(Tango/scalable/mimetypes/gnome-mime-application-vnd.oasis.opendocument.spreadsheet.svg) }
- + .bigicon-application-vnd-oasis-opendocument-presentation { background-image: url(Tango/scalable/mimetypes/gnome-mime-application-vnd.oasis.opendocument.presentation.svg) }
- + .bigicon-welcome-page { background-image: url(mod/scalable/mimetypes/welcome-page.svg) }
- + .bigicon-blocks { background-image: url(mod/scalable/mimetypes/blocks.svg) }
- + .bigicon-header-footer { background-image: url(mod/scalable/mimetypes/header-footer.svg) }
- + .bigicon-appearance { background-image: url(Tango/scalable/apps/preferences-desktop-wallpaper.svg) }
- + .bigicon-media-pause { background-image: url(Tango/scalable/actions/media-playback-pause.svg) }
- + .bigicon-media-play { background-image: url(Tango/scalable/actions/media-playback-start.svg) }
- + .bigicon-media-prev { background-image: url(Tango/scalable/actions/media-skip-backward.svg) }
- + .bigicon-media-next { background-image: url(Tango/scalable/actions/media-skip-forward.svg) }
- + .bigicon-lock { background-image: url(Tango/scalable/actions/lock.svg) }
- + .bigicon-chat { background-image: url(Tango/scalable/apps/internet-group-chat.svg); background-repeat: no-repeat }
- + .bigicon-reply { background-image: url(Tango/scalable/actions/mail-reply-sender.svg) }
- + .bigicon-newforum { background-image: url(Tango/scalable/apps/internet-group-chat.svg) }
- + .bigicon-forum { background-image: url(Tango/scalable/apps/system-users.svg) }
- + .bigicon-gallery { background-image: url(Tango/scalable/mimetypes/image-x-generic.svg) }
- + .bigicon-newgallery { background-image: url(Tango/scalable/mimetypes/image-x-generic.svg) }
- + .bigicon-locale { background-image: url(Tango/scalable/apps/preferences-desktop-locale.svg) }
- + .bigicon-user-removed { background-image: url(Tango/scalable/actions/gtk-cancel.svg) }
- + .bigicon-user-unknown { background-image: url(Tango/scalable/status/dialog-error.svg) }
- + .bigicon-alert { background-image: url(Tango/scalable/status/dialog-warning.svg) }
- + .bigicon-clone { background-image: url(Tango/scalable/actions/edit-copy.svg) }
- + .bigicon-activate-user { background-image: url(Tango/scalable/emblems/emblem-system.svg) }
- + .bigicon-deactivate-user { background-image: url(Tango/scalable/emblems/emblem-unreadable.svg) }
- + .bigicon-clock { background-image: url(Tango/scalable/actions/appointment.svg) }
- /******************LARGE ICONS********************/
- .image-gallery-item .folder { background-image: url(mod/96x96/places/folder.png) }
- diff --cc public/designs/themes/base/style.css
- index 12d8530,59a3a2e..68d5665
- --- a/public/designs/themes/base/style.css
- +++ b/public/designs/themes/base/style.css
- @@@ -2742,20 -1061,14 +2734,23 @@@ hr.pre-posts, hr.sep-posts
- text-decoration: none;
- }
- +#content .automatic-abstract-thumb,
- +#content #boxes .box-1 .article-block img.automatic-abstract-thumb,
- +#content #article .article-body img.automatic-abstract-thumb {
- + float:left;
- + max-width:100px;
- + max-height:100px;
- + margin: 5px 5px 5px 0;
- +}
- +
- - #content .main-block .created-at {
- + #content .main-block .publishing-info {
- text-align: left;
- color: #AAA;
- + font-size: 11px;
- + /*padding-top: 20px;*/
- + margin-bottom:15px;
- }
- - #content .main-block .created-at a {
- + #content .main-block .publishing-info a {
- color: #AAA;
- text-decoration: none;
- }
- @@@ -3105,357 -1418,115 +3100,469 @@@ table#recaptcha_table tr:hover td
- color:#333;
- }
- +/* Provisory: hide the yellow activation box in the person control panel: */
- +#activation_enterprise {
- + display: none;
- +}
- +/* sign-up form */
- +
- +
- +#signup-form {
- + color: #4A4A4A;
- + display: inline-block;
- +}
- +
- +#signup-form small {
- + display: none;
- +}
- +
- +#signup-form #signup-form-header {
- + -moz-border-radius: 8px;
- + border-radius: 8px;
- + -webkit-border-radius: 8px;
- + margin: 60px auto 5px;
- + position: relative;
- +}
- +
- +#signup-form input.invalid_input {
- + border: 1px solid #7f0000;
- + background: #FFF;
- + box-shadow: 0 0 7px red;
- +}
- +
- +#signup-form input.valid_input {
- + border: 1px solid #005000;
- + background: #FFF;
- +}
- +
- +#signup-form select,
- +#signup-form textarea,
- +#signup-form input {
- + padding: 7px 7% 10px 3%;
- + height: 20px;
- + width: 90%;
- + color: #6d786e;
- + font-size: 18px;
- +}
- +
- +#signup-form #profile_data_login {
- + margin: 3px 0px 0px 5px;
- +}
- +
- +#signup-form .filled-in,
- +#signup-form .invalid,
- +#signup-form input.validated,
- +#signup-form .checking {
- + border-width: 1px;
- + border-style: solid;
- + background-color: #fff;
- + background-position: right center;
- + background-repeat: no-repeat;
- + padding: 7px 7% 8px 3%;
- + color: #4A4A4A;
- + box-shadow: 0 0 7px green;
- +}
- +
- +#signup-form input.checking {
- + box-shadow: none;
- +}
- +
- +#signup-form select {
- + height: auto;
- + padding-right: 3px;
- + width: 365px;
- +}
- +
- +#signup-form .select-birth-date select {
- + width: 93px;
- + margin-right: 2px;
- + margin-left: 0;
- +}
- +
- +.webkit #signup-form select {
- + background: #fff;
- +}
- +
- +#signup-form textarea {
- + background: #fff;
- + height: 100px;
- + padding-right: 3px;
- + width: 365px;
- +}
- +
- +#signup-form input[type=file] {
- + font-size: 12px;
- +}
- +
- +#signup-form input[type=radio] {
- + height: auto;
- + margin: 0px 5px 0px 3px;
- + width: auto;
- +}
- +
- +#signup-form .fieldgroup {
- + margin: 5px 10px;
- +}
- +
- +#signup-form #template-options li label {
- + font-size: 18px;
- +}
- +
- +#signup-form #template-options li a {
- + color: #555753
- +}
- +
- +#signup-form label[for=profile_data_sex_female],
- +#signup-form label[for=profile_data_sex_male] {
- + color: #6d786e;
- + font-size: 20px;
- + display: inline;
- + margin-left: 8px;
- +}
- +
- +#signup-form label[for=profile_data_country],
- +#signup-form label[for=profile_data_preferred_domain_id],
- +#signup-form label[for=profile_data_birth_date_2i],
- +#signup-form label[for=profile_data_birth_date_3i],
- +#signup-form label[for=profile_data_schooling],
- +#signup-form label[for=profile_data_formation],
- +#signup-form label[for=profile_data_area_of_study],
- +#signup-form label[for=profile_data_image_builder_uploaded_data] {
- + display: block;
- +}
- +
- +#signup-form .invalid {
- + border-color: #7f0000;
- + background-image: url(/images/passwords_nomatch.png);
- + box-shadow: 0 0 7px red;
- +}
- +
- +#signup-form span.invalid {
- + border: none;
- + padding: 0px;
- + background: transparent;
- + color: #7f0000;
- + box-shadow: none;
- +}
- +
- +#signup-form .checking {
- + border-color: #4A4A4A;
- + background-image: url(/images/login_checking.png);
- +}
- +
- +#signup-form span.checking {
- + border: none;
- + padding: 0px;
- + background: transparent;
- + color: #4A4A4A;
- + box-shadow: none;
- +}
- +
- +#signup-form .validated {
- + border-color: #005000;
- + background-image: url(/images/passwords_match.png);
- +}
- +
- +#signup-form span.validated {
- + background: transparent;
- + color: #005000;
- +}
- +/* ==> public/stylesheets/controller_account.css <== */
- +.controller-account #profile-data .type-text input, .controller-account #profile-data .type-password input, .controller-account #profile-data .type-select select {
- + width: 220px
- +}
- +.controller-account #profile-data .type-select select.select-schooling {
- + width: 108px;
- +}
- +.controller-account #profile-data .select-birth-date select#profile_data_birth_date_3i {
- + width: 47px;
- +}
- +.controller-account .button.disabled {
- + opacity: 0.5;
- +}
- +.controller-account #content .icon-forward.disabled {
- + background-image: url('/designs/icons/default/go-right-disabled-HC.gif');
- +}
- +.controller-account .no-boxes {
- + margin-left: 200px;
- + margin-right: 200px;
- +}
- +
- +.controller-content_viewer .no-boxes, .controller-profile .no-boxes {
- + margin: 0px 200px;
- +}
- +
- +
- +#signup-domain {
- + float: left;
- + display: inline-block;
- + vertical-align: middle;
- + background: #EEE;
- + border: 1px solid #CFCFCF;
- + line-height: 36px;
- + padding: 0px 7px;
- + color: #4A4A4A;
- + font-size: 20px;
- + text-transform: lowercase;
- + min-width: 190px;
- +}
- +
- +#signup-form #signup-form-header #user_login {
- + margin: 0;
- + padding-right: 30px;
- + width: 150px;
- +}
- +
- +#signup-login-field {
- + float: left;
- +}
- +
- +#signup-form #signup-login {
- + display: inline-block;
- +}
- +
- +#signup-form #signup-password,
- +#signup-form #signup-password-confirmation,
- +#signup-form #signup-email,
- +#signup-form #signup-name,
- +#signup-form #signup-login {
- + position: relative;
- +}
- +
- +#signup-form small#signup-balloon,
- +#signup-form small#password-balloon,
- +#signup-form small#password-confirmation-balloon,
- +#signup-form small#email-balloon,
- +#signup-form small#name-balloon {
- + display: none;
- + width: 142px;
- + height: 69px;
- + color: #FFFFFF;
- + font-weight: bold;
- + font-size: 11px;
- + padding: 5px 10px 45px 10px;
- + margin: 0;
- + line-height: 1.5em;
- + background: transparent url(/images/gray-balloon.png) bottom center no-repeat;
- + position: absolute;
- + z-index: 2;
- + right: -150px;
- +}
- +
- +#signup-form small#signup-balloon {
- + top: -110px;
- +}
- +
- +#signup-form small#password-balloon,
- +#signup-form small#password-confirmation-balloon,
- +#signup-form small#email-balloon,
- +#signup-form small#name-balloon {
- + top: -80px;
- +}
- +
- +#signup-form .required-field label,
- +#signup-form .formlabel {
- + color: #4A4A4A;
- + font-size: 20px;
- + font-weight: normal;
- + text-align: left;
- +}
- +
- +#signup-form .required-field label::after {
- + content: '';
- +}
- +
- +.tooltip {
- + padding: 8px;
- + border: 1px solid #FF8000;
- + background-color: #FFFF66;
- + z-index: 100;
- + -moz-border-radius: 3px;
- + -webkit-border-radius: 3px;
- +}
- +
- +
- +/* Text editors sidebar */
- +
- +.controller-cms div.with_media_panel {
- + float: left;
- + width: 500px;
- +}
- +div.with_media_panel .formfield input {
- + width: 100%;
- +}
- +div.with_media_panel .formfield input[type="checkbox"] {
- + width: auto;
- +}
- +
- +
- +.text-editor-sidebar {
- + position: absolute;
- + width: 380px;
- + right: 20px;
- + top: 70px;
- +}
- +
- +#product-name h2 {
- + display: inline;
- +}
- +#product_name {
- + width: 60%;
- +}
- +
- +.image-gallery ul {
- + width: 486px;
- +}
- +
- +.image-gallery-item {
- + margin: 10px;
- + float: left;
- +}
- +
- +.controller-profile_editor .control-panel a {
- + width: 140px;
- +}
- +
- +
- +.categories_container {
- + min-width: 100px;
- +}
- +
- +
- +#product-list .product-image-link {
- + width: 200px;
- +}
- +
- +#product-list .product-big {
- + width: 200px;
- +}
- +
- +#product-list .expand-box {
- + width: 202px;
- +}
- +
- +#content .common-profile-list-block li, #content .comment-actions li {
- + margin: 0px !important;
- +}
- +
- +#catalog-search-input {
- + width: 150px;
- + color: #555;
- + height: 28px;
- + padding: 0px 0px 0px 10px;
- +}
- +
- +/*PROVISORY!*/
- +#product-owner { display:none; }
- + /************************* Article Page *****************************/
- +
- + #article-header .preview {
- + font-size: 15px;
- + }
- +
- + .article-body-img {
- + float: left;
- + margin-right: 20px;
- + margin-top: 5px;
- + }
- +
- + #content #article .article-body .article-body-img img {
- + height: auto;
- + width: auto;
- + min-height: 120px;
- + max-height: 180px;
- + max-width: 250px;
- + background-position: center center;
- + background-repeat: no-repeat;
- + }
- +
- + #content #article .article-body .article-body-img p {
- + margin-bottom: 10px;
- + font-size: 10px;
- + min-height: 20px;
- + }
- + /* Noosfero Events */
- +
- + .event-card {
- + float: left;
- + padding-top: 25px;
- + width: 494px;
- + height: 116px;
- + background-repeat: no-repeat;
- + margin-bottom: 30px;
- + }
- +
- + .event-image {
- + position: relative;
- + float: left;
- + padding-right: 22px;
- + max-width: 130px;
- + height: 130px;
- + }
- +
- + #content #article .article-body img{
- + max-height: 100%;
- + }
- +
- + .about-event {
- + position: relative;
- + float: left;
- + height: 160px;
- + width: 300px;
- + max-width: 300px;
- + }
- +
- + .about-event > span {
- + display: block;
- + max-width: inherit;
- + margin-left: 20px;
- + padding-left: 21px;
- + line-height: 13px;
- + margin-right: 11px;
- + }
- +
- + .about-event .event-date {
- + margin-top: 3px;
- + }
- +
- + .about-event .event-address {
- + margin-top: 19px;
- + }
- +
- + .about-event .event-address span {
- + display: block;
- + margin-left: 0px;
- + margin-top: 4.4px;
- + line-height: 14px;
- + }
- +
- + .event-date {
- + background: url('/images/calendar_date_select/calendar-icon.png') no-repeat left center;
- + padding: 5px;
- + }
- +
- + .event-link {
- + background: url('/images/globe-icon.png') no-repeat left center;
- + margin-top: 18px;
- + }
- +
- + .event-link a {
- + }
- +
- + .event-address {
- + background: url('/images/icone_pin.png') no-repeat left top;
- + }
- +
- + .event-body {
- + float: left;
- + }
- +
- + .event-body .event-lead {
- + font-size: 15px;
- + }
- +
- + .event-body .event-content p {
- + margin-top: 20px;
- + width: 494px;
- + padding-left: 2px;
- + }
- diff --cc public/javascripts/application.js
- index 09ca7da,33615ea..f27cbdd
- --- a/public/javascripts/application.js
- +++ b/public/javascripts/application.js
- @@@ -2,11 -2,10 +2,11 @@@
- // This file is automatically included by javascript_include_tag :defaults
- /*
- * third party libraries
- +*= require lodash.js
- *= require jquery-2.1.1.min.js
- *= require jquery-migrate-1.2.1.js
- - *= require jquery.colorbox-min.js
- *= require jquery.cycle.all.min.js
- + *= require jquery.colorbox-min.js
- *= require jquery-ui-1.10.4/js/jquery-ui-1.10.4.min.js
- *= require jquery.scrollTo.js
- *= require jquery.form.js
- @@@ -14,14 -13,10 +14,12 @@@
- *= require jquery.cookie.js
- *= require jquery.ba-bbq.min.js
- *= require jquery.tokeninput.js
- - *= require jquery.typewatch.js
- - *= require jquery.textchange.js
- ++* select-or-die/_src/selectordie
- *= require jquery-timepicker-addon/dist/jquery-ui-timepicker-addon.js
- *= require inputosaurus.js
- *= require reflection.js
- - *= require select-or-die/_src/selectordie
- *= require rails.js
- +*= require rails-extended.js
- *= require jrails.js
- * noosfero libraries
- *= require_self
- @@@ -32,15 -25,11 +30,16 @@@
- *= require add-and-join.js
- *= require report-abuse.js
- *= require manage-products.js
- -*= require catalog.js
- *= require autogrow.js
- +*= require pagination.js
- +*= require loading-overlay.js
- + *= require require_login.js
- */
- +_.templateSettings = {
- + interpolate: /\{\{(.+?)\}\}/g,
- +};
- +
- // scope for noosfero stuff
- noosfero = {
- };
- diff --cc public/javascripts/chat.js
- index 0e38491,fc787df..f589037
- --- a/public/javascripts/chat.js
- +++ b/public/javascripts/chat.js
- @@@ -184,11 -184,6 +184,12 @@@ jQuery(function($)
- $('#buddy-list #user-status img.avatar').replaceWith(getMyAvatar());
- $.get('/chat/update_presence_status', { status: {chat_status: presence, last_chat_status: presence} });
- },
- + change_status: function(status_element, callback) {
- + $('#chat-connect, #chat-disconnect, #chat-busy').removeClass('active')
- ++ $('#chat .simplemenu-submenu').hide();
- + status_element.addClass('active')
- + callback()
- + },
- send_availability_status: function(presence) {
- log('send availability status ' + presence);
- diff --cc public/stylesheets/application.css
- index be187f9,5c668ee..1342600
- --- a/public/stylesheets/application.css
- +++ b/public/stylesheets/application.css
- @@@ -9,12 -10,10 +10,12 @@@
- *= require token-input-facet
- * noosfero libraries
- *= require_self
- + *= require pagination
- *= require iepngfix/iepngfix
- + *= require loading-overlay
- * views specifics
- - *= require search
- *= require chat
- + *= require search
- */
- /* browser fixes */
- diff --cc public/stylesheets/chat.scss
- index 931d5c5,0000000..6577c67
- mode 100644,000000..100644
- --- a/public/stylesheets/chat.scss
- +++ b/public/stylesheets/chat.scss
- @@@ -1,652 -1,0 +1,654 @@@
- +#chat {
- + width: 0;
- + position: fixed;
- + right: 0;
- + top: 100px;
- + bottom: 0;
- + z-index: 10;
- + background-color: #FFF;
- + box-shadow: -3px 0px 5px #888;
- + transition: width 0.3s ease-in;
- ++ z-index: 200;
- +}
- +
- +#chat.opened {
- + width: 350px;
- + transition: width 0.3s ease-in;
- +}
- +@media (max-width: 367px){
- + body.responsive #chat.opened {
- + width: 300px;
- + }
- +}
- +
- +#chat-window {
- + height: 100%;
- + position: relative;
- +}
- +
- +#chat #buddy-list {
- + background-color: #f9f9f9;
- + top: 0;
- + right: -5px;
- + width: 0;
- + bottom: 100px;
- + position: absolute;
- + border-left: 1px solid #DCE4E7;
- + border-bottom: 1px solid #DCE4E7;
- + z-index: 2;
- + transition: width 0.3s ease-in;
- +}
- +
- +#chat.opened #buddy-list {
- + width: 70px;
- + transition: width 0.3s ease-in;
- +}
- +/*
- +#chat #buddy-list:hover {
- + right: 0;
- + width: 190px;
- + transition: width 0.3s ease-in;
- +}
- +*/
- +
- +#buddy-list .buddies {
- + position: absolute;
- + bottom: 0;
- + top: 25px;
- + right: 6px;
- + left: 7px;
- + bottom: 7px;
- + overflow: hidden;
- + white-space: nowrap;
- + transition: all 0.3s ease-in;
- +}
- +
- +/*
- +#buddy-list:hover .buddies {
- + top: 57px;
- + left: 15px;
- + right: 0;
- + transition: all 0.3s ease-in;
- +}
- +*/
- +
- +#buddy-list .buddies ul {
- + list-style-type: none;
- + padding: 0;
- + margin: 0;
- +}
- +#buddy-list .buddies a:hover {
- + background-color: #eeeeec;
- +}
- +
- +.occupant-list li a:hover {
- + background-color: black;
- +}
- +
- +.occupant-list .icon-menu-chat-11 {
- + background-image: none;
- +}
- +
- +#buddy-list .buddies li a, .occupant-list li a {
- + background-position: 0% 50%;
- + display: block;
- + padding-left: 17px;
- + text-decoration: none;
- + height: 35px;
- + overflow: hidden;
- + margin-top: 5px;
- +}
- +#buddy-list .buddies li a .name, .occupant-list li a .name {
- + vertical-align: middle;
- + margin-left: 5px;
- + position: relative;
- + display: inline-block;
- + max-width: 128px;
- + overflow: hidden;
- +}
- +.occupant-list li a .name {
- + color: white;
- +}
- +
- +#buddy-list .buddies li a img, .occupant-list li a img, #chat .avatar {
- + border-radius: 5px;
- + width: 24px;
- + max-height: 25px;
- + vertical-align: middle;
- +}
- +#chat #buddy-list .toolbar {
- + height: 45px;
- + width: 100%;
- + background-color: #bbbeb7;
- + display: table;
- +}
- +#buddy-list .toolbar .dialog-error {
- + position: absolute;
- + top: 30px;
- + left: 10px;
- + padding: 5px;
- + width: 170px;
- + -moz-border-radius: 5px;
- + -webkit-border-radius: 5px;
- + background: white;
- + border: 1px solid #888;
- ++ z-index: 10;
- +}
- +#buddy-list .toolbar .dialog-error p {
- + margin: 0 0 5px 0;
- +}
- +
- +#buddy-list .body{
- + position: absolute;
- + bottom: 0;
- + right: 0;
- + left: 0;
- + top: 20px;
- + padding: 15px;
- + transition: top 0.3s ease-in;
- +}
- +
- +/*
- +#buddy-list:hover .body{
- + top: 45px;
- + transition: top 0.3s ease-in;
- +}
- +*/
- +
- +#buddy-list .search{
- + width: 142px;
- + padding: 0;
- + height: 0;
- + color: #000;
- + background-color: #dee1da;
- + border: 0;
- + transition: all 0.2s ease-in;
- +}
- +
- +/*
- +#buddy-list:hover .search{
- + transition: all 0.3s ease-in 0.3;
- + height: 16px;
- + padding: 9px;
- +}
- +*/
- +
- +.conversation .input-div {
- + position: absolute;
- + right: 0;
- + left: 0;
- + bottom: 33px;
- + height: 80px;
- + padding-left: 7px;
- +}
- +.msie7 .conversation .input-div {
- + padding-left: 5px;
- + margin-right: 10px;
- +}
- +.conversation .input-div .icon-chat {
- + width: 16px;
- + height: 16px;
- + position: relative;
- + bottom: -23px;
- + left: 5px;
- +}
- +.msie7 .conversation .input-div .icon-chat {
- + left: 20px;
- +}
- +.conversation textarea {
- + height: 100%;
- + width: 98%;
- + overflow: auto;
- + padding-left: 25px;
- + padding-top: 3px;
- +}
- +#conversations .history {
- + overflow: hidden;
- + position: absolute;
- + right: 66px;
- + left: 0;
- + top: 45px;
- + bottom: 100px;
- +}
- +
- +#conversations .history.room {
- + bottom: 132px;
- +}
- +
- +#chat-label.opened #unread-messages,
- +#unread-messages:empty {
- + display: none;
- +}
- +
- +#unread-messages {
- + padding: 3px 5px;
- + background-color: #F57900;
- + border-radius: 5px;
- + margin-top: -10px;
- + margin-left: -30px;
- + position: absolute;
- + z-index: 1;
- +}
- +
- +#chat .unread-messages {
- + height: 32px;
- + line-height: 32px;
- + width: 32px;
- + background-color: black;
- + border-radius: 5px;
- + color: white;
- + font-size: 22px;
- + text-align: center;
- + vertical-align: middle;
- +}
- +
- +#chat-window .history .message {
- + padding: 10px 8px 10px 6px;
- + clear: both;
- +}
- +
- +#chat-window .history .message.self .time {
- + color: #888a85;
- +}
- +
- +#chat-window .history .message .time {
- + float: right;
- + color: white;
- + font-style: italic;
- + font-size: 10px;
- + border-bottom: 1px solid #d3d7cf;
- + width: 100%;
- + text-align: right;
- + margin-bottom: 5px;
- +}
- +#chat-window .history .message h5, #chat-window .history .message p {
- + margin: 0;
- +}
- +#chat-window .history .message p {
- + margin-left: 40px;
- + word-wrap: break-word;
- +}
- +
- +#chat-window .history .message.self p {
- + margin-left: 1px;
- + margin-right: 40px;
- +}
- +
- +#chat-window .history .message .content {
- + background-color: #bbbeb7;
- + color: white;;
- + padding: 8px;
- + border-radius: 5px;
- + display: inline-block;
- + width: 100%;
- + font-size: 15px;
- +}
- +#chat-window .history .message .content a {
- + color: rgb(108, 226, 255);
- + text-decoration: none;
- +}
- +#chat-window .history .message.self .content {
- + background-color: #f9f9f9;
- + color: #888a85;
- +}
- +
- +#chat-window .history .message .avatar {
- + max-height: 42px;
- + max-width: 32px;
- + margin: auto;
- + display: block;
- +}
- +#chat-window .history .notice {
- + font-size: 10px;
- + font-style: italic;
- + color: gray;
- + text-align: center;
- + display: block;
- +}
- +
- +#chat .user-status a:hover {
- + color: #FFF;
- + background-color: #999;
- + transition: 0.2s;
- +}
- +
- +.conversation div.occupants {
- + bottom: 118px;
- + background-color: #2e3436;
- +}
- +
- +div.occupants ul.occupant-list {
- + padding: 0;
- + margin: 0;
- + max-height: 162px;
- + overflow: hidden;
- + position: relative;
- + display: none;
- + border-top: 1px solid rgb(37, 37, 37);
- +}
- +div.occupants ul.occupant-list {
- + text-align: left;
- +}
- +
- +div.occupants > a {
- + color: rgb(168, 168, 168);
- + text-align: center;
- + width: 100%;
- + display: inline-block;
- + text-decoration: none;
- + background-image: url(/images/down-arrow.png);
- + background-position: 158px center;
- + background-repeat: no-repeat;
- + font-size: 10px;
- + font-weight: bold;
- +}
- +div.occupants > a.up {
- + background-image: url(/images/top-arrow.png);
- +}
- +
- +#chat-window .comment-balloon-content {
- + min-height: 50px;
- + padding: 5px 0 5px 25px;
- + position: relative;
- +}
- +#chat-window .comment-wrapper-1 {
- + margin-left: 0;
- +}
- +
- +#chat .title-bar {
- + height: 34px;
- + background: #ccc url(/images/icons-app/chat-22x22.png) 3px 5px no-repeat;
- + width: 250px;
- + background-color: #303030;
- + border-bottom: 1px solid #383838;
- +}
- +#chat .title-bar a {
- + text-decoration: none;
- +}
- +
- +#conversations {
- + height: 100%;
- +}
- +
- +#conversations .conversation {
- + height: 100%;
- + position: relative;
- +}
- +
- +#chat-window #conversations .conversation-header {
- + position: absolute;
- + right: 0;
- + left: 0;
- + background-color: #2e3436;
- + color: white;
- + width: 100%;
- + height: 32px;
- + font-size: 16px;
- + text-align: left;
- + padding-left: 15px;
- + z-index: 20;
- +}
- +
- +#user-status .avatar {
- + margin-left: 4px;
- +}
- +
- +.title-bar .title {
- + margin: 0;
- + font-size: 12px;
- + padding-left: 30px;
- + line-height: 32px;
- + color: rgb(82, 212, 253);
- + float: left;
- +}
- +#chat #chat-templates {
- + display: none;
- +}
- +.conversation .header {
- + position: absolute;
- + top: 0;
- + right: 0;
- + width: 100%;
- + height: 40px;
- + background-color: rgb(39, 39, 39);
- +}
- +.conversation .header .other-name {
- + color: rgb(238, 238, 238);
- +}
- +#chat .back {
- + float: right;
- + margin: 6px;
- + padding: 7px;
- + background-color: rgb(98, 98, 98);
- + border-radius: 6px;
- + text-decoration: none;
- + font-weight: bold;
- + color: white;
- +}
- +#chat #chat-window .other-name, #chat #chat-window .history .self-name, #chat #chat-window .history h5, #chat .toolbar #user-status span.other-name {
- + color: white;
- + overflow: hidden;
- + max-width: 140px;
- + line-height: 28px;
- +}
- +#chat .toolbar #user-status span, #chat #conversations .header .chat-target span {
- + max-width: 140px;
- + font-weight: 900;
- + color: white;
- + display: inline-block
- +}
- +#chat .toolbar #user-status span.user-status {
- + max-width: 200px;
- +}
- +#chat #chat-window .history h5 {
- + text-align: center;
- + word-wrap: break-word;
- + font-size: 9px;
- + max-height: 20px;
- +}
- +.webkit .simplemenu-submenu.opened {
- + top: 18px;
- +}
- +#chat .simplemenu-submenu {
- + background: #585858;
- + border: 1px solid #6B6B6B;
- + top: 42px;
- + left: auto;
- + right: 0;
- +}
- +
- +#chat .simplemenu-item:hover {
- + background: none;
- +}
- +
- +#buddy-list #user-status {
- + display: table-cell;
- + vertical-align: middle;
- + padding: 0;
- + white-space: nowrap;
- + transition: padding 0.3s ease-in;
- +}
- +
- +#chat .user-status a {
- + color: rgb(224, 224, 224);
- +}
- +
- +.user-status {
- + vertical-align: middle;
- +}
- +
- +.user-status span {
- + position: relative;
- +}
- +.user-status span, .user-status .ui-icon {
- + margin-left: 10px;
- +}
- +
- +.user-status .simplemenu-trigger {
- + display: block;
- + height: 42px;
- + line-height: 40px;
- + width: 161px;
- + padding-left: 21px;
- + background-position: 5px 11px;
- + margin: 0px;
- +}
- +
- +.user-status .simplemenu-trigger .ui-icon-triangle-1-s {
- + top: 20px;
- + right: 0px;
- +}
- +
- +.user-status .simplemenu-item a {
- + display: block;
- + height: 20px;
- + padding-left: 20px;
- + line-height: 19px;
- + background-position: 2px 1px;
- +}
- +
- +.conversation .author {
- + width: 32px;
- + display: inline-block;
- + vertical-align: top;
- + float: left;
- +}
- +.conversation .self .author {
- + float: right;
- +}
- +
- +#chat .header {
- + border: 0;
- + height: 50px;
- + line-height: 50px;
- + text-align: center;
- + color: #FFF;
- + font-size: 19px;
- + background-image: linear-gradient(to left, #E3E3E3 25%, #BABDB6 100%, #FFFFFF 100%);
- + xbackground-color: #BABDB6;
- +}
- +
- +#chat-label {
- + right: 0;
- + width: 0;
- + height: 0;
- + background-color: #888A85;
- + position: fixed;
- + top: 150px;
- + cursor: pointer;
- + text-align: center;
- + z-index: 11;
- + transition: background-color 0.2s linear, right 0.3s ease-in;
- +}
- +
- +#chat-label.opened {
- + width: 20px;
- + height: 90px;
- + right: 350px;
- + background-color: #888A85;
- + border-radius: 10px 0px 0 10px;
- + font-size: 14px;
- + transition: background-color 0.2s linear, right 0.3s ease-in;
- +}
- +@media (max-width: 367px){
- + body.responsive #chat-label.opened {
- + right: 300px;
- + }
- +}
- +
- +#chat-label.opened:hover {
- + background-color: #2E3436;
- + transition: background-color 0.2s linear, right 0.3s ease-in;
- +}
- +
- +#chat-label span {
- + color: white;
- +}
- +
- +#chat-label span.title {
- + font-size: 16px;
- + position: absolute;
- + background-color: #888A85;
- + border-radius: 10px 10px 0 0;
- + transform: rotate(-90deg);
- + top: 35px;
- + right: -34px;
- + width: 80px;
- + padding: 2px 5px;
- + text-shadow: 1px -1px 0 #666;
- + transition: background-color 0.2s linear, right 0.3s ease-in;
- +}
- +
- +#chat-label:hover span.title {
- + background-color: #2E3436;
- + transition: background-color 0.2s linear, right 0.3s ease-in;
- +}
- +
- +#chat-label span.right-arrow {
- + font-size: 18pxpx;
- + line-height: 87px;
- +}
- +
- +#chat-label .title {
- + display: inline;
- +}
- +
- +#chat-label.opened .title {
- + display: none;
- +}
- +
- +#chat-label .right-arrow {
- + display: none;
- +}
- +
- +#chat-label.opened .right-arrow {
- + display: inline;
- +}
- +
- +#chat-label div {
- + width: 64px;
- + height: 64px;
- + display: none;
- +}
- +
- +#chat-label.opened div {
- + display: inline-block;
- +}
- +
- +.conversation .room-action {
- + position: absolute;
- + bottom: 100px;
- + left: 7px;
- + right: 79px;
- + text-align: center;
- + cursor: pointer;
- + z-index: 1;
- + color: white;
- + border-radius: 3px;
- + font-size: 14px;
- +}
- +
- +.conversation .join {
- + background-color: #4E9A06;
- +}
- +
- +.conversation .leave {
- + background-color: #A40000;
- +}
- +
- +body.responsive.chat-opened #wrap-1 {
- + width:100%;
- + padding-right:355px;
- + transition: width 0.3s ease-in;
- +}
- +body.responsive.chat-opened #wrap-1 {
- + background-color: transparent !important;
- +}
- +body.responsive.chat-opened #wrap-1 > #content {
- + background-color: #fff;
- +}
- +@media (max-width: 767px){
- + body.responsive.chat-opened #wrap-1{
- + padding-right:0;
- + }
- +}
- diff --cc test/functional/content_viewer_controller_test.rb
- index 214c506,3006e97..647e958
- --- a/test/functional/content_viewer_controller_test.rb
- +++ b/test/functional/content_viewer_controller_test.rb
- @@@ -784,10 -789,24 +797,24 @@@ class ContentViewerControllerTest < Act
- get :view_page, :profile => profile.identifier, :page => blog.path
- - assert_tag :tag => 'div', :attributes => { :class => 'short-post'}, :content => /Content to be displayed./
- - assert_no_tag :tag => 'div', :attributes => { :class => 'short-post'}, :content => /Anything/
- + assert_tag :tag => 'img', :attributes => { :class => 'automatic-abstract-thumb', :src => 'http://this_is_an_url/this_is_an_image.png', :style => nil}
- + assert_tag :tag => 'div', :attributes => { :class => 'short-post'}, :content => /The first paragraph of the article\. The second paragraph The third which is a really biiiiiiig paragraph jds ksajdhf ksdfkjhsdh fakdshf askdjhfsd lfhsdlkfa dslkfah dskjahsd faksdhfk sdfkas fkjshfk sdhjf sdkjf sdkj fkdsjhfal ksdjhflaksjdhdsghfg sjhfgsdjhf sdjhgf asdjf sadj fadjhs gfas dkjgf asdjhf asdjh fjkdsg fjsdgf asdjf sadjlgf jsçlkdsjhfdsa lksajsalj aldja lkja slkdjal aj dasldkjas lkjsdj kj \.\.\./
- end
- + should 'show only first paragraph with picture of posts if visualization_format is short+pic' do
- + login_as(profile.identifier)
- +
- + blog = Blog.create!(:name => 'A blog test', :profile => profile, :visualization_format => 'short+pic')
- +
- + blog.posts << TinyMceArticle.create!(:name => 'first post', :parent => blog, :profile => profile, :body => '<p>Content to be displayed.</p> <img src="pic.jpg">')
- +
- + get :view_page, :profile => profile.identifier, :page => blog.path
- +
- + assert_select '.blog-post .post-pic' do |el|
- + assert_match /background-image:url\(pic.jpg\)/, el.to_s
- + end
- + end
- +
- should 'display link to edit blog for allowed' do
- blog = fast_create(Blog, :profile_id => profile.id, :path => 'blog')
- login_as(profile.identifier)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement