Skip to content

Commit

Permalink
init database
Browse files Browse the repository at this point in the history
  • Loading branch information
Thu committed Mar 17, 2010
1 parent c8b1b67 commit ac9685b
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 224 deletions.
20 changes: 0 additions & 20 deletions config/database.yml.example

This file was deleted.

42 changes: 42 additions & 0 deletions db/migrate/20100317213106_create_structure_for_news.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
class CreateStructureForNews < ActiveRecord::Migration

def self.up
create_table :news_items do |t|
t.string :title
t.text :body
t.datetime :publish_date
t.timestamps
end

add_index :news_items, :id

User.find(:all).each do |user|
user.plugins.create(:title => "News", :position => (user.plugins.maximum(:position) || -1) + 1)
end

page = Page.create(:title => "News",
:link_url => "/news",
:menu_match => "^/news.*$",
:deletable => false,
:position => Page.count)

RefinerySetting.find_or_set(:default_page_parts, ["Body", "Side Body"]).each do |default_page_part|
page.parts.create(:title => default_page_part, :body => nil)
end

end

def self.down
UserPlugin.destroy_all({:title => "News"})

Page.find_all_by_link_url("/news").each do |page|
page.link_url, page.menu_match = nil
page.deletable = true
page.destroy
end
Page.destroy_all({:link_url => "/news"})

drop_table :news_items
end

end
12 changes: 11 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20100315203301) do
ActiveRecord::Schema.define(:version => 20100317213106) do

create_table "images", :force => true do |t|
t.integer "parent_id"
Expand Down Expand Up @@ -45,6 +45,16 @@
t.datetime "updated_at"
end

create_table "news_items", :force => true do |t|
t.string "title"
t.text "body"
t.datetime "publish_date"
t.datetime "created_at"
t.datetime "updated_at"
end

add_index "news_items", ["id"], :name => "index_news_items_on_id"

create_table "page_parts", :force => true do |t|
t.integer "page_id"
t.string "title"
Expand Down
183 changes: 1 addition & 182 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,183 +1,2 @@
# Refinery CMS
# Public site for golf.viff.nu

__An open source Ruby on Rails content management system for small business.__

## Demo Site

