refinerycms-portfolio 0.9.8.rc5 → 0.9.8.rc6

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,8 +3,12 @@ class PortfolioController < ApplicationController
3
3
  before_filter :load_page, :only => [:index, :show, :empty]
4
4
 
5
5
  def index
6
- if (first_entry = PortfolioEntry.where(:parent_id => nil).first).present?
7
- redirect_to portfolio_url(first_entry)
6
+ if RefinerySetting.find_or_set(:portfolio_has_no_index, true)
7
+ if (first_entry = PortfolioEntry.where(:parent_id => nil).first).present?
8
+ redirect_to portfolio_url(first_entry)
9
+ end
10
+ else
11
+ @portfolio_entries = PortfolioEntry.all
8
12
  end
9
13
  end
10
14
 
@@ -1,4 +1,5 @@
1
1
  class PortfolioEntry < ActiveRecord::Base
2
+ belongs_to :title_image, :class_name => 'Image'
2
3
 
3
4
  validates :title, :presence => true
4
5
 
@@ -13,6 +13,17 @@
13
13
  <%= f.required_label t('.title') %>
14
14
  <%= f.text_field :title, :class => "larger widest" %>
15
15
  </div>
16
+ <% unless RefinerySetting.find_or_set(:portfolio_has_no_index, true)%>
17
+ <div class='field'>
18
+ <%= f.label :image -%>
19
+ <%= render :partial => "/shared/admin/image_picker", :locals => {
20
+ :f => f,
21
+ :field => :title_image_id,
22
+ :image => @portfolio_entry.title_image,
23
+ :toggle_image_display => false
24
+ } %>
25
+ </div>
26
+ <% end %>
16
27
  <div class='field clearfix'>
17
28
  <div id='page-tabs' class='clearfix ui-tabs ui-widget ui-widget-content'>
18
29
  <ul id='page_parts'>
@@ -0,0 +1,14 @@
1
+ <% content_for :body_content_title do -%>
2
+ Portfolios
3
+ <% end -%>
4
+
5
+ <% content_for :body_content_left do -%>
6
+ <% @portfolio_entries.each do | portfolio | -%>
7
+ <span>
8
+ <%= link_to raw("#{image_fu portfolio.title_image, '200x200' unless portfolio.title_image.nil?} #{portfolio.title}"),
9
+ portfolio_path(portfolio) %>
10
+ </span>
11
+ <% end -%>
12
+ <% end -%>
13
+
14
+ <%= render :partial => '/shared/content_page' -%>
@@ -37,6 +37,6 @@
37
37
  <%= jquery_include_tags(:include_ui => false) %>
38
38
  <%= javascript_include_tag 'portfolio' %>
39
39
  <script type='text/javascript'>
40
- var portfolio_entry_url = "<%= portfolio_project_url(@master_entry, '') if ::Refinery::Portfolio.multi_level? %>";
40
+ var portfolio_entry_url = "<%= portfolio_project_url(@master_entry, @portfolio_entry) if ::Refinery::Portfolio.multi_level? %>";
41
41
  </script>
42
42
  <% end %>
@@ -1,6 +1,6 @@
1
1
  require 'rails/generators/migration'
2
2
 
3
- class PortfolioGenerator < Rails::Generators::NamedBase
3
+ class RefinerycmsPortfolioGenerator < Rails::Generators::NamedBase
4
4
 
5
5
  include Rails::Generators::Migration
6
6
 
@@ -17,6 +17,7 @@ class CreateStructureForPortfolio < ActiveRecord::Migration
17
17
  t.integer :lft
18
18
  t.integer :rgt
19
19
  t.integer :depth
20
+ t.integer :title_image_id
20
21
  t.timestamps
21
22
  end
22
23
 
@@ -1,7 +1,7 @@
1
1
  module Refinery
2
2
  module Portfolio
3
3
  def self.version
4
- %q{0.9.8.rc5}
4
+ %q{0.9.8.rc6}
5
5
  end
6
6
  end
7
7
  end
data/readme.md CHANGED
@@ -6,11 +6,11 @@ By: [Resolve Digital](http://www.resolvedigital.com)
6
6
 
7
7
  Open your ``Gemfile`` and add this line to the bottom:
8
8
 
9
- gem 'refinerycms-portfolio', '>= 0.9.8.rc1'
9
+ gem 'refinerycms-portfolio', '>= 0.9.8.rc5'
10
10
 
11
11
  Now run ``bundle install`` and once bundler has installed the gem run:
12
12
 
13
- rails generate portfolio
13
+ rails generate refinerycms_portfolio
14
14
  rake db:migrate
15
15
 
16
16
  Now, restart your web server and enjoy.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-portfolio
3
3
  version: !ruby/object:Gem::Version
4
- hash: 977940514
4
+ hash: 977940515
5
5
  prerelease: true
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
9
  - 8
10
- - rc5
11
- version: 0.9.8.rc5
10
+ - rc6
11
+ version: 0.9.8.rc6
12
12
  platform: ruby
13
13
  authors:
14
14
  - Resolve Digital
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-10-05 00:00:00 +13:00
19
+ date: 2010-10-20 00:00:00 +13:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -59,6 +59,7 @@ files:
59
59
  - app/views/admin/portfolio/new.html.erb
60
60
  - app/views/portfolio/_main_image.html.erb
61
61
  - app/views/portfolio/empty.html.erb
62
+ - app/views/portfolio/index.html.erb
62
63
  - app/views/portfolio/show.html.erb
63
64
  - config/locales/en.yml
64
65
  - config/locales/lv.yml
@@ -67,9 +68,9 @@ files:
67
68
  - config/locales/sl.yml
68
69
  - config/routes.rb
69
70
  - lib/gemspec.rb
70
- - lib/generators/portfolio/portfolio_generator.rb
71
- - lib/generators/portfolio/templates/db/migrate/migration_number_create_structure_for_portfolio.rb
72
- - lib/generators/portfolio/templates/db/seeds/portfolio.rb
71
+ - lib/generators/refinerycms_portfolio/refinerycms_portfolio_generator.rb
72
+ - lib/generators/refinerycms_portfolio/templates/db/migrate/migration_number_create_structure_for_portfolio.rb
73
+ - lib/generators/refinerycms_portfolio/templates/db/seeds/portfolio.rb
73
74
  - lib/portfolio/version.rb
74
75
  - lib/portfolio.rb
75
76
  - lib/refinerycms-portfolio.rb