merb-ui 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/app/helpers/global_helpers.rb +14 -8
- data/app/views/styles/index.css.erb +20 -0
- data/lib/merb-ui.rb +3 -57
- metadata +2 -2
data/Rakefile
CHANGED
@@ -12,6 +12,9 @@ module Merb::GlobalHelpers
|
|
12
12
|
if type = options[:type]
|
13
13
|
if type == 'inline'
|
14
14
|
tag_type = :span
|
15
|
+
elsif type == 'tray_inline'
|
16
|
+
tag_type = :span
|
17
|
+
attributes[:class] << %{ mui_block_tray}
|
15
18
|
else
|
16
19
|
tag_type = :div
|
17
20
|
attributes[:class] << %{ mui_block_#{type}}
|
@@ -100,7 +103,7 @@ module Merb::GlobalHelpers
|
|
100
103
|
end
|
101
104
|
|
102
105
|
def mui_cell(options = {}, &block)
|
103
|
-
return unless block_given?
|
106
|
+
return unless block_given? and @mui_grid
|
104
107
|
@mui_grid[:count] += 1
|
105
108
|
attributes = {}
|
106
109
|
attributes[:align] = @mui_grid[:align] || options[:align] || nil
|
@@ -243,14 +246,17 @@ module Merb::GlobalHelpers
|
|
243
246
|
def mui_search(options = {})
|
244
247
|
attributes = {}
|
245
248
|
attributes[:class] = 'mui_search'
|
246
|
-
attributes[:name] = :
|
247
|
-
attributes[:style] =
|
249
|
+
attributes[:name] = :query
|
250
|
+
attributes[:style] = "width:#{options[:width]};" if options[:width]
|
248
251
|
attributes[:type] = :text
|
249
|
-
attributes[:value] = params[:
|
250
|
-
|
251
|
-
button =
|
252
|
-
|
253
|
-
|
252
|
+
attributes[:value] = params[:query]
|
253
|
+
input = self_closing_tag(:input, attributes)
|
254
|
+
button = mui_button(:submit => true, :title => 'Search')
|
255
|
+
grid = mui_grid(:columns => 2){
|
256
|
+
mui_cell(:valign => 'middle'){input} +
|
257
|
+
mui_cell(:align => 'right', :valign => 'middle', :wrap => false){button}
|
258
|
+
}
|
259
|
+
tag(:form, grid, :action => options[:action])
|
254
260
|
end
|
255
261
|
|
256
262
|
def mui_tab(options = {}, &block)
|
@@ -64,6 +64,19 @@ span.mui_block {
|
|
64
64
|
display: inline-block;
|
65
65
|
vertical-align: top;
|
66
66
|
}
|
67
|
+
span.mui_block_tray {
|
68
|
+
background-color: <%= color(0.95, 0.95, 0.95) %>;
|
69
|
+
border-bottom-color: <%= color(0.9, 0.9, 0.9) %>;
|
70
|
+
border-left-color: <%= color(0.8, 0.8, 0.8) %>;
|
71
|
+
border-right-color: <%= color(0.8, 0.8, 0.8) %>;
|
72
|
+
border-top-color: <%= color(0.7, 0.7, 0.7) %>;
|
73
|
+
border-style: solid;
|
74
|
+
border-width: 1px;
|
75
|
+
display: inline-block;
|
76
|
+
padding: 1em;
|
77
|
+
vertical-align: top;
|
78
|
+
<%= border_radius %>
|
79
|
+
}
|
67
80
|
div.mui_block_status {
|
68
81
|
background-image: url('<%= mui_path :image %>/transparency.png');
|
69
82
|
border-color: <%= color(0, 0, 0) %>;
|
@@ -453,6 +466,13 @@ span.mui_truncate {
|
|
453
466
|
font-size: 0.85em;
|
454
467
|
}
|
455
468
|
|
469
|
+
/* url */
|
470
|
+
|
471
|
+
div.mui_url {
|
472
|
+
color: <%= color(0.5, 0.5, 0.5) %>;
|
473
|
+
font-size: 0.85em;
|
474
|
+
}
|
475
|
+
|
456
476
|
/* window */
|
457
477
|
|
458
478
|
table.mui_window {
|
data/lib/merb-ui.rb
CHANGED
@@ -2,76 +2,22 @@ if defined?(Merb::Plugins)
|
|
2
2
|
|
3
3
|
$:.unshift File.dirname(__FILE__)
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
dependencies('merb-helpers', 'merb-slices')
|
6
|
+
|
7
|
+
Merb::Plugins.add_rakefiles('merb-ui/merbtasks', 'merb-ui/slicetasks', 'merb-ui/spectasks')
|
7
8
|
|
8
|
-
# Register the Slice for the current host application
|
9
9
|
Merb::Slices::register(__FILE__)
|
10
10
|
|
11
|
-
# Slice configuration - set this in a before_app_loads callback.
|
12
|
-
# By default a Slice uses its own layout, so you can swicht to
|
13
|
-
# the main application layout or no layout at all if needed.
|
14
|
-
#
|
15
|
-
# Configuration options:
|
16
|
-
# :layout - the layout to use; defaults to :merb-ui
|
17
|
-
# :mirror - which path component types to use on copy operations; defaults to all
|
18
11
|
Merb::Slices::config[:merb_ui][:layout] ||= :application
|
19
12
|
|
20
|
-
# All Slice code is expected to be namespaced inside a module
|
21
13
|
module MerbUi
|
22
14
|
|
23
|
-
# Slice metadata
|
24
|
-
self.description = "Merb UI"
|
25
|
-
self.version = "1.0"
|
26
|
-
self.author = "UI Poet"
|
27
|
-
|
28
|
-
# Stub classes loaded hook - runs before LoadClasses BootLoader
|
29
|
-
# right after a slice's classes have been loaded internally.
|
30
|
-
def self.loaded
|
31
|
-
end
|
32
|
-
|
33
|
-
# Initialization hook - runs before AfterAppLoads BootLoader
|
34
|
-
def self.init
|
35
|
-
end
|
36
|
-
|
37
|
-
# Activation hook - runs after AfterAppLoads BootLoader
|
38
|
-
def self.activate
|
39
|
-
end
|
40
|
-
|
41
|
-
# Deactivation hook - triggered by Merb::Slices.deactivate(MerbUi)
|
42
|
-
def self.deactivate
|
43
|
-
end
|
44
|
-
|
45
|
-
# Setup routes inside the host application
|
46
|
-
#
|
47
|
-
# @param scope<Merb::Router::Behaviour>
|
48
|
-
# Routes will be added within this scope (namespace). In fact, any
|
49
|
-
# router behaviour is a valid namespace, so you can attach
|
50
|
-
# routes at any level of your router setup.
|
51
|
-
#
|
52
|
-
# @note prefix your named routes with :merb_ui_
|
53
|
-
# to avoid potential conflicts with global named routes.
|
54
15
|
def self.setup_router(scope)
|
55
16
|
scope.match('/stylesheets/mui.css').to(:controller => 'styles', :action => 'index')
|
56
17
|
end
|
57
18
|
|
58
19
|
end
|
59
20
|
|
60
|
-
# Setup the slice layout for MerbUi
|
61
|
-
#
|
62
|
-
# Use MerbUi.push_path and MerbUi.push_app_path
|
63
|
-
# to set paths to merb-ui-level and app-level paths. Example:
|
64
|
-
#
|
65
|
-
# MerbUi.push_path(:application, MerbUi.root)
|
66
|
-
# MerbUi.push_app_path(:application, Merb.root / 'slices' / 'merb-ui')
|
67
|
-
# ...
|
68
|
-
#
|
69
|
-
# Any component path that hasn't been set will default to MerbUi.root
|
70
|
-
#
|
71
|
-
# Or just call setup_default_structure! to setup a basic Merb MVC structure.
|
72
21
|
MerbUi.setup_default_structure!
|
73
22
|
|
74
|
-
# Add dependencies for other MerbUi classes below. Example:
|
75
|
-
# dependency "merb-ui/other"
|
76
|
-
|
77
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: merb-ui
|
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
|
- UiPoet
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-12-
|
12
|
+
date: 2008-12-13 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|