Skip to content

Commit 272bbd0

Browse files
committed
moves issue new/edit map to view hook
- also adds some margins to the map
1 parent 4d5652c commit 272bbd0

File tree

5 files changed

+16
-21
lines changed

5 files changed

+16
-21
lines changed

app/overrides/issues.rb

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,6 @@
1212
:partial => "issues/index/geojson"
1313
)
1414

15-
Deface::Override.new(
16-
:virtual_path => "issues/new",
17-
:name => "deface_view_issues_new_map",
18-
:insert_before => "div.box",
19-
:partial => "issues/form/map"
20-
)
21-
22-
Deface::Override.new(
23-
:virtual_path => "issues/_edit",
24-
:name => "deface_view_issues_edit_map",
25-
:insert_before => "div.box",
26-
:partial => "issues/form/map"
27-
)
2815

2916
Deface::Override.new(
3017
:virtual_path => "issues/show",

app/views/issues/form/_map.html.erb

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<% if (@project.nil? or @project.module_enabled?(:gtt)) &&
2+
((issue.new_record? && User.current.allowed_to?(:add_issues, issue.project)) ||
3+
User.current.allowed_to?(:edit_issues, issue.project))
4+
%>
5+
<%= map_form_field form, issue.map, edit_mode: 'Point LineString Polygon' %>
6+
<% end %>
7+

assets/stylesheets/app.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
color: #222;
1313
font-weight: 400;
1414
}
15+
#issue-form .ol-map {
16+
width: 92%;
17+
margin: 1em auto;
18+
}
1519

1620
.ol-control button{
1721
background-color: rgba(40, 40, 40, 0.8);

lib/redmine_gtt/view_hooks.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module RedmineGtt
24
class ViewHooks < Redmine::Hook::ViewListener
35
render_on :view_account_left_bottom,
@@ -8,5 +10,8 @@ class ViewHooks < Redmine::Hook::ViewListener
810

911
render_on :view_users_form,
1012
partial: 'redmine_gtt/hooks/view_users_form'
13+
14+
render_on :view_issues_form_details_top,
15+
partial: 'redmine_gtt/hooks/view_issues_form_details_top'
1116
end
1217
end

0 commit comments

Comments
 (0)