Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updated gem so that it works properly with the plugin process and fix…

…ed a couple of other little issues. Updated version to 0.9.1.5
  • Loading branch information...
commit 4d69fd3b6b122adcb912397c3a205d41ad96b221 1 parent 78774a6
Philip Arndt authored October 09, 2009
18  README
@@ -19,10 +19,28 @@ rake portfolio:install
19 19
 Gem Installation
20 20
 ================
21 21
 
  22
+METHOD ONE
  23
+===========
22 24
 Just install the gem 'portfolio' with the command:
23 25
 gem install portfolio --source http://gemcutter.org
24 26
 
25 27
 Then run:
26 28
 portfolio-install /path/to/your/refinery/application
27 29
 
  30
+Then place in your config/environment.rb file after other all other Refinery gem calls:
  31
+config.gem "portfolio", :version => ">= 0.9.1.5", :lib => "portfolio", :source => "http://gemcutter.org"
  32
+
  33
+..and follow the instructions!
  34
+
  35
+METHOD TWO
  36
+===========
  37
+Place in your config/environment.rb file after other all other Refinery gem calls:
  38
+config.gem "portfolio", :version => ">= 0.9.1.5", :lib => "portfolio", :source => "http://gemcutter.org"
  39
+
  40
+Then run in your application's directory:
  41
+rake gems:install
  42
+
  43
+Then run:
  44
+portfolio-install /path/to/your/refinery/application
  45
+
28 46
 ..and follow the instructions!
6  app/controllers/portfolio_controller.rb
@@ -3,7 +3,7 @@ class PortfolioController < ApplicationController
3 3
   before_filter :load_page, :only => [:index, :show, :empty]
4 4
   
5 5
   def index
6  
-    redirect_to portfolio_url(PortfolioEntry.find(:first, :order => "position ASC", :conditions => "parent_id IS NULL")) rescue error_404
  6
+    redirect_to portfolio_url(PortfolioEntry.find_by_parent_id(nil, :order => "position ASC")) rescue error_404
7 7
   end
8 8
  
9 9
   def show
@@ -11,7 +11,7 @@ def show
11 11
 			if params[:id]
12 12
 	    	@master_entry = PortfolioEntry.find(params[:id])
13 13
 			else
14  
-				@master_entry = PortfolioEntry.find(:first, :order => "position ASC", :conditions => "parent_id IS NULL")
  14
+				@master_entry = PortfolioEntry.find_by_parent_id(nil, :order => "position ASC")
15 15
 			end
16 16
 		
17 17
 			if params[:portfolio_id]
@@ -37,7 +37,7 @@ def show
37 37
 protected
38 38
 
39 39
   def load_page
40  
-    @page = Page.find_by_link_url('/portfolio', :include => [:parts, :slugs]) 
  40
+    @page = Page.find_by_link_url('/portfolio', :include => [:parts]) 
41 41
   end
42 42
  
43 43
 end
3  app/models/portfolio_entry.rb
@@ -2,9 +2,10 @@ class PortfolioEntry < ActiveRecord::Base
2 2
   
3 3
   validates_presence_of :title
4 4
   
  5
+  # call to gems included in refinery.
5 6
   has_friendly_id :title, :use_slug => true, :strip_diacritics => true
6  
-  
7 7
   acts_as_tree :order => "position"
  8
+  
8 9
   has_and_belongs_to_many :images
9 10
 
10 11
   def content
3  app/views/admin/portfolio_entries/_form.html.erb
... ...
@@ -1,4 +1,3 @@
1  
-<% 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" %>
2 1
 <%= error_messages_for :portfolio_entry %>
3 2
 <% form_for [:admin, @portfolio_entry] do |f| %>
4 3
   <div class='field'>
@@ -8,7 +7,7 @@
8 7
   <div class='field images_field'>
9 8
 		<span class='clearfix label_inline_with_link'>
10 9
 	    <%= label_tag('portfolio_entry_image_ids', 'Images') %>
11  
-			<%= link_to "#{refinery_icon_tag "add.png"} Add", "#{insert_admin_images_url}#{insert_args}", :class => "thickbox", :name => "Add Another Image", :id => "add_image_link" %>
  10
+			<%= 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" %>
12 11
 		</span>
13 12
 		<ul id='portfolio_images' class='clearfix portfolio_entry_images'>
14 13
 			<% @portfolio_entry.images.each do |image| %>
6  portfolio.gemspec
... ...
@@ -1,10 +1,10 @@
1 1
 Gem::Specification.new do |s|
2 2
 	
3 3
   s.name = %q{portfolio}
4  
-  s.version = "0.9.1"
  4
+  s.version = "0.9.1.5"
5 5
 
6 6
   s.authors = ["Resolve Digital", "Philip Arndt"]
7  
-  s.date = %q{2009-10-08}
  7
+  s.date = %q{2009-10-09}
8 8
 
9 9
   s.description = %q{A really straightforward open source Ruby on Rails portfolio plugin designed for integration with RefineryCMS.}
10 10
   s.summary = %q{Ruby on Rails portfolio plugin for RefineryCMS.}
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14 14
 
15 15
   s.email = %q{info@refinerycms.com}
16 16
   s.extra_rdoc_files = ["README", "CONTRIBUTORS", "LICENSE"]
17  
-	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"]
  17
+	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"]
18 18
 	s.homepage = %q{http://refinerycms.com}
19 19
 	s.rubygems_version = %q{1.3.4}
20 20
 	
2  public/javascripts/portfolio.js
@@ -42,7 +42,7 @@ image_added = function() {
42 42
 	});
43 43
 	
44 44
 	new_list_item = new Element("li").addClassName("empty");
45  
-	img = new Element("img", {id: 'current_portfolio_entry_image', src: '', alt: ''});
  45
+	img = new Element("img", {id: 'current_portfolio_entry_image', src: '', alt: '', style: 'display:none'});
46 46
 	
47 47
 	hidden_id = new Element("input", {'type': 'hidden', 'id' : "portfolio_entry_image_id", 'name':'portfolio_entry[image_ids][]'});
48 48
 	
3  init.rb → rails/init.rb
@@ -2,7 +2,8 @@
2 2
 	plugin.directory = directory
3 3
 	plugin.title = "Portfolio"
4 4
 	plugin.description = "Manage a portfolio"
5  
-	plugin.version = 1.0
  5
+	plugin.url = "/admin/#{plugin.title.downcase}"
  6
+	plugin.version = '0.9.1.5'
6 7
 	plugin.menu_match = /admin\/((portfolio)|(portfolio_entries))/
7 8
 	plugin.activity = {
8 9
 		:class => PortfolioEntry,

0 notes on commit 4d69fd3

Please sign in to comment.
Something went wrong with that request. Please try again.