tkh_illustrations 0.9.1 → 0.9.2
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/CHANGELOG.md +6 -0
- data/app/controllers/illustrations_controller.rb +10 -0
- data/app/views/illustrations/_form.html.erb +4 -8
- data/app/views/illustrations/_search_form.html.erb +20 -0
- data/app/views/illustrations/_section_header.html.erb +3 -0
- data/app/views/illustrations/edit.html.erb +1 -3
- data/app/views/illustrations/index.html.erb +6 -8
- data/app/views/illustrations/new.html.erb +1 -3
- data/app/views/illustrations/show.html.erb +3 -7
- data/config/routes.rb +6 -2
- data/lib/tkh_illustrations/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e44b135b46bfa957a2c279fd003d28def513d222
|
4
|
+
data.tar.gz: da85adf7580ad137502910c322cc3bbf9595801a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9187ec7a812f0c1db4767e33783139e199e4e536f8ca270ef256783d2e7c8d44ef5afac99d257a66d8f4469c8b3501f24646ba10e4b89c97a19ce773f491ffb
|
7
|
+
data.tar.gz: e1dc09d43b828e3ee9981118a756e6117ecdf190ce4b6160bfb907c7cbbfc261ce66009b21db826c7a32f0ddf6aa1492efb595593b0144c636750d053d409ce4
|
data/CHANGELOG.md
CHANGED
@@ -47,6 +47,16 @@ class IllustrationsController < ApplicationController
|
|
47
47
|
redirect_to illustrations_url
|
48
48
|
end
|
49
49
|
|
50
|
+
def search
|
51
|
+
illustration = Illustration.where('name = ?', illustration_params[:name]).first
|
52
|
+
if illustration
|
53
|
+
redirect_to illustration
|
54
|
+
else
|
55
|
+
flash[:warning] = "We could not find the illustration. Please make sure the name is accurate"
|
56
|
+
redirect_to illustrations_path
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
50
60
|
private
|
51
61
|
|
52
62
|
# Never trust parameters from the scary internet, only allow the white list through.
|
@@ -1,13 +1,9 @@
|
|
1
1
|
<%= simple_form_for @illustration, :html => { multipart: true, class: 'form-horizontal' } do |f| %>
|
2
2
|
<%= f.error_notification %>
|
3
3
|
|
4
|
-
|
5
|
-
<%= f.input :
|
6
|
-
<%= f.input :name, label: t('activerecord.attributes.illustration.name') %>
|
7
|
-
</div>
|
8
|
-
|
9
|
-
<div class="form-actions">
|
4
|
+
<%= f.input :image, label: t('activerecord.attributes.illustration.image') %><br />
|
5
|
+
<%= f.input :name, label: t('activerecord.attributes.illustration.name') %><br />
|
10
6
|
<%= f.button :submit, :class => 'btn btn-primary' %>
|
11
|
-
<%= link_to t('illustrations.cancel'), illustrations_path, :class => 'btn' %>
|
12
|
-
|
7
|
+
<%= link_to t('illustrations.cancel'), illustrations_path, :class => 'btn btn-default btn-xs' %>
|
8
|
+
|
13
9
|
<% end %>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<%= form_for Illustration.new, url: search_illustrations_path, html: { id: 'search-form' }, method: :get do |f| %>
|
2
|
+
<%#= f.error_notification %>
|
3
|
+
|
4
|
+
<%= f.text_field :name,
|
5
|
+
label: false,
|
6
|
+
required: false,
|
7
|
+
placeholder: 'search by illustration name',
|
8
|
+
size: 35,
|
9
|
+
as: :string,
|
10
|
+
autofocus: 'autofocus',
|
11
|
+
id: 'illustration_name',
|
12
|
+
:wrapper_html => { :id => 'name' },
|
13
|
+
:autocomplete => 'off',
|
14
|
+
:data => { provide: 'typeahead',
|
15
|
+
items: 10,
|
16
|
+
source: Illustration.alphabetically.map(&:name).to_json }
|
17
|
+
%>
|
18
|
+
<%= f.submit 'find graphic', :class => 'btn btn-xs btn-primary' %>
|
19
|
+
|
20
|
+
<% end %>
|
@@ -1,16 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
<%= render 'tab_admin_menu' %>
|
1
|
+
<%= render 'section_header' %>
|
4
2
|
|
5
3
|
<table class='table table-striped'>
|
6
4
|
<thead>
|
7
|
-
<tr>
|
5
|
+
<tr>
|
8
6
|
<th><%= t('activerecord.models.illustration') %></th>
|
9
7
|
<th><%= t('name_and_paths') %></th>
|
10
8
|
<th><%= t('actions') %></th>
|
11
9
|
</tr>
|
12
10
|
</thead>
|
13
|
-
|
11
|
+
|
14
12
|
<tbody>
|
15
13
|
<% @illustrations.each do |illustration| %>
|
16
14
|
<tr>
|
@@ -23,8 +21,8 @@
|
|
23
21
|
<b>Large</b> path: <%= illustration.image.large %><br />
|
24
22
|
<b>XL</b> path: <%= illustration.image.xl %>
|
25
23
|
</td>
|
26
|
-
<td><%= link_to t('edit'), edit_illustration_path(illustration), class: 'btn btn-
|
27
|
-
<%= link_to t('delete'), illustration, method: :delete, data: { confirm: t('are_you_sure') }, class: 'btn btn-
|
24
|
+
<td><%= link_to t('edit'), edit_illustration_path(illustration), class: 'btn btn-xs btn-default' %>
|
25
|
+
<%= link_to t('delete'), illustration, method: :delete, data: { confirm: t('are_you_sure') }, class: 'btn btn-xs btn-danger' %></td>
|
28
26
|
</tr>
|
29
27
|
<% end %>
|
30
28
|
</tbody>
|
@@ -34,4 +32,4 @@
|
|
34
32
|
|
35
33
|
<%= link_to t('illustrations.create.new'), new_illustration_path, class: 'btn btn-primary' %>
|
36
34
|
|
37
|
-
<%= render 'shared/admin_sidebar' %>
|
35
|
+
<%= render 'shared/admin_sidebar' %>
|
@@ -1,9 +1,7 @@
|
|
1
1
|
<% content_for :meta_title, @illustration.name %>
|
2
2
|
<% content_for :meta_description, @illustration.name %>
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
<%= render 'tab_admin_menu' %>
|
4
|
+
<%= render 'section_header' %>
|
7
5
|
|
8
6
|
<h3>Name: <%= @illustration.name %></h3>
|
9
7
|
<p>
|
@@ -13,9 +11,7 @@
|
|
13
11
|
<%= image_tag @illustration.image.large %><br /><%= @illustration.image.large %><br /><br />
|
14
12
|
<%= image_tag @illustration.image.xl %><br /><%= @illustration.image.xl %>
|
15
13
|
</p>
|
16
|
-
|
17
|
-
<%= link_to t('edit'), edit_illustration_path(@illustration), :class => 'btn btn-primary' %>
|
18
|
-
<%= link_to t('illustrations.all'), illustrations_path, class: 'btn' %>
|
19
|
-
<%= link_to t('illustrations.upload_new'), new_illustration_path, class: 'btn' %>
|
14
|
+
<br />
|
15
|
+
<%= link_to t('edit'), edit_illustration_path(@illustration), :class => 'btn btn-primary' %><%= link_to t('illustrations.all'), illustrations_path, class: 'btn btn-default' %>
|
20
16
|
|
21
17
|
<%= render 'shared/admin_sidebar' %>
|
data/config/routes.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tkh_illustrations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Swami Atma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -146,6 +146,8 @@ files:
|
|
146
146
|
- app/views/headers/new.html.erb
|
147
147
|
- app/views/headers/show.html.erb
|
148
148
|
- app/views/illustrations/_form.html.erb
|
149
|
+
- app/views/illustrations/_search_form.html.erb
|
150
|
+
- app/views/illustrations/_section_header.html.erb
|
149
151
|
- app/views/illustrations/_tab_admin_menu.html.erb
|
150
152
|
- app/views/illustrations/edit.html.erb
|
151
153
|
- app/views/illustrations/index.html.erb
|