ezii-os 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/Aptfile +2 -0
  3. data/Gemfile +3 -1
  4. data/Gemfile.lock +27 -0
  5. data/Procfile +2 -1
  6. data/app/assets/stylesheets/banal/brainstorms.scss +3 -0
  7. data/app/assets/stylesheets/banal/projects.scss +3 -0
  8. data/app/assets/stylesheets/tasks.scss +3 -0
  9. data/app/controllers/application_controller.rb +9 -0
  10. data/app/controllers/banal/brainstorms_controller.rb +74 -0
  11. data/app/controllers/banal/projects_controller.rb +74 -0
  12. data/app/controllers/directories_controller.rb +2 -2
  13. data/app/controllers/ezii_os_files_controller.rb +17 -0
  14. data/app/controllers/tasks_controller.rb +74 -0
  15. data/app/helpers/banal/brainstorms_helper.rb +2 -0
  16. data/app/helpers/banal/projects_helper.rb +2 -0
  17. data/app/helpers/tasks_helper.rb +2 -0
  18. data/app/models/banal/brainstorm.rb +2 -0
  19. data/app/models/banal/project.rb +4 -0
  20. data/app/models/banal.rb +5 -0
  21. data/app/models/ezii_os_path.rb +2 -1
  22. data/app/models/task.rb +2 -0
  23. data/app/views/application/_navbar.html.erb +20 -0
  24. data/app/views/banal/brainstorms/_banal_brainstorm.json.jbuilder +2 -0
  25. data/app/views/banal/brainstorms/_form.html.erb +47 -0
  26. data/app/views/banal/brainstorms/edit.html.erb +6 -0
  27. data/app/views/banal/brainstorms/index.html.erb +37 -0
  28. data/app/views/banal/brainstorms/index.json.jbuilder +1 -0
  29. data/app/views/banal/brainstorms/new.html.erb +5 -0
  30. data/app/views/banal/brainstorms/show.html.erb +34 -0
  31. data/app/views/banal/brainstorms/show.json.jbuilder +1 -0
  32. data/app/views/banal/projects/_banal_project.json.jbuilder +2 -0
  33. data/app/views/banal/projects/_form.html.erb +22 -0
  34. data/app/views/banal/projects/edit.html.erb +6 -0
  35. data/app/views/banal/projects/index.html.erb +27 -0
  36. data/app/views/banal/projects/index.json.jbuilder +1 -0
  37. data/app/views/banal/projects/new.html.erb +5 -0
  38. data/app/views/banal/projects/show.html.erb +9 -0
  39. data/app/views/banal/projects/show.json.jbuilder +1 -0
  40. data/app/views/directories/show.html.erb +8 -4
  41. data/app/views/ezii_os_files/_entity_visual_selection.html.erb +66 -0
  42. data/app/views/ezii_os_files/_wit_ai_widget.html.erb +80 -72
  43. data/app/views/layouts/application.html.erb +26 -197
  44. data/app/views/layouts/application_legacy.html.erb +212 -0
  45. data/app/views/tasks/_form.html.erb +37 -0
  46. data/app/views/tasks/_task.json.jbuilder +2 -0
  47. data/app/views/tasks/edit.html.erb +6 -0
  48. data/app/views/tasks/index.html.erb +33 -0
  49. data/app/views/tasks/index.json.jbuilder +1 -0
  50. data/app/views/tasks/new.html.erb +5 -0
  51. data/app/views/tasks/show.html.erb +12 -0
  52. data/app/views/tasks/show.json.jbuilder +1 -0
  53. data/config/routes.rb +7 -0
  54. data/db/development.sqlite3 +0 -0
  55. data/db/migrate/20190912113509_create_tasks.rb +12 -0
  56. data/db/migrate/20190912173649_create_banal_projects.rb +9 -0
  57. data/db/migrate/20190912173916_create_banal_brainstorms.rb +14 -0
  58. data/db/seeds.rb +7 -0
  59. data/ezii-os.gemspec +1 -1
  60. data/lib/tasks/rgeo_supports_geos.rake +6 -0
  61. data/lib/tasks/task.rake +5 -5
  62. data/log/development.log +8016 -0
  63. data/test/controllers/banal/brainstorms_controller_test.rb +48 -0
  64. data/test/controllers/banal/projects_controller_test.rb +48 -0
  65. data/test/controllers/tasks_controller_test.rb +48 -0
  66. data/test/fixtures/banal/brainstorms.yml +17 -0
  67. data/test/fixtures/banal/projects.yml +7 -0
  68. data/test/fixtures/tasks.yml +13 -0
  69. data/test/models/banal/brainstorm_test.rb +7 -0
  70. data/test/models/banal/project_test.rb +7 -0
  71. data/test/models/task_test.rb +7 -0
  72. data/test/system/banal/brainstorms_test.rb +53 -0
  73. data/test/system/banal/projects_test.rb +43 -0
  74. data/test/system/tasks_test.rb +49 -0
  75. metadata +58 -4
  76. data/app/assets/stylesheets/scaffolds.scss +0 -84
  77. data/ezii-os-0.0.0.0.1.gem +0 -0
  78. data/ezii-os-0.0.0.1.0.gem +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af2702b497fa0c6932e35c160431d0f9d285a213471a10291042b519de1b0d61
