muck-contents 3.1.2 → 3.1.3
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.
- data/VERSION +1 -1
- data/app/controllers/admin/muck/contents_controller.rb +4 -9
- data/app/views/admin/contents/_content.erb +6 -0
- data/app/views/admin/contents/index.html.erb +11 -13
- data/app/views/contents/_admin.erb +0 -3
- data/config/locales/en.yml +39 -35
- data/config/routes.rb +6 -0
- data/muck-contents.gemspec +2 -1
- metadata +4 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.1.
|
1
|
+
3.1.3
|
@@ -1,15 +1,10 @@
|
|
1
|
-
class Admin::Muck::ContentsController <
|
2
|
-
unloadable
|
1
|
+
class Admin::Muck::ContentsController < Admin::Muck::BaseController
|
3
2
|
|
4
3
|
def index
|
5
|
-
|
6
|
-
|
7
|
-
def edit
|
8
|
-
@content = Content.find(params[:id])
|
9
|
-
@title = @content.title
|
4
|
+
@contents = Content.by_title.by_newest
|
10
5
|
respond_to do |format|
|
11
|
-
format.html { render :template => 'contents/
|
6
|
+
format.html { render :template => 'admin/contents/index' }
|
12
7
|
end
|
13
8
|
end
|
14
|
-
|
9
|
+
|
15
10
|
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<li id="<%=content.dom_id%>" class="contentContainer delete-container">
|
2
|
+
<span class="link"><a href="<%=content.uri%>" target="_blank"><%= content.title %></a></span>
|
3
|
+
<span class="content-controls">
|
4
|
+
<%= render :partial => 'contents/admin', :locals => {:content => content} %>
|
5
|
+
</span>
|
6
|
+
</li>
|
@@ -1,28 +1,26 @@
|
|
1
|
-
<div id="content-
|
2
|
-
<h2><%= t('muck.
|
3
|
-
<
|
4
|
-
|
5
|
-
<
|
1
|
+
<div id="content-manage">
|
2
|
+
<h2><%= t('muck.contents.manage_content_title') %></h2>
|
3
|
+
<p><%=translate('muck.contents.admin_create_instructions') %></p>
|
4
|
+
<div id="content-search">
|
5
|
+
<label><%=translate('muck.contents.search') %></label> <input id="auto-search" />
|
6
6
|
</div>
|
7
|
-
<div id="
|
8
|
-
<ul id="
|
9
|
-
<%= render :partial => 'admin/
|
7
|
+
<div id="content-list-container">
|
8
|
+
<ul id="content-list">
|
9
|
+
<%= render :partial => 'admin/contents/content', :collection => @contents, :locals => {:parent_id => 0} -%>
|
10
10
|
</ul>
|
11
11
|
</div>
|
12
12
|
</div>
|
13
13
|
|
14
|
-
<input id="updatePath" type="hidden" value="<%=admin_pages_path%>">
|
15
|
-
|
16
14
|
<script type="text/javascript" language="JavaScript">
|
17
15
|
jQuery(document).ready(function() {
|
18
|
-
var data = <%= @
|
19
|
-
jQuery("#
|
16
|
+
var data = <%= @contents.collect{|content| { :title => content.title, :id => content.id } }.to_json.html_safe %>;
|
17
|
+
jQuery("#auto-search").autocomplete(data, {
|
20
18
|
minChars: 0,
|
21
19
|
autoFill: true,
|
22
20
|
mustMatch: false,
|
23
21
|
formatItem: function(item) {
|
24
22
|
return item.title;
|
25
23
|
}
|
26
|
-
}).result(function(event, item) { location.href = '/
|
24
|
+
}).result(function(event, item) { location.href = '/contents/' + item.id + '/edit'; });
|
27
25
|
});
|
28
26
|
</script>
|
@@ -1,7 +1,4 @@
|
|
1
1
|
<% if logged_in? && content.can_edit?(current_user) -%>
|
2
|
-
<% if current_user.can_add_root_content? -%>
|
3
|
-
<%= link_to t('muck.contents.add'), new_content_path, :title => t('muck.contents.add_title'), :class => 'admin-content' -%> |
|
4
|
-
<% end -%>
|
5
2
|
<%= link_to t('muck.contents.edit'), edit_content_path(content.id), :title => t('muck.contents.edit_title'), :class => 'admin-content' -%> |
|
6
3
|
<%= link_to t('muck.contents.delete'), content_path(content.id), :method => :delete, :title => t('muck.contents.delete_title'), :class => 'admin-content', :confirm => t('muck.contents.confirm_delete_content') -%>
|
7
4
|
<% end -%>
|
data/config/locales/en.yml
CHANGED
@@ -1,39 +1,43 @@
|
|
1
|
-
---
|
2
|
-
en:
|
3
|
-
muck:
|
4
|
-
contents:
|
5
|
-
|
6
|
-
|
7
|
-
delete: Delete
|
1
|
+
---
|
2
|
+
en:
|
3
|
+
muck:
|
4
|
+
contents:
|
5
|
+
permalink: "Permalink:"
|
6
|
+
tags_help: Add tags to help identify your content. Tags can also be used to generate lists of links for a menu.
|
8
7
|
edit: Edit
|
9
8
|
add: Add
|
9
|
+
default_404_title: 404 Page not found
|
10
|
+
edit_this_content: Edit this content.
|
11
|
+
cancel: Cancel
|
12
|
+
delete: Delete
|
13
|
+
no_images: No images available
|
14
|
+
cant_delete_content: You don't have permission to delete the specified content
|
15
|
+
submit_content_button: Save
|
16
|
+
problem_updating_content: There was a problem updating the content
|
17
|
+
add_new_page: Add New Page
|
18
|
+
confirm_delete_content: Are you sure you wish to delete this content? This cannot be undone!
|
19
|
+
manage_content_title: Manage site content
|
20
|
+
edit_title: Edit this page.
|
21
|
+
create_error: There was a problem adding your content
|
22
|
+
update_error: There was a problem updating your content
|
23
|
+
tags: Tags
|
24
|
+
no_uri_error: Please set a value for uri before saving the model when contentable is nil
|
25
|
+
content_label: Content
|
26
|
+
choose_layout_help: Select a layout template that will render the chrome for this page.
|
27
|
+
admin_create_instructions: To create a new page just type the desired URL into your browser.
|
10
28
|
add_title: Add new page
|
29
|
+
delete_title: Delete this page.
|
30
|
+
title_label: Title
|
31
|
+
save: Save
|
32
|
+
tag_information: Tags help other users find your page and will be used as the meta keywords for the document.
|
33
|
+
tags_label: Tags
|
34
|
+
content_help: This is the content that will appear on the page.
|
35
|
+
problem_adding_content: There was a problem adding the content
|
11
36
|
preview: Preview
|
12
|
-
|
13
|
-
|
14
|
-
no_files:
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
cant_delete_content: "You don't have permission to delete the specified content"
|
20
|
-
manage_pages_title: "Manage site content"
|
21
|
-
tag_information: "Tags help other users find your page and will be used as the meta keywords for the document."
|
22
|
-
tags: Tags
|
23
|
-
permalink: "Permalink:"
|
24
|
-
page_doesnt_exist_create: "The page you requested does not exist. Please provide the information below to create the page."
|
25
|
-
default_404_title: "404 Page not found"
|
26
|
-
default_404_body: "We could not find the page you were looking for."
|
27
|
-
no_uri_error: "Please set a value for uri before saving the model when contentable is nil"
|
28
|
-
submit_content_button: "Save"
|
29
|
-
content_label: "Content"
|
30
|
-
title_label: "Title"
|
31
|
-
title_help: "The title controls the url and the page title displayed in the url bar"
|
32
|
-
tags_label: "Tags"
|
33
|
-
tags_help: "Add tags to help identify your content. Tags can also be used to generate lists of links for a menu."
|
34
|
-
content_help: "This is the content that will appear on the page."
|
35
|
-
problem_adding_content: "There was a problem adding the content"
|
36
|
-
problem_updating_content: "There was a problem updating the content"
|
37
|
-
confirm_delete_content: "Are you sure you wish to delete this content? This cannot be undone!"
|
38
|
-
choose_layout: "Select Template"
|
39
|
-
choose_layout_help: "Select a layout template that will render the chrome for this page."
|
37
|
+
content_removed: Content successfully removed
|
38
|
+
title_help: The title controls the url and the page title displayed in the url bar
|
39
|
+
no_files: No files available
|
40
|
+
page_doesnt_exist_create: The page you requested does not exist. Please provide the information below to create the page.
|
41
|
+
default_404_body: We could not find the page you were looking for.
|
42
|
+
choose_layout: Select Template
|
43
|
+
search: "Search:"
|
data/config/routes.rb
CHANGED
@@ -9,4 +9,10 @@ Rails.application.routes.draw do
|
|
9
9
|
match '/images_for_content' => 'muck/tiny_mce#images_for_content', :as => :images_for_content
|
10
10
|
match '/files_for_content' => 'muck/tiny_mce#files_for_content', :as => :files_for_content
|
11
11
|
match '/links_for_content' => 'muck/tiny_mce#links_for_content', :as => :links_for_content
|
12
|
+
|
13
|
+
# admin
|
14
|
+
namespace :admin do
|
15
|
+
resources :contents, :controller => 'muck/contents'
|
16
|
+
end
|
17
|
+
|
12
18
|
end
|
data/muck-contents.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{muck-contents}
|
8
|
-
s.version = "3.1.
|
8
|
+
s.version = "3.1.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Justin Ball", "Joel Duffin"]
|
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
|
|
26
26
|
"app/controllers/muck/tiny_mce_controller.rb",
|
27
27
|
"app/helpers/muck_contents_helper.rb",
|
28
28
|
"app/helpers/tinymce_helper.rb",
|
29
|
+
"app/views/admin/contents/_content.erb",
|
29
30
|
"app/views/admin/contents/index.html.erb",
|
30
31
|
"app/views/contents/_admin.erb",
|
31
32
|
"app/views/contents/_form.erb",
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: muck-contents
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 3.1.
|
9
|
+
- 3
|
10
|
+
version: 3.1.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Justin Ball
|
@@ -181,6 +181,7 @@ files:
|
|
181
181
|
- app/controllers/muck/tiny_mce_controller.rb
|
182
182
|
- app/helpers/muck_contents_helper.rb
|
183
183
|
- app/helpers/tinymce_helper.rb
|
184
|
+
- app/views/admin/contents/_content.erb
|
184
185
|
- app/views/admin/contents/index.html.erb
|
185
186
|
- app/views/contents/_admin.erb
|
186
187
|
- app/views/contents/_form.erb
|