Skip to content

Commit fe2fecf

Browse files
committed
add setting configuration view
1 parent 22716c5 commit fe2fecf

File tree

4 files changed

+67
-2
lines changed

4 files changed

+67
-2
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<div class="box tabular settings">
2+
<h3><%= l(:setting_message) %></h3>
3+
4+
<p>
5+
<%= content_tag(:label, l(:field_tracker_simple_note)) %>
6+
<%
7+
@options = []
8+
Tracker.all.each do |t|
9+
@options.push([t.name,t.id])
10+
end
11+
%>
12+
<%= select_tag "settings[tracker_simple_notes]",
13+
options_for_select(@options, @settings['tracker_simple_notes']) %>
14+
</p>
15+
16+
<p>
17+
<%= content_tag(:label, l(:field_tracker_photo_note)) %>
18+
<%
19+
@options = []
20+
Tracker.all.each do |t|
21+
@options.push([t.name,t.id])
22+
end
23+
%>
24+
<%= select_tag "settings[tracker_photo_notes]",
25+
options_for_select(@options, @settings['tracker_photo_notes']) %>
26+
</p>
27+
28+
<p>
29+
<%= content_tag(:label, l(:field_tracker_gps_log)) %>
30+
<%
31+
@options = []
32+
Tracker.all.each do |t|
33+
@options.push([t.name,t.id])
34+
end
35+
%>
36+
<%= select_tag "settings[tracker_gps_logs]",
37+
options_for_select(@options, @settings['tracker_gps_logs']) %>
38+
</p>
39+
40+
<p>
41+
<%= content_tag(:label, l(:field_default_subject)) %>
42+
<%= text_field_tag 'settings[default_subject]', @settings['default_subject'], :size => 30 %>
43+
</p>
44+
</div>

config/locales/en.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
en:
22
permission_view_gtt_smash: "View GTT SMASH"
33
project_module_gtt_smash: "GTT SMASH"
4+
5+
field_tracker_simple_note: "Tracker for Simple Notes"
6+
field_tracker_photo_note: "Tracker for Photo Notes"
7+
field_tracker_gps_log: "Tracker for GPS Logs"
8+
field_default_subject: "Default subject"
9+
10+
setting_message: "Caution: ensure hat selected trackers do not have required custom fields!"

config/locales/ja.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
ja:
22
permission_view_gtt_smash: "GTT SMASHの閲覧"
33
project_module_gtt_smash: "GTT SMASH"
4+
5+
tracker_simple_note: "Tracker for Simple Notes"
6+
tracker_photo_note: "Tracker for Photo Notes"
7+
tracker_gps_log: "Tracker for GPS Logs"
8+
default_subject: "Default subject"
9+
10+
setting_message: "Caution: ensure hat selected trackers do not have required custom fields!"

init.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,15 @@
1010

1111
requires_redmine :version_or_higher => '4.0.0'
1212

13-
# settings default: {
14-
# }, partial: 'settings/gtt_smash_settings'
13+
settings(
14+
default: {
15+
'tracker_simple_notes' => 0,
16+
'tracker_photo_notes' => 0,
17+
'tracker_gps_logs' => 1,
18+
'default_subject' => ""
19+
},
20+
partial: 'gtt_smash/settings'
21+
)
1522

1623
project_module :gtt_smash do
1724
permission :view_gtt_smash, {

0 commit comments

Comments
 (0)