4
- data.tar.gz: 307d0c8177472427f1e135cd12c62f7a032b7e6074793b2b994750ac568d87e9
3
+ metadata.gz: a54e9952cf2727260c2697555f65aae81e2535755a289f6f957bd9157bc510a4
4
+ data.tar.gz: 31ada4e6c07e9d60443b6a5a73b760391e8664832c38d00f73b3128c5c20cb58
5
5
  SHA512:
6
- metadata.gz: c843d4043089ad0b433fbc5d1bce4e3ab9e176f46d0d6b020de61edc44880c5c3c2d85b7e42f4e98ff3c03946387619a4e7de03e246292f8e029cce4de424743
7
- data.tar.gz: 73782c21e30ec5cba574e42f1f3235c43dfb20b81de8902c79f31913277e789b7a9ed0ebfe83ee7eb2b99f2f4c5e4e8176602d60277aaacc5b5cd8909b29c919
6
+ metadata.gz: f4954161f055b5256a0245f441536cc920f18b29eaa8e6828ec1c81664c2813c112153ca30679fe6b8d26c31324018069b1cfb479a05a4554e9513ed887fb9ad
7
+ data.tar.gz: 87f9a29bf6b0f1e6c15da787e3bac0c8ce40d7a6fc55b97ff2429776b25196cf6ae934c0c70cd8bf23c8258eff4d441fba43092b1a445507fd539f3c4214c069
data/Aptfile ADDED
@@ -0,0 +1,2 @@
1
+ libproj-dev
2
+ libgeos-dev
data/Gemfile CHANGED
@@ -7,7 +7,9 @@ ruby '2.6.3'
7
7
  gem 'byebug'
8
8
  gem 'wit'
9
9
  gem 'docsplit'
10
-
10
+ gem 'workbook'
11
+ gem 'rgeo-shapefile'
12
+ gem 'rgeo-geojson'
11
13
  # gem 'discordrb'
12
14
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
13
15
  gem 'rails', '~> 6.0.0'
data/Gemfile.lock CHANGED
@@ -58,6 +58,11 @@ GEM
58
58
  zeitwerk (~> 2.1, >= 2.1.8)
59
59
  addressable (2.6.0)
60
60
  public_suffix (>= 2.0.2, < 4.0)
61
+ axlsx (3.0.0.pre)
62
+ htmlentities (~> 4.3, >= 4.3.4)
63
+ mimemagic (~> 0.3)
64
+ nokogiri (~> 1.8, >= 1.8.2)
65
+ rubyzip (~> 1.2, >= 1.2.1)
61
66
  bindex (0.8.1)
62
67
  bootsnap (1.4.4)
63
68
  msgpack (~> 1.0)
@@ -77,6 +82,7 @@ GEM
77
82
  rake (< 13.0)
78
83
  concurrent-ruby (1.1.5)
79
84
  crass (1.0.4)
85
+ dbf (3.1.3)
80
86
  docsplit (0.7.6)
81
87
  dropbox_api (0.1.17)
82
88
  faraday (>= 0.8, <= 0.15.4)
@@ -87,10 +93,12 @@ GEM
87
93
  ffi (1.11.1)
88
94
  globalid (0.4.2)
89
95
  activesupport (>= 4.2.0)
96
+ htmlentities (4.3.4)
90
97
  i18n (1.6.0)
