merb-words 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/app/controllers/pages.rb +3 -3
- data/app/controllers/passwords.rb +1 -1
- data/app/helpers/application_helper.rb +1 -13
- data/app/views/pages/_category.html.erb +2 -2
- data/app/views/pages/_page.html.erb +1 -1
- data/app/views/pages/index.html.erb +1 -2
- data/app/views/pages/read.html.erb +1 -2
- metadata +2 -2
data/Rakefile
CHANGED
data/app/controllers/pages.rb
CHANGED
@@ -3,13 +3,13 @@ require 'cgi'
|
|
3
3
|
class MerbWords::Pages < MerbWords::Application
|
4
4
|
|
5
5
|
before(:mui_window_referer, :only => [:create, :update, :delete])
|
6
|
-
before(:merb_words_password_redirect, :exclude => [:index, :feed, :read], :unless => :
|
6
|
+
before(:merb_words_password_redirect, :exclude => [:index, :feed, :read], :unless => :mui_password?)
|
7
7
|
before(:merb_words_orders, :only => [:index])
|
8
8
|
|
9
9
|
def index
|
10
10
|
if Page
|
11
11
|
filters = {}
|
12
|
-
filters[:publish] = true unless
|
12
|
+
filters[:publish] = true unless mui_password?
|
13
13
|
@order_property = params[:order_property] || MerbWords[:order] || 'created_at'
|
14
14
|
if @order_property == 'title'
|
15
15
|
filters[:order] = [@order_property.intern.asc]
|
@@ -35,7 +35,7 @@ class MerbWords::Pages < MerbWords::Application
|
|
35
35
|
@orders = Order.all
|
36
36
|
display @pages
|
37
37
|
else
|
38
|
-
session[:mui_message] = url(:merb_ui_message, :title => 'Create the first page') if
|
38
|
+
session[:mui_message] = url(:merb_ui_message, :title => 'Create the first page') if mui_password?
|
39
39
|
session[:mui_window] = slice_url(:create)
|
40
40
|
render
|
41
41
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class MerbWords::Passwords < MerbWords::Application
|
2
2
|
|
3
3
|
before(:mui_window_referer, :only => [:exit, :create, :read, :update, :delete])
|
4
|
-
before(:merb_words_password_redirect, :exclude => [:exit, :create, :read], :unless => :
|
4
|
+
before(:merb_words_password_redirect, :exclude => [:exit, :create, :read], :unless => :mui_password?)
|
5
5
|
|
6
6
|
def exit
|
7
7
|
session.delete(:mui_password_id)
|
@@ -20,26 +20,14 @@ module Merb::MerbWords::ApplicationHelper
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
def merb_words_password?
|
24
|
-
session[:mui_password_id] ? true : false
|
25
|
-
end
|
26
|
-
|
27
23
|
def merb_words_password_redirect
|
28
|
-
if Password
|
24
|
+
if Password
|
29
25
|
redirect slice_url(:password_read)
|
30
26
|
else
|
31
27
|
redirect slice_url(:password_create)
|
32
28
|
end
|
33
29
|
end
|
34
30
|
|
35
|
-
def merb_words_password_status
|
36
|
-
if merb_words_password?
|
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
|
-
end
|
41
|
-
end
|
42
|
-
|
43
31
|
def merb_words_paragraph(body)
|
44
32
|
body.gsub(/\r\n|\r|\n/, '<br/>')
|
45
33
|
end
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<%= mui_cell(:width => '100%') do %>
|
9
9
|
<div class="mui_title" style="font-size:1em">Categories</div>
|
10
10
|
<% end =%>
|
11
|
-
<% if
|
11
|
+
<% if mui_password? %>
|
12
12
|
<%= mui_cell(:align => 'right', :valign => 'bottom') do %>
|
13
13
|
<%= mui_button(:title => 'Create', :title_size => '0.75em', :url => slice_url(:category_create), :window => 'open') %>
|
14
14
|
<% end =%>
|
@@ -30,7 +30,7 @@
|
|
30
30
|
<%= mui_link(:title => category.title, :title_size => '0.85em', :url => slice_url(:index, attributes)) %>
|
31
31
|
<% end %>
|
32
32
|
<% end =%>
|
33
|
-
<% if
|
33
|
+
<% if mui_password? %>
|
34
34
|
<%= mui_cell(:align => 'right', :wrap => false) do %>
|
35
35
|
|
36
36
|
<%= mui_button(:title => 'Update', :title_size => '0.75em', :url => slice_url(:category_update, :category_id => category.id), :window => 'open') %>
|
@@ -1,11 +1,10 @@
|
|
1
|
-
<%= merb_words_password_status %>
|
2
1
|
<%= mui_grid(:cell_valign => 'top', :columns => 2, :width => '100%') do %>
|
3
2
|
<%= mui_cell(:width => '75%') do %>
|
4
3
|
<%= mui_grid(:cell_valign => 'bottom', :columns => 2) do %>
|
5
4
|
<%= mui_cell(:width => '100%') do %>
|
6
5
|
<%= mui_block(:title => merb_words_title, :title_size => '3em')%>
|
7
6
|
<% end =%>
|
8
|
-
<% if
|
7
|
+
<% if mui_password? %>
|
9
8
|
<%= mui_cell(:wrap => false) do %>
|
10
9
|
<%= mui_block do %>
|
11
10
|
<%= mui_button(:title => 'Create', :url => slice_url(:create), :window => 'open') %>
|
@@ -1,14 +1,13 @@
|
|
1
1
|
<% throw_content :feeds do %>
|
2
2
|
<link href="<%= slice_url :feed %>" rel="alternate" title="RSS" type="application/rss+xml"/>
|
3
3
|
<% end %>
|
4
|
-
<%= merb_words_password_status %>
|
5
4
|
<%= mui_grid(:cell_valign => 'bottom', :columns => 2) do %>
|
6
5
|
<%= mui_cell(:width => '100%') do %>
|
7
6
|
<%= mui_block(:title => @page.title, :title_size => '3em') %>
|
8
7
|
<% end =%>
|
9
8
|
<%= mui_cell(:wrap => false) do %>
|
10
9
|
<%= mui_button(:title => '← Back', :url => slice_url(:index)) %>
|
11
|
-
<% if
|
10
|
+
<% if mui_password? %>
|
12
11
|
<%= mui_button(:title => 'Update', :url => slice_url(:update, :page_id => @page.id), :window => 'open') %>
|
13
12
|
<%= mui_button(:title => '×', :tone => 'negative', :url => slice_url(:delete, :page_id => @page.id), :window => 'open') %>
|
14
13
|
<% end %>
|
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.4.
|
4
|
+
version: 0.4.3
|
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-
|
12
|
+
date: 2008-12-24 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|