listalicious 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +10 -24
- data/VERSION +1 -1
- data/lib/listalicious.rb +1 -1
- data/listalicious.gemspec +2 -2
- metadata +2 -2
data/README.textile
CHANGED
@@ -36,15 +36,17 @@ I wrote a DSL that met those requirements:
|
|
36
36
|
<% end %>
|
37
37
|
</pre>
|
38
38
|
|
39
|
-
I liked this, but could it be reduced further if the use case allowed? I came up with the following (which outlines the different ways you can pass args)
|
39
|
+
I liked this, but could it be reduced further if the use case allowed? I came up with the following with help from a co-worker (which outlines the different ways you can pass args)
|
40
40
|
|
41
41
|
<pre>
|
42
42
|
<% semantic_list_for @users, :as => :user do |l| %>
|
43
43
|
<%= l.columns [:head, :body] do |user, index| %>
|
44
|
-
<%= l.column :login, :
|
44
|
+
<%= l.column :login, :width => '20%' %>
|
45
45
|
<%= l.column "#{user.first_name} #{user.last_name}", :title => 'Name' %>
|
46
|
-
<%= l.column :email, { link_to user.email, "mailto:#{user.email}" } %>
|
47
|
-
<%= l.controls
|
46
|
+
<%= l.column :email, proc { link_to user.email, "mailto:#{user.email}" } %>
|
47
|
+
<%= l.controls do %>
|
48
|
+
<%= link_to('edit', edit_user_path(user)) %>
|
49
|
+
<% end %>
|
48
50
|
<% end %>
|
49
51
|
<% end %>
|
50
52
|
</pre>
|
@@ -69,7 +71,7 @@ Then install the listalicious gem:
|
|
69
71
|
|
70
72
|
h2. Usage
|
71
73
|
|
72
|
-
Listalicious works fine as a simple view helper, but it also handles ordering of the lists as well. To add ordering to any list just use the
|
74
|
+
Listalicious works fine as a simple view helper, but it also handles ordering of the lists as well. To add ordering to any list just use the ordered_from named scope with your find method. You can also specify fields that are allowed to be ordered in your model by using the orderable_fields method.
|
73
75
|
|
74
76
|
h3. Controllers
|
75
77
|
|
@@ -92,7 +94,7 @@ h3. Models
|
|
92
94
|
</pre>
|
93
95
|
|
94
96
|
h3. Views (I prefer HAML, so no ERB examples, but it should work with ERB fine as well)
|
95
|
-
|
97
|
+
|
96
98
|
It's important to note that all the methods take blocks or content strings. For instance, look at the extra and controls methods in the simple usage example.
|
97
99
|
|
98
100
|
*Simple Usage*
|
@@ -156,7 +158,7 @@ It's important to note that all the methods take blocks or content strings. For
|
|
156
158
|
<table class="semantic-list" id="user_list">
|
157
159
|
<thead>
|
158
160
|
<tr class="header">
|
159
|
-
<th width="20%"><a class="
|
161
|
+
<th width="20%"><a class="ascending" href="?!sort_query!">Name</a></th>
|
160
162
|
<th>Email Address</th>
|
161
163
|
</tr>
|
162
164
|
</thead>
|
@@ -188,28 +190,12 @@ It's important to note that all the methods take blocks or content strings. For
|
|
188
190
|
- semantic_list_for @users, :as => :user, :group_by => :login do |l|
|
189
191
|
</pre>
|
190
192
|
|
191
|
-
*Sorting* -- Sorting requires javascript. It's part of the javascript code that comes with Listalicious and requires Prototype.js. If you want to add sorting to the list, just provide a url for a sort action and it will put that into the HTML5 data-sorturl attribute. You can use your own javascript if you would like.
|
193
|
+
*Sorting* -- Sorting requires javascript. It's part of the javascript code that comes with Listalicious and requires Prototype.js. If you want to add sorting to the list, just provide a url for a sort action and it will put that into the HTML5 data-sorturl attribute. You can use your own javascript if you would like. This feature is incomplete.
|
192
194
|
|
193
195
|
<pre>
|
194
196
|
- semantic_list_for @users, :as => :user, :sort_url => { :action => 'sort' } do |l|
|
195
197
|
</pre>
|
196
198
|
|
197
|
-
*Additional JS Functionality* -- There a few functions that are javascript specific. You can add any additional functionality this way as well since we're using unobtrusive JS to get the following features accomplished.
|
198
|
-
|
199
|
-
You can make the list multi-selectable. There isn't any pre-bundled functionality to do actions on the selected items, but you can fetch the list of selected items by using JS.
|
200
|
-
|
201
|
-
TODO: Document usage here
|
202
|
-
|
203
|
-
<pre>
|
204
|
-
- semantic_list_for @users, :as => :user, :selectable => true do |l|
|
205
|
-
</pre>
|
206
|
-
|
207
|
-
You can make the "extra" information rows expandable. If you add this, the extra rows won't show unless the row they belong to is highlighted.
|
208
|
-
|
209
|
-
<pre>
|
210
|
-
- semantic_list_for @users, :as => :user, :expandable => true do |l|
|
211
|
-
</pre>
|
212
|
-
|
213
199
|
h3. UL / OL Datagrids
|
214
200
|
|
215
201
|
The nature of doing a UL / OL based datagrid requires a certain level of CSS, and I haven't had time or reason to provide that level yet. When I finish up this project and include the JS and CSS needed for it (in a generator) I may add a builder for this, but there isn't plans for one currently.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.2
|
data/lib/listalicious.rb
CHANGED
@@ -30,7 +30,7 @@ module Listalicious #:nodoc:
|
|
30
30
|
options[:html][:class] = add_class(options[:html][:class], 'selectable') if options[:selectable]
|
31
31
|
options[:html][:class] = add_class(options[:html][:class], 'expandable') if options[:expandable]
|
32
32
|
|
33
|
-
builder = options[:builder] ||
|
33
|
+
builder = options[:builder] || @@builder
|
34
34
|
builder.new(@template, collection, options, &proc)
|
35
35
|
end
|
36
36
|
|
data/listalicious.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{listalicious}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jeremy Jackson"]
|
12
|
-
s.date = %q{2010-03-
|
12
|
+
s.date = %q{2010-03-08}
|
13
13
|
s.description = %q{Semantic listing; a semantic way to build datagrid structures in Rails.}
|
14
14
|
s.email = %q{jejacks0n@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: listalicious
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Jackson
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-03-
|
12
|
+
date: 2010-03-08 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|