refinerycms-libris 1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/refinery/libri/admin/libris_controller.rb +14 -0
- data/app/controllers/refinery/libri/libris_controller.rb +34 -0
- data/app/models/refinery/libri/libri.rb +17 -0
- data/app/views/refinery/libri/admin/libris/_actions.html.erb +25 -0
- data/app/views/refinery/libri/admin/libris/_form.html.erb +87 -0
- data/app/views/refinery/libri/admin/libris/_libri.html.erb +20 -0
- data/app/views/refinery/libri/admin/libris/_libris.html.erb +2 -0
- data/app/views/refinery/libri/admin/libris/_records.html.erb +18 -0
- data/app/views/refinery/libri/admin/libris/_sortable_list.html.erb +5 -0
- data/app/views/refinery/libri/admin/libris/edit.html.erb +1 -0
- data/app/views/refinery/libri/admin/libris/index.html.erb +7 -0
- data/app/views/refinery/libri/admin/libris/new.html.erb +1 -0
- data/app/views/refinery/libri/libris/index.html.erb +11 -0
- data/app/views/refinery/libri/libris/show.html.erb +79 -0
- data/config/locales/en.yml +35 -0
- data/config/locales/es.yml +36 -0
- data/config/locales/fr.yml +35 -0
- data/config/locales/nb.yml +35 -0
- data/config/locales/nl.yml +35 -0
- data/config/locales/sk.yml +35 -0
- data/config/routes.rb +19 -0
- data/db/migrate/1_create_libri_libris.rb +34 -0
- data/db/seeds.rb +25 -0
- data/lib/generators/refinery/libris_generator.rb +19 -0
- data/lib/refinery/libris/engine.rb +26 -0
- data/lib/refinery/libris.rb +21 -0
- data/lib/refinerycms-libris.rb +1 -0
- data/lib/tasks/refinery/libris.rake +13 -0
- data/readme.md +10 -0
- metadata +106 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
module Refinery
|
2
|
+
module Libri
|
3
|
+
module Admin
|
4
|
+
class LibrisController < ::Refinery::AdminController
|
5
|
+
|
6
|
+
# Sort the Libri by number
|
7
|
+
crudify :'refinery/libri/libri', :xhr_paging => true,
|
8
|
+
:order => "number ASC",
|
9
|
+
:sortable => false
|
10
|
+
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Refinery
|
2
|
+
module Libri
|
3
|
+
class LibrisController < ::ApplicationController
|
4
|
+
|
5
|
+
before_filter :find_all_libris
|
6
|
+
before_filter :find_page
|
7
|
+
|
8
|
+
def index
|
9
|
+
# you can use meta fields from your model instead (e.g. browser_title)
|
10
|
+
# by swapping @page for @libri in the line below:
|
11
|
+
present(@page)
|
12
|
+
end
|
13
|
+
|
14
|
+
def show
|
15
|
+
@libri = Libri.find(params[:id])
|
16
|
+
|
17
|
+
# you can use meta fields from your model instead (e.g. browser_title)
|
18
|
+
# by swapping @page for @libri in the line below:
|
19
|
+
present(@page)
|
20
|
+
end
|
21
|
+
|
22
|
+
protected
|
23
|
+
|
24
|
+
def find_all_libris
|
25
|
+
@libris = Libri.order('number ASC')
|
26
|
+
end
|
27
|
+
|
28
|
+
def find_page
|
29
|
+
@page = ::Refinery::Page.where(:link_url => "/libris").first
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Refinery
|
2
|
+
module Libri
|
3
|
+
class Libri < Refinery::Core::BaseModel
|
4
|
+
self.table_name = 'refinery_libris'
|
5
|
+
|
6
|
+
attr_accessible :title, :liber, :number, :classification, :blurb, :published, :reception, :cover_id, :document_id, :position
|
7
|
+
|
8
|
+
acts_as_indexed :fields => [:title, :liber, :classification, :blurb, :published, :reception]
|
9
|
+
|
10
|
+
validates :title, :presence => true, :uniqueness => true
|
11
|
+
|
12
|
+
belongs_to :cover, :class_name => '::Refinery::Image'
|
13
|
+
|
14
|
+
belongs_to :document, :class_name => '::Refinery::Resource'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<ul>
|
2
|
+
<% if ::Refinery::Libri::Admin::LibrisController.searchable? %>
|
3
|
+
<li>
|
4
|
+
<%= render '/refinery/admin/search', :url => refinery.libri_admin_libris_path %>
|
5
|
+
</li>
|
6
|
+
<% end %>
|
7
|
+
<li>
|
8
|
+
<%= link_to t('.create_new'), refinery.new_libri_admin_libri_path,
|
9
|
+
:class => "add_icon" %>
|
10
|
+
</li>
|
11
|
+
<% if !searching? && ::Refinery::Libri::Admin::LibrisController.sortable? && ::Refinery::Libri::Libri.any? %>
|
12
|
+
<li>
|
13
|
+
<%= link_to t('.reorder', :what => "Libris"),
|
14
|
+
refinery.libri_admin_libris_path,
|
15
|
+
:id => "reorder_action",
|
16
|
+
:class => "reorder_icon" %>
|
17
|
+
|
18
|
+
<%= link_to t('.reorder_done', :what => "Libris"),
|
19
|
+
refinery.libri_admin_libris_path,
|
20
|
+
:id => "reorder_action_done",
|
21
|
+
:style => "display: none;",
|
22
|
+
:class => "reorder_icon" %>
|
23
|
+
</li>
|
24
|
+
<% end %>
|
25
|
+
</ul>
|
@@ -0,0 +1,87 @@
|
|
1
|
+
<%= form_for [refinery, :libri_admin, @libri] do |f| -%>
|
2
|
+
<%= render '/refinery/admin/error_messages',
|
3
|
+
:object => @libri,
|
4
|
+
:include_object_name => true %>
|
5
|
+
|
6
|
+
|
7
|
+
<div class='field'>
|
8
|
+
<%= f.label :title -%>
|
9
|
+
<%= f.text_field :title, :class => 'larger widest' -%>
|
10
|
+
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<div class='field'>
|
14
|
+
<%= f.label :liber -%>
|
15
|
+
<%= f.text_field :liber -%>
|
16
|
+
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<div class='field'>
|
20
|
+
<%= f.label :number -%>
|
21
|
+
<%= f.number_field :number -%>
|
22
|
+
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div class='field'>
|
26
|
+
<%= f.label :classification -%>
|
27
|
+
<%= f.text_field :classification -%>
|
28
|
+
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div class='field'>
|
32
|
+
<div id='page-tabs' class='clearfix ui-tabs ui-widget ui-widget-content ui-corner-all'>
|
33
|
+
<ul id='page_parts'>
|
34
|
+
<% [:blurb, :published, :reception].each_with_index do |part, part_index| %>
|
35
|
+
<li class='ui-state-default<%= ' ui-state-active' if part_index == 0 %>'>
|
36
|
+
<%= link_to t("#{part}", :scope => "activerecord.attributes.refinery/libri/libri", :default => part.to_s.titleize), "##{part}" %>
|
37
|
+
</li>
|
38
|
+
<% end %>
|
39
|
+
</ul>
|
40
|
+
<div id='page_part_editors'>
|
41
|
+
<% [:blurb, :published, :reception].each do |part| %>
|
42
|
+
<div class='page_part' id='<%= part %>'>
|
43
|
+
<%= f.text_area part, :rows => 20, :class => 'wymeditor widest' -%>
|
44
|
+
</div>
|
45
|
+
<% end %>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
|
49
|
+
</div>
|
50
|
+
|
51
|
+
|
52
|
+
</div>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div class='field'>
|
58
|
+
<%= f.label :cover -%>
|
59
|
+
<%= render '/refinery/admin/image_picker',
|
60
|
+
:f => f,
|
61
|
+
:field => :cover_id,
|
62
|
+
:image => @libri.cover,
|
63
|
+
:toggle_image_display => false %>
|
64
|
+
|
65
|
+
</div>
|
66
|
+
|
67
|
+
<div class='field'>
|
68
|
+
<%= f.label :document -%>
|
69
|
+
<%= render '/refinery/admin/resource_picker',
|
70
|
+
:f => f,
|
71
|
+
:field => :document_id,
|
72
|
+
:resource => @libri.document %>
|
73
|
+
|
74
|
+
</div>
|
75
|
+
|
76
|
+
<%= render '/refinery/admin/form_actions', :f => f,
|
77
|
+
:continue_editing => false,
|
78
|
+
:delete_title => t('delete', :scope => 'refinery.libris.admin.libris.libri'),
|
79
|
+
:delete_confirmation => t('message', :scope => 'refinery.admin.delete', :title => @libri.title) %>
|
80
|
+
<% end -%>
|
81
|
+
<% content_for :javascripts do %>
|
82
|
+
<script>
|
83
|
+
$(document).ready(function(){
|
84
|
+
page_options.init(false, '', '');
|
85
|
+
});
|
86
|
+
</script>
|
87
|
+
<% end %>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(libri) -%>">
|
2
|
+
<span class='title'>
|
3
|
+
<%= libri.title %>
|
4
|
+
|
5
|
+
</span>
|
6
|
+
<span class='actions'>
|
7
|
+
|
8
|
+
<%= link_to refinery_icon_tag("application_go.png"), refinery.libri_libri_path(libri),
|
9
|
+
:title => t('.view_live_html'),
|
10
|
+
:target => "_blank" %>
|
11
|
+
|
12
|
+
<%= link_to refinery_icon_tag("application_edit.png"), refinery.edit_libri_admin_libri_path(libri),
|
13
|
+
:title => t('.edit') %>
|
14
|
+
<%= link_to refinery_icon_tag("delete.png"), refinery.libri_admin_libri_path(libri),
|
15
|
+
:class => "cancel confirm-delete",
|
16
|
+
:title => t('.delete'),
|
17
|
+
:confirm => t('message', :scope => 'refinery.admin.delete', :title => libri.title),
|
18
|
+
:method => :delete %>
|
19
|
+
</span>
|
20
|
+
</li>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<% if searching? %>
|
2
|
+
<h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2>
|
3
|
+
<% end %>
|
4
|
+
<div class='pagination_container'>
|
5
|
+
<% if @libris.any? %>
|
6
|
+
<%= render 'libris' %>
|
7
|
+
<% else %>
|
8
|
+
<p>
|
9
|
+
<% unless searching? %>
|
10
|
+
<strong>
|
11
|
+
<%= t('.no_items_yet') %>
|
12
|
+
</strong>
|
13
|
+
<% else %>
|
14
|
+
<%= t('no_results', :scope => 'refinery.admin.search') %>
|
15
|
+
<% end %>
|
16
|
+
</p>
|
17
|
+
<% end %>
|
18
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render 'form' %>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<section id='records'>
|
2
|
+
<%= render 'records' %>
|
3
|
+
</section>
|
4
|
+
<aside id='actions'>
|
5
|
+
<%= render 'actions' %>
|
6
|
+
</aside>
|
7
|
+
<%= render '/refinery/admin/make_sortable', :tree => false if !searching? and ::Refinery::Libri::Admin::LibrisController.sortable? and ::Refinery::Libri::Libri.count > 1 %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render 'form' %>
|
@@ -0,0 +1,79 @@
|
|
1
|
+
<% content_for :body_content_title do %>
|
2
|
+
<%= @libri.title %>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<% content_for :body do %>
|
6
|
+
<section>
|
7
|
+
<h1>Title</h1>
|
8
|
+
<p>
|
9
|
+
<%=raw @libri.title %>
|
10
|
+
</p>
|
11
|
+
</section>
|
12
|
+
<section>
|
13
|
+
<h1>Liber</h1>
|
14
|
+
<p>
|
15
|
+
<%=raw @libri.liber %>
|
16
|
+
</p>
|
17
|
+
</section>
|
18
|
+
<section>
|
19
|
+
<h1>Number</h1>
|
20
|
+
<p>
|
21
|
+
<%=raw @libri.number %>
|
22
|
+
</p>
|
23
|
+
</section>
|
24
|
+
<section>
|
25
|
+
<h1>Classification</h1>
|
26
|
+
<p>
|
27
|
+
<%=raw @libri.classification %>
|
28
|
+
</p>
|
29
|
+
</section>
|
30
|
+
<section>
|
31
|
+
<h1>Blurb</h1>
|
32
|
+
<p>
|
33
|
+
<%=raw @libri.blurb %>
|
34
|
+
</p>
|
35
|
+
</section>
|
36
|
+
<section>
|
37
|
+
<h1>Published</h1>
|
38
|
+
<p>
|
39
|
+
<%=raw @libri.published %>
|
40
|
+
</p>
|
41
|
+
</section>
|
42
|
+
<section>
|
43
|
+
<h1>Reception</h1>
|
44
|
+
<p>
|
45
|
+
<%=raw @libri.reception %>
|
46
|
+
</p>
|
47
|
+
</section>
|
48
|
+
<section>
|
49
|
+
<h1>Cover</h1>
|
50
|
+
<p>
|
51
|
+
<%= image_fu @libri.cover, nil %>
|
52
|
+
</p>
|
53
|
+
</section>
|
54
|
+
<section>
|
55
|
+
<h1>Document</h1>
|
56
|
+
<p>
|
57
|
+
<% if @libri.document.present? %>
|
58
|
+
<%= link_to 'document', @libri.document.url %>
|
59
|
+
<% else %>
|
60
|
+
document
|
61
|
+
<% end %>
|
62
|
+
</p>
|
63
|
+
</section>
|
64
|
+
<% end %>
|
65
|
+
|
66
|
+
<% content_for :side_body do %>
|
67
|
+
<aside>
|
68
|
+
<h2><%= t('.other') %></h2>
|
69
|
+
<ul id="libris">
|
70
|
+
<% @libris.each do |libri| %>
|
71
|
+
<li>
|
72
|
+
<%= link_to libri.title, refinery.libri_libri_path(libri) %>
|
73
|
+
</li>
|
74
|
+
<% end %>
|
75
|
+
</ul>
|
76
|
+
</aside>
|
77
|
+
<% end %>
|
78
|
+
|
79
|
+
<%= render '/refinery/content_page' %>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
en:
|
2
|
+
refinery:
|
3
|
+
plugins:
|
4
|
+
libris:
|
5
|
+
title: Libris
|
6
|
+
libri:
|
7
|
+
admin:
|
8
|
+
libris:
|
9
|
+
actions:
|
10
|
+
create_new: Add New Libri
|
11
|
+
reorder: Reorder Libris
|
12
|
+
reorder_done: Done Reordering Libris
|
13
|
+
records:
|
14
|
+
title: Libris
|
15
|
+
sorry_no_results: Sorry! There are no results found.
|
16
|
+
no_items_yet: There are no Libris yet. Click "Add New Libri" to add your first libri.
|
17
|
+
libri:
|
18
|
+
view_live_html: View this libri live <br/><em>(opens in a new window)</em>
|
19
|
+
edit: Edit this libri
|
20
|
+
delete: Remove this libri forever
|
21
|
+
libris:
|
22
|
+
show:
|
23
|
+
other: Other Libris
|
24
|
+
activerecord:
|
25
|
+
attributes:
|
26
|
+
'refinery/libri/libri':
|
27
|
+
title: Title
|
28
|
+
liber: Liber
|
29
|
+
number: Number
|
30
|
+
classification: Classification
|
31
|
+
blurb: Blurb
|
32
|
+
published: Published
|
33
|
+
reception: Reception
|
34
|
+
cover: Cover
|
35
|
+
document: Document
|
@@ -0,0 +1,36 @@
|
|
1
|
+
es:
|
2
|
+
refinery:
|
3
|
+
plugins:
|
4
|
+
libris:
|
5
|
+
title: Libris
|
6
|
+
# article: masculino/femenino
|
7
|
+
libri:
|
8
|
+
admin:
|
9
|
+
libris:
|
10
|
+
actions:
|
11
|
+
create_new: Crear nuevo libri
|
12
|
+
reorder: Reordenar libris
|
13
|
+
reorder_done: Reordenación de libris completada
|
14
|
+
records:
|
15
|
+
title: Libris
|
16
|
+
sorry_no_results: Lo siento, no hay resultados
|
17
|
+
no_items_yet: No hay libris todavía. Pulsa en "Crear nuevo Libri" para crear tu primer libri.
|
18
|
+
libri:
|
19
|
+
view_live_html: Ver este libri como abierto al público <br/><em>(abre en ventana nueva)</em>
|
20
|
+
edit: Editar este libri
|
21
|
+
delete: Borrar este libri para siempre
|
22
|
+
libris:
|
23
|
+
show:
|
24
|
+
other: Otros libris
|
25
|
+
activerecord:
|
26
|
+
attributes:
|
27
|
+
'refinery/libri/libri':
|
28
|
+
title: Title
|
29
|
+
liber: Liber
|
30
|
+
number: Number
|
31
|
+
classification: Classification
|
32
|
+
blurb: Blurb
|
33
|
+
published: Published
|
34
|
+
reception: Reception
|
35
|
+
cover: Cover
|
36
|
+
document: Document
|
@@ -0,0 +1,35 @@
|
|
1
|
+
fr:
|
2
|
+
refinery:
|
3
|
+
plugins:
|
4
|
+
libris:
|
5
|
+
title: Libris
|
6
|
+
libri:
|
7
|
+
admin:
|
8
|
+
libris:
|
9
|
+
actions:
|
10
|
+
create_new: Créer un(e) nouve(au/l/lle) Libri
|
11
|
+
reorder: Réordonner les Libris
|
12
|
+
reorder_done: Fin de réordonnancement des Libris
|
13
|
+
records:
|
14
|
+
title: Libris
|
15
|
+
sorry_no_results: "Désolé ! Aucun résultat."
|
16
|
+
no_items_yet: 'Il n''y a actuellement aucun(e) Libri. Cliquer sur "Créer un(e) nouve(au/l/lle) Libri" pour créer votre premi(er/ère) libri.'
|
17
|
+
libri:
|
18
|
+
view_live_html: Voir ce(t/tte) libri <br/><em>(Ouvre une nouvelle fenêtre)</em>
|
19
|
+
edit: Modifier ce(t/tte) libri
|
20
|
+
delete: Supprimer définitivement ce(t/tte) libri
|
21
|
+
libris:
|
22
|
+
show:
|
23
|
+
other: Autres Libris
|
24
|
+
activerecord:
|
25
|
+
attributes:
|
26
|
+
'refinery/libri/libri':
|
27
|
+
title: Title
|
28
|
+
liber: Liber
|
29
|
+
number: Number
|
30
|
+
classification: Classification
|
31
|
+
blurb: Blurb
|
32
|
+
published: Published
|
33
|
+
reception: Reception
|
34
|
+
cover: Cover
|
35
|
+
document: Document
|
@@ -0,0 +1,35 @@
|
|
1
|
+
nb:
|
2
|
+
refinery:
|
3
|
+
plugins:
|
4
|
+
libris:
|
5
|
+
title: Libris
|
6
|
+
libri:
|
7
|
+
admin:
|
8
|
+
libris:
|
9
|
+
actions:
|
10
|
+
create_new: Lag en ny Libri
|
11
|
+
reorder: Endre rekkefølgen på Libris
|
12
|
+
reorder_done: Ferdig å endre rekkefølgen Libris
|
13
|
+
records:
|
14
|
+
title: Libris
|
15
|
+
sorry_no_results: Beklager! Vi fant ikke noen resultater.
|
16
|
+
no_items_yet: Det er ingen Libris enda. Klikk på "Lag en ny Libri" for å legge til din første libri.
|
17
|
+
libri:
|
18
|
+
view_live_html: Vis hvordan denne libri ser ut offentlig <br/><em>(åpner i et nytt vindu)</em>
|
19
|
+
edit: Rediger denne libri
|
20
|
+
delete: Fjern denne libri permanent
|
21
|
+
libris:
|
22
|
+
show:
|
23
|
+
other: Andre Libris
|
24
|
+
activerecord:
|
25
|
+
attributes:
|
26
|
+
'refinery/libri/libri':
|
27
|
+
title: Title
|
28
|
+
liber: Liber
|
29
|
+
number: Number
|
30
|
+
classification: Classification
|
31
|
+
blurb: Blurb
|
32
|
+
published: Published
|
33
|
+
reception: Reception
|
34
|
+
cover: Cover
|
35
|
+
document: Document
|
@@ -0,0 +1,35 @@
|
|
1
|
+
nl:
|
2
|
+
refinery:
|
3
|
+
plugins:
|
4
|
+
libris:
|
5
|
+
title: Libris
|
6
|
+
libri:
|
7
|
+
admin:
|
8
|
+
libris:
|
9
|
+
actions:
|
10
|
+
create_new: Maak een nieuwe Libri
|
11
|
+
reorder: Wijzig de volgorde van de Libris
|
12
|
+
reorder_done: Klaar met het wijzingen van de volgorde van de Libris
|
13
|
+
records:
|
14
|
+
title: Libris
|
15
|
+
sorry_no_results: Helaas! Er zijn geen resultaten gevonden.
|
16
|
+
no_items_yet: Er zijn nog geen Libris. Druk op 'Maak een nieuwe Libri' om de eerste aan te maken.
|
17
|
+
libri:
|
18
|
+
view_live_html: Bekijk deze libri op de website <br/><em>(opent een nieuw venster)</em>
|
19
|
+
edit: Bewerk deze libri
|
20
|
+
delete: Verwijder deze libri voor eeuwig
|
21
|
+
libris:
|
22
|
+
show:
|
23
|
+
other: Andere Libris
|
24
|
+
activerecord:
|
25
|
+
attributes:
|
26
|
+
'refinery/libri/libri':
|
27
|
+
title: Title
|
28
|
+
liber: Liber
|
29
|
+
number: Number
|
30
|
+
classification: Classification
|
31
|
+
blurb: Blurb
|
32
|
+
published: Published
|
33
|
+
reception: Reception
|
34
|
+
cover: Cover
|
35
|
+
document: Document
|
@@ -0,0 +1,35 @@
|
|
1
|
+
sk:
|
2
|
+
refinery:
|
3
|
+
plugins:
|
4
|
+
libris:
|
5
|
+
title: Libris
|
6
|
+
libri:
|
7
|
+
admin:
|
8
|
+
libris:
|
9
|
+
actions:
|
10
|
+
create_new: Pridať Libri
|
11
|
+
reorder: Preusporiadať Libris
|
12
|
+
reorder_done: Koniec radenia Libris
|
13
|
+
records:
|
14
|
+
title: Libris
|
15
|
+
sorry_no_results: Ľutujeme, ale neboli nájdené žiadne výsledky.
|
16
|
+
no_items_yet: Nie sú vytvorené žiadne Libris. Kliknite na "Pridať Libri" pre pridanie prvého libri.
|
17
|
+
libri:
|
18
|
+
view_live_html: Zobraziť náhľad libri<br/><em>(otvorí sa v novom okne)</em>
|
19
|
+
edit: Upraviť libri
|
20
|
+
delete: Zmazať libri
|
21
|
+
libris:
|
22
|
+
show:
|
23
|
+
other: Daľšie Libris
|
24
|
+
activerecord:
|
25
|
+
attributes:
|
26
|
+
'refinery/libri/libri':
|
27
|
+
title: Title
|
28
|
+
liber: Liber
|
29
|
+
number: Number
|
30
|
+
classification: Classification
|
31
|
+
blurb: Blurb
|
32
|
+
published: Published
|
33
|
+
reception: Reception
|
34
|
+
cover: Cover
|
35
|
+
document: Document
|
data/config/routes.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Refinery::Core::Engine.routes.append do
|
2
|
+
|
3
|
+
# Frontend routes
|
4
|
+
namespace :libri do
|
5
|
+
resources :libris, :only => [:index, :show]
|
6
|
+
end
|
7
|
+
|
8
|
+
# Admin routes
|
9
|
+
namespace :libri, :path => '' do
|
10
|
+
namespace :admin, :path => 'refinery/libri' do
|
11
|
+
resources :libris, :except => :show do
|
12
|
+
collection do
|
13
|
+
post :update_positions
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
class CreateLibriLibris < ActiveRecord::Migration
|
2
|
+
|
3
|
+
def up
|
4
|
+
create_table :refinery_libris do |t|
|
5
|
+
t.string :title
|
6
|
+
t.string :liber
|
7
|
+
t.integer :number
|
8
|
+
t.string :classification
|
9
|
+
t.text :blurb
|
10
|
+
t.text :published
|
11
|
+
t.text :reception
|
12
|
+
t.integer :cover_id
|
13
|
+
t.integer :document_id
|
14
|
+
t.integer :position
|
15
|
+
|
16
|
+
t.timestamps
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
def down
|
22
|
+
if defined?(::Refinery::UserPlugin)
|
23
|
+
::Refinery::UserPlugin.destroy_all({:name => "refinerycms-libri"})
|
24
|
+
end
|
25
|
+
|
26
|
+
if defined?(::Refinery::Page)
|
27
|
+
::Refinery::Page.delete_all({:link_url => "/libri/libris"})
|
28
|
+
end
|
29
|
+
|
30
|
+
drop_table :refinery_libris
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
data/db/seeds.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
(Refinery.i18n_enabled? ? Refinery::I18n.frontend_locales : [:en]).each do |lang|
|
2
|
+
I18n.locale = lang
|
3
|
+
|
4
|
+
if defined?(Refinery::User)
|
5
|
+
Refinery::User.all.each do |user|
|
6
|
+
if user.plugins.where(:name => 'refinerycms-libri').blank?
|
7
|
+
user.plugins.create(:name => 'refinerycms-libri',
|
8
|
+
:position => (user.plugins.maximum(:position) || -1) +1)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
url = "/libri/libris"
|
14
|
+
if defined?(Refinery::Page) && Refinery::Page.where(:link_url => url).empty?
|
15
|
+
page = Refinery::Page.create(
|
16
|
+
:title => 'Libris',
|
17
|
+
:link_url => url,
|
18
|
+
:deletable => false,
|
19
|
+
:menu_match => "^#{url}(\/|\/.+?|)$"
|
20
|
+
)
|
21
|
+
Refinery::Pages.default_parts.each_with_index do |default_page_part, index|
|
22
|
+
page.parts.create(:title => default_page_part, :body => nil, :position => index)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Refinery
|
2
|
+
class LibrisGenerator < Rails::Generators::Base
|
3
|
+
|
4
|
+
def rake_db
|
5
|
+
rake("refinery_libris:install:migrations")
|
6
|
+
end
|
7
|
+
|
8
|
+
def append_load_seed_data
|
9
|
+
create_file 'db/seeds.rb' unless File.exists?(File.join(destination_root, 'db', 'seeds.rb'))
|
10
|
+
append_file 'db/seeds.rb', :verbose => true do
|
11
|
+
<<-EOH
|
12
|
+
|
13
|
+
# Added by Refinery CMS Libris extension
|
14
|
+
Refinery::Libri::Engine.load_seed
|
15
|
+
EOH
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Refinery
|
2
|
+
module Libri
|
3
|
+
class Engine < Rails::Engine
|
4
|
+
include Refinery::Engine
|
5
|
+
isolate_namespace Refinery::Libri
|
6
|
+
|
7
|
+
engine_name :refinery_libris
|
8
|
+
|
9
|
+
initializer "register refinerycms_libris plugin" do
|
10
|
+
Refinery::Plugin.register do |plugin|
|
11
|
+
plugin.name = "libris"
|
12
|
+
plugin.url = proc { Refinery::Core::Engine.routes.url_helpers.libri_admin_libris_path }
|
13
|
+
plugin.pathname = root
|
14
|
+
plugin.activity = {
|
15
|
+
:class_name => :'refinery/libri/libri'
|
16
|
+
}
|
17
|
+
plugin.menu_match = %r{refinery/libri/libris(/.*)?$}
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
config.after_initialize do
|
22
|
+
Refinery.register_extension(Refinery::Libris)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'refinerycms-core'
|
2
|
+
|
3
|
+
module Refinery
|
4
|
+
autoload :LibrisGenerator, 'generators/refinery/libris_generator'
|
5
|
+
|
6
|
+
module Libris
|
7
|
+
require 'refinery/libris/engine'
|
8
|
+
|
9
|
+
class << self
|
10
|
+
attr_writer :root
|
11
|
+
|
12
|
+
def root
|
13
|
+
@root ||= Pathname.new(File.expand_path('../../../', __FILE__))
|
14
|
+
end
|
15
|
+
|
16
|
+
def factory_paths
|
17
|
+
@factory_paths ||= [ root.join('spec', 'factories').to_s ]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'refinery/libris'
|
data/readme.md
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
# Libris extension for Refinery CMS.
|
2
|
+
|
3
|
+
## How to build this extension as a gem
|
4
|
+
|
5
|
+
cd vendor/extensions/libris
|
6
|
+
gem build refinerycms-libris.gemspec
|
7
|
+
gem install refinerycms-libris.gem
|
8
|
+
|
9
|
+
# Sign up for a http://rubygems.org/ account and publish the gem
|
10
|
+
gem push refinerycms-libris.gem
|
metadata
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: refinerycms-libris
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '1.0'
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- NShYH
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-11-13 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: refinerycms-core
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 2.0.8
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.0.8
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: refinerycms-testing
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 2.0.8
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 2.0.8
|
46
|
+
description: Ruby on Rails Libris extension for Refinery CMS
|
47
|
+
email: frater.nshyh@nightofpan.com
|
48
|
+
executables: []
|
49
|
+
extensions: []
|
50
|
+
extra_rdoc_files: []
|
51
|
+
files:
|
52
|
+
- app/controllers/refinery/libri/admin/libris_controller.rb
|
53
|
+
- app/controllers/refinery/libri/libris_controller.rb
|
54
|
+
- app/models/refinery/libri/libri.rb
|
55
|
+
- app/views/refinery/libri/admin/libris/_actions.html.erb
|
56
|
+
- app/views/refinery/libri/admin/libris/_form.html.erb
|
57
|
+
- app/views/refinery/libri/admin/libris/_libri.html.erb
|
58
|
+
- app/views/refinery/libri/admin/libris/_libris.html.erb
|
59
|
+
- app/views/refinery/libri/admin/libris/_records.html.erb
|
60
|
+
- app/views/refinery/libri/admin/libris/_sortable_list.html.erb
|
61
|
+
- app/views/refinery/libri/admin/libris/edit.html.erb
|
62
|
+
- app/views/refinery/libri/admin/libris/index.html.erb
|
63
|
+
- app/views/refinery/libri/admin/libris/new.html.erb
|
64
|
+
- app/views/refinery/libri/libris/index.html.erb
|
65
|
+
- app/views/refinery/libri/libris/show.html.erb
|
66
|
+
- config/locales/en.yml
|
67
|
+
- config/locales/es.yml
|
68
|
+
- config/locales/fr.yml
|
69
|
+
- config/locales/nb.yml
|
70
|
+
- config/locales/nl.yml
|
71
|
+
- config/locales/sk.yml
|
72
|
+
- config/routes.rb
|
73
|
+
- db/migrate/1_create_libri_libris.rb
|
74
|
+
- db/seeds.rb
|
75
|
+
- lib/generators/refinery/libris_generator.rb
|
76
|
+
- lib/refinery/libris/engine.rb
|
77
|
+
- lib/refinery/libris.rb
|
78
|
+
- lib/refinerycms-libris.rb
|
79
|
+
- lib/tasks/refinery/libris.rake
|
80
|
+
- readme.md
|
81
|
+
homepage:
|
82
|
+
licenses: []
|
83
|
+
post_install_message:
|
84
|
+
rdoc_options: []
|
85
|
+
require_paths:
|
86
|
+
- lib
|
87
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
89
|
+
requirements:
|
90
|
+
- - ! '>='
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
requirements: []
|
100
|
+
rubyforge_project:
|
101
|
+
rubygems_version: 1.8.24
|
102
|
+
signing_key:
|
103
|
+
specification_version: 3
|
104
|
+
summary: Libris extension for Refinery CMS. This Gem can be used to build a library
|
105
|
+
of Thelemic texts.
|
106
|
+
test_files: []
|