Module: Kublog::PostsHelper
- Defined in:
- app/helpers/kublog/posts_helper.rb
Constant Summary collapse
- VERSIONS =
[['',''], ['original', 'Insert Original'], ['small', 'Insert Small (140x140)'], ['thumb', 'Insert Thumbnail (54x54)']]
Instance Method Summary collapse
- #admin_comment?(comment) ⇒ Boolean
- #atom_url(presenter) ⇒ Object
- #category_options(post) ⇒ Object
- #display?(should) ⇒ Boolean
- #missing_image_url ⇒ Object
- #size_options ⇒ Object
- #user_kinds ⇒ Object
Instance Method Details
#admin_comment?(comment) ⇒ Boolean
33 34 35 |
# File 'app/helpers/kublog/posts_helper.rb', line 33 def admin_comment?(comment) comment.admin? ? 'admin' : '' end |
#atom_url(presenter) ⇒ Object
37 38 39 |
# File 'app/helpers/kublog/posts_helper.rb', line 37 def atom_url(presenter) presenter.category.nil? ? posts_url(:format => :atom) : category_url(presenter.category, :format => :atom) end |
#category_options(post) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'app/helpers/kublog/posts_helper.rb', line 12 def (post) categories = Kublog::Category.all = (categories, :id, :name, post.category.try(:id)) = "<option value='' class='blank'></option>" += += "<option value='create_new_category'>New category...</option>" end |
#display?(should) ⇒ Boolean
29 30 31 |
# File 'app/helpers/kublog/posts_helper.rb', line 29 def display?(should) should ? 'display:block' : 'display:none' end |
#missing_image_url ⇒ Object
25 26 27 |
# File 'app/helpers/kublog/posts_helper.rb', line 25 def missing_image_url Kublog::FileUploader.new.default_url end |
#size_options ⇒ Object
8 9 10 |
# File 'app/helpers/kublog/posts_helper.rb', line 8 def @size_options ||= (VERSIONS, :first, :second) end |
#user_kinds ⇒ Object
21 22 23 |
# File 'app/helpers/kublog/posts_helper.rb', line 21 def user_kinds Kublog.user_kinds end |