Skip to content
Browse files

Localizing site for different technologies. Updating design elements

  • Loading branch information...
1 parent 0143762 commit 1c619ea838a194341fba78aa2593c8c431b4994e @jcnetdev committed Aug 30, 2008
Showing with 877 additions and 558 deletions.
  1. +4 −0 app/controllers/application.rb
  2. +0 −2 app/controllers/comps_controller.rb
  3. +19 −0 app/controllers/pages_controller.rb
  4. +53 −22 app/controllers/projects_controller.rb
  5. +17 −5 app/controllers/users_controller.rb
  6. +26 −2 app/helpers/application_helper.rb
  7. +21 −0 app/helpers/projects_helper.rb
  8. +6 −1 app/helpers/tabs_helper.rb
  9. +3 −0 app/models/comment.rb
  10. +11 −1 app/models/project.rb
  11. +26 −0 app/models/tell_friend.rb
  12. +14 −2 app/models/user.rb
  13. +15 −6 app/models/user_mailer.rb
  14. +3 −2 app/views/activities/_activity.html.haml
  15. +1 −1 app/views/bookmarks/_bookmark_list.html.haml
  16. +4 −1 app/views/comments/_comments.html.haml
  17. +2 −1 app/views/comments/_form.html.haml
  18. +0 −70 app/views/comps/detail.html.erb
  19. +0 −105 app/views/comps/form.html.erb
  20. +0 −3 app/views/comps/index.html.haml
  21. +0 −124 app/views/comps/list.html.erb
  22. +2 −1 app/views/hosted_instances/_form.html.haml
  23. +3 −5 app/views/layouts/_about_us.html.haml
  24. +11 −14 app/views/layouts/_footer.html.haml
  25. +5 −2 app/views/layouts/_header.html.haml
  26. +5 −0 app/views/layouts/_social_media.html.erb
  27. +4 −3 app/views/layouts/application.html.haml
  28. +11 −0 app/views/pages/_tell_friend_form.html.haml
  29. +34 −0 app/views/pages/_tell_friend_preview.html.haml
  30. +38 −21 app/views/pages/about.html.haml
  31. +1 −1 app/views/projects/_project.html.haml
  32. +1 −1 app/views/projects/index.atom.builder
  33. +2 −3 app/views/projects/index.html.haml
  34. +1 −0 app/views/projects/parts/_about_project.html.haml
  35. +5 −2 app/views/projects/parts/_grid.html.haml
  36. +4 −1 app/views/projects/parts/_list.html.haml
  37. +15 −6 app/views/projects/parts/_tabs.html.haml
  38. +2 −1 app/views/projects/show.html.haml
  39. +13 −0 app/views/projects/upcoming.atom.builder
  40. +9 −7 app/views/sessions/_login_panel.html.haml
  41. +2 −0 app/views/sessions/new.html.haml
  42. +11 −0 app/views/user_mailer/tell_friend.erb
  43. +2 −0 app/views/users/new.html.haml
  44. +22 −1 app/views/users/show.html.haml
  45. +7 −5 app/views/versions/_form.html.haml
  46. +16 −4 config/app_config.yml
  47. +44 −12 config/deploy.rb
  48. +4 −0 config/routes.rb
  49. +9 −0 db/migrate/20080826081134_add_requirements_to_project.rb
  50. +11 −0 db/migrate/20080826114524_add_user_fields.rb
  51. +37 −30 db/schema.rb
  52. BIN doc/Gallery.rtfd/1__#$!@%!#__Pasted Graphic.pict
  53. BIN doc/Gallery.rtfd/Pasted Graphic 1.pict
  54. BIN doc/Gallery.rtfd/Pasted Graphic 10.pict
  55. BIN doc/Gallery.rtfd/Pasted Graphic 11.pict
  56. BIN doc/Gallery.rtfd/Pasted Graphic 12.pict
  57. BIN doc/Gallery.rtfd/Pasted Graphic 13.pict
  58. BIN doc/Gallery.rtfd/Pasted Graphic 14.pict
  59. BIN doc/Gallery.rtfd/Pasted Graphic 15.pict
  60. BIN doc/Gallery.rtfd/Pasted Graphic 16.pict
  61. BIN doc/Gallery.rtfd/Pasted Graphic 17.pict
  62. BIN doc/Gallery.rtfd/Pasted Graphic 18.pict
  63. BIN doc/Gallery.rtfd/Pasted Graphic 19.pict
  64. BIN doc/Gallery.rtfd/Pasted Graphic 2.pict
  65. BIN doc/Gallery.rtfd/Pasted Graphic 3.pict
  66. BIN doc/Gallery.rtfd/Pasted Graphic 4.pict
  67. BIN doc/Gallery.rtfd/Pasted Graphic 5.pict
  68. BIN doc/Gallery.rtfd/Pasted Graphic 6.pict
  69. BIN doc/Gallery.rtfd/Pasted Graphic 7.pict
  70. BIN doc/Gallery.rtfd/Pasted Graphic 8.pict
  71. BIN doc/Gallery.rtfd/Pasted Graphic 9.pict
  72. BIN doc/Gallery.rtfd/Pasted Graphic.pict
  73. +48 −0 doc/Gallery.rtfd/TXT.rtf
  74. BIN doc/Slogan.psd
  75. BIN doc/logo.psd
  76. BIN doc/search_box.psd
  77. BIN doc/top.psd
  78. BIN public/images/right-box/bg.png
  79. BIN public/images/right-box/end_bg.png
  80. BIN public/images/right-box/top.png
  81. BIN public/images/right-box/top_about.png
  82. BIN public/images/right-box/top_add.png
  83. BIN public/images/right_tab_bg.gif
  84. BIN public/images/right_tab_bg.png
  85. BIN public/images/slogan.png
  86. BIN public/images/tab-blank-bg.png
  87. BIN public/images/tab-bottom.png
  88. BIN public/images/tab-half-highlighted.png
  89. BIN public/images/tab-half.png
  90. BIN public/images/tab-third-highlighted.png
  91. BIN public/images/tab-third.png
  92. BIN public/images/template/search_box_bg.png
  93. +1 −1 public/javascripts/common/shortcuts.js
  94. +1 −0 public/javascripts/components/project_grid.js
  95. +2 −2 public/javascripts/jquery.ext/jquery.onPage.js
  96. +42 −0 public/stylesheets/sass/v2/components/about.sass
  97. +1 −1 public/stylesheets/sass/v2/components/app_item.sass
  98. +7 −0 public/stylesheets/sass/v2/components/details.sass
  99. +2 −1 public/stylesheets/sass/v2/components/project.sass
  100. +5 −0 public/stylesheets/sass/v2/components/project_grid.sass
  101. +3 −3 public/stylesheets/sass/v2/forms/app_form.sass
  102. +2 −2 public/stylesheets/sass/v2/paging.sass
  103. +10 −1 public/stylesheets/sass/v2/panels/project-list.sass
  104. +23 −6 public/stylesheets/sass/v2/parts/footer.sass
  105. +16 −4 public/stylesheets/sass/v2/parts/header.sass
  106. +4 −3 public/stylesheets/sass/v2/styles.sass
  107. +9 −1 public/stylesheets/sass/v2/tabs.sass
  108. +29 −5 public/stylesheets/v2/paging.css
  109. +114 −41 public/stylesheets/v2/styles.css
  110. 0 script/{merge_javascript_css → merge_assets}
  111. +0 −8 test/functional/blog_controller_test.rb
  112. +0 −8 test/functional/pages_controller_test.rb
  113. +2 −2 vendor/plugins/exception_notification/lib/exception_notifiable.rb
  114. +0 −1 vendor/plugins/use_db