* [Front end live demo ](http://demo.refinerycms.com)
* [Back end live demo ](http://demo.refinerycms.com/admin)

For more screenshots, example sites & high level information: [http://refinerycms.com](http://refinerycms.com)

![Refinery Dashboard](http://refinerycms.com/system/images/0000/0576/dashboard.png)

## What it's good at?

__Refinery is great for small business sites where the client needs to be able to update their website themselves__ without being bombarded with anything too complicated.

Unlike other content managers, Refinery is truly aimed at the end user making it easy for them to pick up and make changes themselves.

### For developers

* Allows you to get a small business site completed __ridiculously quickly__
* Easily __[Theme and customise](http://github.com/resolve/refinerycms/blob/master/vendor/plugins/themes/themes.md)__ the look to suit the business
* __[Extend with custom plugins](http://github.com/resolve/refinerycms/blob/master/vendor/plugins/refinery/plugins.md)__ to do anything Refinery doesn't do out of the box
* Sticks to __"the Rails way"__ as much as possible. We don't force you to learn new templating languages.
* Uses [jQuery](http://jquery.com/) for fast and concise JavaScript

## Requirements

Refinery's gem requirements are:

* [rails ~> 2.3.5](http://rubygems.org/gems/rails)

### Other dependancies

* [RMagick](http://github.com/rmagick/rmagick) - [Install docs](http://rmagick.rubyforge.org/install-faq.html) or for
Mac OS 10.5 or 10.6 users [this shell install script](http://github.com/maddox/magick-installer) will be easier.

## Installing and Setting Up Refinery

### 1. Get the Refinery code

#### Install the Gem

gem install refinerycms
refinery path/to/project

#### Or, clone Refinery's GIT repository

git clone git://github.com/resolve/refinerycms.git mynewsite.com
cd ./mynewsite.com
git remote rm origin
git remote add origin [email protected]:you/yournewsite.git
mv ./config/database.yml.example ./config/database.yml

### 2. Configuration

Firstly, edit ``config/database.yml`` to reflect your database server details.

Next create your database and fill it with Refinery's default data:

rake db:setup

After your database exists, you'll need to install the gems that Refinery depends on. You can do this by running:

rake gems:install

As of version 0.9.6.20, the news engine was extracted into a separate gem. This is included by default in config/application.rb
If you don't want this engine on your site, just remove the config.gem line for it in config/application.rb
If you do want it, please run the following commands to get it up and running:

script/generate news
rake db:migrate

Now, news should be up and running.

### 3. Starting up your site

ruby script/server

Now visit [http://localhost:3000](http://localhost:3000) and your Refinery site should be running.

You will be prompted to setup your first user.

## Help and Developer Documentation

* [Google Group Discussion](http://groups.google.com/group/refinery-cms)
* [Developer/API documentation](http://api.refinerycms.org)
* [Developer video - 26 mins](http://refinerycms.com/pages/for-developers)
* [IRC Channel](irc://irc.freenode.net/refinerycms)

## Setting Up on Heroku or Using S3 for Storage

If you're using [Heroku](http://heroku.com/) you will want to put

Refinery.s3_backend = true

in your ``config/production.rb`` file to make Refinery store files uploaded on Amazon S3.

## Updating to the latest Refinery

### When using the gem

Simply run the command:

refinery-update-core path/to/project/root/

and the up-to-date core files will be copied from the latest gem into your project.

### When using GIT

You can update by running these commands:

git remote add refinerycms git://github.com/resolve/refinerycms.git
git pull refinerycms master

This will pull in all of the updated files in the project and may result in some merge conflicts which you will need to resolve.

## What comes included with Refinery

### [Pages](http://github.com/resolve/refinerycms/blob/master/vendor/plugins/pages/pages.md)

* Easily edit and manage pages with a [WYSIWYG visual editor](http://www.wymeditor.org/)
* Manage you site's structure

### [Images](http://github.com/resolve/refinerycms/blob/master/vendor/plugins/images/images.md) & [Resources](http://github.com/resolve/refinerycms/blob/master/vendor/plugins/resources/resources.md)

* Easily upload and insert images
* Upload and link to resources such as PDF documents
* Uses the popular [attachment_fu](http://github.com/technoweenie/attachment_fu) Rails plugin

### [Inquiries](http://github.com/resolve/refinerycms/blob/master/vendor/plugins/inquiries/inquiries.md)

* Collect inquiries from a contact form
* Manage your inquiries and be notified when new ones come in

### [News](http://github.com/resolve/refinerycms-news)

* Post news about your company and update your visitors

### [Settings](http://github.com/resolve/refinerycms/blob/master/vendor/plugins/refinery_settings/settings.md)

* Manage the behaviour of Refinery
* Easily integrate with [Google Analytics](https://www.google.com/analytics/)

### [Dashboard](http://github.com/resolve/refinerycms/blob/master/vendor/plugins/dashboard/dashboard.md)

* Get an overview of what has been updated recently

### [Authentication & Users](http://github.com/resolve/refinerycms/blob/master/vendor/plugins/authentication/authentication.md)

* Manage who can access Refinery
* Control which plugins each user has access to
* Uses the popular [RESTful authentication](http://github.com/technoweenie/restful-authentication) Rails plugin

### [Themes](http://github.com/resolve/refinerycms/blob/master/vendor/plugins/themes/themes.md)

* Customise Refinery to look exactly how you want
* The Rails Way: use regular Rails erb views, no templating languages here!

### ...Want more? [Extend with Plugins](http://github.com/resolve/refinerycms/blob/master/vendor/plugins/refinery/plugins.md)

Extend Refinery easily by running the Refinery generator

ruby script/generate refinery

to get help on how to use that. Or read the full documentation on [writing plugins for Refinery](http://github.com/resolve/refinerycms/blob/master/vendor/plugins/refinery/plugins.md)

### Run the Tests

If you have installed Refinery using GIT (described above in step 1 of installing Refinery) then you'll be able to run the tests. At your Rails root run:

rake test

### What about a portfolio?

Check out the [portfolio plugin gem](http://github.com/resolve/refinerycms-portfolio)

## License

Refinery is released under the MIT license and is copyright (c) 2005-2009 [Resolve Digital Ltd.](http://www.resolvedigital.co.nz)

[Read the license](http://github.com/resolve/refinerycms/blob/master/license.md)
24 changes: 3 additions & 21 deletions todo.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
# Todo

What are some of the known things that need to be done?

## Tests

* Add unit test coverage for user, user plugin and user mailer
* Add unit test coverage for inquiry mailer and inquiry setting
* Add functional tests for the whole of Refinery.

# Rails 3.0 Support

We've started an effort to move to Rails 3.0 - that just needs to be completed.

# Improve the Generator

We need to have support for build in Refinery field types like "image". So I could run

./script/generate refinery staff name:string bio:text mugshot:image

And it will automatically create a form field that pops open the image picker on the staff form.

There is now a partial to easily call an image picker.
* deploy it online
* create site structure
* create layout

0 comments on commit ac9685b

Please sign in to comment.