redirector_ui 1.0.0 → 1.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bec40b13c6312a28e107b89e80b0615e02207764
4
- data.tar.gz: bbd296c9e4c7b3c7494f503c84ee8b1fc333335c
3
+ metadata.gz: d1ab0b421829de5322e374cb55d563b1b5935031
4
+ data.tar.gz: d58eeda97dc35a17cbc85ff05dcc79fe885281cc
5
5
  SHA512:
6
- metadata.gz: 8be6e8157ad9efece14ba09b8b0632cc18529273de47168723cbd57897f62ff8f1d6a5a68d28911dab39df3efab6a940809cc224d85cbf7a04087cf07a66b4b5
7
- data.tar.gz: 3b7ae814f9c3becdd7e8db187d1703997727fce773597a2448769f273abe7444e71b803f3b12578afd934c5a7607baba44e703580bea31ff766423dcfcc13f8f
6
+ metadata.gz: a9ca3078729c361721ebdd704a7392377e3c60ac7500076d628cfd069e465c68bc8589f128d6e767cf84ab4f0f125dad977480da8189eda7d9bde215d43332eb
7
+ data.tar.gz: c1e4f203925b74f690fd9fc6a9c68d3834d22cf9c528052380029d22dff6c99babc8c5fd5d417324822c11ccffef297ddc91e4e35a93c4d6d13a59d3d3de2397
@@ -20,7 +20,7 @@
20
20
  #redirect_ui {
21
21
  .title {
22
22
  margin-top: 1rem;
23
- margin-bottom: 3rem;
23
+ margin-bottom: 1rem;
24
24
  }
25
25
 
