Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/leikind/wice_grid in…
Browse files Browse the repository at this point in the history
…to development

Conflicts:
	CHANGELOG.md
	README.md
	SAVED_QUERIES_HOWTO.md
  • Loading branch information
ryanfox1985 committed Jul 15, 2015
2 parents 9fa3452 + 926b5be commit 4cef2d6
Show file tree
Hide file tree
Showing 53 changed files with 290 additions and 310 deletions.
39 changes: 38 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,41 @@
# 3.4.10
# 3.5.0

New features:

* In addition to two icons "SET ALL" and "UNSET ALL" in the action column, there is now
an option to use a standard HTML checkbox. This is now the default.
* Support for Bootstrap Datepicker. A suggested way to use Bootstrap Datepicker in a Rails app
is https://github.com/Nerian/bootstrap-datepicker-rails. Configuration variable HELPER_STYLE
sets the default flavor of date pickers. Can also be set per grid with helper_style: :bootstrap
* :calendar jQuery UI datepicker
* :bootstrap Bootstrap datepicker
* :standard
* Italian locale
* Spanish locale
* various fixes
* Configuration variable ALLOW_SHOWING_ALL_QUERIES renamed to ALLOW_SHOWING_ALL_RECORDS



# 3.4.14

Wice::Defaults::HIDE_ALL_LINK_FROM is nil by default

# 3.4.13

New configuration variable Wice::Defaults::HIDE_ALL_LINK_FROM! When set and the total
number of row exceeds its value, the "SHOW ALL" link disappears.

# 3.4.12

fixes

# 3.4.11

started adding HTML5 datepicker
changed how relations are detected so that it can work with relation proxies (aka octopus)

# 3.4.10

