diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml
index 654dfac11e..fba9eb9005 100644
--- a/app/views/groups/show.html.haml
+++ b/app/views/groups/show.html.haml
@@ -32,13 +32,8 @@
%tab{heading: t(:label_map),
active: "tabs.map.active",
select: "select(\'map\')"}
- .map-container
- %map{"ng-controller" => "MapCtrl", "ng-if" => "(isActive(\'/map\') && (mapShowed = true)) || mapShowed"}
- %ui-gmap-google-map{options: "map.additional_options", center: "map.center", zoom: "map.zoom", styles: "map.styles", draggable: "true"}
- %map-osm-tiles
- %map-search
- %ui-gmap-markers{models: "OfnMap.enterprises", fit: "true",
- coords: "'self'", icon: "'icon'", click: "'reveal'"}
+ %div{"ng-if" => "(isActive(\'/map\') && (mapShowed = true)) || mapShowed"}
+ = render partial: "shared/map"
%tab{heading: t(:groups_about),
active: "tabs.about.active",
diff --git a/app/views/map/index.html.haml b/app/views/map/index.html.haml
index 294fa45f8e..6f50bf757c 100644
--- a/app/views/map/index.html.haml
+++ b/app/views/map/index.html.haml
@@ -4,13 +4,7 @@
- content_for :injection_data do
= inject_enterprise_shopfront_list
-.map-container{"fill-vertical" => true}
- %map{"ng-controller" => "MapCtrl"}
- %ui-gmap-google-map{options: "map.additional_options", center: "map.center", zoom: "map.zoom", styles: "map.styles", draggable: "true"}
- %map-osm-tiles
- %map-search
- %ui-gmap-markers{models: "OfnMap.enterprises", fit: "true",
- coords: "'self'", icon: "'icon'", click: "'reveal'"}
+= render partial: "shared/map"
.map-footer
%a{:href => "http://www.openstreetmap.org/copyright"} © OpenStreetMap contributors
diff --git a/app/views/shared/_map.html.haml b/app/views/shared/_map.html.haml
new file mode 100644
index 0000000000..6f8016c81e
--- /dev/null
+++ b/app/views/shared/_map.html.haml
@@ -0,0 +1,8 @@
+.map-container
+ %map{"ng-controller" => "MapCtrl"}
+ %ui-gmap-google-map{options: "map.additional_options", center: "map.center", zoom: "map.zoom",
+ styles: "map.styles", draggable: "true"}
+ %map-osm-tiles
+ %map-search
+ %ui-gmap-markers{models: "OfnMap.enterprises", fit: "true",
+ coords: "'self'", icon: "'icon'", click: "'reveal'"}