carraway 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/carraway/file.rb +3 -2
- data/lib/carraway/file_repository.rb +6 -3
- data/lib/carraway/server.rb +2 -1
- data/lib/carraway/version.rb +1 -1
- data/lib/carraway/views/file_edit.erb +8 -0
- data/lib/carraway/views/files.erb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65b145b7f19885a00a7a1cc9d3ed65bd274471107ee7a48cd2c27c5626bca3bb
|
4
|
+
data.tar.gz: ed4141eb373c87f621c7b44f3fd6f6faf0e3dfbad768a0171201c48c40dc5cd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9a6c383f5e5b8d07af2dcb214008bcf458ea0c623e9d3aaf358396ec94904ebf6055d1521f3b8b2d5dc9a3322adc2e56f29a6b89a591d9d7367728c2fb88b7d
|
7
|
+
data.tar.gz: 6cd84e4f3de7b32302e1094d01fa13e3d6ec050580cfb31642772bddb17e3ceecb45ae4594905f210daa285da1869a57b3e3e156150b225d0e1b2e3275f0a49c
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v0.11.0](https://github.com/adorechic/carraway/tree/v0.11.0) (2019-02-15)
|
4
|
+
[Full Changelog](https://github.com/adorechic/carraway/compare/v0.10.0...v0.11.0)
|
5
|
+
|
6
|
+
**Implemented enhancements:**
|
7
|
+
|
8
|
+
- Support file delete [\#8](https://github.com/adorechic/carraway/pull/8) ([adorechic](https://github.com/adorechic))
|
9
|
+
- File title update [\#7](https://github.com/adorechic/carraway/pull/7) ([adorechic](https://github.com/adorechic))
|
10
|
+
- File detail page [\#6](https://github.com/adorechic/carraway/pull/6) ([adorechic](https://github.com/adorechic))
|
11
|
+
|
12
|
+
**Merged pull requests:**
|
13
|
+
|
14
|
+
- Introduce minio for s3 testing [\#5](https://github.com/adorechic/carraway/pull/5) ([adorechic](https://github.com/adorechic))
|
15
|
+
|
3
16
|
## [v0.10.0](https://github.com/adorechic/carraway/tree/v0.10.0) (2019-02-11)
|
4
17
|
[Full Changelog](https://github.com/adorechic/carraway/compare/v0.9.0...v0.10.0)
|
5
18
|
|
data/lib/carraway/file.rb
CHANGED
@@ -4,13 +4,14 @@ require 'aws-sdk-s3'
|
|
4
4
|
module Carraway
|
5
5
|
class File
|
6
6
|
attr_reader :uid, :created, :file
|
7
|
-
attr_accessor :title
|
7
|
+
attr_accessor :title, :labels
|
8
8
|
|
9
|
-
def initialize(title:, file: nil, uid: nil, created: nil)
|
9
|
+
def initialize(title:, file: nil, uid: nil, created: nil, labels: nil)
|
10
10
|
@title = title
|
11
11
|
@file = file
|
12
12
|
@uid = uid || generate_uid
|
13
13
|
@created = created
|
14
|
+
@labels = labels
|
14
15
|
end
|
15
16
|
|
16
17
|
%i(created).each do |col|
|
@@ -13,7 +13,8 @@ module Carraway
|
|
13
13
|
Carraway::File.new(
|
14
14
|
uid: item['uid'],
|
15
15
|
title: item['title'],
|
16
|
-
created: item['created']
|
16
|
+
created: item['created'],
|
17
|
+
labels: item['labels']
|
17
18
|
)
|
18
19
|
end
|
19
20
|
end
|
@@ -29,7 +30,8 @@ module Carraway
|
|
29
30
|
Carraway::File.new(
|
30
31
|
uid: item['uid'],
|
31
32
|
title: item['title'],
|
32
|
-
created: item['created']
|
33
|
+
created: item['created'],
|
34
|
+
labels: item['labels']
|
33
35
|
)
|
34
36
|
end
|
35
37
|
end
|
@@ -51,7 +53,8 @@ module Carraway
|
|
51
53
|
uid: file.uid,
|
52
54
|
record_type: 'file',
|
53
55
|
title: file.title,
|
54
|
-
created: file.created || at.to_i
|
56
|
+
created: file.created || at.to_i,
|
57
|
+
labels: file.labels
|
55
58
|
}
|
56
59
|
)
|
57
60
|
if file.file
|
data/lib/carraway/server.rb
CHANGED
@@ -139,6 +139,7 @@ module Carraway
|
|
139
139
|
# FIXME handle not found
|
140
140
|
# FIXME validation
|
141
141
|
file.title = params[:title]
|
142
|
+
file.labels = params[:labels]
|
142
143
|
repository.save(file)
|
143
144
|
redirect "/carraway/files/#{file.uid}"
|
144
145
|
end
|
@@ -152,7 +153,7 @@ module Carraway
|
|
152
153
|
end
|
153
154
|
|
154
155
|
post '/carraway/files' do
|
155
|
-
file = File.new(title: params[:title], file: params[:file])
|
156
|
+
file = File.new(title: params[:title], file: params[:file], labels: params[:labels])
|
156
157
|
# FIXME validation and error
|
157
158
|
FileRepository.new.save(file)
|
158
159
|
flash[:message] = "Saved #{file.path}"
|
data/lib/carraway/version.rb
CHANGED
@@ -9,6 +9,14 @@
|
|
9
9
|
<label for="title">ファイルタイトル</label>
|
10
10
|
</div>
|
11
11
|
</div>
|
12
|
+
<% Carraway::Config.labels.each do |key, title| %>
|
13
|
+
<p>
|
14
|
+
<label>
|
15
|
+
<input type="checkbox" class="filled-in" name="labels[]" value="<%= key %>" <%= @file.labels&.include?(key) ? 'checked' : nil %> />
|
16
|
+
<span><%= title %></span>
|
17
|
+
</label>
|
18
|
+
</p>
|
19
|
+
<% end %>
|
12
20
|
|
13
21
|
<button type="submit" class="waves-effect waves-light btn">保存</button>
|
14
22
|
</form>
|
@@ -9,6 +9,14 @@
|
|
9
9
|
<div class="input-field col s12">
|
10
10
|
<input type="file" id="file" name="file" placeholder="ファイル">
|
11
11
|
</div>
|
12
|
+
<% Carraway::Config.labels.each do |key, title| %>
|
13
|
+
<p>
|
14
|
+
<label>
|
15
|
+
<input type="checkbox" class="filled-in" name="labels[]" value="<%= key %>" />
|
16
|
+
<span><%= title %></span>
|
17
|
+
</label>
|
18
|
+
</p>
|
19
|
+
<% end %>
|
12
20
|
</div>
|
13
21
|
|
14
22
|
<button type="submit" class="waves-effect waves-light btn">保存</button>
|