91
98
  concurrent-ruby (~> 1.0)
92
99
  jbuilder (2.9.1)
93
100
  activesupport (>= 4.2.0)
101
+ json (2.2.0)
94
102
  jwt (2.2.1)
95
103
  listen (3.1.5)
96
104
  rb-fsevent (~> 0.9, >= 0.9.4)
@@ -159,7 +167,15 @@ GEM
159
167
  rb-fsevent (0.10.3)
160
168
  rb-inotify (0.10.0)
161
169
  ffi (~> 1.0)
170
+ rchardet (1.8.0)
162
171
  regexp_parser (1.6.0)
172
+ rgeo (2.1.1)
173
+ rgeo-geojson (2.1.1)
174
+ rgeo (>= 1.0.0)
175
+ rgeo-shapefile (2.0.1)
176
+ dbf (~> 3.0)
177
+ rgeo (>= 1.0)
178
+ ruby-ole (1.2.12.2)
163
179
  ruby_dep (1.5.0)
164
180
  rubyzip (1.2.3)
165
181
  sass (3.7.4)
@@ -176,6 +192,8 @@ GEM
176
192
  selenium-webdriver (3.142.3)
177
193
  childprocess (>= 0.5, < 2.0)
178
194
  rubyzip (~> 1.2, >= 1.2.2)
195
+ spreadsheet (1.2.4)
196
+ ruby-ole (>= 1.0)
179
197
  spring (2.1.0)
180
198
  spring-watcher-listen (2.0.1)
181
199
  listen (>= 2.7, < 4.0)
@@ -213,6 +231,12 @@ GEM
213
231
  websocket-extensions (>= 0.1.0)
214
232
  websocket-extensions (0.1.4)
215
233
  wit (6.0.0)
234
+ workbook (0.8.1)
235
+ axlsx (~> 3.0.0.pre)
236
+ json (~> 2.1)
237
+ nokogiri (~> 1.8)
238
+ rchardet (~> 1.3)
239
+ spreadsheet (~> 1.1)
216
240
  xpath (3.2.0)
217
241
  nokogiri (~> 1.8)
218
242
  zeitwerk (2.1.9)
@@ -232,6 +256,8 @@ DEPENDENCIES
232
256
  pg
233
257
  puma (~> 3.11)
234
258
  rails (~> 6.0.0)
259
+ rgeo-geojson
260
+ rgeo-shapefile
235
261
  sass-rails (~> 5)
236
262
  selenium-webdriver
237
263
  spring
@@ -243,6 +269,7 @@ DEPENDENCIES
243
269
  webdrivers
244
270
  webpacker (~> 4.0)
245
271
  wit
272
+ workbook
246
273
 
247
274
  RUBY VERSION
248
275
  ruby 2.6.3p62
data/Procfile CHANGED
@@ -1,2 +1,3 @@
1
1
  web: bundle exec rails server -p $PORT
2
- worker: rails runner 'EziiIntegration.new.start'
2
+ worker: rails runner 'EziiIntegration.new.start'
3
+ release: bundle exec rails rgeo_supports_geos
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the banal/brainstorms controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the banal/projects controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the tasks controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -1,2 +1,11 @@
1
1
  class ApplicationController < ActionController::Base
2
+ layout :choose_layout
3
+
4
+ def choose_layout
5
+ if params[:legacy_layout] == "1"
6
+ "application_legacy"
7
+ else
8
+ "application"
9
+ end
10
+ end
2
11
  end
