weeler 1.1.0 → 1.2.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: 68940eeb55fdefffd683777736dd8061caf8e998
4
- data.tar.gz: 9140eb89f13bbc9a4da87eae17a8c8da335bd012
3
+ metadata.gz: d74bf1a8c861ad71e165a61811adf25b4b702742
4
+ data.tar.gz: 72c0e430791b689a12e7e35b43cd7fef68290206
5
5
  SHA512:
6
- metadata.gz: 3294c821dd0927db19745f754d5e0accf08f3129aad52faef6b387a2d4b159a69baf88a7422fb33c52eaab9afdfb08bf4012a3b93186694271f9029fa263af61
7
- data.tar.gz: 614afa34c328b29a96a1278e02de45af676584b79c2cbd9f018079b80e92bcd368853ca75fd6a8e2f6af5c588bd80ac4b26b8e17032162335509b4df3aa9c820
6
+ metadata.gz: 26bc83df02c82b16027f4c355ea87ced1eed41d50ead778fb8d7bedf1be2673db0f3a0dbabc7a968e0ff0d2a74d85ed91527ac5b293a538b122d7be7c357f585
7
+ data.tar.gz: 813211cdb75e8717382e47a44f4b669de769a1f92f58f26126deda5b8887fc650cb4576f06c2795567bf8794213194d957547502bcecb41360d977b80f72363d
@@ -7,7 +7,10 @@ rvm:
7
7
  - "2.1.3"
8
8
  - "2.1.4"
9
9
  - "2.1.5"
10
+ - "2.1.6"
10
11
  - "2.2.0"
12
+ - "2.2.1"
13
+ - "2.2.2"
11
14
  - "jruby"
12
15
  - "rbx-2.4.1"
13
16
  # uncomment this line if your project needs to run something other than `rake`:
@@ -1,3 +1,24 @@
1
+ ## 1.2.0
2
+
3
+ ### Features & Enhancements
4
+
5
+ * Added option to override acts as restful create, update, destroy redirect path
6
+
7
+ ### Contributors
8
+
9
+ * Artis Raugulis
10
+
11
+
12
+ ## 1.1.1
13
+
14
+ ### Features & Enhancements
15
+
16
+ * Improved working with translations by removing rowlink.
17
+
18
+ ### Contributors
19
+
20
+ * Artis Raugulis
21
+
1
22
  ## 1.1.0
2
23
 
3
24
  ### Features & Enhancements
data/README.md CHANGED
@@ -109,6 +109,21 @@ It will handle <tt>:index</tt>, <tt>:new</tt>, <tt>:edit</tt>, <tt>:update</tt>,
109
109
  For permiting custom by role or permiting all params (permit!),
110
110
  you must add block <tt>permit_params: -> (params) { params.require(:post).permit! }</tt>
111
111
 
112
+ You can override redirect path after <tt>:create</tt>, <tt>:update</tt>, <tt>:destroy</tt> actions.
113
+ You can do this by overriding private methods in your controller.
114
+
115
+ def after_create_path
116
+ { action: :edit, id: @item.id }
117
+ end
118
+
119
+ def after_update_path
120
+ { action: :edit, id: @item.id }
121
+ end
122
+
123
+ def after_destroy_path
124
+ { action: :index }
125
+ end
126
+
112
127
  You should implement form file with your own active record attributes.
113
128
  To do that, create <tt>_form.html.haml</tt> in <tt>views/weeler/_YOUR_RESOURCE_/_form.html.haml</tt>
114
129
  where <tt>_YOUR_RESOURCE_</tt> is name of your resource.
@@ -1,7 +1,5 @@
1
1
  %tr
2
- %td
3
- %a{href: edit_weeler_translation_path(translation.id)}
4
- \   #{translation.locale}
2
+ %td= translation.locale
5
3
  %td= translation.key
6
4
  - if translation.value.present? && translation.value.is_a?(String)
7
5
  %td= strip_tags(truncate(translation.value, lenght: 50))
@@ -9,3 +7,6 @@
9
7
  %td= translation.value
10
8
  %td= translation.interpolations
11
9
  %td.text-center= translation.created_at.strftime("%d/%m/%Y")
10
+ %td
11
+ = link_to 'Edit', edit_weeler_translation_path(translation.id), class: 'btn btn-default'
12
+ = link_to 'Remove', weeler_translation_path(translation), data: { confirm: 'Are you sure you want to remove?' }, method: :delete, class: 'btn btn-danger'
@@ -60,7 +60,7 @@
60
60
  .container
61
61
  .row
62
62
  .col-lg-12
63
- %table.table.table-hover{"data-provides" => "rowlink"}
63
+ %table.table.table-hover
64
64
  %thead
65
65
  %tr
66
66
  %th Locale
@@ -68,6 +68,7 @@
68
68
  %th.text-center Value
69
69
  %th.text-center Interpolations
70
70
  %th.text-center Created
71
+ %th
71
72
  %tbody#translations
72
73
  - @translations.each do |translation|
73
74
  = render :partial => "weeler/translations/translation", locals: {translation: translation}
@@ -83,7 +83,7 @@ module Weeler
83
83
  def create
84
84
  @item = model.new(items_params)
85
85
  if @item.save
86
- redirect_to({ action: :edit, id: @item.id }, {:notice => "Successfully created item"})
86
+ redirect_to( after_create_path, {:notice => "Successfully created item"} )
87
87
  else
88
88
  render :action => 'new'
89
89
  end
@@ -91,7 +91,7 @@ module Weeler
91
91
 
92
92
  def update
93
93
  if @item.update_attributes(items_params)
94
- redirect_to({ action: :edit, id: @item.id }, {:notice => "Successfully updated item"})
94
+ redirect_to( after_update_path, {:notice => "Successfully updated item"} )
95
95
  else
96
96
  render :action => 'edit'
97
97
  end
@@ -99,7 +99,7 @@ module Weeler
99
99
 
100
100
  def destroy
101
101
  @item.destroy
102
- redirect_to({ action: :index}, {:notice => "Successfully destroyed item"})
102
+ redirect_to( after_destroy_path, {:notice => "Successfully destroyed item"})
103
103
  end
104
104
 
105
105
  def remove_image
@@ -142,6 +142,18 @@ module Weeler
142
142
 
143
143
  private
144
144
 
145
+ def after_create_path
146
+ { action: :edit, id: @item.id }
147
+ end
148
+
149
+ def after_update_path
150
+ { action: :edit, id: @item.id }
151
+ end
152
+
153
+ def after_destroy_path
154
+ { action: :index }
155
+ end
156
+
145
157
  def model
146
158
  model
147
159
  end
@@ -1,7 +1,7 @@
1
1
  module Weeler
2
2
  module VERSION
3
3
  MAJOR = 1
4
- MINOR = 1
4
+ MINOR = 2
5
5
  TINY = 0
6
6
  PRE = nil
7
7
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weeler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artūrs Braučs
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-23 00:00:00.000000000 Z
12
+ date: 2015-05-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -540,7 +540,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
540
540
  version: '0'
541
541
  requirements: []
542
542
  rubyforge_project:
543
- rubygems_version: 2.4.5
543
+ rubygems_version: 2.4.7
544
544
  signing_key:
545
545
  specification_version: 4
546
546
  summary: CMS for weby.lv projects.