sibu 0.5.1 → 0.5.2

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: 405cd4af1f8845dfe4b6231e130430052ffac0c4
4
- data.tar.gz: 4a482f965d0b363a14ab74e4e4abee76ebb6fd17
3
+ metadata.gz: 55f88a8944722aa3bd33d953891b63cef8715953
4
+ data.tar.gz: 3a9ffd847bfbacd5f62d1ce5e4a69b3a227f1e56
5
5
  SHA512:
6
- metadata.gz: 6da521391429cc8abfad5c2e2d807506d0a47d0b7a764caa3036cc75cc5fbfa6a9ba0e045f095c3a366dced3fbd629f925440d599b1a55ce925fc4efa54363b8
7
- data.tar.gz: 15de774f8eb8b486cc37d4a3c63ef6ab8f73b3469e87ea58450716436dab9737e6cff4bd8ad4b214ee47b923bdc9e114d448c3b1ad353b020d9757e430ee0afd
6
+ metadata.gz: b1cd49ba86dc257b3ae41427263efa1301145fc76dc3122d5c480abfe7c1b7e58723b370fa00ad49095aaef821835d21df023864cb0dff7513c6ef101863f8b1
7
+ data.tar.gz: 31d3842e221dc8634b9a5d365999499b0216d72b7dae5b79aa3b74520483b1eb3d49f028641ab229dfdfc7c8095d7e64cf58a5ce2e1ae134005f13f1cf9a1d55
@@ -3,7 +3,7 @@ require_dependency "sibu/application_controller"
3
3
  module Sibu
4
4
  class DocumentsController < ApplicationController
5
5
  def index
6
- @documents = Sibu::Document.for_user(sibu_user)
6
+ @documents = Sibu::Document.shared + Sibu::Document.for_user(sibu_user)
7
7
  end
8
8
 
9
9
  def new
@@ -5,6 +5,10 @@ module Sibu
5
5
 
6
6
  validates_presence_of :file_data
7
7
 
8
+ def self.shared
9
+ where(user_id: nil)
10
+ end
11
+
8
12
  def metadata
9
13
  JSON.parse(file_data, symbolize_names: true)[:metadata]
10
14
  end
@@ -22,7 +22,7 @@
22
22
  <td><%= doc.file_url %></td>
23
23
  <td>
24
24
  <%= link_to 'Voir', doc.file_url, target: '_blank' %> |
25
- <%= link_to 'Supprimer', document_path(doc), method: :delete, data: {confirm: "Supprimer le document \"#{doc.file_name}\" ?"} %>
25
+ <%= link_to('Supprimer', document_path(doc), method: :delete, data: {confirm: "Supprimer le document \"#{doc.file_name}\" ?"}) if doc.user_id %>
26
26
  </td>
27
27
  </tr>
28
28
  <% end %>
data/lib/sibu/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sibu
2
- VERSION = '0.5.1'
2
+ VERSION = '0.5.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sibu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Baptiste Vilain