@@ -0,0 +1,74 @@
1
+ class Banal::BrainstormsController < ApplicationController
2
+ before_action :set_banal_brainstorm, only: [:show, :edit, :update, :destroy]
3
+
4
+ # GET /banal/brainstorms
5
+ # GET /banal/brainstorms.json
6
+ def index
7
+ @banal_brainstorms = Banal::Brainstorm.all
8
+ end
9
+
10
+ # GET /banal/brainstorms/1
11
+ # GET /banal/brainstorms/1.json
12
+ def show
13
+ end
14
+
15
+ # GET /banal/brainstorms/new
16
+ def new
17
+ @banal_brainstorm = Banal::Brainstorm.new
18
+ end
19
+
20
+ # GET /banal/brainstorms/1/edit
21
+ def edit
22
+ end
23
+
24
+ # POST /banal/brainstorms
25
+ # POST /banal/brainstorms.json
26
+ def create
27
+ @banal_brainstorm = Banal::Brainstorm.new(banal_brainstorm_params)
28
+
29
+ respond_to do |format|
30
+ if @banal_brainstorm.save
31
+ format.html { redirect_to @banal_brainstorm, notice: 'Brainstorm was successfully created.' }
32
+ format.json { render :show, status: :created, location: @banal_brainstorm }
33
+ else
34
+ format.html { render :new }
35
+ format.json { render json: @banal_brainstorm.errors, status: :unprocessable_entity }
36
+ end
37
+ end
38
+ end
39
+
40
+ # PATCH/PUT /banal/brainstorms/1
41
+ # PATCH/PUT /banal/brainstorms/1.json
42
+ def update
43
+ respond_to do |format|
44
+ if @banal_brainstorm.update(banal_brainstorm_params)
45
+ format.html { redirect_to @banal_brainstorm, notice: 'Brainstorm was successfully updated.' }
46
+ format.json { render :show, status: :ok, location: @banal_brainstorm }
47
+ else
48
+ format.html { render :edit }
49
+ format.json { render json: @banal_brainstorm.errors, status: :unprocessable_entity }
50
+ end
51
+ end
52
+ end
53
+
54
+ # DELETE /banal/brainstorms/1
55
+ # DELETE /banal/brainstorms/1.json
56
+ def destroy
57
+ @banal_brainstorm.destroy
58
+ respond_to do |format|
59
+ format.html { redirect_to banal_brainstorms_url, notice: 'Brainstorm was successfully destroyed.' }
60
+ format.json { head :no_content }
61
+ end
62
+ end
63
+
64
+ private
65
+ # Use callbacks to share common setup or constraints between actions.
66
+ def set_banal_brainstorm
67
+ @banal_brainstorm = Banal::Brainstorm.find(params[:id])
68
+ end
69
+
70
+ # Never trust parameters from the scary internet, only allow the white list through.
71
+ def banal_brainstorm_params
72
+ params.require(:banal_brainstorm).permit(:idea, :main_category, :priority, :status, :comments, :idea_owner)
73
+ end
74
+ end
@@ -0,0 +1,74 @@
1
+ class Banal::ProjectsController < ApplicationController
2
+ before_action :set_banal_project, only: [:show, :edit, :update, :destroy]
3
+
4
+ # GET /banal/projects
5
+ # GET /banal/projects.json
6
+ def index
7
+ @banal_projects = Banal::Project.all
8
+ end
9
+
10
+ # GET /banal/projects/1
11
+ # GET /banal/projects/1.json
12
+ def show
13
+ end
14
+
15
+ # GET /banal/projects/new
16
+ def new
17
+ @banal_project = Banal::Project.new
18
+ end
19
+
20
+ # GET /banal/projects/1/edit
21
+ def edit
22
+ end
23
+
24
+ # POST /banal/projects
25
+ # POST /banal/projects.json
26
+ def create
27
+ @banal_project = Banal::Project.new(banal_project_params)
28
+
29
+ respond_to do |format|
30
+ if @banal_project.save
31
+ format.html { redirect_to @banal_project, notice: 'Project was successfully created.' }
32
+ format.json { render :show, status: :created, location: @banal_project }
33
+ else
34
+ format.html { render :new }
35
+ format.json { render json: @banal_project.errors, status: :unprocessable_entity }
36
+ end
37
+ end
38
+ end
39
+
40
+ # PATCH/PUT /banal/projects/1
41
+ # PATCH/PUT /banal/projects/1.json
42
+ def update
43
+ respond_to do |format|
44
+ if @banal_project.update(banal_project_params)
45
+ format.html { redirect_to @banal_project, notice: 'Project was successfully updated.' }
46
+ format.json { render :show, status: :ok, location: @banal_project }
47
+ else
48
+ format.html { render :edit }
49
+ format.json { render json: @banal_project.errors, status: :unprocessable_entity }
50
+ end
51
+ end
52
+ end
53
+
54
+ # DELETE /banal/projects/1
55
+ # DELETE /banal/projects/1.json
56
+ def destroy
57
+ @banal_project.destroy
58
+ respond_to do |format|
59
+ format.html { redirect_to banal_projects_url, notice: 'Project was successfully destroyed.' }
60
+ format.json { head :no_content }
61
+ end
62
+ end
63
+
64
+ private
65
+ # Use callbacks to share common setup or constraints between actions.
66
+ def set_banal_project
67
+ @banal_project = Banal::Project.find(params[:id])
68
+ end
69
+
70
+ # Never trust parameters from the scary internet, only allow the white list through.
71
+ def banal_project_params
72
+ params.require(:banal_project).permit(:name)
73
+ end
74
+ end
@@ -22,7 +22,7 @@ class DirectoriesController < ApplicationController
22
22
  when 'local'
