diff --git a/Gemfile b/Gemfile index 5de65c8..fff1c6a 100644 --- a/Gemfile +++ b/Gemfile @@ -20,6 +20,11 @@ gem 'locale', '~> 2.0.5' gem 'whenever', :require => false gem 'eita-jrails', '>= 0.9.5', :require => 'jrails' +group :assets do + gem 'uglifier', '>= 1.0.3' + gem 'sass-rails' +end + group :production do gem 'dalli', '~> 2.7.0' end diff --git a/app/assets/designs/icons b/app/assets/designs/icons new file mode 120000 index 0000000..32f9c08 --- /dev/null +++ b/app/assets/designs/icons @@ -0,0 +1 @@ +../../../public/designs/icons \ No newline at end of file diff --git a/app/assets/designs/themes b/app/assets/designs/themes new file mode 120000 index 0000000..2e41f33 --- /dev/null +++ b/app/assets/designs/themes @@ -0,0 +1 @@ +../../../public/designs/themes \ No newline at end of file diff --git a/app/assets/images b/app/assets/images new file mode 120000 index 0000000..bbc6374 --- /dev/null +++ b/app/assets/images @@ -0,0 +1 @@ +../../public/images \ No newline at end of file diff --git a/app/assets/javascripts b/app/assets/javascripts new file mode 120000 index 0000000..a1d91ad --- /dev/null +++ b/app/assets/javascripts @@ -0,0 +1 @@ +../../public/javascripts \ No newline at end of file diff --git a/app/assets/plugins b/app/assets/plugins new file mode 120000 index 0000000..3203382 --- /dev/null +++ b/app/assets/plugins @@ -0,0 +1 @@ +../../public/plugins \ No newline at end of file diff --git a/app/assets/stylesheets b/app/assets/stylesheets new file mode 120000 index 0000000..03c3f80 --- /dev/null +++ b/app/assets/stylesheets @@ -0,0 +1 @@ +../../public/stylesheets \ No newline at end of file diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index dc08a4c..1283599 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -919,18 +919,6 @@ module ApplicationHelper end end - def icon_theme_stylesheet_path - icon_themes = [] - theme_icon_themes = theme_option(:icon_theme) || [] - for icon_theme in theme_icon_themes do - theme_path = "/designs/icons/#{icon_theme}/style.css" - if File.exists?(Rails.root.join('public', theme_path[1..-1])) - icon_themes << theme_path - end - end - icon_themes - end - def page_title CGI.escapeHTML( (@page ? @page.title + ' - ' : '') + diff --git a/app/helpers/layout_helper.rb b/app/helpers/layout_helper.rb index 71b4675..fda8028 100644 --- a/app/helpers/layout_helper.rb +++ b/app/helpers/layout_helper.rb @@ -28,12 +28,12 @@ module LayoutHelper end def noosfero_javascript - plugins_javascripts = @plugins.map { |plugin| [plugin.js_files].flatten.map { |js| plugin.class.public_path(js) } }.flatten + plugins_javascripts = @plugins.map { |plugin| [plugin.js_files].flatten.map { |js| plugin.class.public_path(js, true) } }.flatten output = '' output += render 'layouts/javascript' unless plugins_javascripts.empty? - output += javascript_include_tag plugins_javascripts, :cache => "cache/plugins-#{Digest::MD5.hexdigest plugins_javascripts.to_s}" + output += javascript_include_tag *plugins_javascripts end output += theme_javascript_ng.to_s output += javascript_tag 'render_all_jquery_ui_widgets()' @@ -42,16 +42,6 @@ module LayoutHelper end def noosfero_stylesheets - standard_stylesheets = [ - 'application', - 'search', - 'colorbox', - 'selectordie', - 'inputosaurus', - 'chat', - 'selectordie-theme', - pngfix_stylesheet_path, - ] + tokeninput_stylesheets plugins_stylesheets = @plugins.select(&:stylesheet?).map { |plugin| plugin.class.public_path('style.css') } @@ -59,13 +49,13 @@ module LayoutHelper global_css_at_fs = Rails.root.join 'public' + global_css_pub output = [] - output << stylesheet_link_tag(standard_stylesheets, :cache => 'cache/application') + output << stylesheet_link_tag('application') output << stylesheet_link_tag(template_stylesheet_path) - output << stylesheet_link_tag(icon_theme_stylesheet_path) + output << stylesheet_link_tag(*icon_theme_stylesheet_path) output << stylesheet_link_tag(jquery_ui_theme_stylesheet_path) unless plugins_stylesheets.empty? cacheid = "cache/plugins-#{Digest::MD5.hexdigest plugins_stylesheets.to_s}" - output << stylesheet_link_tag(plugins_stylesheets, :cache => cacheid) + output << stylesheet_link_tag(*plugins_stylesheets, cache: cacheid) end if File.exists? global_css_at_fs output << stylesheet_link_tag(global_css_pub) @@ -74,14 +64,6 @@ module LayoutHelper output.join "\n" end - def pngfix_stylesheet_path - 'iepngfix/iepngfix.css' #TODO: deprecate it - end - - def tokeninput_stylesheets - ['token-input', 'token-input-facebook', 'token-input-mac', 'token-input-facet'] - end - def noosfero_layout_features render :file => 'shared/noosfero_layout_features' end @@ -99,7 +81,7 @@ module LayoutHelper icon_themes = [] theme_icon_themes = theme_option(:icon_theme) || [] for icon_theme in theme_icon_themes do - theme_path = "/designs/icons/#{icon_theme}/style.css" + theme_path = "designs/icons/#{icon_theme}/style.css" if File.exists?(Rails.root.join('public', theme_path)) icon_themes << theme_path end @@ -112,7 +94,7 @@ module LayoutHelper end def theme_stylesheet_path - theme_path + '/style.css' + "/assets#{theme_path}/style.css" end def layout_template diff --git a/app/helpers/macros_helper.rb b/app/helpers/macros_helper.rb index 5a88e86..abb2f73 100644 --- a/app/helpers/macros_helper.rb +++ b/app/helpers/macros_helper.rb @@ -42,7 +42,9 @@ module MacrosHelper [macro.configuration[:js_files]].flatten.map { |js| plugins_javascripts << macro.plugin.public_path(js) } end end - javascript_include_tag(plugins_javascripts, :cache => 'cache/plugins-' + Digest::MD5.hexdigest(plugins_javascripts.to_s)) unless plugins_javascripts.empty? + unless plugins_javascripts.empty? + javascript_include_tag *plugins_javascripts + end end def macro_css_files diff --git a/app/views/layouts/_javascript.html.erb b/app/views/layouts/_javascript.html.erb index a0fce8b..dde28d6 100644 --- a/app/views/layouts/_javascript.html.erb +++ b/app/views/layouts/_javascript.html.erb @@ -1,12 +1,4 @@ -<%= javascript_include_tag 'jquery-2.1.1.min', 'jquery-migrate-1.2.1', 'jrails', 'rails.js', - 'jquery.cycle.all.min.js', 'jquery.colorbox-min.js', - 'jquery-ui-1.10.4/js/jquery-ui-1.10.4.min', 'jquery.scrollTo', 'jquery.form.js', 'jquery-validation/jquery.validate', - 'jquery.cookie', 'jquery.ba-bbq.min.js', 'reflection', 'jquery.tokeninput', 'jquery.typewatch', 'jquery.textchange', - 'jquery-timepicker-addon/dist/jquery-ui-timepicker-addon', 'inputosaurus.js', 'select-or-die/_src/selectordie', - # noosfero libraries - 'application.js', 'modal.js', - 'add-and-join', 'report-abuse', 'catalog', 'manage-products', 'autogrow', - :cache => 'cache/application' %> +<%= javascript_include_tag 'application.js' %> <% language = FastGettext.locale %> <% %w{messages methods}.each do |type| %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index d3fffd7..7b6dd8b 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -21,7 +21,7 @@ import_controller_stylesheets(:themed_source => true) %> <%= stylesheet_link_tag template_stylesheet_path %> - <%= stylesheet_link_tag icon_theme_stylesheet_path %> + <%= stylesheet_link_tag *icon_theme_stylesheet_path %> <%= stylesheet_link_tag jquery_ui_theme_stylesheet_path %> <%# Add custom tags/styles/etc via content_for %> diff --git a/app/views/layouts/chat.html.erb b/app/views/layouts/chat.html.erb new file mode 100644 index 0000000..da00b27 --- /dev/null +++ b/app/views/layouts/chat.html.erb @@ -0,0 +1,64 @@ + + + + <%= h page_title %> + + + + <%= noosfero_javascript %> + <%= javascript_include_tag 'jquery.scrollabletab', 'strophejs-1.0.1/strophe', 'jquery.emoticon', '../designs/icons/pidgin/emoticons.js', 'ba-linkify', 'jquery.ba-hashchange', 'jquery.sound', 'chat' %> + <%= noosfero_stylesheets %> + <%= stylesheet_link_tag *icon_theme_stylesheet_path %> + <%= stylesheet_link_tag theme_stylesheet_path %> + <%= stylesheet_link_tag jquery_ui_theme_stylesheet_path %> + + + +
+

<%= _("%s - Friends online (%d)") % [h(page_title), 0] %>

+
+
+ +
+
<%= user_status_menu('icon-menu-offline', _('Offline')) %>
+ +
+ +
+
+
+ +
+ +
+ <%= yield %> + + diff --git a/app/views/layouts/slideshow.html.erb b/app/views/layouts/slideshow.html.erb index 27530cd..69ffe43 100644 --- a/app/views/layouts/slideshow.html.erb +++ b/app/views/layouts/slideshow.html.erb @@ -11,7 +11,7 @@ %> <%= stylesheet_import "slideshow" %> - <%= javascript_include_tag 'jquery-2.1.1.min', 'sliderjs', 'pikachoose', :cache => 'cache/slideshow' %> + <%= javascript_include_tag 'jquery-2.1.1.min', 'sliderjs', 'pikachoose' %>