postablr 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.md +22 -0
- data/Rakefile +40 -0
- data/app/assets/javascripts/postablr/application.js +15 -0
- data/app/assets/javascripts/postablr/blog.js +2 -0
- data/app/assets/javascripts/postablr/entries.js +2 -0
- data/app/assets/stylesheets/postablr/application.css +13 -0
- data/app/assets/stylesheets/postablr/blog.css +4 -0
- data/app/assets/stylesheets/postablr/entries.css +4 -0
- data/app/controllers/postablr/application_controller.rb +4 -0
- data/app/controllers/postablr/blog_controller.rb +21 -0
- data/app/controllers/postablr/entries_controller.rb +43 -0
- data/app/helpers/postablr/application_helper.rb +4 -0
- data/app/helpers/postablr/blog_helper.rb +27 -0
- data/app/helpers/postablr/entries_helper.rb +4 -0
- data/app/helpers/postablr/truncate_html_helper.rb +52 -0
- data/app/models/postablr/ar_publish.rb +172 -0
- data/app/models/postablr/entry.rb +37 -0
- data/app/models/postablr/entry/audio.rb +23 -0
- data/app/models/postablr/entry/image.rb +17 -0
- data/app/models/postablr/entry/link.rb +8 -0
- data/app/models/postablr/entry/post.rb +8 -0
- data/app/models/postablr/entry/quote.rb +7 -0
- data/app/models/postablr/entry/video.rb +29 -0
- data/app/uploaders/entry_audio_uploader.rb +55 -0
- data/app/uploaders/entry_photo_uploader.rb +42 -0
- data/app/views/layouts/postablr/application.html.erb +14 -0
- data/app/views/postablr/blog/_entry_display.haml +3 -0
- data/app/views/postablr/blog/comments/_comment.haml +10 -0
- data/app/views/postablr/blog/comments/_form.haml +6 -0
- data/app/views/postablr/blog/comments/create.js.haml +5 -0
- data/app/views/postablr/blog/comments/new.html.haml +0 -0
- data/app/views/postablr/blog/comments/new.js.haml +2 -0
- data/app/views/postablr/blog/entries/show.haml +39 -0
- data/app/views/postablr/blog/show.html.haml +46 -0
- data/app/views/postablr/blog/show/_aside.haml +19 -0
- data/app/views/postablr/blog/show/_audio.haml +13 -0
- data/app/views/postablr/blog/show/_image.haml +13 -0
- data/app/views/postablr/blog/show/_link.haml +11 -0
- data/app/views/postablr/blog/show/_post.haml +14 -0
- data/app/views/postablr/blog/show/_quote.haml +12 -0
- data/app/views/postablr/blog/show/_video.haml +16 -0
- data/app/views/postablr/entries/_entries_menu.haml +14 -0
- data/app/views/postablr/entries/_entry.haml +4 -0
- data/app/views/postablr/entries/_form.haml +58 -0
- data/app/views/postablr/entries/edit.haml +1 -0
- data/app/views/postablr/entries/fields/_audio.haml +4 -0
- data/app/views/postablr/entries/fields/_image.haml +2 -0
- data/app/views/postablr/entries/fields/_link.haml +3 -0
- data/app/views/postablr/entries/fields/_post.haml +3 -0
- data/app/views/postablr/entries/fields/_quote.haml +3 -0
- data/app/views/postablr/entries/fields/_video.haml +2 -0
- data/app/views/postablr/entries/index.html.haml +11 -0
- data/app/views/postablr/entries/index.js.haml +2 -0
- data/app/views/postablr/entries/list/_audio.haml +14 -0
- data/app/views/postablr/entries/list/_image.haml +12 -0
- data/app/views/postablr/entries/list/_link.haml +11 -0
- data/app/views/postablr/entries/list/_post.haml +14 -0
- data/app/views/postablr/entries/list/_quote.haml +11 -0
- data/app/views/postablr/entries/list/_video.haml +17 -0
- data/app/views/postablr/entries/new.html.haml +2 -0
- data/app/views/postablr/entries/show.html.haml +5 -0
- data/config/routes.rb +20 -0
- data/db/migrate/20121222195404_create_postablr_entries.rb +18 -0
- data/db/migrate/20121222195417_create_postablr_entry_videos.rb +16 -0
- data/db/migrate/20121222200141_create_postablr_entry_quotes.rb +10 -0
- data/db/migrate/20121222200237_create_postablr_entry_posts.rb +10 -0
- data/db/migrate/20121222200303_create_postablr_entry_links.rb +10 -0
- data/db/migrate/20121222200402_create_postablr_entry_images.rb +12 -0
- data/db/migrate/20121222200810_create_postablr_entry_audios.rb +12 -0
- data/lib/postablr.rb +4 -0
- data/lib/postablr/engine.rb +11 -0
- data/lib/postablr/version.rb +3 -0
- data/lib/tasks/postablr_tasks.rake +4 -0
- data/test/factories/postablr_entries.rb +16 -0
- data/test/factories/postablr_entry_audios.rb +9 -0
- data/test/factories/postablr_entry_images.rb +10 -0
- data/test/factories/postablr_entry_links.rb +8 -0
- data/test/factories/postablr_entry_posts.rb +9 -0
- data/test/factories/postablr_entry_quotes.rb +8 -0
- data/test/factories/postablr_entry_videos.rb +14 -0
- metadata +358 -0
@@ -0,0 +1,12 @@
|
|
1
|
+
%li.article.quote
|
2
|
+
%blockquote.article_quote
|
3
|
+
= raw sanitize_relaxed( postable.body)
|
4
|
+
.article_meta
|
5
|
+
%h3
|
6
|
+
%a{:href => "#"}= raw postable.source
|
7
|
+
%span.meta.author
|
8
|
+
Por
|
9
|
+
= postable.entry.user.name
|
10
|
+
|
11
|
+
|
12
|
+
= render :partial=>'postablr/blog/show/aside', :locals=>{:postable=>postable}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
.article.video
|
2
|
+
|
3
|
+
.article_meta
|
4
|
+
%span.meta.kind Video
|
5
|
+
%h3
|
6
|
+
= postable.title
|
7
|
+
|
8
|
+
.article_video
|
9
|
+
= raw postable.embed_html
|
10
|
+
|
11
|
+
%p= raw sanitize_relaxed( postable.body )
|
12
|
+
|
13
|
+
%span.meta.author
|
14
|
+
= postable.entry.user.name
|
15
|
+
|
16
|
+
= render :partial=>'postablr/blog/show/aside', :locals=>{:postable=>postable}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
|
2
|
+
%ul
|
3
|
+
%li
|
4
|
+
= link_to "Publish Text", new_entries_for_path("post")
|
5
|
+
%li
|
6
|
+
= link_to "Publish Quote", new_entries_for_path("quote")
|
7
|
+
%li
|
8
|
+
= link_to "Publish Image", new_entries_for_path("image")
|
9
|
+
%li
|
10
|
+
= link_to "Publish Audio", new_entries_for_path("audio")
|
11
|
+
%li
|
12
|
+
= link_to "Publish Video", new_entries_for_path("video")
|
13
|
+
%li
|
14
|
+
= link_to "Publish Link", new_entries_for_path("link")
|
@@ -0,0 +1,58 @@
|
|
1
|
+
|
2
|
+
- path = @entry.new_record? ? new_fast_upload_path : edit_fast_upload_path
|
3
|
+
|
4
|
+
- tag_list = ActsAsTaggableOn::Tag.all.map(&:name)
|
5
|
+
%iframe{:id=>"upload_frame", :name=>"upload_frame", :style=>"display: none"}
|
6
|
+
|
7
|
+
= semantic_form_for @entry , :url=> path, :html=>{:multipart=>true, :path=>new_fast_upload_path} do |f|
|
8
|
+
.col_system.col.fluid
|
9
|
+
.col.medium.publisher
|
10
|
+
|
11
|
+
- unless @entry.new_record?
|
12
|
+
%input{:name=>:post_id, :type=>:hidden, :value=>@entry.id}
|
13
|
+
- else
|
14
|
+
%input{:name=>:type, :type=>:hidden, :value=>params[:type]}
|
15
|
+
|
16
|
+
= f.inputs do
|
17
|
+
= f.semantic_fields_for :postable do |postable|
|
18
|
+
|
19
|
+
%h3 Publicar → #{postable.object.class.to_s.underscore.split('/')[1]}
|
20
|
+
= render "postablr/entries/fields/#{@entry.postable_name}", :f => postable
|
21
|
+
|
22
|
+
%li#facebook-list.input-text
|
23
|
+
%input#tag_list_input{:type => "text", :value => "", :placeholder => "Etiquetas"}/
|
24
|
+
%ul#preadded{:style => "display:none"}
|
25
|
+
- @entry.tags.each do |tag|
|
26
|
+
%li{:rel=> "#{tag.id}"}= tag.name
|
27
|
+
|
28
|
+
#autosuggest
|
29
|
+
.default Escribe las etiquetas
|
30
|
+
%ul#feed
|
31
|
+
|
32
|
+
= f.actions do
|
33
|
+
= f.action :submit, :button_html => { :disable_with => 'Wait...' }
|
34
|
+
.uploader_div
|
35
|
+
#uploading{ :style => "display:none" }
|
36
|
+
#progress.bar
|
37
|
+
#progressbar
|
38
|
+
#statusBar
|
39
|
+
.plane
|
40
|
+
#load_photos{ :style => "display:none" }
|
41
|
+
|
42
|
+
.col.small.publisher_options
|
43
|
+
= f.inputs do
|
44
|
+
.form_block.options
|
45
|
+
%h4
|
46
|
+
%span.icons.mini.circle.magenta ⚙
|
47
|
+
Opciones
|
48
|
+
= f.input :comments_enabled
|
49
|
+
-#= f.input :highlight
|
50
|
+
|
51
|
+
-#= f.input :slug
|
52
|
+
-#= f.input :content_source
|
53
|
+
-#= f.input :is_published
|
54
|
+
-#= f.input :publish_at
|
55
|
+
-#= f.input :unpublish_at
|
56
|
+
|
57
|
+
-#= f.input :tag_list #, :as=>:hidden
|
58
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
= render "form"
|
@@ -0,0 +1,14 @@
|
|
1
|
+
%li.article.video{:id=>"entry-#{postable.entry.id}"}
|
2
|
+
%span.editor
|
3
|
+
|
4
|
+
.article_meta
|
5
|
+
%span.meta.kind Audio
|
6
|
+
%span.meta.author
|
7
|
+
Por
|
8
|
+
= postable.entry.user.name
|
9
|
+
|
10
|
+
%ul.playlist
|
11
|
+
%li
|
12
|
+
%a{ :href=>"#{postable.file.url}"}= postable.audio_title
|
13
|
+
.article_text
|
14
|
+
%p= raw sanitize_clean(postable.body , 200 , " #{link_to t('read_more'), blog_entry_path( postable.entry ) } ..." )
|
@@ -0,0 +1,12 @@
|
|
1
|
+
%li.article.photo{:id=>"entry-#{postable.entry.id}" }
|
2
|
+
%span.editor
|
3
|
+
|
4
|
+
= link_to image_tag(postable.photo.url(:thumb_large)), entry_path(postable.entry)
|
5
|
+
.article_meta
|
6
|
+
%span.meta.kind Image
|
7
|
+
%span.meta.author
|
8
|
+
Por
|
9
|
+
= postable.entry.user.name
|
10
|
+
|
11
|
+
.article_text
|
12
|
+
%p= raw sanitize_clean(postable.body , 200 , " #{link_to t('read_more'), ''}" )
|
@@ -0,0 +1,14 @@
|
|
1
|
+
%li.article.text{:id=>"entry-#{postable.entry.id}"}
|
2
|
+
%span.editor
|
3
|
+
|
4
|
+
.article_meta
|
5
|
+
%span.meta.kind Post
|
6
|
+
%h3
|
7
|
+
%a{:href => blog_entry_path(postable.entry)}= postable.title
|
8
|
+
%span.meta.author
|
9
|
+
Por
|
10
|
+
= postable.entry.user.name
|
11
|
+
|
12
|
+
|
13
|
+
.article_text
|
14
|
+
%p= raw sanitize_clean(postable.body , 200 , " #{link_to t('read_more'), blog_entry_path( postable.entry ) } ..." )
|
@@ -0,0 +1,11 @@
|
|
1
|
+
%li.article.quote{:id=>"entry-#{postable.entry.id}"}
|
2
|
+
%span.editor
|
3
|
+
|
4
|
+
%blockquote.article_quote
|
5
|
+
= raw postable.body
|
6
|
+
.article_meta
|
7
|
+
%h3
|
8
|
+
=link_to raw( postable.source), entry_path(postable.entry)
|
9
|
+
%span.meta.author
|
10
|
+
Por
|
11
|
+
= postable.entry.user.name
|
@@ -0,0 +1,17 @@
|
|
1
|
+
%li.article.video{:id=>"entry-#{postable.entry.id}"}
|
2
|
+
%span.editor
|
3
|
+
|
4
|
+
.article_video
|
5
|
+
= raw postable.embed_html
|
6
|
+
|
7
|
+
.article_meta
|
8
|
+
%span.meta.kind Video
|
9
|
+
%h3
|
10
|
+
= postable.title
|
11
|
+
%span.meta.author
|
12
|
+
Por
|
13
|
+
= postable.entry.user.name
|
14
|
+
|
15
|
+
.article_text
|
16
|
+
%p
|
17
|
+
-#= raw sanitize_clean(postable.body , 200 , " #{link_to t('read_more'), blog_entry_path( postable.entry ) } ..." )
|
data/config/routes.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Postablr::Engine.routes.draw do
|
2
|
+
|
3
|
+
resources :entries
|
4
|
+
|
5
|
+
match 'entries/new/:type' => 'entries#new', :as=>:new_entries_for, :via => [:get]
|
6
|
+
match 'entries/new/:type' => 'entries#create', :as=>:new_entries_for, :via => [:post]
|
7
|
+
match 'entries/:type/:id/edit' => 'entries#edit', :as=>:edit_entry_for, :via => [:get]
|
8
|
+
match 'entries/fast_upload' => 'entries#create', :as => :new_fast_upload, :via=>[:post]
|
9
|
+
match 'entries/fast_upload' => 'entries#update', :as => :edit_fast_upload, :via=>[:put]
|
10
|
+
match 'blog/:filter' => 'blog#filter', :as=>:filter_blog, :via => [:get]
|
11
|
+
|
12
|
+
resource :blog, :controller=>"blog" do
|
13
|
+
#resources :entries, :controller=> "blog/entries" do
|
14
|
+
#resources :comments, :controller => "blog/comments"
|
15
|
+
#end
|
16
|
+
#resources :tags, :controller=>"blog/tags"
|
17
|
+
#resources :authors
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreatePostablrEntries < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :postablr_entries do |t|
|
4
|
+
t.integer :user_id
|
5
|
+
t.integer :postable_id
|
6
|
+
t.string :postable_type
|
7
|
+
t.boolean :comments_enabled
|
8
|
+
t.boolean :highlight
|
9
|
+
t.string :slug
|
10
|
+
t.string :content_source
|
11
|
+
t.boolean :is_published
|
12
|
+
t.datetime :publish_at
|
13
|
+
t.datetime :unpublish_at
|
14
|
+
|
15
|
+
t.timestamps
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreatePostablrEntryVideos < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :postablr_entry_videos do |t|
|
4
|
+
t.string :title
|
5
|
+
t.string :thumbnail
|
6
|
+
t.string :embed_url
|
7
|
+
t.text :embed_html
|
8
|
+
t.string :flv
|
9
|
+
t.string :download_url
|
10
|
+
t.string :service
|
11
|
+
t.integer :duration
|
12
|
+
t.text :caption
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/postablr.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# Read about factories at https://github.com/thoughtbot/factory_girl
|
2
|
+
|
3
|
+
FactoryGirl.define do
|
4
|
+
factory :postablr_entry, :class => 'Entry' do
|
5
|
+
user_id 1
|
6
|
+
postable_id 1
|
7
|
+
postable_type "MyString"
|
8
|
+
comments_enabled false
|
9
|
+
highlight false
|
10
|
+
slug "MyString"
|
11
|
+
content_source "MyString"
|
12
|
+
is_published false
|
13
|
+
publish_at "2012-12-22 16:54:05"
|
14
|
+
unpublish_at "2012-12-22 16:54:05"
|
15
|
+
end
|
16
|
+
end
|