rails-semantic-ui 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a0d1ddf252c9caa5aa5fd2d1eeb4a46a5fbe7dab
4
- data.tar.gz: d4ac40d33164f75a92c03b16dd522db8ee0f73ca
3
+ metadata.gz: 1bc9f8a1295d6379630bd3ae17c4eca936f57f73
4
+ data.tar.gz: 991d4eb656720beb7ce1d5556b9e62544638b305
5
5
  SHA512:
6
- metadata.gz: 8ac2a378e2b972816d8e1bd0073329d5db1e392f4d9fd6df900b5ce5a10ef239e683f5bcf02ee417806121fc2c653c4e8f353069a6fe730af9f271fd231748c9
7
- data.tar.gz: 915d4e732e62119c8a4b3261823a9f90c0afbfb65f86155e4b3da7444f61952a819d6d51135edb5be19fe58df2d59c62a98d7298193c286c6cab4c09dc996906
6
+ metadata.gz: b66f7daf8c7e1b40bd456caf40d33033940f174bfdc4d7672d3c287c0cc74921e39f6ea7716995cfdf234481349acecad9885c026c412e206e73a7c64ad8c25b
7
+ data.tar.gz: e62811836620e5d7945344b4e75e5dbe5e5a0d100ad1dfe2b6300c336ce4ccf61c7f7e40794a5a74f1464258c7c5a6172f7a51089274e0084d6d601e3065fbcc
@@ -0,0 +1,19 @@
1
+ = form_for @<%= singular_table_name %>, html: {class: 'ui fluid form'} do |f|
2
+ - if @<%= singular_table_name %>.errors.any?
3
+ .ui.negative.message
4
+ i.close.icon
5
+ .header = "#{pluralize(@<%= singular_table_name %>.errors.count, "error")} prohibited this <%= singular_table_name %> from being saved:"
6
+ ul.list
7
+ - @<%= singular_table_name %>.errors.full_messages.each do |message|
8
+ li = message
9
+
10
+ <% attributes.each do |attribute| -%>
11
+ .field
12
+ = f.label :<%= attribute.name %>
13
+ = f.<%= attribute.field_type %> :<%= attribute.name %>
14
+ <% end -%>
15
+ .actions
16
+ = f.submit class: 'ui primary button'
17
+ - if action_name == 'edit'
18
+ = link_to 'Show', @<%= singular_table_name %>, class: 'ui button'
19
+ = link_to 'Back', <%= index_helper %>_path, class: 'ui button'
@@ -0,0 +1,3 @@
1
+ h1 Editing <%= singular_table_name.capitalize %>
2
+
3
+ == render 'form'
@@ -1,4 +1,4 @@
1
- h1 Listing <%= plural_table_name %>
1
+ h1 <%= plural_table_name.capitalize %>
2
2
 
3
3
  table.ui.compact.striped.table
4
4
  thead
@@ -22,4 +22,4 @@ table.ui.compact.striped.table
22
22
 
23
23
  br
24
24
 
25
- = link_to 'New <%= human_name %>', new_<%= singular_table_name %>_path
25
+ = link_to 'New <%= human_name %>', new_<%= singular_table_name %>_path, class: 'ui tiny primary button'
@@ -0,0 +1,3 @@
1
+ h1 New <%= singular_table_name.capitalize %>
2
+
3
+ == render 'form'
@@ -0,0 +1,18 @@
1
+ - if notice
2
+ .ui.positive.message
3
+ i.close.icon
4
+ .header Success!
5
+ p = notice
6
+
7
+ .ui.large.list
8
+ <% attributes.each do |attribute| -%>
9
+ .item
10
+ i.right.triangle.icon
11
+ .content
12
+ .header <%= attribute.human_name %>
13
+ .description = @<%= singular_table_name %>.<%= attribute.name %>
14
+ <% end -%>
15
+
16
+ = link_to 'Edit', edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), class: 'ui button'
17
+ '
18
+ = link_to 'Back', <%= index_helper %>_path, class: 'ui button'
@@ -25,6 +25,13 @@ module SemanticUi
25
25
  copy_file 'resources/normalize.coffee', 'app/webpack/src/statics/normalize.coffee'
26
26
  end
27
27
 
28
+ def install_scaffold
29
+ empty_directory 'lib/templates/slim/scaffold'
30
+ %w{_form edit index new show}.each do |view|
31
+ copy_file "scaffold/slim/#{view}.html.slim", "lib/templates/slim/scaffold/#{view}.html.slim"
32
+ end
33
+ end
34
+
28
35
  def combine_semantic_ui
29
36
  inject_into_file 'app/webpack/src/pages/common.coffee', after: "# run webpack pipeline against files in src/pages automatically\n" do
30
37
  "require 'statics/normalize.coffee'\nrequire 'statics/semantic-ui.coffee'\n"
@@ -43,16 +50,16 @@ module SemanticUi
43
50
 
44
51
  pattern = case js_ext
45
52
  when 'coffee'
46
- "#\n"
53
+ "#=\n"
47
54
  else 'js'
48
- "//\n"
55
+ "//=\n"
49
56
  end
50
57
 
51
- inject_into_file css, after: " *\n" do
58
+ inject_into_file css, before: " *=\n" do
52
59
  " *= require normalize\n *= require semantic\n"
53
60
  end
54
61
 
55
- inject_into_file js, after: pattern do
62
+ inject_into_file js, before: pattern do
56
63
  "#= require common.bundle\n"
57
64
  end
58
65
  end
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  module SemanticUI
3
- VERSION = '0.2.1'
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-semantic-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeong, Jiung
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-07 00:00:00.000000000 Z
11
+ date: 2015-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -55,6 +55,11 @@ files:
55
55
  - lib/generators/semantic_ui/files/layout.slim
56
56
  - lib/generators/semantic_ui/files/resources/normalize.coffee
57
57
  - lib/generators/semantic_ui/files/resources/semantic-ui.coffee
58
+ - lib/generators/semantic_ui/files/scaffold/slim/_form.html.slim
59
+ - lib/generators/semantic_ui/files/scaffold/slim/edit.html.slim
60
+ - lib/generators/semantic_ui/files/scaffold/slim/index.html.slim
61
+ - lib/generators/semantic_ui/files/scaffold/slim/new.html.slim
62
+ - lib/generators/semantic_ui/files/scaffold/slim/show.html.slim
58
63
  - lib/generators/semantic_ui/files/semantic-ui.coffee
59
64
  - lib/generators/semantic_ui/install_generator.rb
60
65
  - lib/generators/semantic_ui/layout_generator.rb
@@ -64,7 +69,6 @@ files:
64
69
  - lib/rails/semantic_ui/version.rb
65
70
  - lib/rails_semantic_ui.rb
66
71
  - lib/tasks/semantic_ui.rake
67
- - lib/templates/slim/scaffold/index.html.slim
68
72
  homepage: https://github.com/astral1/rails-semantic-ui
69
73
  licenses:
70
74
  - MIT