|
3 | 3 | <div class="columns is-centered">
|
4 | 4 | <div class="column is-8-desktop is-11-tablet is-12-mobile">
|
5 | 5 | <div class="box p-5">
|
6 |
| - <h1 class="title has-text-centered mb-5"><%= t(".title") %></h1> |
| 6 | + <h1 class="title has-text-centered mb-5"> |
| 7 | + <%= t(".title") %> |
| 8 | + </h1> |
7 | 9 | <%= form_with(model: @learning, local: true) do |f| %>
|
8 | 10 | <% if @learning.errors.any? %>
|
9 | 11 | <div class="notification is-danger is-light">
|
10 | 12 | <h2 class="subtitle">
|
11 |
| - <%= pluralize(@learning.errors.count, "error") %> prohibited this learning from being saved: |
| 13 | + <%= pluralize(@learning.errors.count, "error" ) %> prohibited this learning from being saved: |
12 | 14 | </h2>
|
13 | 15 | <ul class="ml-4">
|
14 | 16 | <% @learning.errors.full_messages.each do |msg| %>
|
15 |
| - <li><%= msg %></li> |
16 |
| - <% end %> |
| 17 | + <li> |
| 18 | + <%= msg %> |
| 19 | + </li> |
| 20 | + <% end %> |
17 | 21 | </ul>
|
18 | 22 | </div>
|
19 |
| - <% end %> |
| 23 | + <% end %> |
20 | 24 |
|
21 |
| - <div class="field mb-4"> |
22 |
| - <%= f.label :lesson, class: "label" %> |
23 |
| - <div class="control"> |
24 |
| - <%= f.text_field :lesson, |
25 |
| - class: "input", |
26 |
| - placeholder: "Enter learning name" %> |
27 |
| - </div> |
28 |
| - </div> |
| 25 | + <div class="field mb-4"> |
| 26 | + <%= f.label :lesson, class: "label" %> |
| 27 | + <div class="control"> |
| 28 | + <%= f.text_field :lesson, class: "input" , placeholder: "Enter learning name" %> |
| 29 | + </div> |
| 30 | + </div> |
29 | 31 |
|
30 |
| - <div class="field mb-4"> |
31 |
| - <%= f.label :description, class: "label" %> |
32 |
| - <div class="control"> |
33 |
| - <%= f.text_area :description, |
34 |
| - class: "textarea", |
35 |
| - placeholder: "Enter learning description", |
36 |
| - rows: 5 %> |
37 |
| - </div> |
38 |
| - </div> |
| 32 | + <div class="field mb-4"> |
| 33 | + <%= f.label :description, class: "label" %> |
| 34 | + <div class="control"> |
| 35 | + <%= f.text_area :description, class: "textarea" , placeholder: "Enter learning description" , |
| 36 | + rows: 5 %> |
| 37 | + </div> |
| 38 | + </div> |
39 | 39 |
|
40 |
| - <div class="field mb-4"> |
41 |
| - <%= f.label :organization_id, "Organization", class: "label" %> |
42 |
| - <div class="control"> |
43 |
| - <div class="select is-fullwidth"> |
44 |
| - <%= f.collection_select :organization_id, |
45 |
| - current_user.organizations, |
46 |
| - :id, |
47 |
| - :name, |
48 |
| - { prompt: "Select an organization" }, |
49 |
| - { class: "select" } %> |
| 40 | + <div class="field mb-4"> |
| 41 | + <%= f.label :organization_id, "Organization" , class: "label" %> |
| 42 | + <div class="control"> |
| 43 | + <div class="select is-fullwidth"> |
| 44 | + <%= f.collection_select :organization_id, current_user.organizations, :id, :name, { |
| 45 | + prompt: "Select an organization" }, { class: "select" } %> |
| 46 | + </div> |
| 47 | + </div> |
50 | 48 | </div>
|
51 |
| - </div> |
52 |
| - </div> |
53 | 49 |
|
54 |
| - <div class="field mb-5"> |
55 |
| - <%= f.label "Learning Categories", class: "label mb-3" %> |
56 |
| - <div class="control"> |
57 |
| - <div class="columns is-multiline is-mobile"> |
58 |
| - <% LearningCategory.all.each do |category| %> |
59 |
| - <div class="column is-half-mobile is-one-third-tablet"> |
| 50 | + <div class="field mb-5"> |
| 51 | + <%= f.label "Learning Categories" , class: "label mb-3" %> |
| 52 | + <div class="control"> |
| 53 | + <div class="columns is-multiline is-mobile"> |
| 54 | + <% LearningCategory.all.each do |category| %> |
| 55 | + <div class="column is-half-mobile is-one-third-tablet"> |
| 56 | + <label class="checkbox"> |
| 57 | + <%= check_box_tag "learning[learning_category_ids][]" , category.id, |
| 58 | + @learning.learning_category_ids.include?(category), |
| 59 | + id: "learning_category_#{category.id}" %> |
| 60 | + <span class="ml-2"> |
| 61 | + <%= category.name %> |
| 62 | + </span> |
| 63 | + </label> |
| 64 | + </div> |
| 65 | + <% end %> |
| 66 | + </div> |
| 67 | + </div> |
| 68 | + </div> |
| 69 | + |
| 70 | + <div class="field mb-5"> |
| 71 | + <%= f.label :public, class: "label" %> |
| 72 | + <div class="control"> |
60 | 73 | <label class="checkbox">
|
61 |
| - <%= check_box_tag "learning[learning_category_ids][]", |
62 |
| - category.id, |
63 |
| - @learning.learning_category_ids.include?(category), |
64 |
| - id: "learning_category_#{category.id}" %> |
65 |
| - <span class="ml-2"><%= category.name %></span> |
| 74 | + <%= f.check_box :public_visibility %> |
| 75 | + <span class="ml-2">Make this learning public</span> |
66 | 76 | </label>
|
| 77 | + <p class="help">Public learnings can be viewed by all users</p> |
67 | 78 | </div>
|
68 |
| - <% end %> |
69 | 79 | </div>
|
70 |
| - </div> |
71 |
| - </div> |
72 |
| - |
73 |
| - <div class="field mb-5"> |
74 |
| - <%= f.label :public, class: "label" %> |
75 |
| - <div class="control"> |
76 |
| - <label class="checkbox"> |
77 |
| - <%= f.check_box :public %> |
78 |
| - <span class="ml-2">Make this learning public</span> |
79 |
| - </label> |
80 |
| - <p class="help">Public learnings can be viewed by all users</p> |
81 |
| - </div> |
82 |
| - </div> |
83 | 80 |
|
84 |
| - <div class="field is-grouped is-grouped-centered mt-5"> |
85 |
| - <div class="control"> |
86 |
| - <%= f.submit "Update Learning", |
87 |
| - class: "button is-primary is-medium px-5" %> |
88 |
| - </div> |
89 |
| - <div class="control"> |
90 |
| - <%= link_to "Cancel", |
91 |
| - learnings_path, |
92 |
| - class: "button is-light is-medium" %> |
93 |
| - </div> |
94 |
| - </div> |
95 |
| - <% end %> |
| 81 | + <div class="field is-grouped is-grouped-centered mt-5"> |
| 82 | + <div class="control"> |
| 83 | + <%= f.submit "Update Learning" , class: "button is-primary is-medium px-5" %> |
| 84 | + </div> |
| 85 | + <div class="control"> |
| 86 | + <%= link_to "Cancel" , learnings_path, class: "button is-light is-medium" %> |
| 87 | + </div> |
| 88 | + </div> |
| 89 | + <% end %> |
96 | 90 | </div>
|
97 | 91 |
|
98 | 92 | <div class="has-text-centered mt-4 mb-4">
|
99 |
| - <%= link_to learnings_path, |
100 |
| - class: "has-text-grey is-flex is-align-items-center is-justify-content-center" do %> |
| 93 | + <%= link_to learnings_path, class: "has-text-grey is-flex is-align-items-center is-justify-content-center" do |
| 94 | + %> |
101 | 95 | <span class="icon">
|
102 | 96 | <i class="fas fa-arrow-left"></i>
|
103 | 97 | </span>
|
104 | 98 | <span>Back to Learnings</span>
|
105 |
| - <% end %> |
| 99 | + <% end %> |
106 | 100 | </div>
|
107 | 101 | </div>
|
108 | 102 | </div>
|
|
0 commit comments