Commit 6ae0945a2634c1cefd31af105fdef5c1847fa4a6
1 parent
fed22b92
Exists in
master
and in
1 other branch
Allow the nested forms for watchers to have a user watcher.
Showing
4 changed files
with
30 additions
and
4 deletions
Show diff stats
app/models/watcher.rb
app/views/apps/_fields.html.haml
... | ... | @@ -10,5 +10,10 @@ |
10 | 10 | %legend Watchers |
11 | 11 | - f.fields_for :watchers do |w| |
12 | 12 | %div.nested |
13 | - = w.label :email | |
14 | - = w.text_field :email | |
15 | 13 | \ No newline at end of file |
14 | + %div | |
15 | + = w.label :user | |
16 | + = w.select :user_id, User.all.map{|u| [u.name,u.id]}, :include_blank => '-- Select a User --' | |
17 | + %strong.option - OR - | |
18 | + %div | |
19 | + = w.label :email | |
20 | + = w.text_field :email | |
16 | 21 | \ No newline at end of file | ... | ... |
app/views/apps/show.html.haml
public/stylesheets/application.css
... | ... | @@ -257,6 +257,23 @@ form > div > span { |
257 | 257 | font-size: 0.85em; |
258 | 258 | color: #787878; |
259 | 259 | } |
260 | +form strong.option { | |
261 | + display: block; | |
262 | + margin: 0.7em 0; | |
263 | + color: #999; | |
264 | +} | |
265 | + | |
266 | +form .nested { | |
267 | + border-top: 1px dotted #BBB; | |
268 | + margin-top: 1.5em; | |
269 | + padding-top: 1.5em; | |
270 | +} | |
271 | + | |
272 | +form legend + .nested { | |
273 | + border: none; | |
274 | + margin-top: 0; | |
275 | + padding-top: 0; | |
276 | +} | |
260 | 277 | |
261 | 278 | /* Tables */ |
262 | 279 | table { | ... | ... |