administrate-field-carrierwave 0.0.2 → 0.0.3

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: 650f3f41527902384e4c0b1bc0eaef1d8ab11a44
4
- data.tar.gz: 987ad169a9e691606071cc3fe9b5851b8c3b1b92
3
+ metadata.gz: a1717d7fe72c576d5abfa8bf124e4d06aa287ff4
4
+ data.tar.gz: d42a7557e8138438a623b5e5a772b81ce544f0f6
5
5
  SHA512:
6
- metadata.gz: 551780de16e601b34e9c8dccc8e555d1e97392bbf11537fba331bb8d154c796ef09ebac19c24b26a173801b5b9028c478e728dfa2039d9939af931bd78819e78
7
- data.tar.gz: '049215f25018d1aeceae693a8f86c6c352afbf4ededa21798ce1b15b6c53a237c0bcc44e2da0f259c4e8d89ec7091fce73c2bd57df59868aef29a50f76699485'
6
+ metadata.gz: 676084a803681761b6034240d7c090bf0c013ec65f10b755537a5591154a340d5fcfa75b72677fdcf817a8bdcf964f6427fae8cc3e359fefe3c1bab63dd3d01b
7
+ data.tar.gz: 473f01457a42b5f521fa925b5b912696f4e323262c0d8cdaac5f2dbfb8afe757f39e0fe66c76514207fe0208015bbebb95425fb39a8abcef8908fcc731c67927
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.0.3](https://github.com/z-productions/administrate-field-carrierwave/tree/v0.0.3) (2016-11-29)
4
+ [Full Changelog](https://github.com/z-productions/administrate-field-carrierwave/compare/v0.0.2...v0.0.3)
5
+
6
+ * Improve attachment name visualization
7
+
3
8
  ## [v0.0.2](https://github.com/z-productions/administrate-field-carrierwave/tree/v0.0.2) (2016-11-29)
4
9
  [Full Changelog](https://github.com/z-productions/administrate-field-carrierwave/compare/v0.0.1...v0.0.2)
5
10
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- administrate-field-carrierwave (0.0.2)
4
+ administrate-field-carrierwave (0.0.3)
5
5
  administrate (~> 0.3.0)
6
6
  rails (>= 4.2)
7
7
 
data/README.md CHANGED
@@ -9,7 +9,7 @@ A plugin to upload and preview Carrierwave attachments in [Administrate].
9
9
  Add it to your `Gemfile`:
10
10
 
11
11
  ```ruby
12
- gem 'administrate-field-carrierwave', '~> 0.0.2'
12
+ gem 'administrate-field-carrierwave', '~> 0.0.3'
13
13
  ```
14
14
 
15
15
  Run:
@@ -2,7 +2,7 @@ $:.push File.expand_path('../lib', __FILE__)
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = 'administrate-field-carrierwave'
5
- gem.version = '0.0.2'
5
+ gem.version = '0.0.3'
6
6
  gem.authors = ['Michele Gerarduzzi']
7
7
  gem.email = ['michele.gerarduzzi@gmail.com']
8
8
  gem.homepage = 'https://github.com/z-productions/administrate-field-carrierwave'
@@ -20,7 +20,7 @@ This partial renders a file input field.
20
20
  <br />
21
21
  <%- if field.uploaded? -%>
22
22
  <%= render 'fields/carrierwave/preview', field: field %>
23
- <%= link_to field.filename, field.url, title: field.filename, target: '_blank' %>
23
+ <%= link_to field.basename, field.url, title: field.filename, target: '_blank' %>
24
24
  <%- else -%>
25
25
  <span>No file uploaded yet</span>
26
26
  <%- end -%>
@@ -1,3 +1,3 @@
1
1
  <% if field.image %>
2
- <p><%= image_tag field.url(field.image), alt: field.filename %></p>
2
+ <p><%= image_tag field.url(field.image), alt: field.basename %></p>
3
3
  <% end %>
@@ -12,4 +12,4 @@ opens in a new window/tab, and an optional image preview
12
12
  %>
13
13
 
14
14
  <%= render 'fields/carrierwave/preview', field: field %>
15
- <%= link_to field.filename, field.url, target: '_blank' %>
15
+ <%= link_to field.basename, field.url, title: field.filename, target: '_blank' %>
@@ -15,6 +15,10 @@ module Administrate
15
15
  def uploaded?
16
16
  url.present?
17
17
  end
18
+
19
+ def basename
20
+ File.basename(data.path)
21
+ end
18
22
  end
19
23
  end
20
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: administrate-field-carrierwave
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michele Gerarduzzi