Skip to content

Commit 1223f6b

Browse files
authored
Merge pull request #220 from gtt-project/next
Release updates for 4.3.0
2 parents e8b04b2 + 4caae82 commit 1223f6b

26 files changed

+537
-5286
lines changed

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ The Geo-Task-Tracker (GTT) plugin adds spatial capabilities to Redmine:
1414

1515
## Requirements
1616

17-
Redmine GTT plugins **require PostgreSQL/PostGIS** and will not work with SQLite or MariaDB/MySQL!!!
17+
Redmine GTT plugins **require PostgreSQL/PostGIS** and will not work with SQLite
18+
or MariaDB/MySQL!!!
1819

1920
- Redmine >= 4.2.0
2021
- PostgreSQL >= 10
@@ -31,7 +32,8 @@ createdb -U postgres -O redmine redmine
3132
psql -U postgres -d redmine -c "CREATE EXTENSION postgis;"
3233
```
3334

34-
To install Redmine GTT plugin, download or clone this repository in your Redmine installation plugins directory!
35+
To install Redmine GTT plugin, download or clone this repository in your Redmine
36+
installation plugins directory!
3537

3638
```sh
3739
cd path/to/plugin/directory
@@ -51,11 +53,14 @@ bundle install
5153
bundle exec rake redmine:plugins:migrate
5254
```
5355

54-
Before restarting Redmine, you need to set `postgis` adapter instead of `postgres` adapter in your `config/database.yml`.
56+
Before restarting Redmine, you need to set `postgis` adapter instead of
57+
`postgres` adapter in your `config/database.yml`.
5558

56-
After restarting Redmine, you should be able to see the Redmine GTT plugin in the Plugins page.
59+
After restarting Redmine, you should be able to see the Redmine GTT plugin in
60+
the Plugins page.
5761

58-
More information on installing (and uninstalling) Redmine plugins can be found in the [Redmine Plugin docs](http://www.redmine.org/wiki/redmine/Plugins).
62+
More information on installing (and uninstalling) Redmine plugins can be found
63+
in the [Redmine Plugin docs](http://www.redmine.org/wiki/redmine/Plugins).
5964

6065
## How to use
6166

@@ -65,15 +70,17 @@ More information on installing (and uninstalling) Redmine plugins can be found i
6570
4. Define the project boundary in `GTT` project settings
6671
5. Create a new issue with a point, line or polygon
6772

68-
For more information with screenshots see the [Getting Started](doc/getting-started.md) guide.
73+
For more information with screenshots see the [Getting Started](doc/getting-started.md)
74+
guide.
6975

7076
## Plugin API
7177

7278
For more information see the [Redmine GTT API](doc/api.md) docs.
7379

7480
## Contributing and Support
7581

76-
The GTT Project appreciates any [contributions](https://github.com/gtt-project/.github/blob/main/CONTRIBUTING.md)! Feel free to contact us for [reporting problems and support](https://github.com/gtt-project/.github/blob/main/CONTRIBUTING.md).
82+
The GTT Project appreciates any [contributions](https://github.com/gtt-project/.github/blob/main/CONTRIBUTING.md)!
83+
Feel free to contact us for [reporting problems and support](https://github.com/gtt-project/.github/blob/main/CONTRIBUTING.md).
7784

7885
Help us to translate GTT Project using [OSGeo Weblate](https://weblate.osgeo.org/engage/gtt-project/):
7986

@@ -100,7 +107,8 @@ RAILS_ENV=test NAME=redmine_gtt bundle exec rake redmine:plugins:test
100107

101108
## Version History
102109

103-
See [all releases](https://github.com/gtt-project/redmine_gtt/releases) with release notes.
110+
See [all releases](https://github.com/gtt-project/redmine_gtt/releases) with
111+
release notes.
104112

105113
## Authors
106114

app/controllers/.keep

Whitespace-only changes.

app/helpers/.keep

Whitespace-only changes.

app/helpers/gtt_map_helper.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
22

33
module GttMapHelper
44

5-
def map_form_field(form, map, field: :geojson, bounds: nil, edit_mode: nil, upload: true)
5+
def map_form_field(form, map, field: :geojson, bounds: nil, edit_mode: nil, upload: true, rotation: 0)
66
safe_join [
77
form.hidden_field(field, id: 'geom'),
8-
map_tag(map: map, bounds: bounds, edit: edit_mode, upload: upload)
8+
map_tag(map: map, bounds: bounds, edit: edit_mode, upload: upload, rotation: rotation)
99
]
1010
end
1111

1212
def map_tag(map: nil, layers: map&.layers,
1313
geom: map.json, bounds: map.bounds,
1414
edit: nil, popup: nil, upload: true,
15-
collapsed: false)
15+
collapsed: false, rotation: map&.rotation)
1616

1717
data = {
18-
geom: geom.is_a?(String) ? geom : geom.to_json
18+
geom: geom.is_a?(String) ? geom : geom.to_json,
19+
rotation: rotation
1920
}
2021

2122
if layers

app/models/.keep

Whitespace-only changes.

app/models/gtt_configuration.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
class GttConfiguration
22
include ActiveModel::Model
33

4-
attr_accessor :project, :geojson, :gtt_tile_source_ids
4+
attr_accessor :project, :geojson, :gtt_tile_source_ids, :map_rotation
55

66
def self.for(project)
77
new(
88
project: project,
99
geojson: project.geojson,
10+
map_rotation: project.map_rotation,
1011
gtt_tile_source_ids: project.gtt_tile_source_ids
1112
)
1213
end
1314

1415
def self.from_params(params)
1516
new geojson: params[:geojson],
17+
map_rotation: params[:map_rotation],
1618
gtt_tile_source_ids: params[:gtt_tile_source_ids]
1719
end
1820

1921
def map
20-
GttMap.new json: geojson, layers: project.gtt_tile_sources.sorted
22+
GttMap.new json: geojson, layers: project.gtt_tile_sources.sorted, rotation: project.map_rotation
2123
end
2224

2325
end

app/models/gtt_map.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
class GttMap
22

3-
attr_reader :layers, :json, :bounds
3+
attr_reader :layers, :json, :bounds, :rotation
44

5-
def initialize(geom: nil, json: nil, layers:, bounds: nil)
5+
def initialize(geom: nil, json: nil, layers:, bounds: nil, rotation: nil)
66
unless @json = json
77
@json = RedmineGtt::Conversions.geom_to_json geom if geom
88
end
99

10+
@rotation = rotation || 0
1011
@bounds = bounds || @json
1112
@layers = layers
1213
end

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<legend class="<%= "icon " + (collapsed ? "icon-collapsed" : "icon-expended") %>"><%= l(:field_location) %></legend>
55

66
<%= map_tag map: @project.map, geom: (Issue.array_to_geojson(@issues, include_properties: { only: %i(id subject tracker_id status_id) }) if @issues),
7-
popup: { href: '/issues/[id]' }, collapsed: collapsed %>
7+
popup: { href: '/issues/[id]' }, collapsed: collapsed, rotation: @project.map_rotation %>
88
</fieldset>
99

1010
<% end %>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<% if @project.nil? or @project.module_enabled?(:gtt) %>
2-
<%= map_tag map: @issue.map, geom: (@issue.as_geojson(include_properties: { only: %i(tracker_id status_id) }) if @issue) %>
2+
<%= map_tag map: @issue.map, geom: (@issue.as_geojson(include_properties: { only: %i(tracker_id status_id) }) if @issue), rotation: @project.map_rotation %>
33
<% end %>

app/views/projects/index.api.rsb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ api.array :projects, api_meta(:total_count => @project_count, :offset => @offset
88
api.parent(:id => project.parent.id, :name => project.parent.name) if project.parent && project.parent.visible?
99
api.status project.status
1010
api.is_public project.is_public?
11+
api.rotation project.map_rotation
1112

1213
if @include_geometry
1314
if project.geom

0 commit comments

Comments
 (0)