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
Showing
20 changed files
with
196 additions
and
63 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class CommentSweeper < ActionController::Caching::Sweeper | ||
observe Comment | ||
|
||
def after_create(comment) | ||
expire_page("/feed.xml") | ||
end | ||
|
||
def after_destroy(comment) | ||
expire_page("/feed.xml") | ||
end | ||
|
||
def after_update(comment) | ||
#expire_page("/feed.xml") | ||
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class PostSweeper < ActionController::Caching::Sweeper | ||
observe Post | ||
|
||
def after_create(post) | ||
expire_page("/feed.xml") | ||
expire_fragment("home_intro") | ||
end | ||
|
||
def after_destroy(post) | ||
expire_page("/feed.xml") | ||
expire_fragment("home_intro") | ||
end | ||
|
||
def after_update(post) | ||
expire_page("/feed.xml") | ||
expire_fragment("home_intro") | ||
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class TalkSweeper < ActionController::Caching::Sweeper | ||
observe Talk | ||
|
||
def after_create(talk) | ||
expire_page("/feed.xml") | ||
expire_fragment("home_talks") | ||
end | ||
|
||
def after_destroy(talk) | ||
expire_page("/feed.xml") | ||
expire_fragment("home_talks") | ||
end | ||
|
||
def after_update(talk) | ||
expire_page("/feed.xml") | ||
expire_fragment("home_talks") | ||
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class UserSweeper < ActionController::Caching::Sweeper | ||
observe User | ||
|
||
def after_create(user) | ||
#expire_page("/index.xml") | ||
expire_fragment("home_users") | ||
expire_fragment("users_page") | ||
end | ||
|
||
def after_destroy(user) | ||
#expire_page("/index.xml") | ||
expire_fragment("home_users") | ||
expire_fragment("users_page") | ||
end | ||
|
||
def after_update(talk) | ||
#expire_page("/index.xml") | ||
expire_fragment("home_users") | ||
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 |
---|---|---|
@@ -1,41 +1,47 @@ | ||
<% content_for :intro do %> | ||
<div class="yui-b first" id="intro"> | ||
<h1><img src="/images/mail-24.png" class="icon"> O que é o Barcamp Portugal?</h1> | ||
<p>O Barcamp Portugal nasceu em 2006 e pretende ser um ponto de encontro de gente que se junta para falar nos mais variados temas que, normalmente, gravitam em torno de Inovação, Empreendorismo e Web.</p> | ||
<p>Este ano, optámos por usar este site em vez da tradicional wiki por permitir uma gestão mais rigorosa dos inscritos (no evento e nas refeições, mais tarde) e esperemos que facilite a comunicação entre as pessoas.</p> | ||
|
||
<h1><img src="/images/mail-24.png" class="icon"> Novidades <a href="/feed.xml"><img src="/images/rss-16.png" class="icon" style="margin-right:0px"></a></h1> | ||
|
||
<% for post in @posts %> | ||
<div class="leftbar"> | ||
<h3><%= post.title %>, <%= post.created_at.strftime("%d/%m/%Y - %H:%M")%></h3> | ||
<p><%= white_list post.body_html %><p> | ||
<% cache "home_intro" do %> | ||
<div class="yui-b first" id="intro"> | ||
<h1><img src="/images/mail-24.png" class="icon"> O que é o Barcamp Portugal?</h1> | ||
<p>O Barcamp Portugal nasceu em 2006 e pretende ser um ponto de encontro de gente que se junta para falar nos mais variados temas que, normalmente, gravitam em torno de Inovação, Empreendorismo e Web.</p> | ||
<p>Este ano, optámos por usar este site em vez da tradicional wiki por permitir uma gestão mais rigorosa dos inscritos (no evento e nas refeições, mais tarde) e esperemos que facilite a comunicação entre as pessoas.</p> | ||
|
||
<h1><img src="/images/mail-24.png" class="icon"> Novidades <a href="/feed.xml"><img src="/images/rss-16.png" class="icon" style="margin-right:0px"></a></h1> | ||
|
||
<% for post in @posts %> | ||
<div class="leftbar"> | ||
<h3><%= post.title %>, <%= post.created_at.strftime("%d/%m/%Y - %H:%M")%></h3> | ||
<p><%= white_list post.body_html %><p> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
<div class="yui-u first"> | ||
<h2><img src="/images/phone.png" class="icon"> Users inscritos</h2> | ||
<ul> | ||
<%= render :partial => "users/user", :collection => @users %> | ||
<% if @users.empty? %> | ||
<li>nenhum. ainda :)</li> | ||
<% cache "home_users" do %> | ||
<div class="yui-u first"> | ||
<h2><img src="/images/phone.png" class="icon"> Users inscritos (<%=@user_count%>)</h2> | ||
<ul> | ||
<%= render :partial => "users/user", :collection => @users %> | ||
<% if @users.empty? %> | ||
<li>nenhum. ainda :)</li> | ||
<% end %> | ||
</ul> | ||
<% if @user_count > 10 %> | ||
<a href="/users">Ver a lista completa</a> | ||
<% end %> | ||
</ul> | ||
<% if @user_count > 10 %> | ||
<a href="/users">Ver a lista completa</a> | ||
<% end %> | ||
</div> | ||
<div class="yui-u"> | ||
<h2><img src="/images/text.png" class="icon"> Sessões propostas</h2> | ||
<ul> | ||
<%= render :partial => "talks/talk", :collection => @talks %> | ||
<% if @talks.empty? %> | ||
<li>nenhuma. ainda :)</li> | ||
</div> | ||
<% end %> | ||
<% cache "home_talks" do %> | ||
<div class="yui-u"> | ||
<h2><img src="/images/text.png" class="icon"> Sessões propostas</h2> | ||
<ul> | ||
<%= render :partial => "talks/talk", :collection => @talks %> | ||
<% if @talks.empty? %> | ||
<li>nenhuma. ainda :)</li> | ||
<% end %> | ||
</ul> | ||
<% if @talk_count > 4 %> | ||
<a href="/talks">Ver a lista completa</a> | ||
<% end %> | ||
</ul> | ||
<% if @talk_count > 4 %> | ||
<a href="/talks">Ver a lista completa</a> | ||
<% end %> | ||
</div> | ||
</div> | ||
<% 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
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,7 +1,11 @@ | ||
<h2><img src="/images/phone.png" class="icon"> Users inscritos</h2> | ||
<ul> | ||
<%= render :partial => "users/user", :collection => @users %> | ||
<% if @users.empty? %> | ||
<li>nenhum. ainda :)</li> | ||
<% end %> | ||
</ul> | ||
<% cache "users_page" do %> | ||
Até este momento, estão inscritas <%= @users.size %> pessoas, <%= @openid_count %> das quais usaram OpenID. | ||
|
||
<h2><img src="/images/phone.png" class="icon"> Users inscritos (<%= @users.size %>)</h2> | ||
<ul> | ||
<%= render :partial => "users/user", :collection => @users %> | ||
<% if @users.empty? %> | ||
<li>nenhum. ainda :)</li> | ||
<% end %> | ||
</ul> | ||
<% 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,18 @@ | ||
class PopulateBodyHtml < ActiveRecord::Migration | ||
def self.up | ||
for c in Comment.find(:all) | ||
c.save! | ||
end | ||
|
||
for p in Post.find(:all) | ||
p.save! | ||
end | ||
|
||
for t in Talk.find(:all) | ||
t.save! | ||
end | ||
end | ||
|
||
def self.down | ||
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,8 @@ | ||
require 'test_helper' | ||
|
||
class PostObserverTest < Test::Unit::TestCase | ||
# Replace this with your real tests. | ||
def test_truth | ||
assert true | ||
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require 'test_helper' | ||
|
||
class TalkObserverTest < Test::Unit::TestCase | ||
# Replace this with your real tests. | ||
def test_truth | ||
assert true | ||
end | ||
end |