Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
.svn
<<<<<<< master
=======
log
nbproject
>>>>>>> local
33 changes: 24 additions & 9 deletions README → README.markdown
Original file line number Diff line number Diff line change
@@ -1,26 +1,41 @@
== Welcome to EngineY
# Welcome to EngineY
While originally designed to be a social networking framework allowing users to easily build a social network site, EngineY has become something much greater. It now has full Content Management capabilities and features similar to a full portal, such as the popular Java Portals like Liferay.

EngineY is implemented in Ruby on Rails and is easy to customize and deploy as your own powerful and feature packed social media site. Empower users with their own blogs. Enhance collaboration with forums, groups and events. Let your users post Twitter-like status messages. Track all the activity on your site with a live activity stream. Build a custom client to access all of your social data using EngineY's RESTful API.


== Installation
## Installation

EngineY requires the rmagick gem. To correctly install that gem along with the correct version of Imagemagick for your platform see this FAQ:
http://rmagick.rubyforge.org/install-faq.html
Edit the config/database.yml file to configure a local database for use with EngineY.

You might need the following gem(s)

$ gem install disguise (2.0.0 version)
$ gem install rack (1.2.1)
$ gem install rails (2.3.5)
$ gem install hpricot

The following are installed using rake gem:install
$ ruby-openid
$ aws-s3
$ jammit


Run the following three commands in order:
$ rake db:create:all
$ rake db:migrate
These will create the database with the correct schema.

The run the app
$ ruby script/server and browse http://localhost:3000 for the remainder of the setup.

rake db:create:all
rake db:migrate
rake enginey:db:ruby_mi_populate
This will create the database with the correct schema and populate it with data for a sample site. This will allow you to run the application and have a look around. You will be able to login with the following id and password:
User ID: admin
Password: admin
You can populate the app with data for a sample site, Use the "Populate with Sample Data" function on the engineY install page. This will allow you to run the application and have a look around.

After logging in as the Admin, you can go to the 'Manage' tab and click on the 'Settings' tab. From that page, you can set a theme for your site. For example, try setting the RubyMI theme to see an example of what a Ruby community site might look like.

Getting Help/Support
## Getting Help/Support

Additional documentation is available on the wiki pages. Any questions that you have about using EngineY or developing with EngineY should be posted to the EngineY Google Group http://groups.google.com/group/enginey.

Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require 'rake/rdoctask'

require 'tasks/rails'

require 'disguise/tasks'
#require 'disguise/tasks'

test_dir = File.expand_path('test')

Expand Down
24 changes: 23 additions & 1 deletion app/controllers/admin_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,16 @@ def events
format.json {}
end
end

def locations
@page = 'locations'
respond_to do |format|
format.html {
@locations = Location.find(:all)
}
format.json{}
end
end


# Display the Blog Posts tab of the Admin page.
Expand Down Expand Up @@ -372,14 +382,26 @@ def group_edit

def event_new
@event = Event.new
@locations = Location.find(:all, :order => "name")
render 'event_form'
end


def event_edit
@event = Event.find(params[:id])
@locations = Location.find(:all, :order => "name")
render 'event_form'
end

def location_new
@location = Location.new
render 'location_form'
end

def location_edit
@location = Location.find(params[:id])
render 'location_form'
end


def user_new
Expand Down Expand Up @@ -565,7 +587,7 @@ def post_event_data
event_params = {:name => params[:name],
:start_time => params[:start_time],
:end_time => params[:end_time],
:location => params[:location],
:location_id => params[:location_id],
:organizer => params[:organizer]}
if params[:id] == "_empty"
event = Event.create(event_params)
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/events_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def show

def new
@event = Event.new
@locations = Location.find(:all, :order => "name")
if params[:group_id]
@group = Group.find(params[:group_id])
end
Expand All @@ -85,6 +86,7 @@ def new

def edit
@event = Event.find(params[:id])
@locations = Location.find(:all, :order => "name")
if params[:group_id]
@group = Group.find(params[:group_id])
end
Expand Down
80 changes: 80 additions & 0 deletions app/controllers/locations_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
class LocationsController < ApplicationController
def index
@locations = Location.find(:all, :conditions => "active = true", :order => "name desc")
respond_to do |format|
format.html { render :template => 'locations/index' }
format.xml { render :xml => @locations }
format.json { render :json => @locations.to_json }
end
end

