Commit a6a70bfecedd08c27d46cf63de0dee7361013ea1
1 parent
202d2745
Exists in
staging
and in
42 other branches
ActionItem0: updating block and boxes
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@163 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
3 changed files
with
11 additions
and
1 deletions
Show diff stats
app/controllers/application.rb
| @@ -9,7 +9,7 @@ class ApplicationController < ActionController::Base | @@ -9,7 +9,7 @@ class ApplicationController < ActionController::Base | ||
| 9 | attr_reader :virtual_community | 9 | attr_reader :virtual_community |
| 10 | 10 | ||
| 11 | before_filter :load_owner | 11 | before_filter :load_owner |
| 12 | - # Load the owner | 12 | + # Load the owner |
| 13 | def load_owner | 13 | def load_owner |
| 14 | # TODO: this should not be hardcoded | 14 | # TODO: this should not be hardcoded |
| 15 | if Profile.exists?(1) | 15 | if Profile.exists?(1) |
app/controllers/edit_template_controller.rb
| @@ -6,4 +6,13 @@ class EditTemplateController < ApplicationController | @@ -6,4 +6,13 @@ class EditTemplateController < ApplicationController | ||
| 6 | Profile.find(1) | 6 | Profile.find(1) |
| 7 | end | 7 | end |
| 8 | 8 | ||
| 9 | + def flexible_template_dict(str) | ||
| 10 | + { | ||
| 11 | + 'MainBlock' => _("Main Block"), | ||
| 12 | + 'ListBlock' => _("List Block"), | ||
| 13 | + 'LinkBlock' => _("Link Block") | ||
| 14 | + }[str] || str | ||
| 15 | + end | ||
| 16 | + | ||
| 17 | + | ||
| 9 | end | 18 | end |
db/migrate/005_manage_template_migration.rb
| @@ -2,6 +2,7 @@ class ManageTemplateMigration < ActiveRecord::Migration | @@ -2,6 +2,7 @@ class ManageTemplateMigration < ActiveRecord::Migration | ||
| 2 | def self.up | 2 | def self.up |
| 3 | create_table :boxes do |t| | 3 | create_table :boxes do |t| |
| 4 | t.column :name, :string | 4 | t.column :name, :string |
| 5 | + t.column :title, :string | ||
| 5 | t.column :number, :integer | 6 | t.column :number, :integer |
| 6 | t.column :owner_type, :string | 7 | t.column :owner_type, :string |
| 7 | t.column :owner_id, :integer | 8 | t.column :owner_id, :integer |