Skip to content

Commit fe87692

Browse files
committed
refactoring: move my/account map to view hook #50
1 parent 8a8407e commit fe87692

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

app/overrides/users.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
Deface::Override.new(
2-
:virtual_path => "my/account",
3-
:name => "deface_view_users_account_map",
4-
:insert_after => "div.splitcontentleft fieldset.box",
5-
:partial => "users/form/map"
6-
)
7-
81
Deface::Override.new(
92
:virtual_path => "users/_form",
103
:name => "deface_view_users_form_map",
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
</fieldset>
2+
<fieldset class="box tabular">
3+
<legend><%= l(:label_user_map) %></legend>
4+
<%= map_form_field form, user.map, edit_mode: 'Point' %>
5+

lib/redmine_gtt.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ def self.setup
3333
RedmineGtt::Patches::ProjectsHelperPatch.apply
3434
RedmineGtt::Patches::UsersControllerPatch.apply
3535

36-
ProjectsController.class_eval do
37-
helper 'gtt_map'
38-
end
39-
UsersController.class_eval do
40-
helper 'gtt_map'
36+
[ ProjectsController, MyController, UsersController ].each do |c|
37+
c.class_eval do
38+
helper 'gtt_map'
39+
end
4140
end
4241

4342
# unless IssueQuery.included_modules.include?(RedmineGtt::Patches::IssueQueryPatch)

lib/redmine_gtt/patches/user_patch.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def self.apply
77
User.prepend GeojsonAttribute
88
User.prepend self
99
User.class_eval do
10-
safe_attributes "geom"
10+
safe_attributes "geojson"
1111
end
1212
end
1313
end

lib/redmine_gtt/view_hooks.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@ module RedmineGtt
22
class ViewHooks < Redmine::Hook::ViewListener
33
render_on :view_account_left_bottom,
44
partial: 'redmine_gtt/hooks/view_account_left_bottom'
5+
6+
render_on :view_my_account,
7+
partial: 'redmine_gtt/hooks/view_my_account'
58
end
69
end

0 commit comments

Comments
 (0)