macbury-metro-ui-rails 0.15.9
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +21 -0
- data/.gitmodules +3 -0
- data/Gemfile +4 -0
- data/README.md +44 -0
- data/Rakefile +74 -0
- data/lib/generators/metro/layout/layout_generator.rb +19 -0
- data/lib/generators/metro/layout/templates/layout.html.erb +92 -0
- data/lib/metro/ui/rails/engine.rb +16 -0
- data/lib/metro/ui/rails/metro.rb +2 -0
- data/lib/metro/ui/rails/version.rb +7 -0
- data/lib/metro-ui-rails.rb +10 -0
- data/metro-ui-rails.gemspec +20 -0
- data/vendor/assets/fonts/metro-ui/iconFont.eot +0 -0
- data/vendor/assets/fonts/metro-ui/iconFont.svg +2005 -0
- data/vendor/assets/fonts/metro-ui/iconFont.ttf +0 -0
- data/vendor/assets/fonts/metro-ui/iconFont.woff +0 -0
- data/vendor/assets/javascripts/metro-ui/accordion.js +44 -0
- data/vendor/assets/javascripts/metro-ui/buttonset.js +34 -0
- data/vendor/assets/javascripts/metro-ui/carousel.js +368 -0
- data/vendor/assets/javascripts/metro-ui/dropdown.js +95 -0
- data/vendor/assets/javascripts/metro-ui/input-control.js +103 -0
- data/vendor/assets/javascripts/metro-ui/pagecontrol.js +64 -0
- data/vendor/assets/javascripts/metro-ui/rating.js +249 -0
- data/vendor/assets/javascripts/metro-ui/slider.js +248 -0
- data/vendor/assets/javascripts/metro-ui/tile-drag.js +332 -0
- data/vendor/assets/javascripts/metro-ui/tile-slider.js +196 -0
- data/vendor/assets/javascripts/metro-ui.js +10 -0
- data/vendor/toolkit/metro-ui/accordion.less +69 -0
- data/vendor/toolkit/metro-ui/bricks.less +59 -0
- data/vendor/toolkit/metro-ui/buttons.less +434 -0
- data/vendor/toolkit/metro-ui/cards.less +113 -0
- data/vendor/toolkit/metro-ui/carousel.less +109 -0
- data/vendor/toolkit/metro-ui/code.less +47 -0
- data/vendor/toolkit/metro-ui/colors.less +115 -0
- data/vendor/toolkit/metro-ui/forms.less +434 -0
- data/vendor/toolkit/metro-ui/grid.less +115 -0
- data/vendor/toolkit/metro-ui/hero.less +18 -0
- data/vendor/toolkit/metro-ui/icons.less +1168 -0
- data/vendor/toolkit/metro-ui/images.less +121 -0
- data/vendor/toolkit/metro-ui/jqgrid.less +12 -0
- data/vendor/toolkit/metro-ui/layout.less +287 -0
- data/vendor/toolkit/metro-ui/listview.less +143 -0
- data/vendor/toolkit/metro-ui/menus.less +249 -0
- data/vendor/toolkit/metro-ui/modern-responsive-max480.less +147 -0
- data/vendor/toolkit/metro-ui/modern-responsive-max767.less +241 -0
- data/vendor/toolkit/metro-ui/modern-responsive-max979.less +97 -0
- data/vendor/toolkit/metro-ui/modern-responsive-min1200.less +28 -0
- data/vendor/toolkit/metro-ui/modern-responsive.less +13 -0
- data/vendor/toolkit/metro-ui/modern.less +35 -0
- data/vendor/toolkit/metro-ui/notices.less +185 -0
- data/vendor/toolkit/metro-ui/pagecontrol.less +100 -0
- data/vendor/toolkit/metro-ui/progress.less +22 -0
- data/vendor/toolkit/metro-ui/rating.less +80 -0
- data/vendor/toolkit/metro-ui/reset.less +504 -0
- data/vendor/toolkit/metro-ui/routines.less +141 -0
- data/vendor/toolkit/metro-ui/sidebar.less +136 -0
- data/vendor/toolkit/metro-ui/slider.less +67 -0
- data/vendor/toolkit/metro-ui/tables.less +164 -0
- data/vendor/toolkit/metro-ui/theme-dark.less +54 -0
- data/vendor/toolkit/metro-ui/tiles.less +285 -0
- data/vendor/toolkit/metro-ui/typography.less +347 -0
- metadata +139 -0
data/.gitignore
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
.idea
|
19
|
+
.DS_Store
|
20
|
+
.rbenv-version
|
21
|
+
*.un~
|
data/.gitmodules
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# Metro UI for Rails 3.1 Asset Pipeline
|
2
|
+
|
3
|
+
This gem integrates [Metro-UI-CSS](https://github.com/olton/Metro-UI-CSS) toolkit into Rails 3.1 Asset Pipeline.
|
4
|
+
|
5
|
+
[![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/ViliusLuneckas/metro-ui-rails)
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
gem 'metro-ui-rails'
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
## Installing to Rails project:
|
18
|
+
|
19
|
+
Require metro-ui/metro.less in your application.less:
|
20
|
+
|
21
|
+
@import 'metro-ui/modern.less';
|
22
|
+
@import 'metro-ui/modern-responsive.less'; // for responsive design
|
23
|
+
|
24
|
+
And then require metro-ui in your js or coffee application file:
|
25
|
+
|
26
|
+
#= require metro-ui
|
27
|
+
|
28
|
+
|
29
|
+
## Layout generator
|
30
|
+
|
31
|
+
You can generate Metro UI compatible .erb layout.
|
32
|
+
|
33
|
+
Usage:
|
34
|
+
|
35
|
+
rails generate metro:layout [LAYOUT_NAME]
|
36
|
+
|
37
|
+
Example:
|
38
|
+
|
39
|
+
rails generate metro:layout application
|
40
|
+
|
41
|
+
## License
|
42
|
+
|
43
|
+
This project only integrates [Metro-UI-CSS](https://github.com/olton/Metro-UI-CSS),
|
44
|
+
thus all credits go to Sergey Pimenov, see his [license](https://github.com/olton/Metro-UI-CSS).
|
data/Rakefile
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "pathname"
|
3
|
+
require "fileutils"
|
4
|
+
|
5
|
+
task :submodule do
|
6
|
+
sh "git submodule update --init" unless File.exist?('Metro-UI-CSS/README.md')
|
7
|
+
end
|
8
|
+
|
9
|
+
desc "Remove the vendor directory"
|
10
|
+
task :clean do
|
11
|
+
FileUtils.rm_rf 'vendor'
|
12
|
+
end
|
13
|
+
|
14
|
+
desc "Copy stylesheets files from submodule"
|
15
|
+
task :stylesheets do
|
16
|
+
images_path = 'vendor/assets/images/metro-ui/'
|
17
|
+
FileUtils.mkdir_p 'vendor/toolkit/metro-ui/'
|
18
|
+
FileUtils.mkdir_p images_path
|
19
|
+
|
20
|
+
Dir.glob("Metro-UI-CSS/less/*.less").each do |path|
|
21
|
+
less = File.read(path)
|
22
|
+
|
23
|
+
regexp = /url\(..\/images\/([-_.a-zA-Z0-9]+)\)/
|
24
|
+
|
25
|
+
# copy only required images
|
26
|
+
less.scan(regexp).each do |images|
|
27
|
+
FileUtils.cp "Metro-UI-CSS/public/images/#{images.first}", images_path
|
28
|
+
end
|
29
|
+
|
30
|
+
# fix for image paths
|
31
|
+
less.gsub! regexp, "image-url('metro-ui/\\1')"
|
32
|
+
|
33
|
+
|
34
|
+
regexp = /url\(\'..\/fonts\/([-_.a-zA-Z0-9]+)(\?\#iefix|\#iconFont)?'\)/
|
35
|
+
|
36
|
+
# fix for font paths
|
37
|
+
less.gsub! regexp, "font-url('metro-ui/\\1')"
|
38
|
+
|
39
|
+
basename = Pathname.new(path).basename
|
40
|
+
destination_file = "vendor/toolkit/metro-ui/#{basename}"
|
41
|
+
|
42
|
+
File.write(destination_file, less)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
desc "Copy javascripts files from submodule"
|
47
|
+
task :javascripts do
|
48
|
+
path = 'vendor/assets/javascripts/metro-ui'
|
49
|
+
FileUtils.mkdir_p path
|
50
|
+
js_files = Dir.glob("Metro-UI-CSS/javascript/*.js")
|
51
|
+
FileUtils.cp js_files, path
|
52
|
+
|
53
|
+
File.open('vendor/assets/javascripts/metro-ui.js', 'w') do |output|
|
54
|
+
js_files.each do |f|
|
55
|
+
js_file = Pathname.new(f).basename.to_s.gsub('.js', '')
|
56
|
+
output.write "//= require metro-ui/#{js_file}\n"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
desc "Copy font files from submodule"
|
62
|
+
task :fonts do
|
63
|
+
path = 'vendor/assets/fonts/metro-ui'
|
64
|
+
FileUtils.mkdir_p path
|
65
|
+
image_types = %w(eot svg ttf woff)
|
66
|
+
font_files = Dir.glob("Metro-UI-CSS/fonts/*.{#{image_types.join(',')}}")
|
67
|
+
FileUtils.cp font_files, path
|
68
|
+
end
|
69
|
+
|
70
|
+
desc "Clean and then generate everything (default)"
|
71
|
+
task :assets => [:clean, :stylesheets, :javascripts, :fonts]
|
72
|
+
|
73
|
+
task :default => :assets
|
74
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module Metro
|
4
|
+
module Generators
|
5
|
+
class LayoutGenerator < ::Rails::Generators::Base
|
6
|
+
source_root File.expand_path("../templates", __FILE__)
|
7
|
+
desc "This generator generates layout file with navigation."
|
8
|
+
argument :layout_name, :type => :string, :default => "application"
|
9
|
+
|
10
|
+
attr_reader :app_name
|
11
|
+
|
12
|
+
def generate_layout
|
13
|
+
app = ::Rails.application
|
14
|
+
@app_name = app.class.to_s.split("::").first
|
15
|
+
template "layout.html.erb", "app/views/layouts/#{layout_name}.html.erb"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7
|
+
<title><%%= content_for?(:title) ? yield(:title) : "<%= app_name %>" %></title>
|
8
|
+
<%%= csrf_meta_tags %>
|
9
|
+
|
10
|
+
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
|
11
|
+
<!--[if lt IE 9]>
|
12
|
+
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
|
13
|
+
<![endif]-->
|
14
|
+
|
15
|
+
<%%= stylesheet_link_tag "application", :media => "all" %>
|
16
|
+
|
17
|
+
<!-- For third-generation iPad with high-resolution Retina display: -->
|
18
|
+
<!-- Size should be 144 x 144 pixels -->
|
19
|
+
<%%= favicon_link_tag 'images/apple-touch-icon-144x144-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '144x144' %>
|
20
|
+
|
21
|
+
<!-- For iPhone with high-resolution Retina display: -->
|
22
|
+
<!-- Size should be 114 x 114 pixels -->
|
23
|
+
<%%= favicon_link_tag 'images/apple-touch-icon-114x114-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '114x114' %>
|
24
|
+
|
25
|
+
<!-- For first- and second-generation iPad: -->
|
26
|
+
<!-- Size should be 72 x 72 pixels -->
|
27
|
+
<%%= favicon_link_tag 'images/apple-touch-icon-72x72-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '72x72' %>
|
28
|
+
|
29
|
+
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
|
30
|
+
<!-- Size should be 57 x 57 pixels -->
|
31
|
+
<%%= favicon_link_tag 'images/apple-touch-icon-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png' %>
|
32
|
+
|
33
|
+
<!-- For all other devices -->
|
34
|
+
<!-- Size should be 32 x 32 pixels -->
|
35
|
+
<%%= favicon_link_tag 'images/favicon.ico', :rel => 'shortcut icon' %>
|
36
|
+
</head>
|
37
|
+
|
38
|
+
<body class="modern-ui">
|
39
|
+
<div class="page">
|
40
|
+
<div class="nav-bar">
|
41
|
+
<div class="nav-bar-inner padding10">
|
42
|
+
<span class="pull-menu"></span>
|
43
|
+
|
44
|
+
<a href="/">
|
45
|
+
<span class="element brand">
|
46
|
+
<span class="metro-ui-logo place-left"></span>
|
47
|
+
<span class="name"><%= app_name %></span>
|
48
|
+
</span>
|
49
|
+
</a>
|
50
|
+
|
51
|
+
<ul class="menu">
|
52
|
+
<li><%%= link_to "Home", "/" %></li>
|
53
|
+
|
54
|
+
<li data-role="dropdown">
|
55
|
+
<a href="#">Menu</a>
|
56
|
+
<ul class="dropdown-menu">
|
57
|
+
<li><%%= link_to "Link1", "/path1" %></li>
|
58
|
+
<li><%%= link_to "Link2", "/path2" %></li>
|
59
|
+
<li class="divider"></li>
|
60
|
+
<li><%%= link_to "Link3", "/path3" %></li>
|
61
|
+
</ul>
|
62
|
+
</li>
|
63
|
+
</ul>
|
64
|
+
</div>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
<div class="page-region">
|
68
|
+
<div class="page-region-content">
|
69
|
+
<div class="grid">
|
70
|
+
<div class="row">
|
71
|
+
<%%= yield %>
|
72
|
+
</div>
|
73
|
+
</div>
|
74
|
+
</div>
|
75
|
+
</div>
|
76
|
+
|
77
|
+
|
78
|
+
<div class="nav-bar">
|
79
|
+
<div class="nav-bar-inner" style="padding: 10px 10px 5px;">
|
80
|
+
<span class="element">© Company 2012</span>
|
81
|
+
</div>
|
82
|
+
</div>
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
<!-- Javascripts
|
87
|
+
================================================== -->
|
88
|
+
<!-- Placed at the end of the document so the pages load faster -->
|
89
|
+
<%%= javascript_include_tag "application" %>
|
90
|
+
|
91
|
+
</body>
|
92
|
+
</html>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'rails'
|
2
|
+
|
3
|
+
module Metro
|
4
|
+
module Ui
|
5
|
+
module Rails
|
6
|
+
class Engine < ::Rails::Engine
|
7
|
+
initializer 'metro-ui-rails.setup',
|
8
|
+
:after => 'less-rails.after.load_config_initializers',
|
9
|
+
:group => :all do |app|
|
10
|
+
app.config.less.paths << File.join(config.root, 'vendor', 'toolkit')
|
11
|
+
app.config.assets.paths << File.join(config.root, 'vendor', 'fonts')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'metro/ui/rails/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "macbury-metro-ui-rails"
|
8
|
+
gem.version = Metro::Ui::Rails::VERSION
|
9
|
+
gem.authors = ["Vilius Luneckas"]
|
10
|
+
gem.email = ["vilius.luneckas@gmail.com"]
|
11
|
+
gem.description = %q{metro-ui-rails project integrates Metro-UI CSS toolkit for Rails 3.1 Asset Pipeline}
|
12
|
+
gem.summary = %q{Metro-UI CSS toolkit for Rails 3.1 Asset Pipeline}
|
13
|
+
gem.homepage = "https://github.com/viliusluneckas/metro-ui-rails"
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.require_paths = ["lib"]
|
17
|
+
|
18
|
+
gem.add_runtime_dependency 'less-rails', '~> 2.2.3'
|
19
|
+
gem.add_development_dependency 'rails', '>= 3.1'
|
20
|
+
end
|
Binary file
|