Permalink
Browse files

testing albums branch

  • Loading branch information...
1 parent 7228fb9 commit fe067355f37b727aecad12a67ff83683a9029bb1 @juafrlo juafrlo committed Jun 29, 2009
Showing 1,746 changed files with 287 additions and 241 deletions.
View
5 CHANGELOG 100644 → 100755
@@ -2,6 +2,10 @@
* haml/sass propagation (desert)
* upgrade documentation/rake tasks to fix old migrations
+= 1.0.3
+* Photo albums
+* Static pages
+
= 1.0.2
* Rails 2.3 compatibility
* RedCloth no longer required
@@ -10,6 +14,7 @@
* allow moderators/activity owners to delete activities
* only track login activity once per day
* allow anonymous commenters to choose whether they want to receive follow-up comment notices by e-mail
+* refactor views to use 'box' helper for logical content modules, allowing better flexibility when trying to customize layouts
= 1.0.1
* fixed error when cropping photos using file system storage
View
0 LICENSE 100644 → 100755
No changes.
View
5 README.markdown 100644 → 100755
@@ -1,5 +1,4 @@
-CommunityEngine [v1.0.0]: Modifications to edge branch
-================
+CommunityEngine [v1.0.3]
Information at: [http://www.communityengine.org](http://www.communityengine.org)
@@ -21,7 +20,7 @@ Getting CommunityEngine Running
SHORT VERSION:
- rails your_app_name -m http://www.communityengine.org/install_template.rb
+ rails your_app_name -m http://www.communityengine.org/edge_install_template.rb
LONG VERSION:
View
0 Rakefile 100644 → 100755
No changes.
View
0 UPGRADING.markdown 100644 → 100755
No changes.
View
2 about.yml 100644 → 100755
@@ -4,4 +4,4 @@ homepage: http://www.missingmethod.com
summary: A social networking engine
description: Adds basic social networking capabilities to your existing application, including users, blogs, photos, clippings, favorites, and more.
license: MIT
-version: 1.0.2
+version: 1.0.3
View
No changes.
View
No changes.
View
0 app/controllers/ads_controller.rb 100644 → 100755
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
0 app/controllers/post_sweeper.rb 100644 → 100755
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
@@ -6,8 +6,8 @@ class StatisticsController < BaseController
def index
@total_users = User.count(:conditions => ['activated_at IS NOT NULL'])
@unactivated_users = User.count(:conditions => ['activated_at IS NULL'])
- @yesterday_new_users = find_new_users(1.day.ago.midnight, Time.today.midnight)
- @today_new_users = find_new_users(Time.today.midnight, Time.today.tomorrow.midnight)
+ @yesterday_new_users = find_new_users(1.day.ago.midnight, Date.today.midnight)
+ @today_new_users = find_new_users(Date.today.midnight, Date.today.tomorrow.midnight)
# @active_users_count = Activity.find(:all, :group => "user_id", :conditions => ["created_at > ?", 1.month.ago]).size
@active_users_count = Activity.count(:all, :group => "user_id", :conditions => ["created_at > ?", 1.month.ago]).size
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
@@ -409,7 +409,7 @@ def statistics
date = Date.new(params[:date][:year].to_i, params[:date][:month].to_i)
@month = Time.parse(date.to_s)
else
- @month = Time.today
+ @month = Date.today
end
start_date = @month.beginning_of_month
View
0 app/controllers/vote_sweeper.rb 100644 → 100755
No changes.
View
No changes.
View
No changes.
View
0 app/helpers/ads_helper.rb 100644 → 100755
No changes.
View
0 app/helpers/albums_helper.rb 100644 → 100755
No changes.
View
15 app/helpers/base_helper.rb 100644 → 100755
@@ -50,8 +50,15 @@ def rounded(options={}, &content)
yield(content)
concat('<br class="clear" /><div class="box_bottom"></div></div>')
end
+
+ def block_to_partial(partial_name, html_options = {}, &block)
+ concat(render(:partial => partial_name, :locals => {:body => capture(&block), :html_options => html_options}))
+ end
-
+ def box(html_options = {}, &block)
+ block_to_partial('shared/box', html_options, &block)
+ end
+
def tag_cloud(tags, classes)
max, min = 0, 0
tags.each { |t|
@@ -259,7 +266,11 @@ def paginating_links(paginator, options = {}, html_options = {})
end
end
- content_tag(:div, pagination_info_for(paginator), :class => 'pagination_info') + (links || '')
+ if options[:show_info].eql?(false)
+ (links || '')
+ else
+ content_tag(:div, pagination_info_for(paginator), :class => 'pagination_info') + (links || '')
+ end
end
def pagination_info_for(paginator, options = {})
View
0 app/helpers/categories_helper.rb 100644 → 100755
No changes.
View
0 app/helpers/clippings_helper.rb 100644 → 100755
No changes.
View
0 app/helpers/comments_helper.rb 100644 → 100755
No changes.
View
0 app/helpers/contests_helper.rb 100644 → 100755
No changes.
View
0 app/helpers/forums_helper.rb 100644 → 100755
No changes.
View
0 app/helpers/friendships_helper.rb 100644 → 100755
No changes.
View
No changes.
View
0 app/helpers/invitations_helper.rb 100644 → 100755
No changes.
View
0 app/helpers/metro_areas_helper.rb 100644 → 100755
No changes.
View
0 app/helpers/moderators_helper.rb 100644 → 100755
No changes.
View
No changes.
View
0 app/helpers/offerings_helper.rb 100644 → 100755
No changes.
View
0 app/helpers/photos_helper.rb 100644 → 100755
No changes.
View
0 app/helpers/posts_helper.rb 100644 → 100755
No changes.
View
0 app/helpers/sb_posts_helper.rb 100644 → 100755
No changes.
View
0 app/helpers/sessions_helper.rb 100644 → 100755
No changes.
View
0 app/helpers/sitemap_helper.rb 100644 → 100755
No changes.
View
0 app/helpers/skills_helper.rb 100644 → 100755
No changes.
View
0 app/helpers/statistics_helper.rb 100644 → 100755
No changes.
View
0 app/helpers/tags_helper.rb 100644 → 100755
No changes.
View
0 app/helpers/topics_helper.rb 100644 → 100755
No changes.
View
0 app/helpers/users_helper.rb 100644 → 100755
No changes.
View
0 app/models/ad.rb 100644 → 100755
No changes.
View
0 app/models/album.rb 100644 → 100755
No changes.
View
0 app/models/asset.rb 100644 → 100755
No changes.
View
0 app/models/category.rb 100644 → 100755
No changes.
View
0 app/models/choice.rb 100644 → 100755
No changes.
View
0 app/models/clipping.rb 100644 → 100755
No changes.
View
0 app/models/clipping_image.rb 100644 → 100755
No changes.
View
0 app/models/comment.rb 100644 → 100755
No changes.
View
0 app/models/contest.rb 100644 → 100755
No changes.
View
0 app/models/country.rb 100644 → 100755
No changes.
View
0 app/models/event.rb 100644 → 100755
No changes.
View
0 app/models/favorite.rb 100644 → 100755
No changes.
View
0 app/models/forum.rb 100644 → 100755
No changes.
View
0 app/models/friendship.rb 100644 → 100755
No changes.
View
0 app/models/friendship_status.rb 100644 → 100755
No changes.
View
0 app/models/homepage_feature.rb 100644 → 100755
No changes.
View
0 app/models/invitation.rb 100644 → 100755
No changes.
View
0 app/models/message.rb 100644 → 100755
No changes.
View
0 app/models/metro_area.rb 100644 → 100755
No changes.
View
0 app/models/moderatorship.rb 100644 → 100755
No changes.
View
0 app/models/monitorship.rb 100644 → 100755
No changes.
View
0 app/models/offering.rb 100644 → 100755
No changes.
View
10 app/models/photo.rb 100644 → 100755
@@ -61,6 +61,16 @@ def next_photo
self.user.photos.find(:first, :conditions => ['created_at > ?', created_at], :order => 'created_at ASC')
end
+ def previous_in_album
+ return nil unless self.album
+ self.user.photos.find(:first, :conditions => ['created_at < ? and album_id = ?', created_at, self.album.id], :order => 'created_at DESC')
+ end
+ def next_in_album
+ return nil unless self.album
+ self.user.photos.find(:first, :conditions => ['created_at > ? and album_id = ?', created_at, self.album_id], :order => 'created_at ASC')
+ end
+
+
def self.find_recent(options = {:limit => 3})
self.new_this_week.find(:all, :limit => options[:limit])
end
View
0 app/models/poll.rb 100644 → 100755
No changes.
View
0 app/models/post.rb 100644 → 100755
No changes.
View
0 app/models/role.rb 100644 → 100755
No changes.
View
0 app/models/sb_post.rb 100644 → 100755
No changes.
View
0 app/models/skill.rb 100644 → 100755
No changes.
View
0 app/models/state.rb 100644 → 100755
No changes.
View
0 app/models/static_page.rb 100644 → 100755
No changes.
View
0 app/models/tag.rb 100644 → 100755
No changes.
View
0 app/models/topic.rb 100644 → 100755
No changes.
View
14 app/models/user.rb 100644 → 100755
@@ -17,8 +17,8 @@ class User < ActiveRecord::Base
before_save :encrypt_password, :whitelist_attributes
before_create :make_activation_code
after_create :update_last_login
- after_create {|user| UserNotifier.deliver_signup_notification(user) }
- after_save {|user| UserNotifier.deliver_activation(user) if user.recently_activated? }
+ after_create :deliver_signup_notification
+ after_save :deliver_activation
before_save :generate_login_slug
after_save :recount_metro_area_users
after_destroy :recount_metro_area_users
@@ -351,7 +351,15 @@ def friendship_exists_with?(friend)
# before filter
def generate_login_slug
- self.login_slug = self.login.gsub(/[^a-z1-9]+/i, '-')
+ self.login_slug = self.login.gsub(/[^a-z0-9]+/i, '-')
+ end
+
+ def deliver_activation
+ UserNotifier.deliver_activation(self) if self.recently_activated?
+ end
+
+ def deliver_signup_notification
+ UserNotifier.deliver_signup_notification(self)
end
def update_last_login
View
0 app/models/user_notifier.rb 100644 → 100755
No changes.
View
0 app/models/user_observer.rb 100644 → 100755
No changes.
View
0 app/models/vote.rb 100644 → 100755
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
@@ -1,12 +1,12 @@
.yui-gc
.yui-u.first
- .box.fresh
+ -box :class => "fresh" do
%h3="What's fresh".l
=render :partial => "activities/activity", :collection => @activities
.pagination=paginating_links @activities if @activities.page_count > 1
.yui-u
- .box
+ -box do
%h3="Tags".l
- tag_cloud @popular_tags, %w(nube1 nube2 nube3 nube4 nube5) do |name, css_class|
= link_to name, tag_path(URI.escape(name, /[\/.?#]/)), :class => css_class
View
@@ -2,7 +2,7 @@
=render :partial => 'users/dashboard_nav'
#yui-main
- .yui-b.box.fresh
+ -box :class => 'yui-b fresh' do
-unless @activities.empty?
%h3=:activity_from_your_network.l
%table{:width => "100%"}
View
@@ -4,7 +4,7 @@
- form_tag delete_selected_comments_path, :id => 'comments' do
#yui-main
- .yui-b.box
+ -box :class => "yui-b" do
%h3
= AppConfig.community_name
= :comments.l
View
@@ -3,7 +3,7 @@
#yui-main
.yui-b
- .box
+ -box do
%h3= :contests.l
= link_to :new_contest.l, new_contest_path
View
No changes.
View
5 app/views/admin/users.html.haml 100644 → 100755
@@ -2,7 +2,7 @@
= render :partial => 'shared/admin_nav'
#yui-main
- .yui-b.box
+ -box :class => "yui-b" do
%h3
= AppConfig.community_name
= :members.l
@@ -25,7 +25,7 @@
%th=:actions.l
- @users.each do |user|
- %tr
+ %tr{:id => "user_#{user.id}"}
%td
= link_to h(user.login), user_path(user)
%td
@@ -35,6 +35,7 @@
%td
= link_to( :assume_id.l , assume_user_path(user) )
= (" | " + link_to(:activate.l, :controller => "/admin", :action => "activate_user", :id => user.id)) unless user.active?
+ = link_to_remote(image_tag('icons/delete.png', :plugin => 'community_engine'), {:url => user_path(user), :method => :delete, :success => visual_effect(:fade, "user_#{user.id}"), :confirm => "Are you sure you want to permanently delete this user"} )
-if @users.page_count > 1
.pagination= paginating_links @users, :link_to_current_page => true
View
2 app/views/ads/edit.html.haml 100644 → 100755
@@ -1,4 +1,4 @@
-.box
+-box do
%h3=:editing_ad.l
= error_messages_for :ad
- form_for(:ad, :url => ad_path(@ad), :html => { :method => :put, :class => "MainForm" }) do |f|
View
2 app/views/ads/index.html.haml 100644 → 100755
@@ -2,7 +2,7 @@
= render :partial => 'shared/admin_nav'
#yui-main
- .yui-b.box
+ -box :class => "yui-b" do
%h3= :ads.l
%table{"width"=>"100%"}
%tr
View
2 app/views/ads/new.html.haml 100644 → 100755
@@ -1,4 +1,4 @@
-.box
+-box do
%h3=:new_ad.l
= error_messages_for :ad
- form_for(:ad, :url => ads_path, :html => {:class => "MainForm" }) do |f|
View
2 app/views/ads/show.html.haml 100644 → 100755
@@ -1,4 +1,4 @@
-.box
+-box do
%h3=:showing_ad.l
%p
%b
View
0 app/views/albums/_form.html.erb 100644 → 100755
No changes.
View
0 app/views/albums/edit.html.erb 100644 → 100755
No changes.
View
0 app/views/albums/new.html.erb 100644 → 100755
No changes.
View
0 app/views/albums/show.html.erb 100644 → 100755
No changes.
View
@@ -1,5 +1,5 @@
.yui-b
- .box
+ -box do
%h3=:about_site.l :site => AppConfig.community_name
%ul.list.checks
%li
@@ -9,7 +9,7 @@
%li
%a{:href=>"/advertise"}
=:advertise.l
- .box.alt
+ -box :class => "alt" do
%h3=:need_to_contact_us.l
%p
=:dont_wait_its.l
View
@@ -1,7 +1,7 @@
#welcome
.yui-gc
.yui-u.first
- .box
+ -box do
%h2
=:get_started_banner.l :site=>AppConfig.community_name
%p
@@ -10,7 +10,7 @@
%a{:href=>"http://www.missingmethod.com/projects/community_engine"}
=:homepage_banner_download_msg.l
.yui-u
- .box
+ -box do
%h2
=:homepage_banner_signup_prompt.l
%p
View
2 app/views/base/about.html.haml 100644 → 100755
@@ -2,5 +2,5 @@
#yui-main
.yui-b
- .box
+ -box do
%h3=:your_about_text_goes_here.l
View
@@ -2,7 +2,7 @@
#yui-main
.yui-b
- .box
+ -box do
%h3
=:advertise_on.l
=" #{AppConfig.community_name}"
View
8 app/views/base/faq.html.haml 100644 → 100755
@@ -2,7 +2,7 @@
#yui-main
.yui-b
- .box
+ -box do
%h3=:frequently_asked_questions.l
%h4#what_is_it
@@ -17,8 +17,4 @@
%h4#images_and_flash How do I embed images and flash using the rich text editor?
%p
- You can add images or flash media to your profile and your blog posts by using the image
- %img{:src=>"/plugin_assets/community_engine/javascripts/tiny_mce/themes/advanced/images/image.gif"}
- and media
- %img{:src=>"/plugin_assets/community_engine/javascripts/tiny_mce/plugins/media/images/media.gif"}
- buttons on the rich text editor.
+ You can add images or flash media to your profile and your blog posts by using the image and media buttons on the rich text editor.
View
0 app/views/base/plaxo.html.haml 100644 → 100755
No changes.
View
@@ -5,21 +5,21 @@
#yui-main
.yui-b
- .box.hfeed
+ -box :class => "hfeed" do
%h3
=:recent_posts.l
= render :partial => 'posts/post', :collection => @posts
.yui-b
- .box
+ -box do
%h3= :explore_site.l :site => AppConfig.community_name
%ul.list.checks
- Category.find(:all).each do |c|
%li= link_to c.name, category_path(c)
%li= link_to :whats_popular.l, popular_url, {:class => 'popular'}
%li= link_to :find_an_expert.l, skills_path, {:class => 'users'}
- .box.alt
+ -box :class => "alt" do
%h3
= :whats_hot.l
@@ -29,13 +29,13 @@
%h6.all
%a{:href=>"/popular"}= :see_all.l
- .box.alt
+ -box :class => "alt" do
%h3
=:featured_writer.l
-@featured_writers.each do |user|
=render :partial => "users/sidebar_user", :locals => {:user => user}
- .box.alt
+ -box :class => "alt" do
%h3= :active_users.l
-@active_users.each do |user|
=render :partial => "users/sidebar_user", :locals => {:user => user}
View
0 app/views/base/teaser.html.haml 100644 → 100755
No changes.
View
No changes.
View
@@ -2,7 +2,7 @@
= render :partial => 'shared/admin_nav'
#yui-main
- .yui-b.box
+ -box :class => "yui-b" do
%h3=:editing_category.l
- form_for(:category, :url => category_path(@category), :html => { :method => :put, :class => "MainForm" }) do |f|
View
@@ -3,7 +3,7 @@
#yui-main
.yui-b
- .box
+ -box do
%h3=:categories.l
%table{:width=>"100%"}
View
@@ -1,4 +1,4 @@
-.box
+-box do
%h3= :new_category.l
- form_for(:category, :url => categories_path, :html => {:class => "MainForm"}) do |f|
Oops, something went wrong.

0 comments on commit fe06735

Please sign in to comment.