26
26
  .datagrid-filter.filter {
@@ -19,6 +19,20 @@ module RedirectorUi
19
19
  end
20
20
  end
21
21
 
22
+ def new
23
+ @redirect_rule = RedirectRule.new
24
+ end
25
+
26
+ def create
27
+ @redirect_rule = RedirectRule.new(redirect_rule_params)
28
+
29
+ if @redirect_rule.save
30
+ redirect_to redirector_ui.redirect_rules_path, notice: 'Redirect rule has been correctly created.'
31
+ else
32
+ render action: 'new'
33
+ end
34
+ end
35
+
22
36
  def edit
23
37
  end
24
38
 
@@ -0,0 +1,55 @@
1
+ <%= form_for(@redirect_rule) do |f| %>
2
+ <% if @redirect_rule.errors.any? %>
3
+ <div id='error_explanation'>
4
+ <div class='alert alert-danger' role='alert'>
5
+ <ul>
6
+ <%= @redirect_rule.errors.full_messages.to_sentence %>
7
+ </ul>
8
+ </div>
9
+ </div>
10
+ <% end %>
11
+
12
+ <div class='form-group row'>
13
+ <%= f.label :source, class: 'col-xs-3 col-form-label' %>
14
+ <div class='col-xs-9'>
15
+ <%= f.text_field :source, class: 'form-control', placeholder: '/source' %>
16
+ </div>
17
+ </div>
18
+
19
+ <div class='form-group row'>
20
+ <%= f.label :destination, class: 'col-xs-3 col-form-label' %>
21
+ <div class='col-xs-9'>
22
+ <%= f.text_field :destination, class: 'form-control', placeholder: '/destination' %>
23
+ </div>
24
+ </div>
25
+
26
+ <div class='form-group row'>
27
+ <%= f.label :active, class: 'col-xs-3 col-form-label' %>
28
+ <div class='col-xs-9'>
29
+ <%= f.check_box :active, class: 'form-control' %>
30
+ </div>
31
+ </div>
32
+
33
+ <div class='form-group row'>
34
+ <%= f.label :source_is_regex, class: 'col-xs-3 col-form-label' %>
35
+ <div class='col-xs-9'>
36
+ <%= f.check_box :source_is_regex, class: 'form-control' %>
37
+ </div>
38
+ </div>
39
+
40
+ <div class='form-group row'>
41
+ <%= f.label :source_is_case_sensitive, class: 'col-xs-3 col-form-label' %>
42
+ <div class='col-xs-9'>
43
+ <%= f.check_box :source_is_case_sensitive, class: 'form-control' %>
44
+ </div>
45
+ </div>
46
+
47
+ <div class='form-group row'>
48
+ <div class='col-xs-12'>
49
+ <%= f.submit nil, class: 'btn btn-primary pull-left' %>
50
+ <% if @redirect_rule.persisted? %>
51
+ <%= link_to 'Destroy', redirector_ui.redirect_rule_path(@redirect_rule), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger pull-right' %>
52
+ <% end %>
53
+ </div>
54
+ </div>
55
+ <% end %>
@@ -1,60 +1,8 @@
1
1
  <div class='container'>
2
2
  <h1 class='title'>Edit redirect rule</h1>
3
3
  <div class='row'>
4
- <%= link_to 'Back', redirector_ui.redirect_rules_path, class: 'btn btn-link' %>
4
+ <%= link_to 'Back', request.referer || redirector_ui.redirect_rules_path, class: 'btn btn-link' %>
5
5
  </div>
6
6
 
7
- <%= form_for(@redirect_rule) do |f| %>
8
- <% if @redirect_rule.errors.any? %>
9
- <div id='error_explanation'>
10
- <div class='alert alert-danger' role='alert'>
11
- <ul>
12
- <%= @redirect_rule.errors.full_messages.to_sentence %>
13
- </ul>
14
- </div>
15
- </div>
16
- <% end %>
17
-
18
- <div class='form-group row'>
19
- <%= f.label :source, class: 'col-xs-3 col-form-label' %>
20
- <div class='col-xs-9'>
21
- <%= f.text_field :source, class: 'form-control', placeholder: '/source' %>
22
- </div>
23
- </div>
24
-
25
- <div class='form-group row'>
26
- <%= f.label :destination, class: 'col-xs-3 col-form-label' %>
27
- <div class='col-xs-9'>
28
- <%= f.text_field :destination, class: 'form-control', placeholder: '/destination' %>
29
- </div>
30
- </div>
31
-
32
- <div class='form-group row'>
33
- <%= f.label :active, class: 'col-xs-3 col-form-label' %>
34
- <div class='col-xs-9'>
35
- <%= f.check_box :active, class: 'form-control' %>
36
- </div>
37
- </div>
38
-
39
- <div class='form-group row'>
40
- <%= f.label :source_is_regex, class: 'col-xs-3 col-form-label' %>
41
- <div class='col-xs-9'>
42
- <%= f.check_box :source_is_regex, class: 'form-control' %>
43
- </div>
44
- </div>
45
-
46
- <div class='form-group row'>
47
- <%= f.label :source_is_case_sensitive, class: 'col-xs-3 col-form-label' %>
48
- <div class='col-xs-9'>
49
- <%= f.check_box :source_is_case_sensitive, class: 'form-control' %>
50
- </div>
51
- </div>
52
-
53
- <div class='form-group row'>
54
- <div class='col-xs-12'>
55
- <%= f.submit 'Save', class: 'btn btn-primary pull-left' %>
56
- <%= link_to 'Destroy', redirector_ui.redirect_rule_path(@redirect_rule), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger pull-right' %>
57
- </div>
58
- </div>
59
- <% end %>
7
+ <%= render partial: 'form' %>
60
8
  </div>
@@ -4,20 +4,35 @@
4
4
  </div>
5
5
  </div>
6
6
  <div class='row'>
7
- <div class='col-md-9'>
8
- <div class='col-xs-12'>
9
- <%= paginate @redirect_rules_grid.assets, html: { class: 'pull-left' } %>
10
- <%= link_to fa_icon(:download, text: 'Download'), url_for(format: 'csv', redirector_ui_redirect_rules_grid: params.fetch(:redirector_ui_redirect_rules_grid, {}).permit!.to_h), class: 'pull-right' %>
7
+ <div class='col-xs-12'>
8
+ <%= link_to 'New', redirector_ui.new_redirect_rule_path, class: 'btn btn-primary' %>
9
+ </div>
10
+ </div>
11
+ <div class='row'>
12
+ <div class='col-lg-3 col-lg-push-9 col-xs-12'>
13
+ <div class='row'>
14
+ <div class='col-xs-12'>
15
+ <%= datagrid_form_for @redirect_rules_grid, method: :get, url: url_for(only_path: false) %>
16
+ </div>
17
+ </div>
18
+ </div>
19
+ <div class='col-lg-9 col-lg-pull-3 col-xs-12'>
20
+ <div class='row'>
21
+ <div class='col-xs-12'>
22
+ <%= paginate @redirect_rules_grid.assets, html: { class: 'pull-left' } %>
23
+ <%= link_to fa_icon(:download, text: 'Download'), url_for(format: 'csv', redirector_ui_redirect_rules_grid: params.fetch(:redirector_ui_redirect_rules_grid, {}).permit!.to_h), class: 'pull-right' %>
24
+ </div>
25
+ </div>
26
+ <div class='row'>
27
+ <div class='col-xs-12'>
28
+ <%= datagrid_table @redirect_rules_grid, html: { class: 'table table-hover table-striped' } %>
29
+ </div>
11
30
  </div>
12
- <%= datagrid_table @redirect_rules_grid, html: { class: 'table table-hover table-striped' } %>
13
31
  <div class='row'>
14
32
  <div class='col-xs-12'>
15
33
  <%= paginate @redirect_rules_grid.assets, html: { class: 'pull-left' } %>
16
34
  <%= link_to fa_icon(:download, text: 'Download'), url_for(format: 'csv', redirector_ui_redirect_rules_grid: params.fetch(:redirector_ui_redirect_rules_grid, {}).permit!.to_h), class: 'pull-right' %>
17
35
  </div>
18
36
  </div>
19
- </div>
20
- <div class='col-md-3'>
21
- <%= datagrid_form_for @redirect_rules_grid, method: :get, url: url_for(only_path: false) %>
22
37
  </div>
23
38
  </div>
@@ -0,0 +1,8 @@
1
+ <div class='container'>
2
+ <h1 class='title'>New redirect rule</h1>
3
+ <div class='row'>
4
+ <%= link_to 'Back', request.referer || redirector_ui.redirect_rules_path, class: 'btn btn-link' %>
5
+ </div>
6
+
7
+ <%= render partial: 'form' %>
8
+ </div>
data/config/routes.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  RedirectorUi::Engine.routes.draw do
2
- resources :redirect_rules, only: [ :index, :edit, :update, :destroy ]
2
+ resources :redirect_rules
3
3
 
4
4
  root to: 'redirect_rules#index'
5
5
  end
@@ -1,3 +1,3 @@
1
1
  module RedirectorUi
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redirector_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabien Dobat
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-18 00:00:00.000000000 Z
11
+ date: 2016-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap
@@ -126,14 +126,16 @@ files:
126
126
  - app/grids/redirector_ui/redirect_rules_grid.rb
127
127
  - app/helpers/redirector_ui/application_helper.rb
128
128
  - app/views/layouts/redirector_ui/application.html.erb
129
+ - app/views/redirector_ui/redirect_rules/_form.html.erb
129
130
  - app/views/redirector_ui/redirect_rules/edit.html.erb
130
131
  - app/views/redirector_ui/redirect_rules/index.html.erb
132
+ - app/views/redirector_ui/redirect_rules/new.html.erb
131
133
  - config/routes.rb
132
134
  - lib/redirector_ui.rb
133
135
  - lib/redirector_ui/engine.rb
134
136
  - lib/redirector_ui/version.rb
135
137
  - lib/tasks/redirector_ui_tasks.rake
136
- homepage: http://homepage.com
138
+ homepage: https://github.com/SeniorMedia/redirector_ui
137
139
  licenses:
138
140
  - MIT
139
141
  metadata: {}