Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dani
committed
Jan 20, 2009
1 parent
0983ac4
commit 12192fb
Showing
22 changed files
with
155 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
Blog.Calendario.Mensajes.Documentos.Archivos.Grupos.Usuarios | ||
|
||
todos los clips tienen: destinatario (visibilidad), fecha (para eventos) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
class Clip < ActiveRecord::Base | ||
belongs_to :user | ||
belongs_to :recipient, :class_name => 'Group' | ||
|
||
named_scope :posts, :conditions => {:content_type => 'blog'} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
class Document < ActiveRecord::Base | ||
DIALECTS = [:plain, :html, :textile] | ||
|
||
def summary | ||
"<h1>#{title}</h1>#{body}" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
class Group < ActiveRecord::Base | ||
has_and_belongs_to_many :users | ||
named_scope :gaks, :conditions => {:gak => true} | ||
|
||
|
||
GROUPS = {:cyl => 1, :web => 2} | ||
|
||
|
||
def self.get(name) | ||
Group::GROUPS[name] | ||
end | ||
|
||
def new_clip(user) | ||
Clip.new(:title => 'Nuevo grupo', :description => "Celebramos la creación del grupo #{self.name}", | ||
:content_class => 'Group', :content_type => 'group', :content_id => self.id, | ||
:user_id => user.id, :recipient_id => Group.get(:web)) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<div class="actions"> | ||
<%= link_to 'Crear entrada', {:action => 'blog_new'}, :class => 'button' %> | ||
</div> | ||
|
||
<h1>Entradas del blog</h1> | ||
<table> | ||
<% for post in Clip.posts -%> | ||
<tr> | ||
<td class="info"><%= clip_info post %></td> | ||
<td class="title"><%= Document.find(post.content_id).title %> </td> | ||
<td class="description"><%= link_to 'editar', {:action => 'blog_edit', :id => post.id}, :class => 'button' %></td> | ||
</tr> | ||
<% end -%> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<h1>Crear una entrada de blog</h1> | ||
|
||
<% form_tag( {:action => 'blog_create'}, :id => 'blog_create') do -%> | ||
<%= field_text 'Título', :blog, :title, :validate => [:not_empty] %> | ||
<%= field_select 'Dialecto', :blog, :dialect, Document::DIALECTS %> | ||
<%= field_area 'Contenido', :blog, :body %> | ||
<%= field_submit 'Crear entrada', :blog_create %> | ||
<% end -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<h1>Enviar un nuevo mensaje</h1> | ||
|
||
<% form_tag({:action => 'message_create'}, :id => 'message_create') do -%> | ||
<%= field_info 'De', @current.name %> | ||
<%= field_select 'Para', :message, :to, Group.all.collect {|p| [ p.name, p.id ] } %> | ||
<%= field_select 'Tipo', :message, :type, Label.all.collect {|p| [ p.name, p.id ] } %> | ||
<%= field_text 'Asunto', :message, :subject %> | ||
<%= field_area 'Texto', :message, :body %> | ||
<%= field_submit 'Enviar mensaje', :message_create %> | ||
<% end -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# SQLite version 3.x | ||
# gem install sqlite3-ruby (not necessary on OS X Leopard) | ||
development: | ||
adapter: sqlite3 | ||
database: db/development.sqlite3 | ||
pool: 5 | ||
timeout: 5000 | ||
|
||
# Warning: The database defined as "test" will be erased and | ||
# re-generated from your development database when you run "rake". | ||
# Do not set this db to the same as development or production. | ||
test: | ||
adapter: sqlite3 | ||
database: db/test.sqlite3 | ||
pool: 5 | ||
timeout: 5000 | ||
|
||
production: | ||
adapter: sqlite3 | ||
database: db/production.sqlite3 | ||
pool: 5 | ||
timeout: 5000 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters