etabliocms_actualities 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.rdoc +3 -0
- data/Rakefile +38 -0
- data/app/assets/images/admin/sidebar-actualities.png +0 -0
- data/app/assets/images/admin/sidebar-categories.png +0 -0
- data/app/controllers/etabliocms_actualities/admin/actualities_controller.rb +45 -0
- data/app/controllers/etabliocms_actualities/admin/categories_controller.rb +52 -0
- data/app/models/etabliocms_actualities/actuality.rb +21 -0
- data/app/models/etabliocms_actualities/category.rb +43 -0
- data/app/views/etabliocms_actualities/admin/actualities/_form.html.erb +45 -0
- data/app/views/etabliocms_actualities/admin/actualities/edit.html.erb +7 -0
- data/app/views/etabliocms_actualities/admin/actualities/index.html.erb +39 -0
- data/app/views/etabliocms_actualities/admin/actualities/new.html.erb +7 -0
- data/app/views/etabliocms_actualities/admin/categories/_form.html.erb +44 -0
- data/app/views/etabliocms_actualities/admin/categories/edit.html.erb +7 -0
- data/app/views/etabliocms_actualities/admin/categories/index.html.erb +25 -0
- data/app/views/etabliocms_actualities/admin/categories/new.html.erb +7 -0
- data/app/views/layouts/_sidebar_actualities.html.erb +11 -0
- data/config/locales/actualities.cs.yml +43 -0
- data/config/routes.rb +14 -0
- data/db/migrate/20120225132855_create_categories.etabliocms_actualities_engine.rb +22 -0
- data/db/migrate/20120225160655_create_actualities.etabliocms_actualities_engine.rb +18 -0
- data/lib/etabliocms_actualities/engine.rb +18 -0
- data/lib/etabliocms_actualities/version.rb +3 -0
- data/lib/etabliocms_actualities.rb +7 -0
- metadata +114 -0
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2012 YOURNAME
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
begin
|
3
|
+
require 'bundler/setup'
|
4
|
+
rescue LoadError
|
5
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
|
+
end
|
7
|
+
begin
|
8
|
+
require 'rdoc/task'
|
9
|
+
rescue LoadError
|
10
|
+
require 'rdoc/rdoc'
|
11
|
+
require 'rake/rdoctask'
|
12
|
+
RDoc::Task = Rake::RDocTask
|
13
|
+
end
|
14
|
+
|
15
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
16
|
+
rdoc.rdoc_dir = 'rdoc'
|
17
|
+
rdoc.title = 'EtabliocmsCore'
|
18
|
+
rdoc.options << '--line-numbers'
|
19
|
+
rdoc.rdoc_files.include('README.rdoc')
|
20
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
Bundler::GemHelper.install_tasks
|
27
|
+
|
28
|
+
require 'rake/testtask'
|
29
|
+
|
30
|
+
Rake::TestTask.new(:test) do |t|
|
31
|
+
t.libs << 'lib'
|
32
|
+
t.libs << 'test'
|
33
|
+
t.pattern = 'test/**/*_test.rb'
|
34
|
+
t.verbose = false
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
task :default => :test
|
Binary file
|
Binary file
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module EtabliocmsActualities
|
2
|
+
module Admin
|
3
|
+
class ActualitiesController < EtabliocmsCore::Admin::BaseController
|
4
|
+
|
5
|
+
def index
|
6
|
+
@actualities = Actuality.order(params[:order] || "created_at DESC").page(params[:page])
|
7
|
+
end
|
8
|
+
|
9
|
+
def new
|
10
|
+
@actuality = Actuality.new
|
11
|
+
end
|
12
|
+
|
13
|
+
def create
|
14
|
+
@actuality = Actuality.new(params[:actuality])
|
15
|
+
if @actuality.save
|
16
|
+
flash[:notice] = t('actuality.created')
|
17
|
+
redirect_to :action => 'index'
|
18
|
+
else
|
19
|
+
render :action => 'new'
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def edit
|
24
|
+
@actuality = Actuality.find(params[:id])
|
25
|
+
end
|
26
|
+
|
27
|
+
def update
|
28
|
+
@actuality = Actuality.find(params[:id])
|
29
|
+
if @actuality.update_attributes(params[:actuality])
|
30
|
+
flash[:notice] = t('actuality.updated')
|
31
|
+
redirect_to :action => 'index'
|
32
|
+
else
|
33
|
+
render :action => 'edit'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def destroy
|
38
|
+
Actuality.find(params[:id]).destroy
|
39
|
+
flash[:notice] = t('actuality.destroyed')
|
40
|
+
redirect_to :action => 'index'
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module EtabliocmsActualities
|
2
|
+
module Admin
|
3
|
+
class CategoriesController < EtabliocmsCore::Admin::BaseController
|
4
|
+
|
5
|
+
def new
|
6
|
+
@category = Category.new
|
7
|
+
end
|
8
|
+
|
9
|
+
def create
|
10
|
+
@category = Category.new(params[:category])
|
11
|
+
if @category.save
|
12
|
+
flash[:notice] = t('category.created')
|
13
|
+
redirect_to :action => 'index'
|
14
|
+
else
|
15
|
+
render :action => 'new'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def edit
|
20
|
+
@category = Category.find(params[:id])
|
21
|
+
end
|
22
|
+
|
23
|
+
def update
|
24
|
+
@category = Category.find(params[:id])
|
25
|
+
if @category.update_attributes(params[:category])
|
26
|
+
flash[:notice] = t('category.updated')
|
27
|
+
redirect_to :action => 'index'
|
28
|
+
else
|
29
|
+
render :action => 'edit'
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def destroy
|
34
|
+
Category.find(params[:id]).destroy
|
35
|
+
flash[:notice] = t('category.destroyed')
|
36
|
+
redirect_to :action => 'index'
|
37
|
+
end
|
38
|
+
|
39
|
+
def move
|
40
|
+
@category = Category.find(params[:id])
|
41
|
+
if ["move_lower", "move_higher", "move_to_top", "move_to_bottom"].include?(params[:method])
|
42
|
+
@category.send(params[:method])
|
43
|
+
flash[:notice] = t('category.moved')
|
44
|
+
else
|
45
|
+
flash[:notice] = t('category.not_moved')
|
46
|
+
end
|
47
|
+
redirect_to :action => 'index'
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module EtabliocmsActualities
|
2
|
+
class Actuality < ActiveRecord::Base
|
3
|
+
default_scope :order => "updated_at desc"
|
4
|
+
|
5
|
+
scope :recent, lambda { |limit| {:limit => limit, :order => "updated_at desc"} }
|
6
|
+
scope :last_edited, lambda { |limit| {:limit => limit, :order => "updated_at desc"} }
|
7
|
+
scope :visible, lambda { where(["(publish_date < ? AND unpublish_date > ?) ", Time.now, Time.now]) }
|
8
|
+
scope :last_week, lambda { where(['created_at > ? and created_at < ?', 7.days.ago, Time.now]) }
|
9
|
+
|
10
|
+
validates :title, :presence => true
|
11
|
+
validates :publish_date, :presence => true
|
12
|
+
validates :unpublish_date, :presence => true
|
13
|
+
|
14
|
+
has_slug :to_param => :id_slug
|
15
|
+
|
16
|
+
def summary
|
17
|
+
self.perex.present? ? self.perex : self.text
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module EtabliocmsActualities
|
2
|
+
class Category < ActiveRecord::Base
|
3
|
+
|
4
|
+
has_many :actualities, :dependent => :nullify
|
5
|
+
|
6
|
+
acts_as_nested_set
|
7
|
+
attr_accessor :child_of
|
8
|
+
after_save :update_position
|
9
|
+
|
10
|
+
validates :title, :presence => true
|
11
|
+
validates :locale, :presence => true
|
12
|
+
|
13
|
+
has_slug :to_param => "path"
|
14
|
+
|
15
|
+
def path
|
16
|
+
self_and_ancestors.map(&:slug).join("/")
|
17
|
+
end
|
18
|
+
|
19
|
+
def other_categories_for_select
|
20
|
+
categories = EtabliocmsActualities::Category.order("lft ASC")
|
21
|
+
categories = categories.where("id != ?", id) unless new_record?
|
22
|
+
categories.map { |d| [d.title, d.id] }
|
23
|
+
end
|
24
|
+
|
25
|
+
scope :for_locale, lambda { |locale| where(:locale => locale) }
|
26
|
+
|
27
|
+
private
|
28
|
+
def update_position
|
29
|
+
if child_of.to_i != parent_id.to_i
|
30
|
+
if child_of.present?
|
31
|
+
parent = Category.find(child_of)
|
32
|
+
move_to_child_of parent unless parent == self or parent == self.parent
|
33
|
+
move_to_bottom
|
34
|
+
elsif !child_of.nil?
|
35
|
+
move_to_root
|
36
|
+
move_to_bottom
|
37
|
+
end
|
38
|
+
end
|
39
|
+
self.child_of = nil
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<fieldset>
|
2
|
+
<legend><%= t('actuality.admin_legend') %></legend>
|
3
|
+
|
4
|
+
<%= render "layouts/errors", :target => @actuality %>
|
5
|
+
|
6
|
+
<p>
|
7
|
+
<%= f.label :title, :id => "actuality_title_label" %>
|
8
|
+
<%= f.text_field :title, :class => 'text-field' %>
|
9
|
+
</p>
|
10
|
+
|
11
|
+
<p>
|
12
|
+
<%= f.label :perex, :id => "actuality_perex_label" %>
|
13
|
+
<%= f.textile_text_area :perex, :class => "small-text-area" %>
|
14
|
+
</p>
|
15
|
+
|
16
|
+
<p>
|
17
|
+
<%= f.label :text, :id => "actuality_text_label" %>
|
18
|
+
<%= f.textile_text_area :text %>
|
19
|
+
</p>
|
20
|
+
|
21
|
+
<p>
|
22
|
+
<%= f.label :publish_date, :id => "actuality_publish_date_label" %>
|
23
|
+
<%= f.datetime_select :publish_date %>
|
24
|
+
</p>
|
25
|
+
|
26
|
+
<p>
|
27
|
+
<%= f.label :unpublish_date, :id => "actuality_unpublish_date_label" %>
|
28
|
+
<%= f.datetime_select :unpublish_date, :default => Time.now + 5.years %>
|
29
|
+
</p>
|
30
|
+
|
31
|
+
<p>
|
32
|
+
<%= f.label :category_id %>
|
33
|
+
<%= f.collection_select :category_id, EtabliocmsActualities::Category.all, :id, :title, {:include_blank => true} %>
|
34
|
+
</p>
|
35
|
+
|
36
|
+
<p>
|
37
|
+
<%= f.label :locale, :id => "category_locale_label" %>
|
38
|
+
<%= f.select :locale, I18n.available_locales.map(&:to_s).sort.map { |locale| [I18n.t("admin.locales.#{locale}"), locale.to_s] } %>
|
39
|
+
</p>
|
40
|
+
|
41
|
+
<p>
|
42
|
+
<%= submit_tag t('admin.save'), :class => 'submit' %>
|
43
|
+
</p>
|
44
|
+
|
45
|
+
</fieldset>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<% set_title_and_breadcrumb t('actuality.edit', :title => @actuality.title) %>
|
2
|
+
|
3
|
+
<h1><%= @actuality.title %></h1>
|
4
|
+
|
5
|
+
<%= form_for :actuality, :url => admin_actuality_path(@actuality.id), :html => {:method => :put, :id => "admin-form"} do |f| -%>
|
6
|
+
<%= render :partial => 'form', :locals => { :f => f } %>
|
7
|
+
<% end %>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<% set_title_and_breadcrumb t('actuality.actualities') %>
|
2
|
+
|
3
|
+
<h1><%= t('actuality.actualities') %></h1>
|
4
|
+
|
5
|
+
<div class="strap">
|
6
|
+
<%= link_to "#{t('actuality.add')} »".html_safe, new_admin_actuality_path, :class => 'text-icon icon-add' %>
|
7
|
+
<%= link_to "#{t('admin.refresh')} »".html_safe, admin_actualities_path, :class => 'text-icon icon-refresh' %>
|
8
|
+
<%= link_to "#{t('admin.back_to_admin')} »".html_safe, admin_path, :class => 'text-icon icon-backward' %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<table class="admin-table">
|
12
|
+
<thead>
|
13
|
+
<tr>
|
14
|
+
<th><%= t('activerecord.attributes.etabliocms_actualities/actuality.title') %> </th>
|
15
|
+
<th><%= t('activerecord.attributes.etabliocms_actualities/actuality.publish_date') %></th>
|
16
|
+
<th><%= t('activerecord.attributes.etabliocms_actualities/actuality.unpublish_date') %></th>
|
17
|
+
<th><%= t('admin.actions') %></th>
|
18
|
+
</tr>
|
19
|
+
</thead>
|
20
|
+
<tbody>
|
21
|
+
|
22
|
+
<% for item in @actualities %>
|
23
|
+
<tr class="<%= cycle("odd-row", "even-row") -%>">
|
24
|
+
<td><%= link_to item.title, edit_admin_actuality_url(item.id) %></td>
|
25
|
+
<td class="center"><%= l item.publish_date, :format => :short %></td>
|
26
|
+
<td class="center"><%= l item.unpublish_date, :format => :short %></td>
|
27
|
+
<td>
|
28
|
+
<%= link_to t('admin.edit'), edit_admin_actuality_url(item.id), :class => 'icon icon-edit', :title => t('admin.edit') %>
|
29
|
+
<%= link_to t('admin.destroy'), admin_actuality_url(item.id),
|
30
|
+
:method => :delete,
|
31
|
+
:confirm => t('actuality.destroy_confirmation'),
|
32
|
+
:class => 'icon icon-destroy',
|
33
|
+
:title => t('admin.destroy') %>
|
34
|
+
</td>
|
35
|
+
<% end %>
|
36
|
+
</tbody>
|
37
|
+
</table>
|
38
|
+
|
39
|
+
<%= paginate @actualities %>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<% set_title_and_breadcrumb t('actuality.new') %>
|
2
|
+
|
3
|
+
<h1><%= t('actuality.new') %></h1>
|
4
|
+
|
5
|
+
<%= form_for :actuality, :url => admin_actualities_path, :html => {:method => :post, :id => "admin-form"} do |f| -%>
|
6
|
+
<%= render :partial => 'form', :locals => { :f => f } %>
|
7
|
+
<% end %>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<%= render "layouts/errors", :target => @category %>
|
2
|
+
|
3
|
+
<fieldset>
|
4
|
+
|
5
|
+
<legend><%= t('category.admin_legend') %></legend>
|
6
|
+
|
7
|
+
<p>
|
8
|
+
<%= f.label :title, :id => "category_title_label" %>
|
9
|
+
<%= f.text_field :title, :class => 'text-field' %>
|
10
|
+
</p>
|
11
|
+
|
12
|
+
<p>
|
13
|
+
<%= f.label :child_of, :id => "category_child_of_label" %>
|
14
|
+
<%= f.select :child_of, [[t('hierarchy.top_level'), nil]] + @category.other_categories_for_select,
|
15
|
+
:selected => @category.parent ? [@category.parent.title, @category.parent_id] : nil %>
|
16
|
+
</p>
|
17
|
+
|
18
|
+
<p>
|
19
|
+
<%= f.label :locale, :id => "category_locale_label" %>
|
20
|
+
<%= f.select :locale, [[t('admin.locale.cs'), 'cs'], [t('admin.locale.en'), 'en']] %>
|
21
|
+
</p>
|
22
|
+
|
23
|
+
|
24
|
+
<p>
|
25
|
+
<%= f.label :visible, :id => "category_visible_label" %>
|
26
|
+
<%= f.boolean_yes_no_select :visible %>
|
27
|
+
</p>
|
28
|
+
|
29
|
+
<p>
|
30
|
+
<%= f.textile_text_area :text, :width => 560, :height => 200 %>
|
31
|
+
</p>
|
32
|
+
|
33
|
+
<% if !@category.new_record? && respond_to?(:category_path) %>
|
34
|
+
<p>
|
35
|
+
<strong>Náhled: </strong>
|
36
|
+
<%= link_to @category.title, category_url(@category, :locale => @category.locale), :"data-popup" => "true" %>
|
37
|
+
</p>
|
38
|
+
<% end %>
|
39
|
+
|
40
|
+
<p>
|
41
|
+
<%= submit_tag t('admin.save'), :class => 'submit' %>
|
42
|
+
</p>
|
43
|
+
|
44
|
+
</fieldset>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<% set_title_and_breadcrumb t('category.edit', :title => @category.title) %>
|
2
|
+
|
3
|
+
<h1><%= @category.title %></h1>
|
4
|
+
|
5
|
+
<%= form_for :category, :url => admin_category_path(@category.id), :html => {:method => :put, :id => "admin-form"} do |f| -%>
|
6
|
+
<%= render :partial => 'form', :locals => { :f => f } %>
|
7
|
+
<% end %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<% set_title_and_breadcrumb t('category.categories') %>
|
2
|
+
|
3
|
+
<h1><%= t('category.categories') %></h1>
|
4
|
+
|
5
|
+
<div class="strap">
|
6
|
+
<%= link_to "#{t('category.add')} »".html_safe, new_admin_category_path, :class => 'text-icon icon-add' %>
|
7
|
+
<%= link_to "#{t('admin.refresh')} »".html_safe, admin_categories_path, :class => 'text-icon icon-refresh' %>
|
8
|
+
<%= link_to "#{t('admin.back_to_admin')} »".html_safe, admin_path, :class => 'text-icon icon-backward' %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<table class="admin-table hierarchical-table">
|
12
|
+
<thead>
|
13
|
+
<tr>
|
14
|
+
<th><%= t('activerecord.attributes.etabliocms_actualities/category.title') %></th>
|
15
|
+
<th><%= t('admin.created_at') %></th>
|
16
|
+
<th><%= t('activerecord.attributes.etabliocms_actualities/category.locale') %></th>
|
17
|
+
<th><%= t('admin.actions') %></th>
|
18
|
+
</tr>
|
19
|
+
</thead>
|
20
|
+
<tbody>
|
21
|
+
|
22
|
+
<%= render_table_tree(EtabliocmsActualities::Category.order("lft asc")) %>
|
23
|
+
|
24
|
+
</tbody>
|
25
|
+
</table>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<% set_title_and_breadcrumb t('category.new') %>
|
2
|
+
|
3
|
+
<h1><%= t('category.new') %></h1>
|
4
|
+
|
5
|
+
<%= form_for :category, :url => admin_categories_url, :html => {:method => :post, :id => "admin-form"} do |f| -%>
|
6
|
+
<%= render :partial => 'form', :locals => { :f => f } %>
|
7
|
+
<% end %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<h3><%= image_tag asset_path("admin/sidebar-actualities.png"), :alt => t('actuality.actualities') %><%= t('actuality.actualities') %></h3>
|
2
|
+
<ul>
|
3
|
+
<li><%= link_to_unless_current I18n.t('actuality.actualities_count', :count => EtabliocmsActualities::Actuality.count), admin_actualities_path %></li>
|
4
|
+
<li><%= link_to_unless_current t('actuality.add'), new_admin_actuality_path %></li>
|
5
|
+
</ul>
|
6
|
+
|
7
|
+
<h3><%= image_tag asset_path("admin/sidebar-categories.png"), :alt => t('category.categories') %><%= t('category.categories') %></h3>
|
8
|
+
<ul>
|
9
|
+
<li><%= link_to_unless_current I18n.t('category.categories_count', :count => EtabliocmsActualities::Category.count), admin_categories_path %></li>
|
10
|
+
<li><%= link_to_unless_current t('category.add'), new_admin_category_path %></li>
|
11
|
+
</ul>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
cs:
|
2
|
+
actuality:
|
3
|
+
actualities: Novinky
|
4
|
+
actualities_count: "Novinky (%{count})"
|
5
|
+
add: Přidat novinku
|
6
|
+
created: Novinka byla úspěšně vytvořena.
|
7
|
+
updated: Novinka byla úspěšně upravena.
|
8
|
+
destroyed: Novinka byla úspěšně odstraněna.
|
9
|
+
moved: Novinka byla úspěšně přesunuta.
|
10
|
+
not_moved: Novinka nebyla přesunuta.
|
11
|
+
destroy_confirmation: Skutečně chcete smazat tuto novinku?
|
12
|
+
admin_legend: Základní údaje o novince
|
13
|
+
edit: "Editace novinky %{title}"
|
14
|
+
new: Nová novinka
|
15
|
+
category:
|
16
|
+
categories: Kategorie
|
17
|
+
categories_count: "Kategorie (%{count})"
|
18
|
+
add: Přidat kategorii
|
19
|
+
created: Kategorie byla úspěšně vytvořena.
|
20
|
+
updated: Kategorie byla úspěšně upravena.
|
21
|
+
destroyed: Kategorie byla úspěšně odstraněna.
|
22
|
+
moved: Kategorie byla úspěšně přesunuta.
|
23
|
+
not_moved: Kategorie nebyla přesunuta.
|
24
|
+
destroy_confirmation: Skutečně chcete smazat tuto kategorii?
|
25
|
+
admin_legend: Základní údaje o kategorii
|
26
|
+
edit: "Editace kategorie %{title}"
|
27
|
+
new: Nová kategorie
|
28
|
+
activerecord:
|
29
|
+
attributes:
|
30
|
+
"etabliocms_actualities/category":
|
31
|
+
title: Nadpis
|
32
|
+
child_of: Rodič
|
33
|
+
text: Text
|
34
|
+
visible: Viditelné
|
35
|
+
locale: Jazyk
|
36
|
+
"etabliocms_actualities/actuality":
|
37
|
+
title: Nadpis
|
38
|
+
perex: Perex
|
39
|
+
text: Text
|
40
|
+
category_id: Kategorie
|
41
|
+
publish_date: Publikovat
|
42
|
+
unpublish_date: Stáhnout
|
43
|
+
locale: Jazyk
|
data/config/routes.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
class CreateCategories < ActiveRecord::Migration
|
2
|
+
|
3
|
+
def change
|
4
|
+
create_table :categories do |t|
|
5
|
+
t.string :title, :null => false
|
6
|
+
t.string :slug, :null => false
|
7
|
+
t.text :text
|
8
|
+
|
9
|
+
t.integer :lft
|
10
|
+
t.integer :rgt
|
11
|
+
t.integer :parent_id
|
12
|
+
|
13
|
+
t.boolean :visible
|
14
|
+
t.string :locale, :null => false
|
15
|
+
|
16
|
+
t.timestamps
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreateActualities < ActiveRecord::Migration
|
2
|
+
|
3
|
+
def change
|
4
|
+
create_table :actualities do |t|
|
5
|
+
t.string :slug, :null => false
|
6
|
+
t.string :title, :null => false
|
7
|
+
t.text :perex
|
8
|
+
t.text :text
|
9
|
+
t.integer :category_id
|
10
|
+
t.datetime :publish_date, :null => false
|
11
|
+
t.datetime :unpublish_date, :null => false
|
12
|
+
t.string :locale
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module EtabliocmsActualities
|
2
|
+
|
3
|
+
class Engine < ::Rails::Engine
|
4
|
+
|
5
|
+
initializer "etabliocms_core.initialize" do |app|
|
6
|
+
EtabliocmsCore.setup do |config|
|
7
|
+
config.modules ||= []
|
8
|
+
config.modules << :actualities
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
initializer "etabliocms_core.link_public_assets" do |app|
|
13
|
+
app.middleware.insert_before(::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public")
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,114 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: etabliocms_actualities
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- papricek
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-02-25 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: &13121620 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.2.1
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *13121620
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: etabliocms_core
|
27
|
+
requirement: &13121120 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *13121120
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: awesome_nested_set
|
38
|
+
requirement: &13120500 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - =
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 2.1.2
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *13120500
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: sqlite3
|
49
|
+
requirement: &13120040 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *13120040
|
58
|
+
description: Small CMS - module for actualities
|
59
|
+
email:
|
60
|
+
- patrikjira@gmail.com
|
61
|
+
executables: []
|
62
|
+
extensions: []
|
63
|
+
extra_rdoc_files: []
|
64
|
+
files:
|
65
|
+
- app/views/layouts/_sidebar_actualities.html.erb
|
66
|
+
- app/views/etabliocms_actualities/admin/actualities/_form.html.erb
|
67
|
+
- app/views/etabliocms_actualities/admin/actualities/new.html.erb
|
68
|
+
- app/views/etabliocms_actualities/admin/actualities/edit.html.erb
|
69
|
+
- app/views/etabliocms_actualities/admin/actualities/index.html.erb
|
70
|
+
- app/views/etabliocms_actualities/admin/categories/_form.html.erb
|
71
|
+
- app/views/etabliocms_actualities/admin/categories/new.html.erb
|
72
|
+
- app/views/etabliocms_actualities/admin/categories/edit.html.erb
|
73
|
+
- app/views/etabliocms_actualities/admin/categories/index.html.erb
|
74
|
+
- app/assets/images/admin/sidebar-categories.png
|
75
|
+
- app/assets/images/admin/sidebar-actualities.png
|
76
|
+
- app/controllers/etabliocms_actualities/admin/actualities_controller.rb
|
77
|
+
- app/controllers/etabliocms_actualities/admin/categories_controller.rb
|
78
|
+
- app/models/etabliocms_actualities/category.rb
|
79
|
+
- app/models/etabliocms_actualities/actuality.rb
|
80
|
+
- config/routes.rb
|
81
|
+
- config/locales/actualities.cs.yml
|
82
|
+
- db/migrate/20120225160655_create_actualities.etabliocms_actualities_engine.rb
|
83
|
+
- db/migrate/20120225132855_create_categories.etabliocms_actualities_engine.rb
|
84
|
+
- lib/etabliocms_actualities/version.rb
|
85
|
+
- lib/etabliocms_actualities/engine.rb
|
86
|
+
- lib/etabliocms_actualities.rb
|
87
|
+
- MIT-LICENSE
|
88
|
+
- Rakefile
|
89
|
+
- README.rdoc
|
90
|
+
homepage: https://github.com/papricek/etabliocms_actualities
|
91
|
+
licenses: []
|
92
|
+
post_install_message:
|
93
|
+
rdoc_options: []
|
94
|
+
require_paths:
|
95
|
+
- lib
|
96
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
+
none: false
|
104
|
+
requirements:
|
105
|
+
- - ! '>='
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
requirements: []
|
109
|
+
rubyforge_project:
|
110
|
+
rubygems_version: 1.8.5
|
111
|
+
signing_key:
|
112
|
+
specification_version: 3
|
113
|
+
summary: Small CMS - module for actualities
|
114
|
+
test_files: []
|