agilib 0.1.4 → 0.1.5
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/app/controllers/agilib/devices_controller.rb +14 -2
- data/app/models/agilib/device.rb +3 -1
- data/app/views/agilib/devices/_form.html.erb +27 -17
- data/app/views/agilib/devices/edit.html.erb +11 -4
- data/app/views/agilib/devices/index.html.erb +29 -0
- data/app/views/agilib/devices/index.json.jbuilder +4 -0
- data/app/views/agilib/devices/new.html.erb +7 -3
- data/app/views/agilib/devices/show.html.erb +19 -22
- data/app/views/agilib/devices/show.json.jbuilder +1 -0
- data/lib/agilib/composer/templates/recipes/layout.rb +3 -0
- data/lib/agilib/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 957f22bc0492db8d31a2b8b09504dcf17e420848
|
4
|
+
data.tar.gz: ce3664959d727aef66671f1b51dc8f16db7c003a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb6bfa1133dddae17c0b0432768e79ee130b4d5e4e3f5da56951580bc5afe85eafa612c1ec49a2bd2891aac081b2157b877f198b1f10840753216b80570633d2
|
7
|
+
data.tar.gz: c59dece64979d4d424cb7650c7563f5f89f81baba50ebab46d450742d9a7d86eb183d7d7a1d618ac1cda756adab51118b627155d3ebb2d6487d3e5ca12358107
|
@@ -7,7 +7,7 @@ module Agilib
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def index
|
10
|
-
@devices = @get_devices
|
10
|
+
@devices = @get_devices
|
11
11
|
respond_with(@devices)
|
12
12
|
end
|
13
13
|
|
@@ -27,12 +27,21 @@ module Agilib
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def create
|
30
|
-
|
30
|
+
if Agilib.rails4?
|
31
|
+
@device = @get_devices.build(device_params)
|
32
|
+
else
|
33
|
+
@device = @get_devices.build(params[:device])
|
34
|
+
end
|
31
35
|
respond_with(@device)
|
32
36
|
end
|
33
37
|
|
34
38
|
def update
|
35
39
|
@device = @get_devices.find(params[:id])
|
40
|
+
if Agilib.rails4?
|
41
|
+
@device.update(device_params)
|
42
|
+
else
|
43
|
+
@device.update_attributes(params[:device])
|
44
|
+
end
|
36
45
|
respond_with(@device)
|
37
46
|
end
|
38
47
|
|
@@ -46,6 +55,9 @@ module Agilib
|
|
46
55
|
def get_devices
|
47
56
|
@get_devices = current_user.devices
|
48
57
|
end
|
58
|
+
def device_params
|
59
|
+
params.require(:device).permit(:platform, :register)
|
60
|
+
end
|
49
61
|
end
|
50
62
|
|
51
63
|
end
|
data/app/models/agilib/device.rb
CHANGED
@@ -1,22 +1,32 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
<%= form_for(@device, :html => { :class => "form-horizontal" }) do |f| %>
|
2
|
+
<% if @device.errors.any? %>
|
3
|
+
<div class="alert alert-danger alert-dismissable">
|
4
|
+
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
5
|
+
<h4><%= pluralize(@device.errors.count, "error") %> prohibited this device from being saved:</h4>
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
<%= f.association :user %>
|
11
|
-
<%= f.input :platform %>
|
12
|
-
<%= f.input :register %>
|
13
|
-
<%= f.input :deleted_at %>
|
7
|
+
<ul>
|
8
|
+
<% @device.errors.full_messages.each do |msg| %>
|
9
|
+
<li><%= msg %></li>
|
10
|
+
<% end %>
|
11
|
+
</ul>
|
14
12
|
</div>
|
13
|
+
<% end %>
|
15
14
|
|
15
|
+
<div class="form-group">
|
16
|
+
<%= f.label :platform, :class => "col-lg-2 control-label" %>
|
17
|
+
<div class="col-lg-10">
|
18
|
+
<%= f.text_field :platform, :class => "form-control" %>
|
19
|
+
</div>
|
16
20
|
</div>
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
+
<div class="form-group">
|
22
|
+
<%= f.label :register, :class => "col-lg-2 control-label" %>
|
23
|
+
<div class="col-lg-10">
|
24
|
+
<%= f.text_field :register, :class => "form-control" %>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
<div class="form-group">
|
28
|
+
<div class="col-lg-offset-2 col-lg-10">
|
29
|
+
<%= f.submit :class => "btn btn-primary" %>
|
30
|
+
</div>
|
21
31
|
</div>
|
22
|
-
<% end %>
|
32
|
+
<% end %>
|
@@ -1,6 +1,13 @@
|
|
1
|
-
<
|
1
|
+
<div class="page-header">
|
2
|
+
<%= link_to devices_path, :class => 'btn btn-default' do %>
|
3
|
+
<span class="glyphicon glyphicon-list-alt"></span>
|
4
|
+
Back
|
5
|
+
<% end %>
|
6
|
+
<%= link_to @device, :class => 'btn btn-primary' do %>
|
7
|
+
<span class="glyphicon glyphicon-info-sign"></span>
|
8
|
+
Show
|
9
|
+
<% end %>
|
10
|
+
<h1>Editing device</h1>
|
11
|
+
</div>
|
2
12
|
|
3
13
|
<%= render 'form' %>
|
4
|
-
|
5
|
-
<%= link_to 'Show', @device %> |
|
6
|
-
<%= link_to 'Back', devices_path %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<div class="page-header">
|
2
|
+
<%= link_to new_device_path, :class => 'btn btn-primary' do %>
|
3
|
+
<span class="glyphicon glyphicon-plus"></span>
|
4
|
+
New User
|
5
|
+
<% end %>
|
6
|
+
<h1>Listing devices</h1>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<div class="table-responsive">
|
10
|
+
<table class="table table-striped table-bordered table-hover">
|
11
|
+
<thead>
|
12
|
+
<tr>
|
13
|
+
<th>Name</th>
|
14
|
+
<th></th>
|
15
|
+
<th></th>
|
16
|
+
<th></th>
|
17
|
+
</tr>
|
18
|
+
</thead>
|
19
|
+
|
20
|
+
<tbody>
|
21
|
+
<%= content_tag_for(:tr, @devices) do |device| %>
|
22
|
+
<td><%= device.platform %></td>
|
23
|
+
<td><%= link_to 'Show', device %></td>
|
24
|
+
<td><%= link_to 'Edit', edit_device_path(device) %></td>
|
25
|
+
<td><%= link_to 'Destroy', device, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
26
|
+
<% end %>
|
27
|
+
</tbody>
|
28
|
+
</table>
|
29
|
+
</div>
|
@@ -1,5 +1,9 @@
|
|
1
|
-
<
|
1
|
+
<div class="page-header">
|
2
|
+
<%= link_to devices_path, :class => 'btn btn-default' do %>
|
3
|
+
<span class="glyphicon glyphicon-list-alt"></span>
|
4
|
+
Back
|
5
|
+
<% end %>
|
6
|
+
<h1>New device</h1>
|
7
|
+
</div>
|
2
8
|
|
3
9
|
<%= render 'form' %>
|
4
|
-
|
5
|
-
<%= link_to 'Back', devices_path %>
|
@@ -1,25 +1,22 @@
|
|
1
|
-
<
|
1
|
+
<div class="page-header">
|
2
|
+
<%= link_to devices_path, :class => 'btn btn-default' do %>
|
3
|
+
<span class="glyphicon glyphicon-list-alt"></span>
|
4
|
+
Back
|
5
|
+
<% end %>
|
6
|
+
<%= link_to edit_device_path(@device), :class => 'btn btn-primary' do %>
|
7
|
+
<span class="glyphicon glyphicon-pencil"></span>
|
8
|
+
Edit
|
9
|
+
<% end %>
|
10
|
+
<h1>Show device</h1>
|
11
|
+
</div>
|
2
12
|
|
3
|
-
<
|
4
|
-
<
|
5
|
-
|
6
|
-
</p>
|
13
|
+
<dl class="dl-horizontal">
|
14
|
+
<dt>Platform:</dt>
|
15
|
+
<dd><%= @device.platform %></dd>
|
7
16
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
17
|
+
</dl>
|
18
|
+
<dl class="dl-horizontal">
|
19
|
+
<dt>Register:</dt>
|
20
|
+
<dd><%= @device.register %></dd>
|
12
21
|
|
13
|
-
|
14
|
-
<b>Register:</b>
|
15
|
-
<%= @device.register %>
|
16
|
-
</p>
|
17
|
-
|
18
|
-
<p>
|
19
|
-
<b>Deleted at:</b>
|
20
|
-
<%= @device.deleted_at %>
|
21
|
-
</p>
|
22
|
-
|
23
|
-
|
24
|
-
<%= link_to 'Edit', edit_device_path(@device) %> |
|
25
|
-
<%= link_to 'Back', devices_path %>
|
22
|
+
</dl>
|
@@ -0,0 +1 @@
|
|
1
|
+
json.extract! @device, :id, :platform, :register, :created_at, :updated_at
|
data/lib/agilib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: agilib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcos Junior
|
@@ -178,8 +178,10 @@ files:
|
|
178
178
|
- app/views/agilib/devices/_form.html.erb
|
179
179
|
- app/views/agilib/devices/edit.html.erb
|
180
180
|
- app/views/agilib/devices/index.html.erb
|
181
|
+
- app/views/agilib/devices/index.json.jbuilder
|
181
182
|
- app/views/agilib/devices/new.html.erb
|
182
183
|
- app/views/agilib/devices/show.html.erb
|
184
|
+
- app/views/agilib/devices/show.json.jbuilder
|
183
185
|
- app/views/agilib/welcome/index.html
|
184
186
|
- app/views/agilib/welcome/index.html.erb
|
185
187
|
- bin/agilib
|