23
23
  @paths = Dir
24
24
  .entries(@path.file_system_path)
25
- .sample(100)
25
+ .take(25)
26
26
  .map do |entry|
27
27
  EziiOsPath.new(
28
28
  File.join(@path.global_path, entry)
@@ -36,7 +36,7 @@ class DirectoriesController < ApplicationController
36
36
  dropbox_directory = DropboxDirectory.new(@path.file_system_path)
37
37
  @paths = dropbox_directory
38
38
  .entries
39
- .sample(20)
39
+ .take(25)
40
40
  .map do |entry|
41
41
  path = EziiOsPath.new(
42
42
  File.join(@path.global_path, entry['name'])
@@ -28,6 +28,7 @@ class EziiOsFilesController < ApplicationController
28
28
  @path.https_url = '/' + relative_path_to_file.gsub(/\s/, '%20')
29
29
  when 'dropbox'
30
30
  bda = BanalDropboxApi.new
31
+
31
32
  bda.download(@path.file_system_path) do |file_content|
32
33
  @last_file_input = file_content
33
34
 
@@ -39,6 +40,22 @@ class EziiOsFilesController < ApplicationController
39
40
  @path.local_file_system_path = t.path
40
41
  end
41
42
 
43
+ if File.extname(@path.file_system_path) == '.shp'
44
+ remote_path = @path.file_system_path
45
+ local_path = @path.local_file_system_path
46
+
47
+ %w(.shx .dbf).each do |file_extension|
48
+ bda.download(remote_path.gsub('.shp', file_extension)) do |file_content|
49
+ t = Tempfile.new(['file', file_extension])
50
+ t.binmode
51
+ #TODO: figure out why this had to be attempted multiple times for the write to work
52
+ 5.times { t.write(file_content) }
53
+ `ln -s #{t.path} #{local_path.gsub('.shp', file_extension)}`
54
+ @path.complementary_local_file_system_paths.push(local_path.gsub('.shp', file_extension))
55
+ end
56
+ end
57
+ end
58
+
42
59
  @path.https_url = bda.get_link(@path.file_system_path) rescue nil
43
60
  end
44
61
  end
@@ -0,0 +1,74 @@
1
+ class TasksController < ApplicationController
2
+ before_action :set_task, only: [:show, :edit, :update, :destroy]
3
+
4
+ # GET /tasks
5
+ # GET /tasks.json
6
+ def index
7
+ @tasks = Task.all
8
+ end
9
+
10
+ # GET /tasks/1
11
+ # GET /tasks/1.json
12
+ def show
13
+ end
14
+
15
+ # GET /tasks/new
16
+ def new
17
+ @task = Task.new
18
+ end
19
+
20
+ # GET /tasks/1/edit
21
+ def edit
22
+ end
23
+
24
+ # POST /tasks
25
+ # POST /tasks.json
26
+ def create
27
+ @task = Task.new(task_params)
28
+
29
+ respond_to do |format|
30
+ if @task.save
31
+ format.html { redirect_to @task, notice: 'Task was successfully created.' }
32
+ format.json { render :show, status: :created, location: @task }
33
+ else
34
+ format.html { render :new }
35
+ format.json { render json: @task.errors, status: :unprocessable_entity }
36
+ end
37
+ end
38
+ end
39
+
40
+ # PATCH/PUT /tasks/1
41
+ # PATCH/PUT /tasks/1.json
42
+ def update
43
+ respond_to do |format|
44
+ if @task.update(task_params)
45
+ format.html { redirect_to @task, notice: 'Task was successfully updated.' }
46
+ format.json { render :show, status: :ok, location: @task }
47
+ else
48
+ format.html { render :edit }
49
+ format.json { render json: @task.errors, status: :unprocessable_entity }
50
+ end
51
+ end
52
+ end
53
+
54
+ # DELETE /tasks/1
55
+ # DELETE /tasks/1.json
56
+ def destroy
57
+ @task.destroy
58
+ respond_to do |format|
59
+ format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' }
60
+ format.json { head :no_content }
61
+ end
62
+ end
63
+
64
+ private
65
+ # Use callbacks to share common setup or constraints between actions.
66
+ def set_task
67
+ @task = Task.find(params[:id])
68
+ end
69
+
70
+ # Never trust parameters from the scary internet, only allow the white list through.
71
+ def task_params
72
+ params.require(:task).permit(:reward, :title, :briefing, :cta_copy)
73
+ end
74
+ end
@@ -0,0 +1,2 @@
1
+ module Banal::BrainstormsHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module Banal::ProjectsHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module TasksHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ class Banal::Brainstorm < ApplicationRecord
2
+ end
@@ -0,0 +1,4 @@
1
+ module Banal
2
+ class Project < ApplicationRecord
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ module Banal
2
+ def self.table_name_prefix
3
+ 'banal_'
4
+ end
5
+ end
@@ -3,11 +3,12 @@ class EziiOsPath
3
3
 
4
4
  attr_accessor :dropbox_metainfo # should be refactored
5
5
 
6
- attr_accessor :https_url, :local_file_system_path # hacky
6
+ attr_accessor :https_url, :local_file_system_path, :complementary_local_file_system_paths # hacky
7
7
 
8
8
  def initialize(global_path)
9
9
  self.global_path = global_path
10
10
  self.file_system = FileSystem.find_by(machine_readable_identifier: file_system_identifier)
11
+ self.complementary_local_file_system_paths = []
11
12
  end
12
13
 
13
14
  def file_system_path
@@ -0,0 +1,2 @@
1
+ class Task < ApplicationRecord
2
+ end
@@ -0,0 +1,20 @@
1
+ <nav class="navbar sticky-top navbar-expand-lg navbar-dark bg-primary">
2
+ <a class="navbar-brand" href="/">
3
+ <img src="https://image.flaticon.com/icons/png/512/68/68335.png" width="30" height="30">
4
+ Banal Data
5
+ </a>
6
+ <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
7
+ <span class="navbar-toggler-icon"></span>
8
+ </button>
9
+
10
+ <div class="collapse navbar-collapse" id="navbarSupportedContent">
11
+ <ul class="navbar-nav mr-auto">
12
+ <li class="nav-item active">
13
+ <a class="nav-link" href="/banal/brainstorms">Brainstorms</a>
14
+ </li>
15
+ <li class="nav-item active">
16
+ <a class="nav-link" href="/banal/projects">Projects</a>
17
+ </li>
18
+ </ul>
19
+ </div>
20
+ </nav>
@@ -0,0 +1,2 @@
1
+ json.extract! banal_brainstorm, :id, :idea, :main_category, :priority, :status, :comments, :idea_owner, :created_at, :updated_at
2
+ json.url banal_brainstorm_url(banal_brainstorm, format: :json)
@@ -0,0 +1,47 @@
1
+ <%= form_with(model: banal_brainstorm, local: true) do |form| %>
2
+ <% if banal_brainstorm.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(banal_brainstorm.errors.count, "error") %> prohibited this banal_brainstorm from being saved:</h2>
5
+
6
+ <ul>
7
+ <% banal_brainstorm.errors.full_messages.each do |message| %>
8
+ <li><%= message %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= form.label :idea %>
16
+ <%= form.text_area :idea %>
17
+ </div>
18
+
19
+ <div class="field">
20
+ <%= form.label :main_category %>
21
+ <%= form.text_field :main_category %>
22
+ </div>
23
+
24
+ <div class="field">
25
+ <%= form.label :priority %>
26
+ <%= form.text_field :priority %>
27
+ </div>
28
+
29
+ <div class="field">
30
+ <%= form.label :status %>
31
+ <%= form.text_field :status %>
32
+ </div>
33
+
34
+ <div class="field">
35
+ <%= form.label :comments %>
36
+ <%= form.text_area :comments %>
37
+ </div>
38
+
39
+ <div class="field">
40
+ <%= form.label :idea_owner %>
41
+ <%= form.text_field :idea_owner %>
42
+ </div>
43
+
44
+ <div class="actions">
45
+ <%= form.submit %>
46
+ </div>
47
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing Banal Brainstorm</h1>
2
+
3
+ <%= render 'form', banal_brainstorm: @banal_brainstorm %>
4
+
5
+ <%= link_to 'Show', @banal_brainstorm %> |
6
+ <%= link_to 'Back', banal_brainstorms_path %>
@@ -0,0 +1,37 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <h1>Banal Brainstorms</h1>
4
+
5
+ <table>
6
+ <thead>
7
+ <tr>
8
+ <th>Idea</th>
9
+ <th>Main category</th>
10
+ <th>Priority</th>
11
+ <th>Status</th>
12
+ <th>Comments</th>
13
+ <th>Idea owner</th>
14
+ <th colspan="3"></th>
15
+ </tr>
16
+ </thead>
17
+
18
+ <tbody>
19
+ <% @banal_brainstorms.each do |banal_brainstorm| %>
20
+ <tr>
21
+ <td><%= banal_brainstorm.idea %></td>
22
+ <td><%= banal_brainstorm.main_category %></td>
23
+ <td><%= banal_brainstorm.priority %></td>
24
+ <td><%= banal_brainstorm.status %></td>
25
+ <td><%= banal_brainstorm.comments %></td>
26
+ <td><%= banal_brainstorm.idea_owner %></td>
27
+ <td><%= link_to 'Show', banal_brainstorm %></td>
28
+ <td><%= link_to 'Edit', edit_banal_brainstorm_path(banal_brainstorm) %></td>
29
+ <td><%= link_to 'Destroy', banal_brainstorm, method: :delete, data: { confirm: 'Are you sure?' } %></td>
30
+ </tr>
31
+ <% end %>
32
+ </tbody>
33
+ </table>
34
+
35
+ <br>
36
+
37
+ <%= link_to 'New Banal Brainstorm', new_banal_brainstorm_path %>
@@ -0,0 +1 @@
1
+ json.array! @banal_brainstorms, partial: "banal_brainstorms/banal_brainstorm", as: :banal_brainstorm
@@ -0,0 +1,5 @@
1
+ <h1>New Banal Brainstorm</h1>
2
+
3
+ <%= render 'form', banal_brainstorm: @banal_brainstorm %>
4
+
5
+ <%= link_to 'Back', banal_brainstorms_path %>
@@ -0,0 +1,34 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Idea:</strong>
5
+ <%= @banal_brainstorm.idea %>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>Main category:</strong>
10
+ <%= @banal_brainstorm.main_category %>
11
+ </p>
12
+
13
+ <p>
14
+ <strong>Priority:</strong>
15
+ <%= @banal_brainstorm.priority %>
16
+ </p>
17
+
18
+ <p>
19
+ <strong>Status:</strong>
20
+ <%= @banal_brainstorm.status %>
21
+ </p>
22
+
23
+ <p>
24
+ <strong>Comments:</strong>
25
+ <%= @banal_brainstorm.comments %>
26
+ </p>
27
+
28
+ <p>
29
+ <strong>Idea owner:</strong>
30
+ <%= @banal_brainstorm.idea_owner %>
31
+ </p>
32
+
33
+ <%= link_to 'Edit', edit_banal_brainstorm_path(@banal_brainstorm) %> |
34
+ <%= link_to 'Back', banal_brainstorms_path %>
@@ -0,0 +1 @@
1
+ json.partial! "banal_brainstorms/banal_brainstorm", banal_brainstorm: @banal_brainstorm
@@ -0,0 +1,2 @@
1
+ json.extract! banal_project, :id, :name, :created_at, :updated_at
2
+ json.url banal_project_url(banal_project, format: :json)
@@ -0,0 +1,22 @@
1
+ <%= form_with(model: banal_project, local: true) do |form| %>
2
+ <% if banal_project.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(banal_project.errors.count, "error") %> prohibited this banal_project from being saved:</h2>
5
+
6
+ <ul>
7
+ <% banal_project.errors.full_messages.each do |message| %>
8
+ <li><%= message %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= form.label :name %>
16
+ <%= form.text_field :name %>
17
+ </div>
18
+
19
+ <div class="actions">
20
+ <%= form.submit %>
21
+ </div>
22
+ <% end %>