merb-words 0.3.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'merb-core/tasks/merb'
6
6
  spec = Gem::Specification.new do |s|
7
7
  s.add_dependency('merb-slices', '~> 1.0.0')
8
8
  s.add_dependency('merb_datamapper', '~> 1.0.0')
9
- s.add_dependency('merb-ui', '>= 0.3')
9
+ s.add_dependency('merb-ui', '>= 0.4')
10
10
  s.author = 'UiPoet'
11
11
  s.email = 'dont.tase@me.com'
12
12
  s.files = FileList['app/**/*', 'lib/**/*', '[A-Z]*'].to_a
@@ -15,7 +15,7 @@ spec = Gem::Specification.new do |s|
15
15
  s.name = 'merb-words'
16
16
  s.rubyforge_project = 'uipoet'
17
17
  s.summary = 'Word Management for Merb'
18
- s.version = '0.3.3'
18
+ s.version = '0.4'
19
19
  end
20
20
 
21
21
  Rake::GemPackageTask.new(spec) do |pkg|
@@ -16,15 +16,15 @@ class MerbWords::Pages < MerbWords::Application
16
16
  else
17
17
  filters[:order] = [@order_property.intern.desc]
18
18
  end
19
- if search = params[:search] and !search.blank?
20
- search = CGI.escape(search).to_a
21
- if searches = session[:mui_searches]
22
- session[:mui_searches] = searches | search
19
+ if params[:q]
20
+ query = CGI.escape(params[:q])
21
+ if queries = session[:merb_words_queries]
22
+ session[:merb_words_queries] = queries | query.to_a
23
23
  else
24
- session[:mui_searches] = search
24
+ session[:merb_words_queries] = query.to_a
25
25
  end
26
- pages_title = Page.all(:title.like => "%#{search}%")
27
- pages_body = Page.all(:body.like => "%#{search}%")
26
+ pages_title = Page.all(:title.like => "%#{query}%")
27
+ pages_body = Page.all(:body.like => "%#{query}%")
28
28
  @pages = pages_title | pages_body
29
29
  elsif @category_id = params[:category_id]
30
30
  @pages = Category.get!(@category_id).pages(filters)
@@ -103,9 +103,13 @@ class MerbWords::Pages < MerbWords::Application
103
103
  redirect(slice_url(:index))
104
104
  end
105
105
 
106
- def search_delete
107
- session[:mui_searches] = session[:mui_searches] - params[:search].to_a
108
- redirect(slice_url(:index))
106
+ def query_delete
107
+ if(session[:merb_words_queries] and params[:query])
108
+ queries = session[:merb_words_queries]
109
+ query = params[:query].to_a
110
+ session[:merb_words_queries] = queries - query
111
+ redirect(slice_url(:index))
112
+ end
109
113
  end
110
114
 
111
115
  end
@@ -34,9 +34,9 @@ module Merb::MerbWords::ApplicationHelper
34
34
 
35
35
  def merb_words_password_status
36
36
  if merb_words_password?
