Skip to content

Commit

Permalink
Updated gem so that it works properly with the plugin process and fix…
Browse files Browse the repository at this point in the history
…ed a couple of other little issues. Updated version to 0.9.1.5
  • Loading branch information
parndt committed Oct 8, 2009
1 parent 78774a6 commit 4d69fd3
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 11 deletions.
18 changes: 18 additions & 0 deletions README
Expand Up @@ -19,10 +19,28 @@ rake portfolio:install
Gem Installation
================

METHOD ONE
===========
Just install the gem 'portfolio' with the command:
gem install portfolio --source http://gemcutter.org

Then run:
portfolio-install /path/to/your/refinery/application

Then place in your config/environment.rb file after other all other Refinery gem calls:
config.gem "portfolio", :version => ">= 0.9.1.5", :lib => "portfolio", :source => "http://gemcutter.org"

..and follow the instructions!

METHOD TWO
===========
Place in your config/environment.rb file after other all other Refinery gem calls:
config.gem "portfolio", :version => ">= 0.9.1.5", :lib => "portfolio", :source => "http://gemcutter.org"

Then run in your application's directory:
rake gems:install

Then run:
portfolio-install /path/to/your/refinery/application

..and follow the instructions!
6 changes: 3 additions & 3 deletions app/controllers/portfolio_controller.rb
Expand Up @@ -3,15 +3,15 @@ class PortfolioController < ApplicationController
before_filter :load_page, :only => [:index, :show, :empty]

def index
redirect_to portfolio_url(PortfolioEntry.find(:first, :order => "position ASC", :conditions => "parent_id IS NULL")) rescue error_404
redirect_to portfolio_url(PortfolioEntry.find_by_parent_id(nil, :order => "position ASC")) rescue error_404
end

def show
begin
if params[:id]
@master_entry = PortfolioEntry.find(params[:id])
else
@master_entry = PortfolioEntry.find(:first, :order => "position ASC", :conditions => "parent_id IS NULL")
@master_entry = PortfolioEntry.find_by_parent_id(nil, :order => "position ASC")
end

if params[:portfolio_id]
Expand All @@ -37,7 +37,7 @@ def show
protected

def load_page
@page = Page.find_by_link_url('/portfolio', :include => [:parts, :slugs])
@page = Page.find_by_link_url('/portfolio', :include => [:parts])
end

end
3 changes: 2 additions & 1 deletion app/models/portfolio_entry.rb
Expand Up @@ -2,9 +2,10 @@ class PortfolioEntry < ActiveRecord::Base

validates_presence_of :title

# call to gems included in refinery.
has_friendly_id :title, :use_slug => true, :strip_diacritics => true

acts_as_tree :order => "position"

has_and_belongs_to_many :images

def content
Expand Down
3 changes: 1 addition & 2 deletions app/views/admin/portfolio_entries/_form.html.erb
@@ -1,4 +1,3 @@
<% insert_args = "?thickbox=true&modal=true&titlebar=true&field=portfolio_entry_image_id&callback=image_added&update_image=current_portfolio_entry_image&thumbnail=grid&KeepThis=true&TB_iframe=true&width=950&height=510" %>
<%= error_messages_for :portfolio_entry %>
<% form_for [:admin, @portfolio_entry] do |f| %>
<div class='field'>
Expand All @@ -8,7 +7,7 @@
<div class='field images_field'>
<span class='clearfix label_inline_with_link'>
<%= label_tag('portfolio_entry_image_ids', 'Images') %>
<%= link_to "#{refinery_icon_tag "add.png"} Add", "#{insert_admin_images_url}#{insert_args}", :class => "thickbox", :name => "Add Another Image", :id => "add_image_link" %>
<%= link_to "#{refinery_icon_tag "add.png"} Add", "#{insert_admin_images_url}?thickbox=true&modal=true&titlebar=true&field=portfolio_entry_image_id&callback=image_added&update_image=current_portfolio_entry_image&thumbnail=grid&KeepThis=true&TB_iframe=true&width=950&height=510", :class => "thickbox", :name => "Add Another Image", :id => "add_image_link" %>
</span>
<ul id='portfolio_images' class='clearfix portfolio_entry_images'>
<% @portfolio_entry.images.each do |image| %>
Expand Down
6 changes: 3 additions & 3 deletions portfolio.gemspec
@@ -1,10 +1,10 @@
Gem::Specification.new do |s|

