diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1917b6b..957fe89 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -11,7 +11,6 @@ module ApplicationHelper ICONS_DIR_PATH = "#{RAILS_ROOT}/public/icons" THEME_DIR_PATH = "#{RAILS_ROOT}/public/themes" - # Generate a select option to choose one of the available themes. # The available themes are those in 'public/themes' diff --git a/app/models/link_block.rb b/app/models/link_block.rb index 7b50f9e..cca0c6a 100644 --- a/app/models/link_block.rb +++ b/app/models/link_block.rb @@ -1,21 +1,7 @@ class LinkBlock < Block - # Redefinition of to_html Block method that show a list of links showing the Profile name. - # - # Ex: - # - # Colivre - # - # PSL-BA - def to_html - profiles = Profile.find(:all).map do |p| - content_tag("a href='http://www.google.com.br'", p.name) - end - profiles.join(',') - end - def content - profiles = Profile.find(:all) + Profile.find(:all).map{|p| p.name} end end diff --git a/app/models/list_block.rb b/app/models/list_block.rb index 933c34b..b03a5de 100644 --- a/app/models/list_block.rb +++ b/app/models/list_block.rb @@ -1,6 +1,6 @@ class ListBlock < Block - def to_html - content_tag(:ul, Profile.find(:all).map{|p| content_tag( :li, p.name ) }) + def content + Profile.find(:all).map{|p|p.name} end end diff --git a/db/migrate/005_manage_template_migration.rb b/db/migrate/005_manage_template_migration.rb index 350cc42..b9b2412 100644 --- a/db/migrate/005_manage_template_migration.rb +++ b/db/migrate/005_manage_template_migration.rb @@ -12,6 +12,7 @@ class ManageTemplateMigration < ActiveRecord::Migration t.column :box_id, :integer t.column :position, :integer t.column :type, :string + t.column :helper, :string end end diff --git a/test/fixtures/blocks.yml b/test/fixtures/blocks.yml index ce96174..e2d3642 100644 --- a/test/fixtures/blocks.yml +++ b/test/fixtures/blocks.yml @@ -5,6 +5,7 @@ one: box_id: 2 position: 1 type: 'MainBlock' + helper: 'plain_content' name: 'Main Content' # Link Blocks two: @@ -12,12 +13,14 @@ two: box_id: 1 position: 2 type: 'LinkBlock' + helper: 'list_content' name: 'List of Links 1' three: id: 3 box_id: 1 position: 3 type: 'LinkBlock' + helper: 'plain_content' name: 'List of Link 2' #List Blocks four: @@ -25,16 +28,19 @@ four: box_id: 1 position: 1 type: 'ListBlock' + helper: 'list_content' name: 'List of Names 1' five: id: 5 box_id: 3 position: 1 type: 'ListBlock' + helper: 'list_content' name: 'List of Names 2' six: id: 6 box_id: 3 position: 2 type: 'ListBlock' + helper: 'list_content' name: 'List of Names 3' -- libgit2 0.21.2