diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d33cbef..c1473a4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -268,21 +268,7 @@ module ApplicationHelper end def text_editor(object, method, filter_type_method = nil, options = {}) - filter_type = - if filter_type_method.blank? - '' - else - instance_variable_get("@#{object}").send(filter_type_method) - end - if filter_type == '[No Filter]' || filter_type.blank? - html_class = "tiny_mce_editor" - if options[:class] - html_class << " #{options[:class]}" - end - text_area(object, method, { :size => '72x12' }.merge(options).merge({:class => html_class})) - else - text_area(object, method, { :size => '72x12' }.merge(options)) - end + text_area(object, method, { :rows => 10, :cols => 64 }.merge(options)) end def file_manager(&block) @@ -318,6 +304,10 @@ module ApplicationHelper design_display_button(type, label, url, { :class => 'with_text' }.merge(html_options)) end + def submit_button(type, label, html_options = {}) + design_display_button_submit(type, label, { :class => 'with_text' }.merge(html_options)) + end + def button_to_function(type, label, js_code, html_options = {}) #design_display_function_button(type, label, js_code, { :class => 'with_text' }.merge(html_options)) html_options[:class] = "" unless html_options[:class] @@ -330,7 +320,7 @@ module ApplicationHelper end def button_bar(options = {}, &block) - concat(content_tag('div', capture(&block) + tag('br', :style => 'clear: left;'), options), block.binding) + concat(content_tag('div', capture(&block) + tag('br', :style => 'clear: left;'), { :class => 'button-bar' }.merge(options)), block.binding) end def link_to_category(category) diff --git a/app/models/person.rb b/app/models/person.rb index 0a99868..914c71f 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -53,7 +53,4 @@ class Person < Profile end end - def person? - true - end end diff --git a/app/models/profile.rb b/app/models/profile.rb index 1e8a99c..ae15a2e 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -143,7 +143,17 @@ class Profile < ActiveRecord::Base environment end + # returns +false+ def person? - false + self.kind_of?(Person) end + + def enterprise? + self.kind_of?(Enterprise) + end + + def organization? + self.kind_of?(Organization) + end + end diff --git a/app/views/cms/text_html_new.rhtml b/app/views/cms/text_html_new.rhtml index 66485d4..4d874b1 100644 --- a/app/views/cms/text_html_new.rhtml +++ b/app/views/cms/text_html_new.rhtml @@ -8,10 +8,10 @@ <%= f.text_field('name', :size => '64') %> - <%= f.text_area('abstract', :cols => 64, :rows => 5) %> - <%= f.text_field('tag_list', :size => 64, :title => _('Separate tags with commas')) %> + <%= f.text_area('abstract', :cols => 64, :rows => 5) %> + <%= f.text_area('body', :cols => 64) %> <%= design_display_button_submit('save', _('Save')) %> diff --git a/app/views/enterprise_registration/basic_information.rhtml b/app/views/enterprise_registration/basic_information.rhtml index e154fcf..4e91237 100644 --- a/app/views/enterprise_registration/basic_information.rhtml +++ b/app/views/enterprise_registration/basic_information.rhtml @@ -28,9 +28,9 @@ <%= f.select('region_id', @regions) %> -
- <%= submit_tag _('Register') %> - <%= link_to _('Cancel'), :action => 'index' %> -
+ <% button_bar do %> + <%= submit_button('save', _('Register')) %> + <%= button 'cancel', _('Cancel'), :action => 'index' %> + <% end %> <% end %> diff --git a/app/views/layouts/application.rhtml b/app/views/layouts/application.rhtml index fc9a359..4113362 100644 --- a/app/views/layouts/application.rhtml +++ b/app/views/layouts/application.rhtml @@ -42,6 +42,7 @@
+ <%= image_tag 'noosfero.png', :style => 'float: left;' %>
<% if @category %> <%= @category.full_name %> diff --git a/app/views/profile_editor/index.rhtml b/app/views/profile_editor/index.rhtml index 469d078..a4e58e3 100644 --- a/app/views/profile_editor/index.rhtml +++ b/app/views/profile_editor/index.rhtml @@ -13,15 +13,16 @@ <%= file_manager_button(_('Manage Content'), 'icons-app/cms.png', :controller => 'cms') %> - <%= file_manager_button(_('Change Password'), 'icons-app/change-password.png', :controller => 'account', :action => 'change_password') %> + <%= file_manager_button(_('Change Password'), 'icons-app/change-password.png', :controller => 'account', :action => 'change_password') if profile.person? %> - <%= file_manager_button(_('Manage Products'), 'icons-app/products.png', :controller => 'manage_products') if @profile.kind_of?(Enterprise) %> + <%= file_manager_button(_('Manage Products'), 'icons-app/products.png', :controller => 'manage_products') if profile.enterprise? %> <% end %> - -

<%= _('My organizations') %>

+ +<% file_manager do %> + + <%= file_manager_button(_('Register a new Enterprise'), 'icons-app/enterprise-registration.png', :controller => 'enterprise_registration') %> + +<% end %> diff --git a/public/images/icons-app/README b/public/images/icons-app/README index fb0b95c..fb75ace 100644 --- a/public/images/icons-app/README +++ b/public/images/icons-app/README @@ -1,17 +1,29 @@ dlg-neu icons in Noosfero ========================= -The icons in this directory are taken from the dlg-neu icon theme for GNOME, +The icons in this directory are taken from the icon themes for GNOME, section "apps/". We take the SVG files and convert to 64x64 PNG images, so these icons are in fact derived works based on dlg-neu's SVG files. Structure ========= -To keep a trace back to dlg-neu theme, when rasterizing the SVG files we keep +To keep a trace back to the theme theme, when rasterizing the SVG files we keep the original filenames (replacing .svg by .png, obviously) and create symbolic links with names more sensible for Noosfero. +Source for icons +================ + +Icon Theme +------------------------------ ------- +gnome-settings-background.png dlg-neu +gnome-settings-theme.png Nuovo +password.png dlg-neu +abiword_48.png dlg-neu +gnome-other.png Nuovo +user_icon.png dlg-neu + Icons rasterization =================== diff --git a/public/images/icons-app/enterprise-registration.png b/public/images/icons-app/enterprise-registration.png new file mode 120000 index 0000000..9850e17 --- /dev/null +++ b/public/images/icons-app/enterprise-registration.png @@ -0,0 +1 @@ +gnome-settings-theme.png \ No newline at end of file diff --git a/public/images/icons-app/gnome-settings-theme.png b/public/images/icons-app/gnome-settings-theme.png new file mode 100644 index 0000000..9f4d59b Binary files /dev/null and b/public/images/icons-app/gnome-settings-theme.png differ diff --git a/public/stylesheets/button.css b/public/stylesheets/button.css index 11069cd..d41f9de 100644 --- a/public/stylesheets/button.css +++ b/public/stylesheets/button.css @@ -1,3 +1,7 @@ +.button-bar { + margin-top: 1em; +} + .button { border: none; margin-left: 5px; diff --git a/public/stylesheets/common.css b/public/stylesheets/common.css index 3f40f19..51b8a1c 100644 --- a/public/stylesheets/common.css +++ b/public/stylesheets/common.css @@ -123,6 +123,7 @@ div.file-manager-button a { padding: 3px; height: 80px; overflow: hidden; + background: white; } div.file-manager -- libgit2 0.21.2