def show
@location = Location.find(params[:id])
respond_to do |format|
format.html # location.html.erb
format.xml { render :xml => @location }
format.json { render :json => @location.to_json }
end
end

def new
@location = Location.new
end

def edit
@location = Location.find(params[:id])
end

def create
@location = Location.new(params[:location])
if @location.save
format.html {
if params['admin_page']
redirect_to('/admin/locations')
else
redirect_to(@location)
end
}
format.xml { render :xml => @location, :status => :created, :location => @location }
format.json { render :json => @location.to_json, :status => :created, :location => @location }
else
format.html { render :action => "new" }
format.xml { render :xml => @location.errors, :status => :unprocessable_entity }
format.json { render :json => @location.errors.to_json, :status => :unprocessable_entity }
end

end

def update
@location = Location.find(params[:id])
respond_to do |format|
if @location.update_attributes(params[:location])
flash[:notice] = 'Location was successfully updated.'
format.html {
if params['admin_page']
redirect_to('/admin/locations')
else
redirect_to(@location)
end
}
format.xml { head :ok }
format.json { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @location.errors, :status => :unprocessable_entity }
format.json { render :json => @location.errors.to_json, :status => :unprocessable_entity }
end
end
end

def destroy
@location = Location.find(params[:id])
@location.destroy
respond_to do |format|
format.html { redirect_to(events_url) }
format.xml { head :ok }
format.json { head :ok }
end
end

end
2 changes: 2 additions & 0 deletions app/helpers/locations_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module LocationsHelper
end
1 change: 1 addition & 0 deletions app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class Event < ActiveRecord::Base

has_one :profile_photo
belongs_to :user # the creator
belongs_to :location
has_many :wall_posts, :order=>'created_at DESC'

validates_presence_of :start_time, :end_time, :name
Expand Down
17 changes: 17 additions & 0 deletions app/models/location.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class Location < ActiveRecord::Base

# == Schema Information
# Schema version: 20101212153538
#
# Table name: locations
# name :string(255)
# street :string(255)
# city :string(255)
# website :string(255)
# phone :string(255)
# created_at :datetime
# updated_at :datetime

has_many :events

end
1 change: 1 addition & 0 deletions app/views/admin/_left_nav.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<li><%= link_to 'Users', '/admin/users' %></li>
<li><%= link_to 'Groups', '/admin/groups' %></li>
<li><%= link_to 'Events', '/admin/events' %></li>
<li><%= link_to 'Locations', '/admin/locations' %></li>
<li><%= link_to 'Blog Posts', '/admin/blog_posts' %></li>
<li><%= link_to 'Forums', '/admin/forums' %></li>
<li><%= link_to 'Managed Content', '/admin/contents' %></li>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/events.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<td><%= event.name %></td>
<td><%= event.start_time.to_s(:basic) %></td>
<td><%= event.end_time.to_s(:basic) %></td>
<td><%= event.location %></td>
<td><%= event.location.name %></td>
<td><%= event.organized_by %></td>
<td>
<%= link_to 'Edit', '/admin/event_edit?id=' + event.id.to_s %> |
Expand Down
5 changes: 5 additions & 0 deletions app/views/admin/location_form.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<%= stylesheet_link_tag 'locations' %>

<div id="add_location">
<%= render :partial=>'/locations/location_form', :locals => {:admin_page => true} %>
</div>
44 changes: 44 additions & 0 deletions app/views/admin/locations.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<style>
table#events th, table#events td {
text-align: left;
}

#content {
width: 900px;
}
</style>

