Skip to content

Commit 84fcf01

Browse files
committed
add support for None selection to default tracker
1 parent 8a0a324 commit 84fcf01

File tree

2 files changed

+9
-21
lines changed

2 files changed

+9
-21
lines changed

app/views/gtt_smash/_settings.html.erb

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,26 @@
11
<div class="box tabular settings">
2+
<%
3+
@options = ["None"]
4+
Tracker.all.sort.each do |t|
5+
@options.push([t.name,t.id])
6+
end
7+
%>
28
<h3><%= l(:setting_message) %></h3>
39

410
<p>
511
<%= content_tag(:label, l(:field_tracker_simple_note)) %>
6-
<%
7-
@options = []
8-
Tracker.all.sort.each do |t|
9-
@options.push([t.name,t.id])
10-
end
11-
%>
1212
<%= select_tag "settings[tracker_simple_notes]",
1313
options_for_select(@options, @settings['tracker_simple_notes']) %>
1414
</p>
1515

1616
<p>
1717
<%= content_tag(:label, l(:field_tracker_photo_note)) %>
18-
<%
19-
@options = []
20-
Tracker.all.sort.each do |t|
21-
@options.push([t.name,t.id])
22-
end
23-
%>
2418
<%= select_tag "settings[tracker_photo_notes]",
2519
options_for_select(@options, @settings['tracker_photo_notes']) %>
2620
</p>
2721

2822
<p>
2923
<%= content_tag(:label, l(:field_tracker_gps_log)) %>
30-
<%
31-
@options = []
32-
Tracker.all.sort.each do |t|
33-
@options.push([t.name,t.id])
34-
end
35-
%>
3624
<%= select_tag "settings[tracker_gps_logs]",
3725
options_for_select(@options, @settings['tracker_gps_logs']) %>
3826
</p>

init.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
settings(
1414
default: {
15-
'tracker_simple_notes' => 0,
16-
'tracker_photo_notes' => 0,
17-
'tracker_gps_logs' => 1,
15+
'tracker_simple_notes' => "",
16+
'tracker_photo_notes' => "",
17+
'tracker_gps_logs' => "",
1818
'default_subject' => ""
1919
},
2020
partial: 'gtt_smash/settings'

0 commit comments

Comments
 (0)