Skip to content
This repository has been archived by the owner on Aug 15, 2018. It is now read-only.

Commit

Permalink
fixed a typo in some instructions in the menu entries plugin, I don't…
Browse files Browse the repository at this point in the history
… know what else.
  • Loading branch information
Josh Adams committed Nov 4, 2008
1 parent b26f8da commit 5e7cbca
Show file tree
Hide file tree
Showing 56 changed files with 3,653 additions and 27 deletions.
9 changes: 6 additions & 3 deletions app/views/admin/pages/edit.html.erb
@@ -1,4 +1,5 @@
<%= title "Edit Page: #{@page}" -%>
<% content_for :sidebar do -%>
<% form_remote_tag :url => admin_page_path(@page),
:update => 'main',
Expand All @@ -11,9 +12,7 @@
<%= render :partial => 'form' %>
<%= submit_tag 'Update', :class => 'submit' -%>
<% end -%>
<% end -%>

<% content_for :sidebar do -%>
<h2>Plugins on this page</h2>
<ul id="page_plugins" class='page_plugins'>
<% @page.page_plugins.each do |plugin| -%>
Expand All @@ -31,6 +30,10 @@
<% end %>
<% if @page.page_plugins.any? -%>
<% @page.page_plugins.each do |plugin| -%>
<%= render :partial => plugin.module_class.view_partial, :locals => { :plugin_module => plugin.module } -%>
<% if plugin.module_class.respond_to?(:admin_partial) -%>
<%= render :partial => plugin.module_class.admin_partial, :locals => { :plugin_module => plugin.module } -%>
<% else -%>
<%= render :partial => plugin.module_class.view_partial, :locals => { :plugin_module => plugin.module } -%>
<% end -%>
<% end -%>
<% end -%>
5 changes: 4 additions & 1 deletion app/views/admin/site_settings/edit.html.erb
@@ -1,7 +1,10 @@
<%= title "Choose a Theme" -%>
<% content_for :sidebar do -%>
<% if Admin::AnsuzThemesController -%>
<%= link_to "Install more themes", '/admin/ansuz_theme_installers', :class => 'button icon add' -%>
<% end -%>
<div class='note'>
Just click on a theme to set it as the active theme for the site. The currently-selected theme is highlighted. If you want to install more themes, and the ansuz_theme_installer plugin is installed, you should be able to just <a href='/admin/ansuz_theme_installers'>click this link</a>. We need a way for plugins to insert text into other plugins (rather, a standard way). That way I could only add the link if it were installed, or add a link to install it if it weren't.
Just click on a theme to set it as the active theme for the site. The currently-selected theme is highlighted.
</div>
<% end -%>
<ul class='grid'>
Expand Down
12 changes: 3 additions & 9 deletions app/views/layouts/admin.html.erb
Expand Up @@ -28,16 +28,10 @@
</head>
<body>
<%= display_standard_flashes -%>
<div id='toolbar'>
<%= render :partial => "/admin/tabs" %>
</div>
<div id='wrapper'>
<div id='header'>
<h1>
<span class='logo'></span>
<span>Ansuz CMS: Admin</span>
</h1>
</div>
<div id='toolbar'>
<%= render :partial => "/admin/tabs" %>
</div>
<div id='content'>
<div id="doc2" class="yui-t7">
<div id="bd">
Expand Down
14 changes: 12 additions & 2 deletions public/stylesheets/admin.css
Expand Up @@ -28,8 +28,8 @@ body{
background-color: #ddd;
text-align: left;
position: absolute;
top: 60px;
height: 23px;
top: 0;
height: 20px;
left: 0;
width: 100%;
}
Expand Down Expand Up @@ -60,6 +60,8 @@ body{
/* Tabs */
#hd {
width:100%;
height: 20px;
background: #bbb;
}

#hd ul {
Expand Down Expand Up @@ -234,6 +236,14 @@ a.button.icon.rss{
font-size: 100%;
}

.clickMenu li{
padding: 0 2px !important;
}

.clickMenu li a{
margin-right: 0 !important;
}

.clickMenu li.main{
font-size: 85%;
}
Expand Down
106 changes: 106 additions & 0 deletions vendor/gems/mislav-will_paginate-2.3.5/CHANGELOG.rdoc
@@ -0,0 +1,106 @@
== 2.3.5, released 2008-10-07

* update the backported named_scope implementation for Rails versions older than 2.1
* break out of scope of paginated_each() yielded block when used on named scopes
* fix paginate(:from)

== 2.3.4, released 2008-09-16

* Removed gem dependency to Active Support (causes trouble with vendored rails).
* Rails 2.1: fix a failing test and a deprecation warning.
* Cope with scoped :select when counting.

== 2.3.3, released 2008-08-29