37
- update = mui_button(:title => 'Update', :url => slice_url(:password_update), :window => 'open')
38
- exit = mui_button(:title => 'Exit', :url => slice_url(:password_exit))
39
- mui_block(:type => 'status'){%{Password: #{update} #{exit}}}
37
+ update_button = mui_button(:title => 'Update Password', :title_size => '0.75em', :url => slice_url(:password_update), :window => 'open')
38
+ exit_button = mui_button(:title => 'Exit', :title_size => '0.75em', :tone => 'positive', :url => slice_url(:password_exit))
39
+ mui_status{"#{update_button} #{exit_button}"}
40
40
  end
41
41
  end
42
42
 
@@ -9,7 +9,7 @@
9
9
  <% end =%>
10
10
  <% if merb_words_password? %>
11
11
  <%= mui_cell(:align => 'right', :valign => 'bottom') do %>
12
- <%= mui_button(:title => 'Create', :url => slice_url(:category_create), :window => 'open') %>
12
+ <%= mui_button(:title => 'Create', :title_size => '0.75em', :url => slice_url(:category_create), :window => 'open') %>
13
13
  <% end =%>
14
14
  <% end %>
15
15
  <% end =%>
@@ -32,8 +32,8 @@
32
32
  <% if merb_words_password? %>
33
33
  <%= mui_cell(:align => 'right', :wrap => false) do %>
34
34
  &nbsp;
35
- <%= mui_button(:title => 'Update', :url => slice_url(:category_update, :category_id => category.id), :window => 'open') %>
36
- <%= mui_button(:title => '&#215;', :tone => 'negative', :url => slice_url(:category_delete, :category_id => category.id), :window => 'open') %>
35
+ <%= mui_button(:title => 'Update', :title_size => '0.75em', :url => slice_url(:category_update, :category_id => category.id), :window => 'open') %>
36
+ <%= mui_button(:title => '&#215;', :title_size => '0.75em', :tone => 'negative', :url => slice_url(:category_delete, :category_id => category.id), :window => 'open') %>
37
37
  <% end =%>
38
38
  <% end %>
39
39
  <% end =%>
@@ -1,4 +1,3 @@
1
- <%= mui_divider %>
2
1
  <%= mui_block(:title => 'Sort by', :title_size => '1em') %>
3
2
  <% orders.each do |order| %>
4
3
  <div>
@@ -15,8 +15,8 @@
15
15
  <% if page.publish == false %>
16
16
  <i>unpublished</i>&nbsp;
17
17
  <% end %>
18
- <%= mui_button(:title => 'Update', :url => slice_url(:update, :page_id => page.id), :window => 'open') %>
19
- <%= mui_button(:title => '&#215;', :tone => 'negative', :url => slice_url(:delete, :page_id => page.id), :window => 'open') %>
18
+ <%= mui_button(:title => 'Update', :title_size => '0.75em', :url => slice_url(:update, :page_id => page.id), :window => 'open') %>
19
+ <%= mui_button(:title => '&#215;', :title_size => '0.75em', :tone => 'negative', :url => slice_url(:delete, :page_id => page.id), :window => 'open') %>
20
20
  <% end =%>
21
21
  <% end =%>
22
22
  <% end %>
@@ -1,21 +1,17 @@
1
- <%
2
- attributes = {}
3
- attributes[:order_property] = params[:order_property]
4
- %>
5
- <%= mui_block do %>
6
- <%= mui_search(:action => slice_url(:index, attributes), :width => '10em') %>
7
- <% end =%>
8
- <% if searches = session[:mui_searches] %>
9
- <% searches.each do |search| %>
10
- <% attributes[:search] = CGI.unescape(search) %>
1
+ <% if queries = session[:merb_words_queries] and !queries.blank? %>
2
+ <%= mui_block(:title => 'Searches', :title_size => '1em') %>
3
+ <% attributes = {} %>
4
+ <% queries.each do |q| %>
5
+ <% attributes[:q] = CGI.unescape(q) %>
11
6
  <%= mui_grid(:columns => 2, :width => '100%') do %>
12
7
  <%= mui_cell do %>
13
- <%= mui_link(:title => CGI.unescape(search), :title_size => '0.85em', :url => slice_url(:index, attributes)) %>
8
+ <%= mui_link(:title => CGI.unescape(q), :title_size => '0.85em', :url => slice_url(:index, attributes)) %>
14
9
  <% end =%>
15
10
  <%= mui_cell(:align => 'right', :wrap => false) do %>
16
11
  &nbsp;
17
- <%= mui_button(:title => '&#215;', :tone => 'negative', :url => slice_url(:search_delete, :search => search)) %>
12
+ <%= mui_button(:title => '&#215;', :title_size => '0.75em', :tone => 'negative', :url => slice_url(:query_delete, :query => q)) %>
18
13
  <% end =%>
19
14
  <% end =%>
20
15
  <% end %>
16
+ <%= mui_divider %>
21
17
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <%= merb_words_password_status %>
2
- <%= mui_grid(:columns => 2, :width => '100%') do %>
2
+ <%= mui_grid(:cell_valign => 'top', :columns => 2, :width => '100%') do %>
3
3
  <%= mui_cell(:width => '75%') do %>
4
4
  <%= mui_grid(:cell_valign => 'bottom', :columns => 2) do %>
5
5
  <%= mui_cell(:width => '100%') do %>
@@ -25,7 +25,7 @@
25
25
  <% end %>
26
26
  <% end =%>
27
27
  <%= mui_cell(:width => '25%') do %>
28
- <%= mui_block(:type => 'tray') do %>
28
+ <%= mui_tray do %>
29
29
  <%= partial(:search, :searches => @searches) if @pages %>
30
30
  <%= partial(:order, :orders => @orders, :order_property => @order_property) if @orders %>
31
31
  <%= partial(:category, :categories => @categories, :category_id => @category_id) %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: merb-words
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: "0.4"
5
5
  platform: ruby
6
6
  authors:
7
7
  - UiPoet
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-13 00:00:00 -08:00
12
+ date: 2008-12-15 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: "0.3"
43
+ version: "0.4"
44
44
  version:
45
45
  description:
46
46
  email: dont.tase@me.com