Skip to content

Commit 4c8c666

Browse files
dkastlosgeoweblatesanak
authored
Prepares next release (#42)
* Added translation using Weblate (German) (#18) * None (#23) * Translated using OSGeo Weblate (English) Currently translated at 100.0% (10 of 10 strings) Translation: GTT Project/Redmine Text Blocks Plugin Translate-URL: https://weblate.osgeo.org/projects/gtt-project/redmine_text_blocks/en/ * Translated using OSGeo Weblate (Japanese) Currently translated at 100.0% (10 of 10 strings) Translation: GTT Project/Redmine Text Blocks Plugin Translate-URL: https://weblate.osgeo.org/projects/gtt-project/redmine_text_blocks/ja/ * Translated using OSGeo Weblate (German) Currently translated at 100.0% (10 of 10 strings) Translation: GTT Project/Redmine Text Blocks Plugin Translate-URL: https://weblate.osgeo.org/projects/gtt-project/redmine_text_blocks/de/ Co-authored-by: Daniel Kastl <daniel@georepublic.de> * Fixes i18n format Signed-off-by: Daniel Kastl <daniel@georepublic.de> * Lints Markdown Signed-off-by: Daniel Kastl <daniel@georepublic.de> * Prepares minor release Signed-off-by: Daniel Kastl <daniel@georepublic.de> * Fixes Markdown issue Signed-off-by: Daniel Kastl <daniel@georepublic.de> * Fixes missing closing tag Signed-off-by: Daniel Kastl <daniel@georepublic.de> * Support redmine trunk (>=r22488) build and drop ruby 2.6 from CI * Exclude redmine:master + ruby:2.7 in CI * Update actions/checkout@v4 to use Node.js 20 * Adds wiki-edit class to form element, fixes #35 * Replace removed jQuery api '.size()' to '.length' * Redmine 6 compliance (#41) * Refactor text block views and styles, add SVG icons, and update plugin version * Remove jQuery dotdotdot plugin, update text block styles for truncation * Update README to reflect Redmine 5.0 compatibility and improve formatting * Update CI test for Redmine 6 * Exclude CI matrix 5.1-stable x 3.3 combination * Update comment part in CI --------- Co-authored-by: Ko Nagase <nagase@georepublic.co.jp> --------- Signed-off-by: Daniel Kastl <daniel@georepublic.de> Co-authored-by: OSGeo Weblate <97247866+osgeoweblate@users.noreply.github.com> Co-authored-by: Ko Nagase <nagase@georepublic.co.jp>
1 parent 07c904f commit 4c8c666

File tree

14 files changed

+85
-101
lines changed

14 files changed

+85
-101
lines changed

.github/workflows/test.yml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,57 +7,53 @@ on:
77
push:
88
branches:
99
- main
10-
- master
10+
- next
1111
pull_request:
1212
branches:
1313
- main
14-
- master
14+
- next
1515

1616
jobs:
1717
test:
1818
name: redmine:${{ matrix.redmine_version }} ruby:${{ matrix.ruby_version }} db:${{ matrix.db }}
19-
runs-on: ubuntu-22.04
19+
runs-on: ubuntu-24.04
2020

2121
container:
2222
image: ruby:${{ matrix.ruby_version }}-bullseye
2323

2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
redmine_version: [4.2-stable, 5.0-stable, master]
28-
ruby_version: ['2.6', '2.7', '3.0', '3.1', '3.2']
27+
redmine_version: [5.0-stable, 5.1-stable, 6.0-stable, master]
28+
ruby_version: ['3.1', '3.2', '3.3']
2929
db: [mysql, postgres, sqlite]
3030
# # System test takes 2~3 times longer, so limit to specific matrix combinations
3131
# # See: https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations
3232
# include:
3333
# - system_test: true
3434
# redmine_version: master
35-
# ruby_version: '3.1'
35+
# ruby_version: '3.3'
3636
# db: mysql
3737
exclude:
38-
- redmine_version: 4.2-stable
39-
ruby_version: '3.0'
40-
- redmine_version: 4.2-stable
41-
ruby_version: '3.1'
42-
- redmine_version: 4.2-stable
43-
ruby_version: '3.2'
4438
- redmine_version: 5.0-stable
4539
ruby_version: '3.2'
46-
- redmine_version: master
47-
ruby_version: '2.6'
40+
- redmine_version: 5.0-stable
41+
ruby_version: '3.3'
42+
- redmine_version: 5.1-stable
43+
ruby_version: '3.3'
4844

4945
services:
5046
mysql:
5147
image: mysql:5.7 # min
52-
# image: mysql:8.0 # latest
48+
# image: mysql:9.1 # latest
5349
env:
5450
MYSQL_ROOT_PASSWORD: password
5551
ports:
5652
- 3306:3306
5753
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 5
5854
postgres:
5955
image: postgres:10 # min
60-
# image: postgres:15 # latest
56+
# image: postgres:17 # latest
6157
env:
6258
POSTGRES_USER: postgres
6359
POSTGRES_PASSWORD: postgres
@@ -67,14 +63,14 @@ jobs:
6763

6864
steps:
6965
- name: Checkout Redmine
70-
uses: actions/checkout@v3
66+
uses: actions/checkout@v4
7167
with:
7268
repository: redmine/redmine
7369
ref: ${{ matrix.redmine_version }}
7470
path: redmine
7571

7672
- name: Checkout Plugin
77-
uses: actions/checkout@v3
73+
uses: actions/checkout@v4
7874
with:
7975
path: redmine/plugins/${{ env.PLUGIN_NAME }}
8076

@@ -165,22 +161,22 @@ jobs:
165161
# For system test in plugin
166162
GOOGLE_CHROME_OPTS_ARGS: "headless,disable-gpu,no-sandbox,disable-dev-shm-usage"
167163
working-directory: redmine
168-
run: bundle exec rake redmine:plugins:test NAME=${{ env.PLUGIN_NAME }} RUBYOPT="-W0"
164+
run: bundle exec rails test plugins/redmine_text_blocks/test
169165

170166
# - name: Run core tests
171167
# env:
172168
# RAILS_ENV: test
173169
# PARALLEL_WORKERS: 1
174170
# working-directory: redmine
175-
# run: bundle exec rake test
171+
# run: bundle exec rails test
176172

177173
# - name: Run core system tests
178174
# if: matrix.system_test == true
179175
# env:
180176
# RAILS_ENV: test
181177
# GOOGLE_CHROME_OPTS_ARGS: "headless,disable-gpu,no-sandbox,disable-dev-shm-usage"
182178
# working-directory: redmine
183-
# run: bundle exec rake test:system
179+
# run: bundle exec rails test:system
184180

185181
- name: Run uninstall test
186182
env:

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ This plugin adds configurable text blocks for replying to issues.
88

99
## Requirements
1010

11-
- Redmine >= 4.0.0
11+
- Redmine >= 5.0.0
1212

1313
## Installation
1414

15-
To install Redmine text blocks plugin, download or clone this repository in your Redmine installation plugins directory!
15+
To install Redmine text blocks plugin, download or clone this repository in your
16+
Redmine installation plugins directory!
1617

1718
```sh
1819
cd path/to/plugin/directory
@@ -26,26 +27,25 @@ bundle install
2627
bundle exec rake redmine:plugins:migrate
2728
```
2829

29-
After restarting Redmine, you should be able to see the Redmine Text Blocks plugin in the Plugins page.
30+
After restarting Redmine, you should be able to see the Redmine Text Blocks
31+
plugin in the Plugins page.
3032

31-
More information on installing (and uninstalling) Redmine plugins can be found in [Redmine Plugins](http://www.redmine.org/wiki/redmine/Plugins) documentation.
33+
More information on installing (and uninstalling) Redmine plugins can be found in
34+
[Redmine Plugins](http://www.redmine.org/wiki/redmine/Plugins) documentation.
3235

3336
## How to use
3437

3538
[Settings, screenshots, etc.]
3639

3740
## Contributing and Support
3841

39-
The Text Blocks 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).
42+
The Text Blocks Project appreciates any [contributions](https://github.com/gtt-project/.github/blob/main/CONTRIBUTING.md)!
43+
Feel free to contact us for [reporting problems and support](https://github.com/gtt-project/.github/blob/main/CONTRIBUTING.md).
4044

4145
## Version History
4246

43-
- 2.0.0 Support Redmine 5.0
44-
- 1.2.0 Publish on GitHub
45-
- 1.0.2 Fixes localization
46-
- 1.0.1 Bugfix
47-
48-
See [all releases](https://github.com/gtt-project/redmine_text_blocks/releases) with release notes.
47+
See [all releases](https://github.com/gtt-project/redmine_text_blocks/releases)
48+
with release notes.
4949

5050
## Authors
5151

app/models/text_block.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class TextBlock < ActiveRecord::Base
1+
class TextBlock < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base)
22
belongs_to :project
33
has_and_belongs_to_many :issue_statuses
44
acts_as_positioned :scope => [:project_id]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<% if User.current.allowed_to?(:view_text_blocks, @project) %>
2-
<%= select_tag :text_block, text_block_options(@issue), id: 'textblock-select', style: 'display:none; border: 1px solid #e0e2e3; background: #f6f6f6; height: 24px; color: #3d454c; vertical-align: bottom; margin-left: 6px; margin-botton: 0;' %>
2+
<%= select_tag :text_block, text_block_options(@issue), id: 'textblock-select' %>
33
<%= javascript_include_tag 'text_blocks', plugin: 'redmine_text_blocks' %>
44
<%= hidden_field_tag :text_block_project_id, @project.id %>
55
<% end %>

app/views/text_blocks/_form.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<div class="box tabular">
44
<p><%= f.text_field :name, required: true, size: 25 %></p>
5-
<p><%= f.text_area :text, label: l(:field_text_block_text), rows: 10 %></p>
5+
<p><%= f.text_area :text, label: l(:field_text_block_text), rows: 10, class: 'wiki-edit' %></p>
66
<p>
77
<%= content_tag :label, l(:label_issue_status_plural) %>
88
<%= f.collection_select :issue_status_ids,

app/views/text_blocks/_list.html.erb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,7 @@
1717
<% end %>
1818

1919
<%= content_for :header_tags do %>
20-
<%= javascript_include_tag 'jquery.dotdotdot', plugin: 'redmine_text_blocks' %>
2120
<%= javascript_tag do %>
22-
$(document).ready(function() {
23-
$("table.list.textblocks tbody td.text div").dotdotdot({
24-
watch: 'window',
25-
});
26-
27-
// make sure text is shortened when it was initially hidden and just
28-
// becomes visible due to Redmine's tabbing in project settings:
29-
var origShowTab = window.showTab;
30-
window.showTab = function(name, url){
31-
origShowTab(name, url);
32-
$("table.list.textblocks tbody td.text div").trigger('update.dot');
33-
}
34-
});
3521
$(function() {
3622
$("table.textblocks tbody").positionedItems();
3723
});

app/views/text_blocks/_text_block.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<tr>
22
<td><%= link_to text_block.name, (text_block.project ? edit_project_text_block_path(text_block.project, text_block) : edit_text_block_path(text_block)) %></td>
3-
<td class="text"><div><%= textilizable text_block.text %></div></td>
4-
<td class="text"><div>
3+
<td class="text"><div class="truncated"><%= textilizable text_block.text %></div></td>
4+
<td class="text"><div class="truncated">
55
<% text_block.issue_statuses.pluck(:name).map do |s| %>
66
<%= textilizable s %>
77
<% end %>

app/views/text_blocks/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="contextual">
2-
<%= link_to l(:label_text_block_new), new_text_block_path, class: 'icon icon-add' %>
2+
<%= link_to (Redmine::VERSION.to_s >= '6.0.0') ? sprite_icon('add', l(:label_text_block_new)) : l(:label_text_block_new), new_text_block_path, :class => 'icon icon-add' %>
33
</div>
44

55
<h2><%= l :label_text_block_plural %></h2>

assets/images/icons.svg

Lines changed: 12 additions & 0 deletions
Loading

assets/javascripts/jquery.dotdotdot.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

assets/javascripts/text_blocks.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ var TextBlocks = {
1212
var value = $(this).val();
1313
if(value == '') return;
1414

15-
console.log(value);
1615
var fieldId = $('#textblock-select').parents().next('div.jstEditor').find('textarea').attr('id');
1716

1817
var field = document.getElementById(fieldId);
@@ -36,7 +35,7 @@ var TextBlocks = {
3635

3736
reload: function(e){
3837
var projectId = null
39-
if ($("#issue_project_id").size() > 0) {
38+
if ($("#issue_project_id").length > 0) {
4039
projectId = $("#issue_project_id").val()
4140
} else {
4241
projectId = $("#text_block_project_id").val()

assets/stylesheets/text_blocks.css

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,53 @@
22
/* ICONS
33
/**************************************************************/
44

5-
#admin-menu a.text-blocks { background-image: url(../images/text_signature.png);}
6-
5+
.icon-text-blocks:not(:has(svg)) { background-image: url(../images/text_signature.png); }
76

87
/**************************************************************/
98
/* TextBlocks table
109
/**************************************************************/
1110

1211
table.list.textblocks tbody td { vertical-align: top; }
1312
table.list.textblocks tbody td.text { text-align: left; }
14-
table.list.textblocks tbody td.text div { height: 3.8em; }
15-
1613

1714
/**************************************************************/
1815
/* TextBlocks template selector
1916
/**************************************************************/
2017

18+
select#textblock-select {
19+
display: none;
20+
border: 1px solid #e0e2e3;
21+
background-color: #f7f7f7;
22+
}
23+
2124
div.jstElements {
2225
display: inline-flex;
2326
}
2427

25-
@media all and (max-width: 899px) {
28+
table.textblocks th {
29+
min-width: 100px; /* to ensure columns don't get too narrow */
30+
}
31+
32+
table.textblocks .truncated {
33+
display: -webkit-box;
34+
-webkit-box-orient: vertical;
35+
overflow: hidden;
36+
37+
/* Number of lines to show */
38+
-webkit-line-clamp: 3;
39+
line-clamp: 3;
40+
}
41+
42+
@media all and (max-width: 1099px) {
2643
#textblock-select {
27-
order: -1
44+
order: -1;
45+
margin-right: 6px;
2846
}
2947
}
3048

31-
@media all and (min-width: 900px) {
49+
@media all and (min-width: 1100px) {
3250
#textblock-select {
33-
order: 1
51+
order: 1;
52+
margin-left: 6px;
3453
}
3554
}

config/icon_source.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- name: text-blocks
2+
svg: template

init.rb

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,14 @@
1-
require File.expand_path('../lib/redmine_text_blocks/view_hooks', __FILE__)
2-
3-
if Rails.version > '6.0' && Rails.autoloaders.zeitwerk_enabled?
4-
Rails.application.config.after_initialize do
5-
RedmineTextBlocks.setup
6-
end
7-
else
8-
require 'redmine_text_blocks'
9-
Rails.configuration.to_prepare do
10-
RedmineTextBlocks.setup
11-
end
12-
end
1+
require_relative 'lib/redmine_text_blocks/view_hooks'
132

143
Redmine::Plugin.register :redmine_text_blocks do
154
name 'Redmine Text Blocks Plugin'
165
author 'Jens Krämer, Georepublic'
176
author_url 'https://github.com/georepublic'
187
url 'https://github.com/gtt-project/redmine_text_blocks'
198
description 'Adds configurable text blocks for replying to issues'
20-
version '2.0.1'
9+
version '3.0.0'
2110

22-
requires_redmine version_or_higher: '4.0.0'
11+
requires_redmine version_or_higher: '5.0.0'
2312

2413
#settings default: {
2514
#}, partial: 'redmine_text_blocks/settings'
@@ -35,5 +24,10 @@
3524

3625
menu :admin_menu, :text_blocks,
3726
{ controller: 'text_blocks', action: 'index' },
38-
caption: :label_text_block_plural, :html => {:class => 'icon icon-text-blocks'}
27+
caption: :label_text_block_plural, :html => {:class => 'icon icon-text-blocks'},
28+
:icon => 'text-blocks', :plugin => :redmine_text_blocks
29+
end
30+
31+
Rails.application.config.after_initialize do
32+
RedmineTextBlocks.setup
3933
end

0 commit comments

Comments
 (0)