bug fixes
better support for :group
Expand Down
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,19 @@ Here is `application.js` if [Bootstrap Datepicker](https://github.com/Nerian/boo
//= require bootstrap-datepicker
//= require_tree .
```

WiceGrid provides some very basic styles, not specifying exactly how the table should look like, but if
Require WiceGrid CSS in your `application.scss`:
```
@import "wice_grid";
```
This will provide very basic styles, not specifying exactly how the table should look like, but if
the application uses Twitter Bootstrap, the markup generated by WiceGrid will have correct classes and
will fit nicely. Generally it is advised to modify WiceGrid css to match the application style.
will fit nicely.

WiceGrid uses icons from [Font Awesome](http://fortawesome.github.io/Font-Awesome/)

Should you decide to write you own styles for WiceGrid, the suggested way is to copy wice_grid.scss
from the plugin into `app/assets/stylesheets`, rename it to avoid loading name clashes, and replace
`@import "wice_grid";` by a directive to load your own SASS file.


## Basics
Expand Down Expand Up @@ -709,7 +718,7 @@ WiceGrid provides four ways of selecting dates and times. The default style is s
`config/initializers/wice_grid_config.rb` using the HELPER_STYLE constant. The available options are

* `:calendar` (jQuery UI datepicker),
* `:bootstrap` [Bootstrap Datepicker](https://github.com/Nerian/bootstrap-datepicker-rails),
* `:bootstrap` [Bootstrap datepicker](https://github.com/Nerian/bootstrap-datepicker-rails),
* `:standard`.

The style can also be individually configured via the `helper_style` option on a Date/DateTime
Expand Down Expand Up @@ -1335,18 +1344,13 @@ only under certain circumstances:
end
```


## Icons

Icons used by the plugin are courtesy of Mark James, the creator of [the SILK icon set](http://www.famfamfam.com/lab/icons/silk/).

## Bug reports

The author of the plugins welcomes any contribution.
Please follow [these guidelines](https://github.com/leikind/wice_grid/wiki/How-to-submit-a-bug-report-or-a-question) when submitting a bug report.

## Changelog
{file:CHANGELOG.md}
See the file {file:CHANGELOG.md}.

## License
{file:MIT-LICENSE}
See the file {file:MIT-LICENSE}.
6 changes: 3 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ require 'rdoc/task'
require 'yard'
require 'yard/rake/yardoc_task'

task default: :doc
task default: :rdoc

desc 'Generate documentation for the wice_grid plugin.'
YARD::Rake::YardocTask.new(:doc) do |t|
YARD::Rake::YardocTask.new(:rdoc) do |t|
OTHER_PATHS = %w()

t.files = ['lib/**/*.rb', OTHER_PATHS]
t.options = %w(--main=README.md --file CHANGELOG.md,SAVED_QUERIES_HOWTO.md,MIT-LICENSE)
t.options = %w(--main=README.md --file TODO.md,CHANGELOG.md,SAVED_QUERIES_HOWTO.md,MIT-LICENSE)
t.stats_options = ['--list-undoc']
end
26 changes: 13 additions & 13 deletions SAVED_QUERIES_HOWTO.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ It is also possible to initialize a grid with an initial saved query providing t
itself to parameter `saved_query`:
```
@products_grid = initialize_grid(Product,
:name => 'prod_grid',
:saved_query => SavedQuery.find_by_id_and_grid_name(12, 'prod_grid') )
name: 'prod_grid',
saved_query: SavedQuery.find_by_id_and_grid_name(12, 'prod_grid') )
```

## Adding Application Specific Logic to Saving/Restoring Queries
Expand All @@ -61,14 +61,14 @@ After renaming the model to SavedQuery it looks like this:
class SavedQuery < ActiveRecord::Base #:nodoc:
serialize :query
validates_uniqueness_of :name, :scope => :grid_name, :on => :create,
:message => 'A query with this name already exists'
validates_uniqueness_of :name, scope: :grid_name, on: :create,
message: 'A query with this name already exists'
validates_presence_of :name, :message => 'Please submit the name of the custom query'
validates_presence_of :name, message: 'Please submit the name of the custom query'
def self.list(name, controller)
conditions = {:grid_name => name}
self.find(:all, :conditions => conditions)
conditions = {grid_name: name}
self.find(:all, conditions: conditions)
end
end
```
Expand All @@ -80,19 +80,19 @@ store queries for each user, we could add +user_id+ to the table and modify the
class SavedQuery < ActiveRecord::Base
serialize :query
validates_uniqueness_of :name, :scope => :grid_name, :on => :create,
:message => 'A query with this name already exists'
validates_uniqueness_of :name, scope: :grid_name, on: :create,
message: 'A query with this name already exists'
validates_presence_of :name, :message => 'Please submit the name of the custom query'
validates_presence_of :name, message: 'Please submit the name of the custom query'
belongs_to :identity # !
def self.list(name, controller)
conditions = {:grid_name => name}
conditions = {grid_name: name}
if controller.current_user # !
conditions[:user_id] = controller.current_user.id # provided that method current_user is defined in ApplicationController and returns the currrent user.
end
self.find(:all, :conditions => conditions)
self.find(:all, conditions: conditions)
end
end
```
Expand All @@ -101,7 +101,7 @@ The following step is to make sure that a new query is saved with the correct +u
`saved_queries_panel(@grid_object)` to the following:

```
<%= saved_queries_panel(@identities_grid, :extra_parameters => {:user_id => @current_user.id}) %>
<%= saved_queries_panel(@identities_grid, extra_parameters: {user_id: @current_user.id}) %>
```
For every key in has :extra_parameters there must exist a field in the model - this hash will be used as a parameter to
`attributes=` method of the query object.
Expand Down
13 changes: 13 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
* Replace all icons by Font Awesome, remove the icons
* Switching between datepickers should be done via :filter_type, not via :helper_style.
Get rid of :helper_style and Wice::Defaults::HELPER_STYLE
* More unified and flexible approach to datepickers
* Fix datepickers when used with Datetime columns
* Implement paging in the app, get rid of Kaminari
* Joined tables: Instead of
model: 'ModelClassName'
use
association: :comments
* better tests (https://github.com/leikind/wice_grid_testbed)
* review css class names in the generated markup
* throw away saved queries?
2 changes: 1 addition & 1 deletion app/views/kaminari/wice_grid/_next_page.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<li><%= link_to_unless current_page.last?, ::Wice::NlMessage['next_label'], url, :rel => 'next', :remote => remote %></li>
<li><%= link_to_unless current_page.last?, ::Wice::NlMessage['next_label'], url, rel: 'next', remote: remote %></li>
2 changes: 1 addition & 1 deletion app/views/kaminari/wice_grid/_page.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<li <%if page.current?%>class="active"<%end%>><%= link_to page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %></li>
<li <%if page.current?%>class="active"<%end%>><%= link_to page, url, {remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil} %></li>
2 changes: 1 addition & 1 deletion app/views/kaminari/wice_grid/_prev_page.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<li><%= link_to_unless current_page.first?, ::Wice::NlMessage['previous_label'], url, :rel => 'prev', :remote => remote %></li>
<li><%= link_to_unless current_page.first?, ::Wice::NlMessage['previous_label'], url, rel: 'prev', remote: remote %></li>
3 changes: 0 additions & 3 deletions lib/generators/wice_grid/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ def copy_stuff #:nodoc:
template 'wice_grid_config.rb', 'config/initializers/wice_grid_config.rb'

copy_file 'wice_grid.yml', 'config/locales/wice_grid.yml'

copy_file 'wice_grid.scss', 'app/assets/stylesheets/wice_grid.scss'

end
end
end
Expand Down
140 changes: 0 additions & 140 deletions lib/generators/wice_grid/templates/wice_grid.scss

This file was deleted.

6 changes: 0 additions & 6 deletions lib/generators/wice_grid/templates/wice_grid_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,6 @@
end
}

# Icon to popup the calendar.
Wice::Defaults::CALENDAR_ICON = "/assets/icons/grid/calendar_view_month.png"

# popup calendar will be shown relative to the popup trigger element or to the mouse pointer
Wice::Defaults::POPUP_PLACEMENT_STRATEGY = :trigger # :pointer

# The name of the page method (should correspond to Kaminari.config.page_method_name)
Wice::Defaults::PAGE_METHOD_NAME = :page
end
1 change: 0 additions & 1 deletion lib/wice/active_record_column_wrapper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: UTF-8
module Wice

# to be mixed in into ActiveRecord::ConnectionAdapters::Column
Expand Down
1 change: 0 additions & 1 deletion lib/wice/columns.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: UTF-8
module Wice #:nodoc:

module Columns #:nodoc:
Expand Down
Loading

0 comments on commit 4cef2d6

Please sign in to comment.