publinator 0.0.26 → 0.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ require_dependency "publinator/application_controller"
2
+
3
+
4
+ class StandardController < Publinator::ApplicationController
5
+
6
+ layout :current_layout
7
+ before_filter :in_a_site
8
+
9
+ def search
10
+ render :text => "Searching now..."
11
+ end
12
+
13
+ end
14
+
15
+
@@ -77,6 +77,8 @@ module Publinator
77
77
  end
78
78
  div_content.html_safe
79
79
  end
80
+ rescue => e
81
+ logger.info e
80
82
  end
81
83
 
82
84
  def publishable_asset(pub, asset_type)
@@ -94,5 +96,10 @@ module Publinator
94
96
  image_tag(imgs.first.asset.url(size.to_sym))
95
97
  end
96
98
  end
99
+
100
+ def clean_result_text(txt)
101
+ stp_txt = truncate(strip_tags(m(txt)), :length => 200)
102
+ stp_txt.gsub("&#39;", "'").gsub("&amp;", "&").gsub("&reg;", "").gsub("&trade;", "") unless stp_txt.nil?
103
+ end
97
104
  end
98
105
  end
@@ -13,5 +13,14 @@ module Publinator
13
13
  title
14
14
  end
15
15
 
16
+ if ThinkingSphinx
17
+ define_index do
18
+ indexes title
19
+ indexes body
20
+ indexes subtitle
21
+ has created_at, updated_at
22
+ end
23
+ end
24
+
16
25
  end
17
26
  end
@@ -21,6 +21,18 @@ module Publinator
21
21
  Site.find(self.parent_id)
22
22
  end
23
23
 
24
+ def default_url
25
+ dn = domain_names.where(:default => true).first
26
+ url = "http://"
27
+ url += "#{dn.subdomain}." unless dn.subdomain.blank?
28
+ url += "#{dn.name}"
29
+ url
30
+ end
31
+
32
+ def url(path)
33
+ "#{default_url}#{path}"
34
+ end
35
+
24
36
  def publications(scope = 'published', sort = 'updated_at desc', publishable_type)
25
37
  if publishable_type.nil?
26
38
  pubs = Publication.for_site(self.id).send(scope).order(sort)
@@ -1,3 +1,3 @@
1
1
  module Publinator
2
- VERSION = "0.0.26"
2
+ VERSION = "0.0.27"
3
3
  end
data/lib/publinator.rb CHANGED
@@ -72,6 +72,10 @@ module Publinator
72
72
  end
73
73
  end
74
74
 
75
+ def url
76
+ site.url(path)
77
+ end
78
+
75
79
  def menu_collection
76
80
  nil
77
81
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: publinator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.26
4
+ version: 0.0.27
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -294,6 +294,7 @@ files:
294
294
  - app/controllers/publinator/manage_controller.rb
295
295
  - app/controllers/publinator/publishable_controller.rb
296
296
  - app/controllers/publinator/section_controller.rb
297
+ - app/controllers/standard_controller.rb
297
298
  - app/helpers/publinator/application_helper.rb
298
299
  - app/helpers/publinator/home_helper.rb
299
300
  - app/helpers/publinator/manage/publishable_types_helper.rb
@@ -388,7 +389,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
388
389
  version: '0'
389
390
  segments:
390
391
  - 0
391
- hash: -2320802535541339817
392
+ hash: -915766590298524915
392
393
  required_rubygems_version: !ruby/object:Gem::Requirement
393
394
  none: false
394
395
  requirements:
@@ -397,7 +398,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
397
398
  version: '0'
398
399
  segments:
399
400
  - 0
400
- hash: -2320802535541339817
401
+ hash: -915766590298524915
401
402
  requirements: []
402
403
  rubyforge_project:
403
404
  rubygems_version: 1.8.24