* Ensure that paginate_by_sql doesn't change the original SQL query.
* RDoc love (now live at http://mislav.caboo.se/static/will_paginate/doc/)
* Rename :prev_label to :previous_label for consistency. old name still functions but is deprecated
* ActiveRecord 2.1: Remove :include option from count_all query when it's possible.

== 2.3.2, released 2008-05-16

* Fixed LinkRenderer#stringified_merge by removing "return" from iterator block
* Ensure that 'href' values in pagination links are escaped URLs

== 2.3.1, released 2008-05-04

* Fixed page numbers not showing with custom routes and implicit first page
* Try to use Hanna for documentation (falls back to default RDoc template if not)

== 2.3.0, released 2008-04-29

* Changed LinkRenderer to receive collection, options and reference to view template NOT in
constructor, but with the #prepare method. This is a step towards supporting passing of
LinkRenderer (or subclass) instances that may be preconfigured in some way
* LinkRenderer now has #page_link and #page_span methods for easier customization of output in
subclasses
* Changed page_entries_info() method to adjust its output according to humanized class name of
collection items. Override this with :entry_name parameter (singular).

page_entries_info(@posts)
#-> "Displaying all 12 posts"
page_entries_info(@posts, :entry_name => 'item')
#-> "Displaying all 12 items"

== 2.2.3, released 2008-04-26

* will_paginate gem is no longer published on RubyForge, but on
gems.github.com:

gem sources -a http://gems.github.com/ (you only need to do this once)
gem install mislav-will_paginate

* extract reusable pagination testing stuff into WillPaginate::View
* rethink the page URL construction mechanizm to be more bulletproof when
combined with custom routing for page parameter
* test that anchor parameter can be used in pagination links

== 2.2.2, released 2008-04-21

* Add support for page parameter in custom routes like "/foo/page/2"
* Change output of "page_entries_info" on single-page collection and erraneous
output with empty collection as reported by Tim Chater

== 2.2.1, released 2008-04-08

* take less risky path when monkeypatching named_scope; fix that it no longer
requires ActiveRecord::VERSION
* use strings in "respond_to?" calls to work around a bug in acts_as_ferret
stable (ugh)
* add rake release task


== 2.2.0, released 2008-04-07

=== API changes
* Rename WillPaginate::Collection#page_count to "total_pages" for consistency.
If you implemented this interface, change your implementation accordingly.
* Remove old, deprecated style of calling Array#paginate as "paginate(page,
per_page)". If you want to specify :page, :per_page or :total_entries, use a
parameter hash.
* Rename LinkRenderer#url_options to "url_for" and drastically optimize it

=== View changes
* Added "prev_page" and "next_page" CSS classes on previous/next page buttons
* Add examples of pagination links styling in "examples/index.html"
* Change gap in pagination links from "..." to
"<span class="gap">&hellip;</span>".
* Add "paginated_section", a block helper that renders pagination both above and
below content in the block
* Add rel="prev|next|start" to page links

=== Other

* Add ability to opt-in for Rails 2.1 feature "named_scope" by calling
WillPaginate.enable_named_scope (tested in Rails 1.2.6 and 2.0.2)
* Support complex page parameters like "developers[page]"
* Move Array#paginate definition to will_paginate/array.rb. You can now easily
use pagination on arrays outside of Rails:

gem 'will_paginate'
require 'will_paginate/array'

* Add "paginated_each" method for iterating through every record by loading only
one page of records at the time
* Rails 2: Rescue from WillPaginate::InvalidPage error with 404 Not Found by
default
18 changes: 18 additions & 0 deletions vendor/gems/mislav-will_paginate-2.3.5/LICENSE
@@ -0,0 +1,18 @@
Copyright (c) 2007 PJ Hyett and Mislav Marohnić

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
107 changes: 107 additions & 0 deletions vendor/gems/mislav-will_paginate-2.3.5/README.rdoc
@@ -0,0 +1,107 @@
= WillPaginate

Pagination is just limiting the number of records displayed. Why should you let
it get in your way while developing, then? This plugin makes magic happen. Did
you ever want to be able to do just this on a model:

Post.paginate :page => 1, :order => 'created_at DESC'

... and then render the page links with a single view helper? Well, now you
can.

Some resources to get you started:

* {Installation instructions}[http://github.com/mislav/will_paginate/wikis/installation]
on {the wiki}[http://github.com/mislav/will_paginate/wikis]
* Your mind reels with questions? Join our
{Google group}[http://groups.google.com/group/will_paginate].
* {How to report bugs}[http://github.com/mislav/will_paginate/wikis/report-bugs]


== Example usage

Use a paginate finder in the controller:

@posts = Post.paginate_by_board_id @board.id, :page => params[:page], :order => 'updated_at DESC'

Yeah, +paginate+ works just like +find+ -- it just doesn't fetch all the
records. Don't forget to tell it which page you want, or it will complain!
Read more on WillPaginate::Finder::ClassMethods.

Render the posts in your view like you would normally do. When you need to render
pagination, just stick this in:

<%= will_paginate @posts %>

You're done. (You can find the option list at WillPaginate::ViewHelpers.)

How does it know how much items to fetch per page? It asks your model by calling
its <tt>per_page</tt> class method. You can define it like this:

class Post < ActiveRecord::Base
cattr_reader :per_page
@@per_page = 50
end

... or like this:

class Post < ActiveRecord::Base
def self.per_page
50
end
end

... or don't worry about it at all. WillPaginate defines it to be <b>30</b> by default.
But you can always specify the count explicitly when calling +paginate+:

@posts = Post.paginate :page => params[:page], :per_page => 50

The +paginate+ finder wraps the original finder and returns your resultset that now has
some new properties. You can use the collection as you would with any ActiveRecord
resultset. WillPaginate view helpers also need that object to be able to render pagination:

<ol>
<% for post in @posts -%>
<li>Render `post` in some nice way.</li>
<% end -%>
</ol>

<p>Now let's render us some pagination!</p>
<%= will_paginate @posts %>

More detailed documentation:

* WillPaginate::Finder::ClassMethods for pagination on your models;
* WillPaginate::ViewHelpers for your views.


== Authors and credits

Authors:: Mislav Marohnić, PJ Hyett
Original announcement:: http://errtheblog.com/post/929
Original PHP source:: http://www.strangerstudios.com/sandbox/pagination/diggstyle.php

All these people helped making will_paginate what it is now with their code
contributions or just simply awesome ideas:

Chris Wanstrath, Dr. Nic Williams, K. Adam Christensen, Mike Garey, Bence
Golda, Matt Aimonetti, Charles Brian Quinn, Desi McAdam, James Coglan, Matijs
van Zuijlen, Maria, Brendan Ribera, Todd Willey, Bryan Helmkamp, Jan Berkel,
Lourens Naudé, Rick Olson, Russell Norris, Piotr Usewicz, Chris Eppstein,
Denis Barushev, Ben Pickles.


== Usable pagination in the UI

There are some CSS styles to get you started in the "examples/" directory. They
are {showcased online here}[http://mislav.caboo.se/static/will_paginate/].

More reading about pagination as design pattern:

* {Pagination 101}[http://kurafire.net/log/archive/2007/06/22/pagination-101]
* {Pagination gallery}[http://www.smashingmagazine.com/2007/11/16/pagination-gallery-examples-and-good-practices/]
* {Pagination on Yahoo Design Pattern Library}[http://developer.yahoo.com/ypatterns/parent.php?pattern=pagination]

Want to discuss, request features, ask questions? Join the
{Google group}[http://groups.google.com/group/will_paginate].

62 changes: 62 additions & 0 deletions vendor/gems/mislav-will_paginate-2.3.5/Rakefile
@@ -0,0 +1,62 @@
require 'rubygems'
begin
hanna_dir = '/Users/mislav/Projects/Hanna/lib'
$:.unshift hanna_dir if File.exists? hanna_dir
require 'hanna/rdoctask'
rescue LoadError
require 'rake'
require 'rake/rdoctask'
end
load 'test/tasks.rake'

desc 'Default: run unit tests.'
task :default => :test

desc 'Generate RDoc documentation for the will_paginate plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_files.include('README.rdoc', 'LICENSE', 'CHANGELOG.rdoc').
include('lib/**/*.rb').
exclude('lib/will_paginate/named_scope*').
exclude('lib/will_paginate/array.rb').
exclude('lib/will_paginate/version.rb')

rdoc.main = "README.rdoc" # page to start on
rdoc.title = "will_paginate documentation"

rdoc.rdoc_dir = 'doc' # rdoc output folder
rdoc.options << '--inline-source' << '--charset=UTF-8'
rdoc.options << '--webcvs=http://github.com/mislav/will_paginate/tree/master/'
end

desc %{Update ".manifest" with the latest list of project filenames. Respect\
.gitignore by excluding everything that git ignores. Update `files` and\
`test_files` arrays in "*.gemspec" file if it's present.}
task :manifest do
list = Dir['**/*'].sort
spec_file = Dir['*.gemspec'].first
list -= [spec_file] if spec_file

File.read('.gitignore').each_line do |glob|
glob = glob.chomp.sub(/^\//, '')
list -= Dir[glob]
list -= Dir["#{glob}/**/*"] if File.directory?(glob) and !File.symlink?(glob)
puts "excluding #{glob}"
end

if spec_file
spec = File.read spec_file
spec.gsub! /^(\s* s.(test_)?files \s* = \s* )( \[ [^\]]* \] | %w\( [^)]* \) )/mx do
assignment = $1
bunch = $2 ? list.grep(/^test\//) : list
'%s%%w(%s)' % [assignment, bunch.join(' ')]
end

File.open(spec_file, 'w') {|f| f << spec }
end
File.open('.manifest', 'w') {|f| f << list.join("\n") }
end

task :examples do
%x(haml examples/index.haml examples/index.html)
%x(sass examples/pagination.sass examples/pagination.css)
end
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5e7cbca

Please sign in to comment.