-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
major refactor and upgrade for Radiant 1.0.0
- Loading branch information
Andrew vonderLuft
committed
Apr 22, 2011
1 parent
aa5e459
commit 221588b
Showing
31 changed files
with
516 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
The *Sitemap Search* extension, as its name implies, enables you to search your sitemap; pages, snippets and layouts | ||
|
||
h2. Usage | ||
|
||
The Search tab is located under 'Content' to the right of 'Pages' | ||
|
||
The Search box is located in the lower bar of the index page for Pages, Snippets, Layouts. | ||
If you have the the BannerRotator extension and/or the Templates extension installed, it will be on those index pages also. | ||
And of course it is also on the Search Results page. | ||
|
||
Enter your search string, and click the button. Results are sortable by attribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
h2. Sitemap Search | ||
|
||
Created by Sean Cribbs in Fall 2007. | ||
Revised and generalized by Sean Cribbs and Andrew vonderLuft in August 2008. | ||
Extended and refactored by Andrew vonderLuft since then. | ||
|
||
Provides a simple content search of pages, snippets, and layouts. | ||
Contains rudimentary support for scoping searches within a given site when using the multi_site extension. | ||
|
||
h2. Revision History | ||
|
||
* 4/2011 - UI upgrade for Radiant >= 1.0.0; added Layouts; added templates to search from "Templates extension":https://github.com/avonderluft/radiant-templates-extension | ||
* 2/2010 - add banners to search, from "BannerRotator extension":https://github.com/avonderluft/radiant-banner_rotator-extension | ||
* 2/2009 - upgraded for compatibility with Radiant 0.7 | ||
* 12/2008 - initial commit | ||
|
||
h2. Requirements | ||
|
||
* current version requires Radiant >= 1.0.0 | ||
* tag 0.7.2 available for earlier versions | ||
|
||
page_list_view extension must be installed | ||
|
||
From your RADIANT_ROOT: | ||
|
||
<pre> | ||
$ script/extension install page_list_view | ||
</pre> | ||
|
||
h2. Installation | ||
|
||
From your RADIANT_ROOT: | ||
|
||
<pre> | ||
$ script/extension install sitemap_search | ||
</pre> | ||
|
||
Restart your radiant app, and you should be good to go. | ||
|
||
h2. Usage | ||
|
||
See the Help doc. | ||
|
||
h2. To do | ||
|
||
* Include page fields, e.g. 'keywords' and 'description' | ||
|
||
h2. Acknowledgments | ||
|
||
Thanks to Digital Pulp for funding the initial development of this extension as part of the Redken.com project. | ||
Further support for generalization and release was provided by Con-way. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
begin | ||
require 'jeweler' | ||
Jeweler::Tasks.new do |gem| | ||
gem.name = "radiant-sitemap_search-extension" | ||
gem.summary = %Q{Sitemap Search Extension for Radiant CMS} | ||
gem.description = %Q{Adds search feature for pages, snippets, layouts, et al.} | ||
gem.email = "[email protected]" | ||
gem.homepage = "https://github.com/avonderluft/radiant-sitemap_search-extension" | ||
gem.authors = ['Andrew vonderLuft','Sean Cribbs'] | ||
gem.add_dependency 'radiant', ">=1.0.0" | ||
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings | ||
end | ||
rescue LoadError | ||
puts "Jeweler (or a dependency) not available. This is only required if you plan to package banner_rotator as a gem." | ||
end | ||
# I think this is the one that should be moved to the extension Rakefile template | ||
|
||
# In rails 1.2, plugins aren't available in the path until they're loaded. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class Admin::SearchController < ApplicationController | ||
def index | ||
if params[:q] | ||
@pages = Page.search(params[:q]) | ||
if current_user.designer? || current_user.admin? | ||
@snippets = Snippet.search(params[:q]) | ||
@layouts = Layout.search(params[:q]) | ||
@templates = Template.search(params[:q]) if defined?(TemplatesExtension) | ||
@banners = Banner.search(params[:q]) if defined?(BannerRotatorExtension) | ||
end | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
- @page_title = t('pages') + ' - ' + default_page_title | ||
|
||
.outset | ||
= render_region :top | ||
%table.index#pages{:summary=>t('page_hierarchy')} | ||
%thead | ||
%tr | ||
- render_region :sitemap_head do |sitemap_head| | ||
- sitemap_head.title_column_header do | ||
%th.name= t('page') | ||
- sitemap_head.status_column_header do | ||
%th.status= t('status') | ||
- sitemap_head.actions_column_header do | ||
%th.actions= t('modify') | ||
%tbody | ||
- if @homepage | ||
= render_node @homepage | ||
- else | ||
%tr | ||
%td.empty{:colspan => admin.page.index.node.length}= t('no_pages') | ||
= render_region :bottom | ||
|
||
#actions | ||
%ul | ||
- unless @homepage | ||
%li= link_to image('plus') + " " + t("new_homepage"), new_admin_page_path, :class => 'action_button' | ||
- else | ||
= render :partial => 'admin/search/search_action' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
- include_javascript 'admin/tablekit' | ||
- include_javascript 'admin/ruledtable' | ||
- @page_title = t('pages') + ' - ' + default_page_title | ||
|
||
.outset | ||
= render_region :top | ||
%table.index.sortable{:summary=>"Sortable list of pages"} | ||
%thead | ||
%tr | ||
- list_display_attributes.each do |att| | ||
%th{:class => attribute_header_class(att), :id => attribute_header_id(att) } | ||
%a | ||
%span.w1= att.humanize | ||
%tbody | ||
- if @pages.any? | ||
= render :partial => 'page', :collection => @pages | ||
- else | ||
%tr | ||
%td.empty{:colspan => list_display_attributes.length}= t('no_pages') | ||
#actions | ||
= pagination_for(@pages) | ||
%ul | ||
- unless @pages.any? | ||
%li= link_to image('plus') + " " + t("new_homepage"), new_admin_page_path, :class => 'action_button' | ||
= render :partial => 'admin/search/search_action' | ||
|
||
= render :partial => 'page_list_view_styles' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
%tr[banner] | ||
%td.preview | ||
%a{:href => edit_admin_banner_url(banner)} | ||
%img.snapshot{:src => banner.background_image, :alt => "#{banner.name} #{t('banner_rotator.banner')}", :title => "#{t('banner_rotator.edit')} #{banner.name} #{t('banner_rotator.banner')}"} | ||
%td.name= link_to banner.name, edit_admin_banner_url(banner) | ||
%td.status | ||
= banner.description if banner.description | ||
%td.status{:style=>"font-size:75%"} | ||
= banner.link_url if banner.link_url | ||
%td.status | ||
= banner.updated_at.strftime("%m/%d/%Y at %I:%M %p") if banner.updated_at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#actions | ||
= pagination_for(@banners) | ||
%ul | ||
%li= link_to image('plus') + " " + t('banner_rotator.new_banner'), new_admin_banner_url | ||
= render :partial => 'admin/search/search_action' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
%tr[layout] | ||
%td.name | ||
= image('layout', :alt => '') | ||
= link_to layout.name, edit_admin_layout_url(layout) | ||
%td.status | ||
= layout.updated_by.name if layout.updated_by | ||
%td.status | ||
= layout.updated_at.strftime("%m/%d/%Y at %I:%M %p") if layout.updated_at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#actions | ||
= pagination_for(@layouts) | ||
%ul | ||
%li= link_to image('plus') + " " + t('new_layout'), new_admin_layout_url, :class => 'action_button' | ||
= render :partial => 'admin/search/search_action' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.nav | ||
= link_to t('pages') + " (#{@pages.size})", '#pages' | ||
- if designer? | ||
• | ||
= link_to t('snippets') + " (#{@snippets.size})", '#snippets' | ||
• | ||
= link_to t('layouts') + " (#{@layouts.size})", '#layouts' | ||
- if defined?(TemplatesExtension) | ||
• | ||
= link_to t('templates') + " (#{@templates.size})", '#templates' | ||
- if defined?(BannerRotatorExtension) | ||
• | ||
= link_to t('banner_rotator.banners') + " (#{@banners.size})", '#banners' | ||
• | ||
= link_to 'Top', '#top' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
%li | ||
#site_search.action_button | ||
- form_for :site_search, :url => search_path, :html => { :class => 'button_form', :multipart => true } do |f| | ||
%span | ||
= f.label :site_search, image('search') | ||
= text_field_tag :q, params[:q], :title => t('sitemap_search.search_content'), :cols => "20" | ||
= f.submit t('sitemap_search.search_content') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
%tr[snippet] | ||
%td.name | ||
= image('snippet', :alt => '') | ||
= link_to snippet.name, edit_admin_snippet_url(snippet) | ||
%td.status | ||
= snippet.updated_by.name if snippet.updated_by | ||
%td.status | ||
= snippet.updated_at.strftime("%m/%d/%Y at %I:%M %p") if snippet.updated_at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#actions | ||
= pagination_for(@snippets) | ||
%ul | ||
%li= link_to image('plus') + " " + t('new_snippet'), new_admin_snippet_url, :class => 'action_button' | ||
= render :partial => 'admin/search/search_action' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
%tr[template] | ||
%td.name | ||
= image('template', :alt => '') | ||
= link_to template.name, edit_admin_template_url(template) | ||
%td.status | ||
= template.page_class_name if template.page_class_name | ||
%td.status | ||
= template.updated_at.strftime("%m/%d/%Y at %I:%M %p") if template.updated_at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#actions | ||
%ul | ||
%li= link_to image('plus') + " " + t('new_template'), new_admin_template_url | ||
= render :partial => 'admin/search/search_action' |
Oops, something went wrong.