View
4 app/controllers/application.rb
@@ -27,4 +27,8 @@ def check_spam(val)
return false
end
end
+
+ def helpers
+ self.class.helpers
+ end
end
View
2 app/controllers/comps_controller.rb
@@ -1,2 +0,0 @@
-class CompsController < ApplicationController
-end
View
19 app/controllers/pages_controller.rb
@@ -1,6 +1,20 @@
class PagesController < ApplicationController
def about
+ if request.post?
+ @tell_friend = TellFriend.new(params[:tell_friend])
+ @tell_friend.valid?
+ if button_pressed?(:send)
+ if @tell_friend.send_msg(current_or_anon_user)
+ flash[:success] = "Sent Message. Thanks for helping to promote #{AppConfig.site_name}!"
+ redirect_to about_url
+ end
+ elsif button_pressed?(:preview)
+ @preview = true
+ end
+ else
+ @tell_friend = TellFriend.new(:from => current_or_anon_user.email)
+ end
end
def blog
@@ -11,4 +25,9 @@ def blog
redirect_to root_url
end
end
+
+ protected
+ def button_pressed?(id)
+ !params[id].blank?
+ end
end
View
75 app/controllers/projects_controller.rb
@@ -1,32 +1,39 @@
class ProjectsController < ApplicationController
def index
- @projects = find_projects
+ build_gallery(gallery_projects)
@upcoming = Project.upcoming
- @my_projects = current_or_anon_user.projects
-
- @latest_activities = Activity.latest
-
- @top_downloaded = Project.top_downloaded
- @top_bookmarked = Project.top_bookmarked
-
- if AppConfig.enable_throttler and throttled?
- @tags = []
- else
- @tags = Project.tag_counts(:conditions => Project.in_gallery_conditions, :order => "name")
- end
-
- if params[:ajax]
- render :partial => "projects/parts/grid", :locals => {:projects => @projects}, :layout => false
- else
- render
+ respond_to do |format|
+ format.html do
+ if params[:ajax]
+ render :partial => "projects/parts/grid", :locals => {:projects => @projects}, :layout => false
+ else
+ render
+ end
+ end
+ format.atom
+ end
+ end
+
+ def upcoming
+ build_gallery(upcoming_projects)
+ respond_to do |format|
+ format.html do
+ @grid_title = "Upcoming Projects"
+ @grid_rss = formatted_upcoming_projects_url(:atom)
+
+ @hide_upcoming = true
+ if params[:ajax]
+ render :partial => "projects/parts/grid", :locals => {:projects => @projects}, :layout => false
+ else
+ render :action => "index"
+ end
+ end
+ format.atom
end
-
- session[:page] = params[:page]
end
def feed
@projects = Project.latest
-
respond_to do |format|
format.atom do
render :action => "index.atom.builder"
@@ -226,6 +233,26 @@ def previous
end
protected
+ def build_gallery(projects)
+ @projects = projects
+ @my_projects = current_or_anon_user.projects
+
+ @latest_activities = Activity.latest
+
+ @top_downloaded = Project.top_downloaded
+ @top_bookmarked = Project.top_bookmarked
+
+ if throttled?
+ @tags = []
+ else
+ @tags = Project.tag_counts(:conditions => Project.in_gallery_conditions, :order => "name")
+ end
+
+ if params[:q].blank? and params[:tag].blank?
+ session[:page] = params[:page]
+ end
+ end
+
# retrieves the current project from params[:id]
def get_project
@current_project ||= Project.find(params[:id])
@@ -237,7 +264,7 @@ def get_tag
end
# find the projects to display based on the querystring
- def find_projects
+ def gallery_projects
# try to find an associated tag
@tag = get_tag
@search_term = params[:q].strip unless params[:q].blank?
@@ -249,7 +276,11 @@ def find_projects
else
@projects = Project.paginate(:conditions => Project.in_gallery_conditions, :order => "promoted_at DESC", :page => params[:page], :per_page => AppConfig.projects_per_page)
end
+ end
+ # list the upcoming projects
+ def upcoming_projects
+ @projects = Project.paginate(:conditions => Project.upcoming_conditions, :order => "updated_at DESC", :page => params[:page], :per_page => AppConfig.projects_per_page)
end
# verify that the current user owns a project
View
22 app/controllers/users_controller.rb
@@ -35,13 +35,20 @@ def create
def show
@user = find_user
- @bookmarked_projects = @user.projects
+ @bookmarked_projects = @user.projects.paginate(:page => params[:page], :per_page => AppConfig.bookmarks_per_page)
@submitted_projects = @user.submitted
@activities = @user.activities.all(:limit => 101, :order => "created_at DESC")
@rated_projects = @user.rated_projects
respond_to do |format|
- format.html
+ format.html do
+ @grid_title = helpers.pluralize(@user.projects.count, "Bookmarked Project")
+ if params[:ajax]
+ render :partial => "projects/parts/grid", :locals => {:projects => @bookmarked_projects}, :layout => false
+ else
+ render
+ end
+ end
format.js do
render :partial => "users/parts/about_user", :locals => {:user => @user}, :layout => false
end
@@ -154,7 +161,7 @@ def purge
def forgot_password
if request.post?
User.forgot_password(params[:email])
- flash[:notice] = "An email has been sent to you that will allow you to reset your password. If you have any problems email us at opensourcerails@gmail.com"
+ flash[:notice] = "An email has been sent to you that will allow you to reset your password. If you have any problems email us at #{AppConfig.admin_email_address}"
end
redirect_to new_session_url
end
@@ -165,7 +172,7 @@ def reset_password
# find user from auth code
@user = User.find_by_forgot_password_hash(params[:auth])
unless @user
- flash[:error] = "Reset Password URL was invalid. It may have expired. Please email us at opensourcerails@gmail.com if you are still unable to log in."
+ flash[:error] = "Reset Password URL was invalid. It may have expired. Please email us at #{AppConfig.admin_email_address} if you are still unable to log in."
redirect_to new_session_url
return
end
@@ -189,7 +196,12 @@ def reset_password
protected
def find_user
- @user = User.find(params[:id])
+ if(params[:id].to_s.include? "anon_")
+ user_id = params[:id].gsub("anon_","").to_i
+ @user = User.find_by_id(user_id)
+ else
+ @user = User.find_by_login(params[:id])
+ end
end
# verify that the current user can edit this profile
View
28 app/helpers/application_helper.rb
@@ -114,7 +114,7 @@ def current_year
def paging(page_data, style = :sabros)
return unless page_data.class == WillPaginate::Collection
- will_paginate(page_data, :class => "pagination #{style}", :inner_window => 3)
+ will_paginate(page_data, :class => "pagination #{style}", :outer_window => 1, :inner_window => 1)
end
def error_messages_for(name, options = {})
@@ -132,12 +132,36 @@ def default(val, default = "")
def name_display(user)
if current_or_anon_user == user
return "Your"
- elsif user
+ elsif !user.name.blank?
return "#{user.name}'s"
+ elsif !user.login.blank?
+ return "#{user.login}'s"
+ else
+ return "User's"
end
end
def paging?(list)
list.is_a? WillPaginate::Collection
end
+
+ def hide_login_panel?
+ @hide_login_panel
+ end
+
+ def hide_login_panel
+ @hide_login_panel = true
+ end
+
+ def projects_rss
+ AppConfig.rss_url || formatted_projects_url(:atom)
+ end
+
+ def upcoming_rss
+ AppConfig.upcoming_rss_url || formatted_upcoming_projects_url(:atom)
+ end
+
+ def activity_rss
+ AppConfig.upcoming_activity_url || formatted_activity_projects_url(:atom)
+ end
end
View
21 app/helpers/projects_helper.rb
@@ -1,5 +1,13 @@
module ProjectsHelper
+ def gallery_url
+ if session[:page].blank?
+ root_url
+ else
+ root_url :page => session[:page]
+ end
+ end
+
def activity_display(activity, options = {})
partial "activities/activity", options.merge(:activity => activity)
end
@@ -121,6 +129,19 @@ def approve_button(project)
end
end
+ # Display an approve button for a project (if permissions allow)
+ def delete_button(project)
+ if admin?
+ haml_tag :div, :class => "actions text-center" do
+ puts br
+ puts link_to("Delete Project",
+ project_url(@project),
+ :method => :delete,
+ :confirm => "This delete this project and all related information. There is no UNDO. Continue?")
+ end
+ end
+ end
+
def deploy_now(project)
content_tag(:div, :class => "deploy-now") do
View
7 app/helpers/tabs_helper.rb
@@ -33,12 +33,17 @@ def tabs(options={}, &block)
# Give the tab a name and unique id
def tab(name, tab_id , options={}, &block)
# append an element to our nav_html
- @__tabs_navhtml << content_tag(:li, link_to(name, "##{tab_id}", :title => name))
+ @__tabs_navhtml << content_tag(:li, link_to(name, "##{tab_id}", :title => name), :class => options[:tab_class])
# build our tab
haml_tag :div, options.merge(:id => tab_id) do
puts capture_haml(&block)
puts content_tag(:div, "", :style => "clear: both")
end
end
+
+ def blank_tab
+ @__tabs_navhtml << content_tag(:li, "&nbsp;", :class => "blank")
+ return ""
+ end
end
View
3 app/models/comment.rb
@@ -5,6 +5,9 @@ class Comment < ActiveRecord::Base
validates_presence_of :author_name, :author_email
validates_as_email_address :author_email, :allow_blank => true
+
+ belongs_to :user, :class_name => "User", :foreign_key => "owner_id"
+
def self.initialize_from_user(user)
comment = Comment.new
if user.is_a? User
View
12 app/models/project.rb
@@ -12,10 +12,11 @@ class Project < ActiveRecord::Base
has_many :instructions, :order => "updated_at DESC", :dependent => :delete_all
has_many :bookmarks, :dependent => :destroy
+ has_many :activities, :order => "updated_at DESC", :dependent => :delete_all
validates_uniqueness_of :title, :on => :create, :message => "must be unique"
- attr_accessible :title, :description, :author_name, :author_contact,
+ attr_accessible :title, :description, :author_name, :author_contact, :requirements,
:homepage_url, :source_url, :license, :short_description, :tag_list
# checkbox used to auto assign author from current_user
@@ -102,6 +103,10 @@ def self.upcoming(limit = 25)
find(:all, :conditions => {:in_gallery => false, :is_submitted => true}, :limit => limit, :order => "last_changed DESC")
end
+ def self.gallery(limit = 25)
+ find(:all, :conditions => {:in_gallery => true, :is_submitted => true}, :limit => limit, :order => "last_changed DESC")
+ end
+
# Search projects with a given search string
def self.search(search_term, options = {})
@@ -134,6 +139,11 @@ def self.in_gallery_conditions
{:in_gallery => true, :is_submitted => true}
end
+ # I'll convert this to named_scope when Rails 2.1 comes out
+ def self.upcoming_conditions
+ {:in_gallery => false, :is_submitted => true}
+ end
+
# Top Downloaded
def self.top_downloaded(limit = 5)
find(:all, :limit => limit, :conditions => {:is_submitted => true}, :order => "downloads DESC")
View
26 app/models/tell_friend.rb
@@ -0,0 +1,26 @@
+class TellFriend < ActiveRecord::BaseWithoutTable
+ column :to, :string
+ column :from, :string
+ column :subject, :string
+ column :message, :text
+
+ validates_as_email_address :to, :from
+
+ attr_accessor :error_message
+
+ def send_msg(user)
+ if self.valid?
+ UserMailer.deliver_tell_friend(user, self)
+
+ # incremement
+ user.tell_friend_count += 1
+ user.tell_friend_last_sent = Time.now
+ user.save
+
+ return true
+ else
+ return false
+ end
+ end
+
+end
View
16 app/models/user.rb
@@ -18,7 +18,7 @@ class User < ActiveRecord::Base
has_many :rated, :class_name => "ProjectRating", :foreign_key => "rater_id"
def rated_projects
project_list = []
- rated.all(:include => [:project]).each do |r|
+ rated.all(:order => "created_at DESC", :include => [:project]).each do |r|
p = r.project
p.user_rating = r
project_list << p
@@ -51,7 +51,7 @@ def rated_projects
# prevents a user from submitting a crafted form that bypasses activation
# anything else you want your user to change should be added here.
- attr_accessible :login, :email, :password, :password_confirmation, :signup
+ attr_accessible :login, :email, :password, :password_confirmation, :signup, :homepage, :name, :about
acts_as_state_machine :initial => :anonymous
state :anonymous
@@ -122,6 +122,14 @@ def send_forgot_password
UserMailer.deliver_send_password_reset(self)
end
+ def login
+ if self[:login].blank?
+ "anon_#{self.id}"
+ else
+ self[:login]
+ end
+ end
+
# finds an email and initiate the forgot password flow
def self.forgot_password(email)
@@ -181,6 +189,10 @@ def to_s
return "Anonymous"
end
+ def to_param
+ return self.login
+ end
+
def update_from_comment(comment)
unless self.signed_up?
self.name = comment.author_name if self.name.blank?
View
21 app/models/user_mailer.rb
@@ -1,30 +1,39 @@
class UserMailer < ActionMailer::Base
def signup_notification(user)
- setup_email(user)
+ setup_email(user.email)
subject "#{AppConfig.site_name} - Please activate your new account"
body :user => user,
:url => "#{AppConfig.site_url}/users/#{user.activation_code}/activate"
end
def activation_success(user)
- setup_email(user)
+ setup_email(user.email)
subject "#{AppConfig.site_name} - Your account has been activated!"
body :user => user,
:url => "#{AppConfig.site_url}"
end
def send_password_reset(user)
- setup_email(user)
+ setup_email(user.email)
subject "#{AppConfig.site_name} Password Recovery"
body :user => user
end
+ def tell_friend(user, friend)
+ setup_email(friend.to)
+ reply_to friend.from
+
+ subject AppConfig.tellafriend_subject
+ body :tell_friend => friend, :current_user => user
+
+ end
+
protected
- def setup_email(user)
- recipients "#{user.email}"
- from "Admin"
+ def setup_email(to)
+ recipients "#{to}"
+ from "#{AppConfig.admin_email_name} <#{AppConfig.admin_email_address}>"
sent_on Time.now
end
end
View
5 app/views/activities/_activity.html.haml
@@ -1,5 +1,5 @@
- if local_assigns[:activity]
- %span.activity{:class => activity.target_type.downcase}
+ %span.activity{:class => activity.target_type.to_s.downcase}
= activity.user_name
= activity.action_name
@@ -8,7 +8,8 @@
= activity.endconnector
- if activity.project_id
- = activity.endconnector+link_to(activity.project_name.to_s+".", project_url(:id => activity.project_id))
+ = activity.endconnector
+ = link_to("#{activity.project_name}.", project_url(:id => activity.project_id))
- else
== #{activity.endconnector}.
View
2 app/views/bookmarks/_bookmark_list.html.haml
@@ -4,5 +4,5 @@
%p You haven't bookmarked any applications.
- else
-# list my projects
- = partial "projects/parts/list", :projects => @my_projects
+ = partial "projects/parts/list", :projects => @my_projects, :action => local_assigns[:action]
View
5 app/views/comments/_comments.html.haml
@@ -16,7 +16,10 @@
%p.comment-meta
%span.comment-num
= link_to "##{index+1}", project_comment_url(comment.project, comment)
- %strong= comment.author_name
+ - if comment.user and comment.user.active?
+ %strong= link_to comment.author_name, comment.user
+ - else
+ %strong= comment.author_name
%span.comment-time{:title => comment.created_at.to_s(:comment)}
== posted #{time_ago_in_words(comment.created_at)}
ago.
View
3 app/views/comments/_form.html.haml
@@ -28,7 +28,8 @@
= f.text_field :author_email, :label => "Email (not displayed)"
%li= f.text_area :body, :label => "Comment"
- %li= f.text_field :antispam, :label => AppConfig.spam_question, :separator => ""
+ - if comment.new_record?
+ %li= f.text_field :antispam, :label => AppConfig.spam_question, :separator => ""
%li.app_form_sub
- if is_edit?
.right
View
70 app/views/comps/detail.html.erb
@@ -1,70 +0,0 @@
-<div class="details main">
- <h2>
- Totspot
- </h2>
- <p>
- <a href="http://totspot.com/login" target="_blank" title="Totspot"><img src="/images/gallery/totspot_lg.gif" alt="" /></a>
- <br class="clear" />
- </p>
- <div id="post-ratings-830" class="post-ratings">
- <span>1 Votes, Rating: 4</span><img is="rating_830_1" src="/images/rating_on.gif" alt="1 Star" title="1 Star" style="border: 0px none ; cursor: pointer;" /><img id="rating_830_2" src="/images/rating_on.gif" alt="2 Stars" title="2 Stars" style="border: 0px none ; cursor: pointer;" /><img id="rating_830_3" src="/images/rating_on.gif" alt="3 Stars" title="3 Stars" style="border: 0px none ; cursor: pointer;" /><img id="rating_830_4" src="/images/rating_on.gif" alt="4 Stars" title="4 Stars" style="border: 0px none ; cursor: pointer;" /><img id="rating_830_5" src="/images/rating_off.gif" alt="5 Stars" title="5 Stars" style="border: 0px none ; cursor: pointer;" />
- </div>
- <p class="tags">
- <strong>Tags:</strong> <a href="#tag/kids/" rel="tag">Kids</a>, <a href="#tag/service/" rel="tag">Service</a>
- </p>
-</div>
-<div class="details description">
- <h2>
- Project Description
- </h2>
- <p>
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
- </p>
- <div class="clear"></div>
-</div>
-
-<div class="comments">
- <h2>
- Comments (1)
- </h2>
- <ul id="comment-list">
- <li class="comment" id="comment-20">
-
- <div class="details">
- <p class="comment-meta">
- <span class="comment-num"><a href="#comment-20" title="Permalink to this comment">#1</a></span> <strong>Dude Man</strong> <span class="comment-time">~ Mar 29, 2008 at 9:10 pm</span>
- </p>
- <p>
- Love the look of this splash page. Color scheme really stands out and seems to target their intended audience really well. Cant wait to see their real site!
- </p>
- </div>
- </li>
-
- </ul>
-
- <!-- Comment Form -->
- <div class="details">
- <h2>
- Post a Comment
- </h2>
- <form action="#/wp-comments-post.php" method="post" id="comment-form">
- <p>
- <input class="text_input" name="author" id="author" value="Dude Man" tabindex="1" type="text" /> <label for="author"><strong>Name</strong></label>
- </p>
- <p>
- <input class="text_input" name="email" id="email" value="jpcx01@gmail.com" tabindex="2" type="text" /> <label for="email"><strong>Mail</strong></label>
- </p>
- <p>
- <input class="text_input" name="url" id="url" value="" tabindex="3" type="text" /> <label for="url"><strong>Website</strong></label>
- </p>
- <p>
- <textarea class="text_input text_area" name="comment" id="comment" rows="7" cols="36" tabindex="4"></textarea>
- </p>
- <p>
- <input name="submit" class="submit" id="submit" tabindex="5" value="Submit" type="submit" /> <input name="comment_post_ID" value="830" type="hidden" />
- </p>
- </form>
- <div class="clear flat"></div>
- </div>
-</div>
View
105 app/views/comps/form.html.erb
@@ -1,105 +0,0 @@
-<div class="details main">
- <h2>
- Suggest
- </h2>
- <form action="#suggest/" name="wpcf_form" method="post" id="wpcf_form">
- <table cellpadding="0" cellspacing="5">
- <tbody>
- <tr>
- <td style="text-align: right;">
- <input name="wpcf_stage" value="process" type="hidden" />Name:
- </td>
- <td style="text-align: left;">
- <input class="text_input" name="wpcf_your_name" id="wpcf_your_name" size="30" maxlength="50" tabindex="1" value="" type="text" />
- </td>
- </tr>
- <tr>
- <td style="text-align: right;">
- Email:
- </td>
- <td style="text-align: left;">
- <input class="text_input" name="wpcf_email" id="wpcf_email" size="30" maxlength="50" tabindex="2" value="" type="text" />
- </td>
- </tr>
- <tr>
- <td style="text-align: right;">
- 35 + 8 =
- </td>
- <td style="text-align: left;">
- <input class="text_input" name="wpcf_response" id="wpcf_response" size="30" maxlength="50" tabindex="3" value="" type="text" />
- </td>
- </tr>
- <tr>
- <td style="text-align: right;">
- Website:
- </td>
- <td style="text-align: left;">
- <input class="text_input" name="wpcf_website" id="wpcf_website" size="30" maxlength="100" tabindex="4" value="" type="text" />
- </td>
- </tr>
- <tr>
- <td style="text-align: right;">
- Category:
- </td>
- <td style="text-align: left;">
- <select name="wpcf_usersubject" id="wpcf_usersubject" class="text_input" tabindex="5">
- <option value="Arts and Photography">
- Arts and Photography
- </option>
- <option value="Beauty and Health">
- Beauty and Health
- </option>
- <option value="Blog">
- Blog
- </option>
- <option value="Corporate">
- Corporate
- </option>
- <option value="CSS Gallery">
- CSS Gallery
- </option>
- <option value="Internet">
- Internet
- </option>
- <option value="Organization">
- Organization
- </option>
- <option value="Others">
- Others
- </option>
- <option value="Personal">
- Personal
- </option>
- <option value="Resources">
- Resources
- </option>
- <option value="Web Development">
- Web Development
- </option>
- </select>
- </td>
- </tr>
- <tr>
- <td style="text-align: right;">
- Message:
- </td>
- <td style="text-align: left;">
- <textarea name="wpcf_msg" class="text_area" id="wpcf_msg" rows="8" cols="8" tabindex="6"></textarea>
- </td>
- </tr>
- <tr>
- <td></td>
- <td style="text-align: right;">
- <input name="Submit" tabindex="8" value="Submit" id="contactsubmit" type="submit" />
- </td>
- </tr>
- </tbody>
- </table>
- </form>
-</div>
-<div class="singleads">
- <h2>
- Advertisements
- </h2>
- <div class="clear"></div>
-</div>
View
3 app/views/comps/index.html.haml
@@ -1,3 +0,0 @@
-%h1= link_to "List View", :action => "list"
-%h1= link_to "Detail View", :action => "detail"
-%h1= link_to "Form View", :action => "form"
View
124 app/views/comps/list.html.erb
@@ -1,124 +0,0 @@
- <div class="project">
- <h2>
- <a href="##/web-development/838/kavoon/" rel="bookmark" title="Permanent Link to Kavoon">Kavoon</a>
- </h2>
- <p>
- <a href="##/r.php?url=http://www.kavoon.com" target="_blank" title="Kavoon"><img src="/images/gallery/kavoon.jpg" alt="Kavoon" /></a>
- </p>
- <div class="clear"></div>
- <div class="post-ratings">
- <span>5 Votes, Rating: 4.8</span><img src="/images/rating_on.gif" alt="1 Star" title="1 Star" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="2 Stars" title="2 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="3 Stars" title="3 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="4 Stars" title="4 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_half.gif" alt="5 Stars" title="5 Stars" style="border: 0px none ; cursor: pointer;" />
- </div>
- </div><!-- Item Div -->
- <div class="project">
- <h2>
- <a href="##/web-development/836/iamww/" rel="bookmark" title="Permanent Link to IAMWW">IAMWW</a>
- </h2>
- <p>
- <a href="##/r.php?url=http://iamww.com" target="_blank" title="IAMWW"><img src="/images/gallery/iamww.gif" alt="IAMWW" /></a>
- </p>
- <div class="clear"></div>
- <div class="post-ratings">
- <span>5 Votes, Rating: 4.8</span><img src="/images/rating_on.gif" alt="1 Star" title="1 Star" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="2 Stars" title="2 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="3 Stars" title="3 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="4 Stars" title="4 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_half.gif" alt="5 Stars" title="5 Stars" style="border: 0px none ; cursor: pointer;" />
- </div>
- </div><!-- Item Div -->
- <div class="project">
- <h2>
- <a href="##/web-development/834/singularity-concepts/" rel="bookmark" title="Permanent Link to Singularity Concepts">Singularity Concepts</a>
- </h2>
- <p>
- <a href="##/r.php?url=http://singularityconcepts.com" target="_blank" title="Singularity Concepts"><img src="/images/gallery/singularityconcepts.gif" alt="Singularity Concepts" /></a>
- </p>
- <div class="clear"></div>
- <div class="post-ratings">
- <span>5 Votes, Rating: 4.8</span><img src="/images/rating_on.gif" alt="1 Star" title="1 Star" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="2 Stars" title="2 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="3 Stars" title="3 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="4 Stars" title="4 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_half.gif" alt="5 Stars" title="5 Stars" style="border: 0px none ; cursor: pointer;" />
- </div>
- </div><!-- Item Div -->
- <div class="project">
- <h2>
- <a href="##/corporate/832/phillip-newton/" rel="bookmark" title="Permanent Link to Phillip Newton">Phillip Newton</a>
- </h2>
- <p>
- <a href="##/r.php?url=http://phillipnewton.com" target="_blank" title="Phillip Newton"><img src="/images/gallery/phillipnewton.gif" alt="Phillip Newton" /></a>
- </p>
- <div class="clear"></div>
- <div class="post-ratings">
- <span>5 Votes, Rating: 4.8</span><img src="/images/rating_on.gif" alt="1 Star" title="1 Star" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="2 Stars" title="2 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="3 Stars" title="3 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="4 Stars" title="4 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_half.gif" alt="5 Stars" title="5 Stars" style="border: 0px none ; cursor: pointer;" />
- </div>
- </div><!-- Item Div -->
- <div class="project">
- <h2>
- <a href="##/corporate/830/totspot/" rel="bookmark" title="Permanent Link to Totspot">Totspot</a>
- </h2>
- <p>
- <a href="##/r.php?url=http://totspot.com/login" target="_blank" title="Totspot"><img src="/images/gallery/totspot.gif" alt="Totspot" /></a>
- </p>
- <div class="clear"></div>
- <div class="post-ratings">
- <span>5 Votes, Rating: 4.8</span><img src="/images/rating_on.gif" alt="1 Star" title="1 Star" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="2 Stars" title="2 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="3 Stars" title="3 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="4 Stars" title="4 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_half.gif" alt="5 Stars" title="5 Stars" style="border: 0px none ; cursor: pointer;" />
- </div>
- </div><!-- Item Div -->
- <div class="project">
- <h2>
- <a href="##/web-development/828/mootools/" rel="bookmark" title="Permanent Link to mooTools">mooTools</a>
- </h2>
- <p>
- <a href="##/r.php?url=http://mootools.net" target="_blank" title="mooTools"><img src="/images/gallery/mootools.gif" alt="mooTools" /></a>
- </p>
- <div class="clear"></div>
- <div class="post-ratings">
- <span>5 Votes, Rating: 4.8</span><img src="/images/rating_on.gif" alt="1 Star" title="1 Star" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="2 Stars" title="2 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="3 Stars" title="3 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="4 Stars" title="4 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_half.gif" alt="5 Stars" title="5 Stars" style="border: 0px none ; cursor: pointer;" />
- </div>
- </div><!-- Item Div -->
- <div class="project">
- <h2>
- <a href="##/blog/826/matt/" rel="bookmark" title="Permanent Link to Matt">Matt</a>
- </h2>
- <p>
- <a href="##/r.php?url=http://ma.tt" target="_blank" title="Matt"><img src="/images/gallery/matt.gif" alt="Matt" /></a>
- </p>
- <div class="clear"></div>
- <div class="post-ratings">
- <span>5 Votes, Rating: 4.8</span><img src="/images/rating_on.gif" alt="1 Star" title="1 Star" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="2 Stars" title="2 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="3 Stars" title="3 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="4 Stars" title="4 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_half.gif" alt="5 Stars" title="5 Stars" style="border: 0px none ; cursor: pointer;" />
- </div>
- </div><!-- Item Div -->
- <div class="project">
- <h2>
- <a href="##/web-development/824/the-escapers/" rel="bookmark" title="Permanent Link to The Escapers">The Escapers</a>
- </h2>
- <p>
- <a href="##/r.php?url=http://www.theescapers.com" target="_blank" title="The Escapers"><img src="/images/gallery/theescapers.gif" alt="The Escapers" /></a>
- </p>
- <div class="clear"></div>
- <div class="post-ratings">
- <span>5 Votes, Rating: 4.8</span><img src="/images/rating_on.gif" alt="1 Star" title="1 Star" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="2 Stars" title="2 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="3 Stars" title="3 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="4 Stars" title="4 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_half.gif" alt="5 Stars" title="5 Stars" style="border: 0px none ; cursor: pointer;" />
- </div>
- </div><!-- Item Div -->
- <div class="project">
- <h2>
- <a href="##/web-development/822/timothy-van-sas/" rel="bookmark" title="Permanent Link to Timothy van Sas">Timothy van Sas</a>
- </h2>
- <p>
- <a href="##/r.php?url=http://www.incg.nl" target="_blank" title="Timothy van Sas"><img src="/images/gallery/incg.gif" alt="Timothy van Sas" /></a>
- </p>
- <div class="clear"></div>
- <div class="post-ratings">
- <span>5 Votes, Rating: 4.8</span><img src="/images/rating_on.gif" alt="1 Star" title="1 Star" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="2 Stars" title="2 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="3 Stars" title="3 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="4 Stars" title="4 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_half.gif" alt="5 Stars" title="5 Stars" style="border: 0px none ; cursor: pointer;" />
- </div>
- </div><!-- Item Div -->
- <div class="project">
- <h2>
- <a href="##/web-development/820/wp-designer/" rel="bookmark" title="Permanent Link to WP Designer">WP Designer</a>
- </h2>
- <p>
- <a href="##/r.php?url=http://www.wpdesigner.com" target="_blank" title="WP Designer"><img src="/images/gallery/wpdesigner.gif" alt="WP Designer" /></a>
- </p>
- <div class="clear"></div>
- <div class="post-ratings">
- <span>5 Votes, Rating: 4.8</span><img src="/images/rating_on.gif" alt="1 Star" title="1 Star" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="2 Stars" title="2 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="3 Stars" title="3 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_on.gif" alt="4 Stars" title="4 Stars" style="border: 0px none ; cursor: pointer;" /><img src="/images/rating_half.gif" alt="5 Stars" title="5 Stars" style="border: 0px none ; cursor: pointer;" />
- </div>
- </div><!-- Item Div -->
- <div class="clear"></div>
- <div class="paging">
- <span>Page 1 of 40</span><strong class="on">1</strong> <a href="##/page/2/">2</a> <a href="##/page/3/">3</a> <a href="##/page/4/">4</a> <a href="##/page/2/"><strong>»</strong></a> ... <a href="##/page/40/">Last »</a>
- </div>
View
3 app/views/hosted_instances/_form.html.haml
@@ -4,7 +4,8 @@
= f.text_field :title, :label => "Link Name"
= f.text_field :url, :label => "Link URL"
= f.text_area :description, :label => "Notes, demo logins, etc.. (optional)", :separator => ""
- = f.text_field :antispam, :label => AppConfig.spam_question, :separator => ""
+ - if hosted_instance.new_record?
+ = f.text_field :antispam, :label => AppConfig.spam_question, :separator => ""
.actions
- if hosted_instance.new_record?
View
8 app/views/layouts/_about_us.html.haml
@@ -1,13 +1,11 @@
- force_show = false unless local_assigns[:force_show]
#about_us{hide_unless(current_or_anon_user.show_welcome! || force_show)}
- right_box "about" do
- %h3.about About Open Source Rails
+ %h3.about== About #{AppConfig.site_name}
%p
- Open Source Rails is a community site dedicated to tracking the best open source Ruby on Rails applications.
+ = AppConfig.site_description
- unless force_show
= link_to "Read More...", about_url, :class => "readmore"
|
- = link_to "Close", "#", :class => "hide-click", :rel => ".right-box-top.about"
-
-
+ = link_to "Hide About", "#", :class => "hide-click", :rel => ".right-box-top.about"
View
25 app/views/layouts/_footer.html.haml
@@ -2,29 +2,26 @@
.links
%strong LINKS:
= link_to "Gallery", root_url
- - if logged_in?
- |
- = link_to "Profile", user_url(current_user)
+ |
+ = link_to "Profile", user_url(current_or_anon_user)
|
= link_to "About", about_url
|
= link_to "Blog", blog_url
+ - if AppConfig.feedback_link
+ |
+ = link_to "Feedback", AppConfig.feedback_link
- unless logged_in?
|
= link_to "Login", new_session_url
|
= link_to "Sign Up", new_user_url
- .about
.credits
- &copy; Open Source Rails
- |
- Developed by
- = link_to "RailsJedi", "http://www.railsjedi.com"
- .credits
- Logo by
- = link_to("VivaLogo", "http://www.vivalogo.com")+","
- Source Code
- = link_to "Available", "http://www.github.com/jcnetdev/opensourcerails"
+ == &copy; #{AppConfig.site_name}
+
+ .about
+ = partial("layouts/social_media") if AppConfig.show_social_media
- = clear
+ = clear
+
View
7 app/views/layouts/_header.html.haml
@@ -1,18 +1,21 @@
#header
- = partial "sessions/login_panel"
%h1
%a.replace#logo{:href => root_url, :name => "logo", :title => AppConfig.site_name}
%span &nbsp;
= AppConfig.site_name
+ .address
+ = link_to image_tag("slogan.png"), AppConfig.site_url
+
#menu
%ul
- if active_tab.is_a? String
%li= menu_item(active_tab, url_for, true)
- %li= menu_item("Gallery", root_url, active_tab == :gallery)
+ %li= menu_item("Gallery", gallery_url, active_tab == :gallery)
%li= menu_item("About", about_url, active_tab == :about)
%li= menu_item("Blog", blog_url, active_tab == :blog)
- if logged_in?
%li= link_to menu_tag("Log Out"), session_url, :method => :delete, :confirm => "Are you sure you want to log out?"
= clear
+ = partial "sessions/login_panel"
View
5 app/views/layouts/_social_media.html.erb
@@ -0,0 +1,5 @@
+<script type="text/javascript">
+ if (typeof window.Delicious == "undefined") window.Delicious = {};
+ Delicious.BLOGBADGE_DEFAULT_CLASS = 'delicious-blogbadge-line';
+</script>
+<script src="http://static.delicious.com/js/blogbadge.js"></script>
View
7 app/views/layouts/application.html.haml
@@ -8,9 +8,10 @@
= stylesheets
= javascripts
- = yield :head
-
- = auto_discovery_link_tag(:atom, AppConfig.rss_url || formatted_projects_url(:atom), :title => "Latest Projects")
+ = auto_discovery_link_tag(:atom, projects_rss, :title => "Latest Apps")
+ = auto_discovery_link_tag(:atom, upcoming_rss, :title => "Upcoming Apps")
+ - if AppConfig.blog_rss
+ = auto_discovery_link_tag(:atom, AppConfig.blog_rss, :title => "Latest Blog Posts")
%body
.body-main
View
11 app/views/pages/_tell_friend_form.html.haml
@@ -0,0 +1,11 @@
+- build_form_for @tell_friend, :url => url_for do |f|
+ = f.text_field :from, :label => "Your Email"
+ = f.text_field :to, :label => "Friend's Email"
+ = f.text_area :message
+ .actions
+ = f.submit "Preview Message...", :id => "tell_friend_preview", :name => "preview"
+ or
+ = link_to "cancel", about_url
+ .hidden
+ = f.submit "Send!", :id => "tell_friend_submit", :name => "send"
+ = f.submit "Cancel", :id => "tell_friend_cancel", :name => "sancel"
View
34 app/views/pages/_tell_friend_preview.html.haml
@@ -0,0 +1,34 @@
+.details.main.preview
+ %h2 Previewing Tell a Friend Message
+ = clear
+
+ .entry
+ = br
+ %p
+ %strong From:
+ = @tell_friend.from
+ %p
+ %strong To:
+ = @tell_friend.to
+ %p
+ %strong Subject:
+ = AppConfig.tellafriend_subject
+
+ %p= AppConfig.tellafriend_body_intro
+ - if @tell_friend.message.blank?
+ %p= AppConfig.tellafriend_body_message
+ - else
+ = simple_format h(@tell_friend.message)
+
+ - if current_user.is_a?(User) and current_user.active?
+ %p
+ You can view my profile here:
+ = br
+ = link_to user_url(current_user), user_url(current_user), :target => "_blank"
+
+ .actions
+ = button_to_function "Send Message!", :disabled => !@tell_friend.valid? do |page|
+ - page[:tell_friend_submit].click
+ = button_to_function "Go Back" do |page|
+ - page[:tell_friend_cancel].click
+
View
59 app/views/pages/about.html.haml
@@ -1,28 +1,49 @@
- active_tab :about
-#body
+#body.about
#body_left
#left_pad
- .details.main
- %h2.right== Latest #{AppConfig.version}
- %h2.left About OpenSourceRails.com
- = clear
- .entry{:style => "font-size: 20px;color:#666"}
- %p Open Source Rails is dedicated to keeping track of the latest and greatest Ruby on Rails open source applications.
- %p
- If you are the author of one of the projects listed on the site and want admin access over your project,
- register a user and then email us
- = mail_to "opensourcerails@gmail.com", "here", :encode => "javascript"
- and we'll grant you project ownership access.
- %p
- Feature request and bug can be
- sent
- = mail_to "opensourcerails@gmail.com", "here.", :encode => "javascript"
+ - if @preview
+ = partial "pages/tell_friend_preview"
+ - else
+ .details.main
+ %h2.right== Latest #{AppConfig.version}
+ %h2.left== About #{AppConfig.site_name}
+ = clear
+ .entry{:style => "color:#666"}
+ %p
+ = br
+ Open Source Rails features an easy to browse gallery of the best open source / freely available rails projects.
+
+ %p
+ Each project features screenshots plus community driven comments, ratings, and bookmarking.
+
+ %p
+ If you have a Rails project that you're considering to release to the community, please let us know
+ and we'll help you get featured, and hopefully build up a community to help build and extend your project.
+
+ %p{:style => "margin-bottom: 0"}
+ Keep up to date with OpenSourceRails.com:
+
+ %ul{:style => "margin-bottom: 20px"}
+ %li= link_to "Featured Projects RSS Feed", projects_rss
+ %li= link_to "Upcoming Projects RSS Feed", upcoming_rss
+ - if AppConfig.blog_rss
+ %li= link_to "Latest Blog RSS Feed", AppConfig.blog_rss
+
+ %p
+ Got a feature idea? Find a bug?
+ = mail_to AppConfig.admin_email_address, "Email", :encode => "javascript"
+ us.
#body_right
= partial "layouts/about_us", :force_show => true
#about_tabs
- - tabs do
+ - tabs(:class => "size-3") do
+ - tab "Promote", "spread_tab" do
+ %p{:style => "margin-top: 0px;margin-bottom: 10px"} Let a friend know about Open Source Rails!
+ = partial "pages/tell_friend_form"
+
- tab "Credits", "credits_tab" do
%p{:style => "margin-bottom: 0px"} Open Source Rails uses the following freely available design components.
%ul
@@ -33,10 +54,6 @@
Crystal Icons by
= link_to "Everaldo", "http://www.everaldo.com/crystal/"
%li
- Initial Theme Template
- = br+"by"
- = link_to "Shabu Anower", "http://www.osdesigner.net/about/"
- %li
Javascript Lightbox Effect
= br+"by"
= link_to "Nick Stakenburg", "http://www.nickstakenburg.com"
View
2 app/views/projects/_project.html.haml
@@ -1,7 +1,7 @@
- if local_assigns[:project]
- div_for(project, :class => cycle("start-row", "")) do
%h2= link_to h(project.title), project_url(project), :rel => "bookmark", :title => h(project.short_description)
- %p= project.short_description
+ %p.tagline= project.short_description
-# show default screenshot
.screen= link_to image_tag(project.screenshot_url), project_url(project)
View
2 app/views/projects/index.atom.builder
@@ -1,5 +1,5 @@
atom_feed do |feed|
- feed.title "Open Source Rails"
+ feed.title AppConfig.site_name
feed.updated((@projects.first.promoted_at)) unless @projects.empty?
View
5 app/views/projects/index.html.haml
@@ -7,17 +7,16 @@
= partial "projects/parts/grid", :projects => @projects
#body_right
- = partial "layouts/searchbox"
+ = partial "layouts/about_us"
#submit_app
= link_to_image "template/submit_app.gif", "#", |
:label => "Submit a New Application", |
:class => "submit toggle", :rel => "#new_project_tab_form" |
= render :partial => "projects/parts/mini_form"
+ = partial "layouts/searchbox"
- = partial "layouts/about_us"
= partial "projects/parts/tabs"
-
= clear
View
1 app/views/projects/parts/_about_project.html.haml
@@ -16,6 +16,7 @@
%p
- unless project.license.blank?
+ = br
%strong License:
=h project.license
View
7 app/views/projects/parts/_grid.html.haml
@@ -1,8 +1,11 @@
#project_grid
- if local_assigns[:projects]
- - unless local_assigns[:grid_title].blank?
- %h3= local_assigns[:grid_title]
+ - if !@grid_title.blank?
+ %h3
+ - if @grid_rss
+ .rss= link_to image_tag("rss-reflection-sm.png", :size => "20x20"), @grid_rss
+ = @grid_title
- else
= search_or_tag_title
View
5 app/views/projects/parts/_list.html.haml
@@ -19,4 +19,7 @@
= time_ago_in_words(project.last_changed)
ago.
- = clear
+ = clear
+ - if local_assigns[:action]
+ %li.action
+ = link_to action.first, action.last
View
21 app/views/projects/parts/_tabs.html.haml
@@ -1,14 +1,23 @@
-- if @upcoming and @my_projects
- - tabs(:class => "size-2") do
+- tabs(:class => "size-2") do
+ - if @hide_upcoming
+ - tab "Gallery", "gallery_apps", :class => "scroll-250" do
+ - if Project.gallery.size > 0
+ = partial "projects/parts/list", :projects => Project.gallery, :action => ["View All Gallery Projects", projects_url]
+ - else
+ %p No gallery applications. Submit one now!
+
+ - else
- tab "Upcoming", "upcoming_apps", :class => "scroll-250" do
- - if @upcoming.size > 0
- = partial "projects/parts/list", :projects => @upcoming
+ - if Project.upcoming.size > 0
+ = partial "projects/parts/list", :projects => Project.upcoming, :action => ["View All Upcoming Projects", upcoming_projects_url]
- else
%p No upcoming applications. Submit one now!
+ - if @my_projects
- tab "Bookmarked", "projects_add", :class => "scroll-250" do
- #my_bookmarks= partial "bookmarks/bookmark_list", :projects => @my_projects
-
+ #my_bookmarks= partial "bookmarks/bookmark_list", :projects => @my_projects, :action => ["View All Bookmarks", user_url(current_or_anon_user)]
+ - else
+ - blank_tab
- if @latest_activities and @tags and @top_downloaded
- tabs(:class => "size-3") do
View
3 app/views/projects/show.html.haml
@@ -21,7 +21,7 @@
#body_right
#go_back
- = link_to_image "back-arrow-sm.png", projects_url(:page => session[:page]), :label => "Back to Gallery..."
+ = link_to_image "back-arrow-sm.png", gallery_url, :label => "Back to Gallery..."
#project_info
- right_box do
= partial "projects/parts/about_project", :project => @project
@@ -32,5 +32,6 @@
- if @project.is_submitted?
= partial "projects/tabs/project_activity", :activities => @latest_activities
= approve_button(@project)
+ = delete_button(@project)
= clear
View
13 app/views/projects/upcoming.atom.builder
@@ -0,0 +1,13 @@
+atom_feed do |feed|
+ feed.title "Upcoming #{AppConfig.site_name} Projects"
+ @projects.each do |project|
+ feed.entry(project, :published => project.promoted_at, :updated => project.promoted_at) do |entry|
+ entry.title(project.title)
+ entry.content(image_tag(AppConfig.site_url+project.preview_url, :style => "float:left;margin-right:10px")+simple_format(project.description)+"<br style='clear:both' />", :type => 'html')
+
+ entry.author do |author|
+ author.name(project.owner.to_s)
+ end
+ end
+ end
+end
View
16 app/views/sessions/_login_panel.html.haml
@@ -1,9 +1,11 @@
-.login
+- unless @hide_login_panel
- if logged_in?
- Logged in as:
- %strong= link_to current_user.login, user_url(current_user)
+ .login.current
+ Logged in as:
+ %strong= link_to current_user.login, user_url(current_user)
- else
- .links
- = link_to "Login", new_session_url
- |
- = link_to "Sign Up", new_user_url
+ .login
+ .links
+ = link_to "Login", new_session_url
+ |
+ = link_to "Sign Up", new_user_url
View
2 app/views/sessions/new.html.haml
@@ -3,6 +3,8 @@
- @login ||= Login.new
+- hide_login_panel
+
#body
#body_left
#left_pad
View
11 app/views/user_mailer/tell_friend.erb
@@ -0,0 +1,11 @@
+<%= AppConfig.tellafriend_body_intro %>
+
+<% if @tell_friend.message.blank? -%>
+<%= AppConfig.tellafriend_body_message %>
+<% else -%>
+<%= @tell_friend.message %>
+<% end -%>
+
+<% if @current_user.is_a?(User) and @current_user.active? -%>
+You can view my profile here: <%= AppConfig.site_url %>/users/<%= @current_user.login %>
+<% end -%>
View
2 app/views/users/new.html.haml
@@ -1,6 +1,8 @@
- title "Sign Up"
- active_tab "Sign Up"
+- hide_login_panel
+
#body
#body_left
#left_pad
View
23 app/views/users/show.html.haml
@@ -12,8 +12,29 @@
#body_right
- if current_or_anon_user == @user
+ - if @user.active?
+ - right_box do
+ = partial "users/parts/about_user", :user => @user
+ - else
+ - right_box do
+ = br
+ %h2= link_to "Make an Account!", new_user_url
+ - else
- right_box do
- = partial "users/parts/about_user", :user => @user
+ %h3== #{name_display(@user)} Profile
+ .display
+ %p
+ %strong Name:
+ =h default(@user.name, "[Not Entered]")
+ - unless @user.homepage.blank?
+ = br
+ %strong Homepage:
+ = link_to h(@user.homepage), h(@user.homepage)
+
+ - unless @user.profile.blank?
+ = br
+ %strong About:
+ =h(@user.profile)
- right_box do
%h3== #{name_display(@user)} Activities (#{@activities.size})
View
12 app/views/versions/_form.html.haml
@@ -2,16 +2,18 @@
- build_form_for [@project, version], :html => {:multipart => true} do |f|
- .attach-download
- - f.file_field :download, :label => "Upload Tarball", :size => "25" do
- .text-right= link_to "Set Download Link", "#", :class => "set-link"
- .attach-link{hidden}
+ .attach-link
- f.text_field :link, :label => "Download Link" do
.text-right= link_to "Upload Version", "#", :class => "set-upload"
+
+ .attach-download{hidden}
+ - f.file_field :download, :label => "Upload Tarball", :size => "25" do
+ .text-right= link_to "Set Download Link", "#", :class => "set-link"
= f.text_field :title, :label => "Version Name"
= f.text_area :notes, :label => "Update Notes (optional)"
- = f.text_field :antispam, :label => AppConfig.spam_question, :separator => ""
+ - if version.new_record?
+ = f.text_field :antispam, :label => AppConfig.spam_question, :separator => ""
.actions
- if version.new_record?
View
20 config/app_config.yml
@@ -1,20 +1,32 @@
# Set Site Details
site_name: "Open Source Rails"
site_url: "http://www.opensourcerails.com"
+blog_url: "http://blog.opensourcerails.com"
+admin_email_name: "OpenSourceRails"
+admin_email_address: "opensourcerails@gmail.com"
version: "v1.0"
+
+# Options
+show_social_media: true
require_email_activation: true
enable_throttler: false
+show_morph: true
-blog_url: http://blog.opensourcerails.com
-
-file_storage: s3
+# About Page
+site_description: "Open Source Rails is a community site dedicated to tracking the best open source Ruby on Rails applications."
# SEO Stuff
default_meta_keywords: "open source ruby on rails"
default_meta_description: "Open Source Rails is a community site dedicated to tracking the best open source Ruby on Rails applications."
+# Tell a Friend
+tellafriend_subject: "Check out OpenSourceRails.com"
+tellafriend_body_intro: "OpenSourceRails.com is features the latest and greatest open source Ruby on Rails projects. Check it out: http://www.opensourcerails.com"
+tellafriend_body_message: "It features an easy to use browse gallery with screenshots plus community driven comments, ratings, and bookmarking."
+
# Paging Sizes
projects_per_page: 6
+bookmarks_per_page: 8
# Set Avatar Sizes
screenshot_sizes:
@@ -24,9 +36,9 @@ screenshot_sizes:
# Set default avatar
screenshot_default: "/images/default_screenshots/:style.png"
+# Retarded Spam Question
spam_question: What is 3 plus 2?
spam_answer:
- "5"
- "five"
-show_morph: false
View
56 config/deploy.rb
@@ -9,6 +9,12 @@
set :checkout, "export"
set :deploy_via, :remote_cache
+# set the list of config files to symlink on deployment
+set :config_files, %w[database.yml app_config.yml environments/production.yml]
+
+# set the list of folders to symlink on deployment
+set :upload_folders, %w[screenshots downloads]
+
set :base_path, "/var/www"
set :deploy_to, "/var/www/production/#{application}"
set :apache_site_folder, "/etc/apache2/sites-enabled"
@@ -83,6 +89,7 @@
after "deploy:setup", "init:database_yml"
after "deploy:setup", "init:create_database"
after "deploy:setup", "init:create_vhost"
+after "deploy:setup", "init:create_app_config"
after "deploy:setup", "init:enable_site"
namespace :init do
@@ -140,34 +147,59 @@
end
+ desc "create app config"
+ task :create_app_config do
+ app_config_yml = File.open(File.join(File.dirname(__FILE__), "app_config.yml"), "r").read
+ put app_config_yml, "#{shared_path}/config/app_config.yml"
+
+ run "mkdir -p #{shared_path}/config/environments/"
+
+ production_yml = File.open(File.join(File.dirname(__FILE__), "environments", "production.yml"), "r").read
+ put production_yml, "#{shared_path}/config/environments/production.yml"
+ end
+
end
after "deploy:update_code", "localize:install_gems"
after "deploy:update_code", "localize:copy_shared_configurations"
-after "deploy:update_code", "localize:upload_folders"
+after "deploy:update_code", "localize:link_upload_folders"
+after "deploy:update_code", "localize:merge_assets"
namespace :localize do
desc "copy shared configurations to current"
task :copy_shared_configurations, :roles => [:app] do
- %w[database.yml].each do |f|
- run "ln -nsf #{shared_path}/config/#{f} #{release_path}/config/#{f}"
+ if defined? :config_files
+ config_files.each do |f|
+ run "ln -nsf #{shared_path}/config/#{f} #{release_path}/config/#{f}"
+ end
end
end
desc "installs / upgrades gem dependencies "
task :install_gems, :roles => [:app] do
- sudo "date" # fuck you capistrano
+ sudo "date"
run "cd #{release_path} && sudo rake RAILS_ENV=production gems:install"
end
- task :upload_folders, :roles => [:app] do
- # create symlink for screenshots
- run "mkdir -p #{deploy_to}/shared/screenshots"
- run "ln -s #{deploy_to}/shared/screenshots #{release_path}/public/screenshots"
-
- # create symlink for downloads
- run "mkdir -p #{deploy_to}/shared/downloads"
- run "ln -s #{deploy_to}/shared/downloads #{release_path}/public/downloads"
+ desc "linking upload folders"
+ task :link_upload_folders, :roles => [:app] do
+ if defined? :upload_folders
+ upload_folders.each do |f|
+ run "mkdir -p #{shared_path}/uploads/#{f}"
+ run "ln -nsf #{shared_path}/uploads/#{f} #{release_path}/public/#{f}"
+ end
+ end
+ end
+
+ desc "merge asset files"
+ task :merge_assets, :roles => [:app] do
+ sudo "date"
+ run "cd #{release_path} && sudo script/merge_assets"
+ end
+
+ task :merge_current_assets, :roles => [:app] do
+ sudo "date"
+ run "cd #{current_path} && sudo script/merge_assets"
end
end
View
4 config/routes.rb
@@ -10,6 +10,10 @@
:details => :get,
:rate => :post,
:download => :get
+ },
+ :collection => {
+ :upcoming => :get,
+ :activity => :get
} do |project|
project.resources :comments
View
9 db/migrate/20080826081134_add_requirements_to_project.rb
@@ -0,0 +1,9 @@
+class AddRequirementsToProject < ActiveRecord::Migration
+ def self.up
+ add_column :projects, :requirements, :string
+ end
+
+ def self.down
+ remove_column :projects, :requirements
+ end
+end
View
11 db/migrate/20080826114524_add_user_fields.rb
@@ -0,0 +1,11 @@
+class AddUserFields < ActiveRecord::Migration
+ def self.up
+ add_column :users, :tell_friend_count, :integer, :default => 0
+ add_column :users, :tell_friend_last_sent, :datetime
+ end
+
+ def self.down
+ remove_column :users, :tell_friend_last_sent
+ remove_column :users, :tell_friend_count
+ end
+end
View
67 db/schema.rb
@@ -9,24 +9,24 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20080728120230) do
+ActiveRecord::Schema.define(:version => 20080826114524) do
create_table "activities", :force => true do |t|
- t.datetime "created_at"
- t.datetime "updated_at"
- t.integer "project_id", :limit => 11
- t.integer "target_id", :limit => 11
+ t.string "user_name"
+ t.integer "user_id", :limit => 11
t.string "action_name"
- t.string "target_name"
t.string "midsentence"
- t.string "project_name"
- t.string "endconnector"
- t.string "source_action"
+ t.string "target_name"
+ t.integer "target_id", :limit => 11
t.string "target_type"
- t.integer "user_id", :limit => 11
- t.string "source_model"
- t.string "user_name"
+ t.string "endconnector"
+ t.string "project_name"
+ t.integer "project_id", :limit => 11
t.datetime "happened_at"
+ t.string "source_model"
+ t.string "source_action"
+ t.datetime "created_at"
+ t.datetime "updated_at"
end
create_table "bookmarks", :force => true do |t|
@@ -74,9 +74,9 @@
t.string "license"
t.datetime "created_at"
t.datetime "updated_at"
- t.string "thumb_url", :default => "/images/default_screenshots/thumb.png"
- t.string "preview_url", :default => "/images/default_screenshots/medium.png"
- t.string "screenshot_url", :default => "/images/default_screenshots/original.png"
+ t.string "thumb_url", :default => "/images/default_thumb.png"
+ t.string "preview_url", :default => "/images/default_preview.png"
+ t.string "screenshot_url", :default => "/images/default_screenshot.png"
t.string "download_url"
t.boolean "in_gallery", :default => false
t.boolean "is_submitted", :default => false
@@ -85,7 +85,7 @@
t.integer "author_id", :limit => 11
t.string "short_description"
t.integer "rating_count", :limit => 11
- t.integer "rating_total", :limit => 10
+ t.integer "rating_total", :limit => 10, :precision => 10, :scale => 0
t.decimal "rating_avg", :precision => 10, :scale => 2
t.text "cached_tag_list"
t.integer "downloads", :limit => 11, :default => 0
@@ -96,30 +96,35 @@
t.integer "screenshots_count", :limit => 11, :default => 0
t.integer "instructions_count", :limit => 11, :default => 0
t.datetime "last_changed"
+ t.string "requirements"
end
create_table "ratings", :force => true do |t|
t.integer "rater_id", :limit => 11
t.integer "rated_id", :limit => 11
t.string "rated_type"
- t.integer "rating", :limit => 10
+ t.integer "rating", :limit => 10, :precision => 10, :scale => 0
t.datetime "created_at"
end
add_index "ratings", ["rater_id"], :name => "index_ratings_on_rater_id"
add_index "ratings", ["rated_type", "rated_id"], :name => "index_ratings_on_rated_type_and_rated_id"
+ create_table "schema_info", :id => false, :force => true do |t|
+ t.integer "version", :limit => 11
+ end
+
create_table "screenshots", :force => true do |t|
t.integer "project_id", :limit => 11
- t.integer "owner_id", :limit => 11
- t.string "screenshot_file_name"
- t.string "screenshot_content_type"
- t.integer "screenshot_file_size", :limit => 11
- t.string "filename"
t.string "content_type"
+ t.string "filename"
t.integer "size", :limit => 11
t.datetime "created_at"
t.datetime "updated_at"
+ t.integer "owner_id", :limit => 11
+ t.string "screenshot_content_type"
+ t.string "screenshot_file_name"
+ t.integer "screenshot_file_size", :limit => 11
end
create_table "taggings", :force => true do |t|
@@ -152,15 +157,17 @@
t.boolean "admin", :default => false
t.string "ip_address"
t.string "name"
- t.string "homepage"
t.text "profile"
t.boolean "signed_up", :default => false
t.text "bookmark_blob"
t.boolean "show_alert", :default => false
t.boolean "show_welcome", :default => true
t.boolean "spammer", :default => false
- t.string "forgot_password_hash"
t.datetime "forgot_password_expire"
+ t.string "forgot_password_hash"
+ t.string "homepage"
+ t.integer "tell_friend_count", :limit => 11, :default => 0
+ t.datetime "tell_friend_last_sent"
end
add_index "users", ["ip_address"], :name => "index_users_on_ip_address"
@@ -169,18 +176,18 @@
create_table "versions", :force => true do |t|
t.integer "project_id", :limit => 11
t.integer "uploader_id", :limit => 11
- t.string "title"
t.text "notes"
- t.string "link"
- t.string "download_file_name"
- t.string "download_content_type"
- t.integer "download_file_size", :limit => 11
- t.string "filename"
t.string "content_type"
+ t.string "filename"
t.integer "size", :limit => 11
t.datetime "created_at"
t.datetime "updated_at"
+ t.string "title"
t.integer "owner_id", :limit => 11
+ t.string "download_content_type"
+ t.string "download_file_name"
+ t.integer "download_file_size", :limit => 11
+ t.string "link"
end