semanticui-generators 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/generators/semanticui/install/install_generator.rb +8 -6
- data/lib/generators/semanticui/install/templates/assets/stylesheets/semanticui-scaffold.scss +1 -7
- data/lib/generators/semanticui/install/templates/form_builders/form_builder/_form.html.erb +10 -10
- data/lib/generators/semanticui/install/templates/layouts/application.html.erb +10 -15
- data/lib/generators/semanticui/install/templates/lib/templates/erb/scaffold/edit.html.erb +21 -16
- data/lib/generators/semanticui/install/templates/lib/templates/erb/scaffold/index.html.erb +51 -44
- data/lib/generators/semanticui/install/templates/lib/templates/erb/scaffold/new.html.erb +20 -15
- data/lib/generators/semanticui/install/templates/lib/templates/erb/scaffold/show.html.erb +33 -27
- data/lib/semanticui/generators/version.rb +1 -1
- metadata +3 -4
- data/lib/generators/semanticui/install/templates/lib/templates/erb/controller/view.html.erb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb0965173122a6a7426f0a71e261a003f4f7f6a9
|
4
|
+
data.tar.gz: ef437b228919e571776560e9a6e6cc819a5a8360
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33a5b7b476c7646b5985c22b9801c5d0d3b4bc6fd171f50b6d52c51b8f2833850068b57b17b7c2f7bc9ec3739a5ad98e8ab8b8dffb339d952e02f9b0691ee60c
|
7
|
+
data.tar.gz: 702a17ef21c981e6983a893265b2d8a2643f351a618b0a79147c3acbb691a17e04c3eee165e9733222ddb3c96e567fa909a925fd0d2c45f5c6358902d923cdf0
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# SemanticUI Generators
|
2
2
|
|
3
|
-
semanticui-generators provides [SemanticUI](http://semantic-ui.com/) scaffold generators for Rails
|
3
|
+
semanticui-generators provides [SemanticUI](http://semantic-ui.com/) scaffold generators for Rails 5 (supported Rails >= 3.1).
|
4
4
|
|
5
5
|
## Screenshots
|
6
6
|
|
@@ -10,7 +10,7 @@ semanticui-generators provides [SemanticUI](http://semantic-ui.com/) scaffold ge
|
|
10
10
|
|
11
11
|
## SemanticUI Installation
|
12
12
|
|
13
|
-
Installs [SemanticUI](http://semantic-ui.com/) via [
|
13
|
+
Installs [SemanticUI](http://semantic-ui.com/) via [Semantic-UI-Rails-LESS](https://github.com/Semantic-Org/Semantic-UI-Rails-LESS)
|
14
14
|
|
15
15
|
## Give it a try
|
16
16
|
|
@@ -6,8 +6,6 @@ module Semanticui
|
|
6
6
|
desc 'Copy SemanticUI Generators default files'
|
7
7
|
source_root ::File.expand_path('../templates', __FILE__)
|
8
8
|
|
9
|
-
class_option :skip_turbolinks, type: :boolean, default: false, desc: "Skip Turbolinks on assets"
|
10
|
-
|
11
9
|
def copy_lib
|
12
10
|
directory "lib/templates/erb"
|
13
11
|
end
|
@@ -29,18 +27,22 @@ module Semanticui
|
|
29
27
|
end
|
30
28
|
|
31
29
|
def add_semanticui_gem
|
32
|
-
|
33
|
-
gem "rails-
|
30
|
+
gem "less-rails"
|
31
|
+
gem "less-rails-semantic_ui"
|
32
|
+
gem "autoprefixer-rails"
|
33
|
+
|
34
34
|
Bundler.with_clean_env do
|
35
35
|
run 'bundle install'
|
36
36
|
end
|
37
|
+
|
38
|
+
generate "semantic_ui:install"
|
37
39
|
end
|
38
40
|
|
39
41
|
def inject_semanticui_requires
|
40
42
|
application_js_path = "app/assets/javascripts/application.js"
|
41
43
|
if ::File.exists?(::File.join(destination_root, application_js_path))
|
42
44
|
inject_into_file application_js_path, before: "//= require_tree" do
|
43
|
-
"//= require
|
45
|
+
"//= require semantic_ui/semantic_ui\n" +
|
44
46
|
"//= require semanticui-scaffold\n"
|
45
47
|
end
|
46
48
|
end
|
@@ -48,7 +50,7 @@ module Semanticui
|
|
48
50
|
application_css_path = "app/assets/stylesheets/application.css"
|
49
51
|
if ::File.exists?(::File.join(destination_root, application_css_path))
|
50
52
|
inject_into_file application_css_path, before: '*= require_tree .' do
|
51
|
-
"*= require
|
53
|
+
"*= require semantic_ui/semantic_ui\n"
|
52
54
|
end
|
53
55
|
end
|
54
56
|
end
|
@@ -13,13 +13,13 @@
|
|
13
13
|
</div>
|
14
14
|
<%% end %>
|
15
15
|
|
16
|
-
<div class="ui secondary segment">
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
16
|
+
<div class="ui secondary segment">
|
17
|
+
<% attributes.each do |attribute| -%>
|
18
|
+
<div class="field">
|
19
|
+
<%%= f.label :<%= attribute.name %> %>
|
20
|
+
<%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
|
21
|
+
</div>
|
22
|
+
<% end -%>
|
23
|
+
<%%= f.submit class: "ui submit blue button" %>
|
24
|
+
</div>
|
25
|
+
<%% end %>
|
@@ -11,13 +11,8 @@
|
|
11
11
|
<%%= javascript_include_tag "https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js", "https://oss.maxcdn.com/respond/1.4.2/respond.min.js" %>
|
12
12
|
<![endif]-->
|
13
13
|
|
14
|
-
<%- if options[:skip_turbolinks] -%>
|
15
|
-
<%%= stylesheet_link_tag 'application', media: 'all' %>
|
16
|
-
<%%= javascript_include_tag 'application' %>
|
17
|
-
<%- else -%>
|
18
14
|
<%%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
19
15
|
<%%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
20
|
-
<%- end -%>
|
21
16
|
<%%= csrf_meta_tags %>
|
22
17
|
</head>
|
23
18
|
<body>
|
@@ -28,17 +23,17 @@
|
|
28
23
|
<%% end %>
|
29
24
|
</div>
|
30
25
|
|
31
|
-
<div class="
|
32
|
-
<
|
33
|
-
<
|
34
|
-
|
35
|
-
|
36
|
-
|
26
|
+
<div class="pusher">
|
27
|
+
<div class="ui top fixed inverted main menu">
|
28
|
+
<a class="item side toggle" href="#">
|
29
|
+
<i class="content icon"></i>
|
30
|
+
</a>
|
31
|
+
<div class="item header">
|
32
|
+
<%= application_name %>
|
33
|
+
</div>
|
37
34
|
</div>
|
38
|
-
</div>
|
39
35
|
|
40
|
-
|
41
|
-
<div class="page">
|
36
|
+
<div class="ui page container">
|
42
37
|
<%% flash.each do |name, msg| %>
|
43
38
|
<%%= content_tag :div, class: "ui message #{ name == :error ? "negative" : "positive" }" do %>
|
44
39
|
<i class="close icon"></i>
|
@@ -46,7 +41,7 @@
|
|
46
41
|
<%% end %>
|
47
42
|
<%% end %>
|
48
43
|
|
49
|
-
<div class="ui
|
44
|
+
<div class="ui segment">
|
50
45
|
<%%= yield %>
|
51
46
|
</div>
|
52
47
|
</div>
|
@@ -1,20 +1,25 @@
|
|
1
1
|
<div class="ui stackable grid">
|
2
|
-
<div class="
|
2
|
+
<div class="row">
|
3
|
+
<div class="two wide column">
|
4
|
+
</div>
|
5
|
+
<div class="center aligned twelve wide title column">
|
6
|
+
<h2>
|
7
|
+
Editing <%= singular_table_name.titleize %>
|
8
|
+
</h2>
|
9
|
+
</div>
|
10
|
+
<div class="right aligned two wide column">
|
11
|
+
<%%= link_to 'Destroy', <%= singular_table_name %>_path(@<%= singular_table_name %>), method: :delete, data: { confirm: 'Are you sure?' }, class: 'ui tiny fluid red button' %>
|
12
|
+
</div>
|
3
13
|
</div>
|
4
|
-
<div class="
|
5
|
-
<
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
</div>
|
12
|
-
</div>
|
14
|
+
<div class="one column row">
|
15
|
+
<div class="column">
|
16
|
+
<div class="ui breadcrumb">
|
17
|
+
<%%= link_to '<%= plural_table_name.titleize %>', <%= index_helper %>_path, class: 'section' %>
|
18
|
+
<i class="right chevron icon divider"></i>
|
19
|
+
<div class="active section">Edit</div>
|
20
|
+
</div>
|
13
21
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
<div class="active section">Edit</div>
|
22
|
+
<%%= render 'form' %>
|
23
|
+
</div>
|
24
|
+
</div>
|
18
25
|
</div>
|
19
|
-
|
20
|
-
<%%= render 'form' %>
|
@@ -1,48 +1,55 @@
|
|
1
1
|
<div class="ui stackable grid">
|
2
|
-
<div class="
|
2
|
+
<div class="row">
|
3
|
+
<div class="two wide column">
|
4
|
+
</div>
|
5
|
+
<div class="center aligned twelve wide title column">
|
6
|
+
<h2>
|
7
|
+
<%= plural_table_name.titleize %>
|
8
|
+
</h2>
|
9
|
+
</div>
|
10
|
+
<div class="right aligned two wide column">
|
11
|
+
<%%= link_to 'New', new_<%= singular_table_name %>_path, class: 'ui tiny fluid green button' %>
|
12
|
+
</div>
|
3
13
|
</div>
|
4
|
-
<div class="
|
5
|
-
<
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
14
|
+
<div class="one column row">
|
15
|
+
<div class="column">
|
16
|
+
<%% if !@<%= plural_table_name %>.empty? %>
|
17
|
+
<table class="ui striped table">
|
18
|
+
<thead>
|
19
|
+
<tr>
|
20
|
+
<% attributes.first(3).each do |attribute| -%>
|
21
|
+
<th><%= attribute.human_name %></th>
|
22
|
+
<% end -%>
|
23
|
+
<th></th>
|
24
|
+
</tr>
|
25
|
+
</thead>
|
26
|
+
|
27
|
+
<tbody>
|
28
|
+
<%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
|
29
|
+
<tr>
|
30
|
+
<% attributes.first(3).each do |attribute| -%>
|
31
|
+
<td><%%= <%= singular_table_name %>.<%= attribute.name %> %></td>
|
32
|
+
<% end -%>
|
33
|
+
<td class="right aligned">
|
34
|
+
<span class="ui icon buttons">
|
35
|
+
<%%= link_to <%= singular_table_name %>, class: 'ui button' do %>
|
36
|
+
<i class="icon folder open"></i>
|
37
|
+
<%% end %>
|
38
|
+
<%%= link_to edit_<%= singular_table_name %>_path(<%= singular_table_name %>), class: 'ui button' do %>
|
39
|
+
<i class="icon edit"></i>
|
40
|
+
<%% end %>
|
41
|
+
<%%= link_to <%= singular_table_name %>, method: :delete, data: { confirm: 'Are you sure?' }, class: 'ui button' do %>
|
42
|
+
<i class="icon remove"></i>
|
43
|
+
<%% end %>
|
44
|
+
</span>
|
45
|
+
</td>
|
46
|
+
</tr>
|
47
|
+
<%% end %>
|
48
|
+
</tbody>
|
49
|
+
</table>
|
50
|
+
<%% else %>
|
51
|
+
<div class="ui message">No <%= plural_table_name %> to display.</div>
|
52
|
+
<%% end %>
|
53
|
+
</div>
|
11
54
|
</div>
|
12
55
|
</div>
|
13
|
-
|
14
|
-
<%% if !@<%= plural_table_name %>.empty? %>
|
15
|
-
<table class="ui striped table">
|
16
|
-
<thead>
|
17
|
-
<tr>
|
18
|
-
<% attributes.first(3).each do |attribute| -%>
|
19
|
-
<th><%= attribute.human_name %></th>
|
20
|
-
<% end -%>
|
21
|
-
<th></th>
|
22
|
-
</tr>
|
23
|
-
</thead>
|
24
|
-
|
25
|
-
<tbody>
|
26
|
-
<%%= content_tag_for(:tr, @<%= plural_table_name %>) do |<%= singular_table_name %>| %>
|
27
|
-
<% attributes.first(3).each do |attribute| -%>
|
28
|
-
<td><%%= <%= singular_table_name %>.<%= attribute.name %> %></td>
|
29
|
-
<% end -%>
|
30
|
-
<td class="right aligned">
|
31
|
-
<span class="ui icon buttons">
|
32
|
-
<%%= link_to <%= singular_table_name %>, class: 'ui button' do %>
|
33
|
-
<i class="icon folder open"></i>
|
34
|
-
<%% end %>
|
35
|
-
<%%= link_to edit_<%= singular_table_name %>_path(<%= singular_table_name %>), class: 'ui button' do %>
|
36
|
-
<i class="icon edit"></i>
|
37
|
-
<%% end %>
|
38
|
-
<%%= link_to <%= singular_table_name %>, method: :delete, data: { confirm: 'Are you sure?' }, class: 'ui button' do %>
|
39
|
-
<i class="icon remove"></i>
|
40
|
-
<%% end %>
|
41
|
-
</span>
|
42
|
-
</td>
|
43
|
-
<%% end %>
|
44
|
-
</tbody>
|
45
|
-
</table>
|
46
|
-
<%% else %>
|
47
|
-
<div class="ui message">No <%= plural_table_name %> to display.</div>
|
48
|
-
<%% end %>
|
@@ -1,19 +1,24 @@
|
|
1
1
|
<div class="ui stackable grid">
|
2
|
-
<div class="
|
2
|
+
<div class="row">
|
3
|
+
<div class="two wide column">
|
4
|
+
</div>
|
5
|
+
<div class="center aligned twelve wide title column">
|
6
|
+
<h2>
|
7
|
+
Adding <%= singular_table_name.titleize %>
|
8
|
+
</h2>
|
9
|
+
</div>
|
10
|
+
<div class="two wide column">
|
11
|
+
</div>
|
3
12
|
</div>
|
4
|
-
<div class="
|
5
|
-
<
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
</div>
|
13
|
+
<div class="one column row">
|
14
|
+
<div class="column">
|
15
|
+
<div class="ui breadcrumb">
|
16
|
+
<%%= link_to '<%= plural_table_name.titleize %>', <%= index_helper %>_path, class: 'section' %>
|
17
|
+
<i class="right chevron icon divider"></i>
|
18
|
+
<div class="active section">New</div>
|
19
|
+
</div>
|
12
20
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
<div class="active section">New</div>
|
21
|
+
<%%= render 'form' %>
|
22
|
+
</div>
|
23
|
+
</div>
|
17
24
|
</div>
|
18
|
-
|
19
|
-
<%%= render 'form' %>
|
@@ -1,34 +1,40 @@
|
|
1
1
|
<div class="ui stackable grid">
|
2
|
-
<div class="
|
2
|
+
<div class="row">
|
3
|
+
<div class="four wide column">
|
4
|
+
</div>
|
5
|
+
<div class="center aligned eight wide title column">
|
6
|
+
<h2>
|
7
|
+
Showing <%= singular_table_name.titleize %>
|
8
|
+
</h2>
|
9
|
+
</div>
|
10
|
+
<div class="right aligned two wide column">
|
11
|
+
<%%= link_to 'Edit', edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), class: 'ui tiny fluid orange button' %>
|
12
|
+
</div>
|
13
|
+
<div class="right aligned two wide column">
|
14
|
+
<%%= link_to 'Destroy', <%= singular_table_name %>_path(@<%= singular_table_name %>), method: :delete, data: { confirm: 'Are you sure?' }, class: 'ui tiny fluid red button' %>
|
15
|
+
</div>
|
3
16
|
</div>
|
4
|
-
<div class="
|
5
|
-
<
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
</div>
|
12
|
-
<div class="right aligned two wide column">
|
13
|
-
<%%= link_to 'Destroy', <%= singular_table_name %>_path(@<%= singular_table_name %>), method: :delete, data: { confirm: 'Are you sure?' }, class: 'ui tiny fluid red button' %>
|
14
|
-
</div>
|
15
|
-
</div>
|
16
|
-
|
17
|
-
<div class="ui breadcrumb">
|
18
|
-
<%%= link_to '<%= plural_table_name.titleize %>', <%= index_helper %>_path, class: 'section' %>
|
19
|
-
<i class="right chevron icon divider"></i>
|
20
|
-
<div class="active section">Show</div>
|
21
|
-
</div>
|
17
|
+
<div class="one column row">
|
18
|
+
<div class="column">
|
19
|
+
<div class="ui breadcrumb">
|
20
|
+
<%%= link_to '<%= plural_table_name.titleize %>', <%= index_helper %>_path, class: 'section' %>
|
21
|
+
<i class="right chevron icon divider"></i>
|
22
|
+
<div class="active section">Show</div>
|
23
|
+
</div>
|
22
24
|
|
23
|
-
<div class="ui secondary segment">
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
<div class="ui secondary segment">
|
26
|
+
<div class="ui list">
|
27
|
+
<%- attributes.each do |attribute| -%>
|
28
|
+
<div class="item">
|
29
|
+
<div class="header">
|
30
|
+
<%= attribute.human_name %>:
|
31
|
+
</div>
|
32
|
+
<%%= @<%= singular_table_name %>.<%= attribute.name %> %>
|
33
|
+
</div>
|
34
|
+
<%- end -%>
|
29
35
|
</div>
|
30
|
-
<%%= @<%= singular_table_name %>.<%= attribute.name %> %>
|
31
36
|
</div>
|
32
|
-
|
37
|
+
</div>
|
33
38
|
</div>
|
34
39
|
</div>
|
40
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semanticui-generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Lins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,7 +72,6 @@ files:
|
|
72
72
|
- lib/generators/semanticui/install/templates/assets/stylesheets/semanticui-scaffold.scss
|
73
73
|
- lib/generators/semanticui/install/templates/form_builders/form_builder/_form.html.erb
|
74
74
|
- lib/generators/semanticui/install/templates/layouts/application.html.erb
|
75
|
-
- lib/generators/semanticui/install/templates/lib/templates/erb/controller/view.html.erb
|
76
75
|
- lib/generators/semanticui/install/templates/lib/templates/erb/scaffold/edit.html.erb
|
77
76
|
- lib/generators/semanticui/install/templates/lib/templates/erb/scaffold/index.html.erb
|
78
77
|
- lib/generators/semanticui/install/templates/lib/templates/erb/scaffold/new.html.erb
|
@@ -100,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
99
|
version: '0'
|
101
100
|
requirements: []
|
102
101
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.
|
102
|
+
rubygems_version: 2.5.1
|
104
103
|
signing_key:
|
105
104
|
specification_version: 4
|
106
105
|
summary: SemanticUI generators for Rails
|