<h2 class="ic-db">Locations</h2>
<%= link_to 'Add Location', '/admin/location_new' %>
<table id="locations">
<thead>
<th width="50px">ID</th>
<th width="190px">Name</th>
<th width="150px">Street</th>
<th width="150px">City</th>
<th width="150px">Website</th>
<th width="100px">Phone</th>
<th width="100px">Created At</th>
<th width="100px">Updated At</th>
<th width="200px">Actions</th>
</thead>
<tbody>
<% @locations.each do |location| %>
<tr>
<td><%= location.id %></td>
<td><%= location.name %></td>
<td><%= location.street %></td>
<td><%= location.city %></td>
<td><%= location.website %></td>
<td><%= location.phone %></td>
<td><%= location.created_at.to_s(:basic) %></td>
<td><%= location.updated_at.to_s(:basic) %></td>
<td>
<%= link_to 'Edit', '/admin/location_edit?id=' + location.id.to_s %> |
</td>
</tr>
<% end %>
</tbody>
</table>


2 changes: 1 addition & 1 deletion app/views/events/_event_brief.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ limitations under the License.
<div class="event_brief_text">
<span id="event_name"><%= link_to event.name, event_url(event) %></span><br/>
<%= event.start_time.to_s(:event_brief) %> to <%= event.end_time.to_s(:event_brief) %><br/>
<%= event.location %><br/>
<%= event.location.name %><br/>
<%= event.description %><br/>
Organized By: <%= event.organized_by %><br/>
Event Type: <%= event.event_type %>
Expand Down
5 changes: 3 additions & 2 deletions app/views/events/_event_details.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ limitations under the License.
<div class="event_detail_name"><%= @event.name %></div>
<%= link_to @event.website, @event.website %><br/>
Time: <%= @event.start_time.to_s(:event_brief) %><br/>
Location: <%= @event.location %><br/>
City/Town: <%= @event.city %><br/>
Location: <%= @event.location.name %><br/>
City/Town: <%= @event.location.city %><br/>
State: <%= @event.location.state %><br />
Event Type: <%= @event.event_type %><br/>
Organized By: <%= @event.organized_by %>
</div>
Expand Down
20 changes: 10 additions & 10 deletions app/views/events/_event_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,20 @@ limitations under the License.
<div class="datetime"><%= f.datetime_select :end_time, :twelve_hour => true, :class=>'input_field' %></div>

<label for="location">Location:</label>
<%= f.text_field :location, :class=>'input_field' %>
<div class="input_field"><%= select "event", "location_id", @locations.map {|l| [l.name, l.id]}, :class=>'input_field' %></div>

<label for="street">Street:</label>
<%= f.text_field :street, :class=>'input_field' %>
<%#*<label for="street">Street:</label>%>
<%#= f.text_field :street, :class=>'input_field' %>

<label for="city">City:</label>
<%= f.text_field :city, :class=>'input_field' %>
<%#*<label for="city">City:</label>%>
<%#= f.text_field :city, :class=>'input_field' %>

<label for="website">Website or Map:</label>
<%= f.text_field :website, :class=>'input_field' %>
<div class="field_help_text">Add the web address for the venue or link to a Google Map</div>
<%#*<label for="website">Website or Map:</label>%>
<%#= f.text_field :website, :class=>'input_field' %>
<%#*<div class="field_help_text">Add the web address for the venue or link to a Google Map</div>%>

<label for="phone">Phone:</label>
<%= f.text_field :phone, :class=>'input_field' %>
<%#*<label for="phone">Phone:</label>%>
<%#= f.text_field :phone, :class=>'input_field' %>

<label for="organized_by">Organized By:</label>
<%= f.text_field :organized_by, :class=>'input_field' %>
Expand Down
6 changes: 6 additions & 0 deletions app/views/locations/_location_admin_widget.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="module">
<div class="module_head">Location Admin</div>
<div class="module_body">
<%= link_to 'Edit Location', edit_event_url(@location) %><br/>
</div>
</div>
16 changes: 16 additions & 0 deletions app/views/locations/_location_details.html.erb.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div class="module" style="background-color:white;">
<div class="module_head">Location Details</div>
<div class="module_body">
<div id="location_description">
<div class="event_detail_name"><%= @location.name %></div>
<%= link_to @location.website, @location.website %><br/>
Name: <%= @location.name %><br/>
Street: <%= @location.street %><br/>
City/Town: <%= @location.city %><br/>
State: <%= @location.state %><br />
Website: <%= @location.website %><br/>
Phone: <%= @location.phone %>
</div>
<div style="clear:both"></div>
</div>
</div>
Loading