s.name = %q{portfolio}
s.version = "0.9.1"
s.version = "0.9.1.5"

s.authors = ["Resolve Digital", "Philip Arndt"]
s.date = %q{2009-10-08}
s.date = %q{2009-10-09}

s.description = %q{A really straightforward open source Ruby on Rails portfolio plugin designed for integration with RefineryCMS.}
s.summary = %q{Ruby on Rails portfolio plugin for RefineryCMS.}
Expand All @@ -14,7 +14,7 @@ Gem::Specification.new do |s|

s.email = %q{info@refinerycms.com}
s.extra_rdoc_files = ["README", "CONTRIBUTORS", "LICENSE"]
s.files = ["CONTRIBUTORS","LICENSE","README","app","app/controllers","app/controllers/admin","app/controllers/admin/portfolio_entries_controller.rb","app/controllers/portfolio_controller.rb","app/models","app/models/portfolio_entry.rb","app/views","app/views/admin","app/views/admin/portfolio_entries","app/views/admin/portfolio_entries/_form.html.erb","app/views/admin/portfolio_entries/_list.html.erb","app/views/admin/portfolio_entries/_sortable_list.html.erb","app/views/admin/portfolio_entries/edit.html.erb","app/views/admin/portfolio_entries/index.html.erb","app/views/admin/portfolio_entries/new.html.erb","app/views/portfolio","app/views/portfolio/empty.html.erb","app/views/portfolio/show.html.erb","bin","bin/portfolio-install","config","config/routes.rb","db","db/migrate","db/migrate/20090917224823_create_portfolio_structure.rb","init.rb","lib","lib/portfolio.rb","lib/tasks","lib/tasks/portfolio.rake","public","public/javascripts","public/javascripts/portfolio.js","public/stylesheets","public/stylesheets/portfolio.css"]
s.files = ["CONTRIBUTORS","LICENSE","README","app","app/controllers","app/controllers/admin","app/controllers/admin/portfolio_entries_controller.rb","app/controllers/portfolio_controller.rb","app/models","app/models/portfolio_entry.rb","app/views","app/views/admin","app/views/admin/portfolio_entries","app/views/admin/portfolio_entries/_form.html.erb","app/views/admin/portfolio_entries/_list.html.erb","app/views/admin/portfolio_entries/_sortable_list.html.erb","app/views/admin/portfolio_entries/edit.html.erb","app/views/admin/portfolio_entries/index.html.erb","app/views/admin/portfolio_entries/new.html.erb","app/views/portfolio","app/views/portfolio/empty.html.erb","app/views/portfolio/show.html.erb","bin","bin/portfolio-install","config","config/routes.rb","db","db/migrate","db/migrate/20090917224823_create_portfolio_structure.rb","lib","lib/portfolio.rb","lib/tasks","lib/tasks/portfolio.rake","public","public/javascripts","public/javascripts/portfolio.js","public/stylesheets","public/stylesheets/portfolio.css","rails","rails/init.rb"]
s.homepage = %q{http://refinerycms.com}
s.rubygems_version = %q{1.3.4}

Expand Down
2 changes: 1 addition & 1 deletion public/javascripts/portfolio.js
Expand Up @@ -42,7 +42,7 @@ image_added = function() {
});

new_list_item = new Element("li").addClassName("empty");
img = new Element("img", {id: 'current_portfolio_entry_image', src: '', alt: ''});
img = new Element("img", {id: 'current_portfolio_entry_image', src: '', alt: '', style: 'display:none'});

hidden_id = new Element("input", {'type': 'hidden', 'id' : "portfolio_entry_image_id", 'name':'portfolio_entry[image_ids][]'});

Expand Down
3 changes: 2 additions & 1 deletion init.rb → rails/init.rb
Expand Up @@ -2,7 +2,8 @@
plugin.directory = directory
plugin.title = "Portfolio"
plugin.description = "Manage a portfolio"
plugin.version = 1.0
plugin.url = "/admin/#{plugin.title.downcase}"
plugin.version = '0.9.1.5'
plugin.menu_match = /admin\/((portfolio)|(portfolio_entries))/
plugin.activity = {
:class => PortfolioEntry,
Expand Down

0 comments on commit 4d69fd3

Please sign in to comment.