Skip to content

Commit ad37b96

Browse files
committed
0.8.0 update - Complete rework. Compatible with last Redmine version. New settings added (#70 #88). Removed external lib (FontAwesome) (#74). Mobile style added (#87). Print style added (#84). Bug fix (#79, #85)
1 parent e968ee7 commit ad37b96

File tree

9 files changed

+411
-946
lines changed

9 files changed

+411
-946
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ You can set some settings by editing the file `assets/javascripts/issue_dynamic_
2929
* **\_CONF\_LISTENER\_TYPE\_ICON** : Choose which action will trigger the apparition of the edition block when fired from the pencil icon (by default: same as **\_CONF\_LISTENER\_TYPE\_VALUE**). Allowed value : `none`, `click`, `dblclick`
3030
* **\_CONF\_LISTENER\_TARGET** : Choose which area will trigger the apparition of the edition block
3131
* **\_CONF\_EXCLUDED\_FIELD\_ID** : Choose which fields to exclude. They won't have the edit block and pencil. Eg: `TitleInput`, `DescriptionInput`, `statusListDropdown` ...
32+
* **\_CONF\_CHECK\_ISSUE\_UPDATE\_CONFLICT** : Choose if you allow current user to override all modifications performed by other users while editing the issue
3233

3334
### 🎨 Customization
3435

3536
Feel free to edit `assets/stylesheets/issue_dynamic_edit.css` to update the look of your fields depending on your current Redmine Theme.
3637

37-
This plugin uses [FontAwesome icons 4.7](https://fontawesome.com/v4.7.0/)
38-
3938
### 🆕 Changelog
4039

41-
* **v 0.7.2** : New settings added into config file (`\_CONF\_DISPLAY\_EDIT\_ICON` and `\_CONF\_LISTENER\_TYPE\_ICON`) see Configuration part for more info ; new event `none` for `\_CONF\_LISTENER\_TYPE\_VALUE` disabling listener on value ; css fix
40+
* **v 0.8.0** : Complete rework. Compatible with last Redmine version. New settings added : `_CONF_CHECK_ISSUE_UPDATE_CONFLICT` (#70 #88). Removed external lib (FontAwesome) (#74). Mobile style added (#87). Print style added (#84). Bug fix (#79, #85)
41+
* **v 0.7.2** : New settings added into config file (`_CONF_DISPLAY_EDIT_ICON` and `_CONF_LISTENER_TYPE_ICON`) see Configuration part for more info ; new event `none` for `_CONF_LISTENER_TYPE_VALUE` disabling listener on value ; css fix
4242
* **v 0.7.1** : Fixed incorrect DOM structure if user has read only access to the issue (#61 #64)
4343
* **v 0.7.0** : Category filter by project added (#55) and prevent dialog closing when using fa-pencil selector (#59)
4444
* **v 0.6.9** : Category field support (Github request #54)

assets/javascripts/issue_dynamic_edit.js

Lines changed: 279 additions & 628 deletions
Large diffs are not rendered by default.

assets/javascripts/issue_dynamic_edit_configuration_file.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,25 @@ var _CONF_LISTENER_TYPE_ICON = "click";
3636
/*
3737
* _CONF_LISTENER_TARGET (string)
3838
* Choose which area will trigger the apparition of the edition block
39-
* "value" will target the whole line, "fa-pencil" will only target the pencil icon
40-
* Allowed values : value (default), fa-pencil
39+
* "value" will target the value of the attribute (+ pencil), "iconEdit" will only target the pencil icon, "label" will trigger the label attribute
40+
* "all" will target the whole line (label + value + pencil)
41+
* Allowed values : value (default), iconEdit, label, all
4142
*/
4243
var _CONF_LISTENER_TARGET = "value";
4344

4445
/*
4546
* _CONF_EXCLUDED_FIELD_ID (string array)
4647
* Choose which fields to exclude. They won't have the edit block and pencil
47-
* Custom fields have an unique ID and this ID must be prefixed by "issue_custom_field_values_". Eg : "issue_custom_field_values_4" is an allowed value
48-
* Allowed values : array of any ID selector (css). Eg : ["statusListDropdown", "StartDateInput", "TitleInput", "issue_custom_field_values_4"]
48+
* You have to take element (input, select, textarea ...) class attribute from edit form at the bottom of the page
49+
* Custom fields have an unique ID and this ID must be prefixed by "custom_field_values_". Eg : "custom_field_values_4" is an allowed value
50+
* Allowed values : array of any ID selector (css). Eg : ["status", "priority", "category", "assigned_to", "done_ratio", "start_date", "custom_field_values_4"]
4951
*/
5052
var _CONF_EXCLUDED_FIELD_ID = [];
53+
54+
/*
55+
* _CONF_CHECK_ISSUE_UPDATE_CONFLICT (boolean)
56+
* Choose if you allow current user to override all modifications performed by other users while editing the issue
57+
* true : will check issue update conflict and prevent current user to update the issue without refreshing the page
58+
* false : user will be able to update the issue no matter other modification performed (will override modification made by other)
59+
*/
60+
var _CONF_CHECK_ISSUE_UPDATE_CONFLICT = true;
Lines changed: 100 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,60 @@
11
/* prefix selector with body.controller-issues.action-show to avoid unwanted style on other page ? */
22

3-
body.controller-issues.action-show div.issue.details .value, body.controller-issues.action-show div.issue.details .splitcontent {
3+
body.controller-issues.action-show div.issue.details .value, body.controller-issues.action-show div.issue.details .attributes .attribute .value {
44
overflow: visible;
55
position: relative;
6+
cursor: pointer;
7+
display: flex;
8+
align-items: center;
69
}
710

8-
body.controller-issues.action-show div.issue .attribute .value .percent {
9-
display: inline-block;
11+
body.controller-issues.action-show .issue.details div.description,
12+
body.controller-issues.action-show .issue.details div.subject {
13+
position: relative;
1014
}
1115

12-
/* Progress bar fix */
13-
body.controller-issues.action-show table.progress {
14-
margin-right: 10px;
16+
body.controller-issues.action-show .issue.details.no-cursor .value {
17+
cursor: initial;
1518
}
1619

1720
body.controller-issues.action-show .attribute .error {
1821
color: #e74c3c;
1922
margin-left: 3px;
2023
}
2124

22-
body.controller-issues.action-show .fa-pencil {
23-
opacity: 0;
25+
body.controller-issues.action-show div.issue.details .subject {
26+
display: flex;
27+
justify-content: space-between;
28+
align-items: center;
2429
}
2530

26-
body.controller-issues.action-show .issue.details .showValue {
31+
body.controller-issues.action-show div.issue.details .subject .refreshData {
2732
cursor: pointer;
2833
}
2934

30-
body.controller-issues.action-show .issue.details.no-cursor .showValue {
31-
cursor: initial;
35+
body.controller-issues.action-show div.issue.details .splitcontent {
36+
overflow: initial;
3237
}
3338

34-
body.controller-issues.action-show .issue.details .value:hover .fa-pencil,
35-
body.controller-issues.action-show .issue.details.showDynamicEdit:hover .value .fa-pencil {
39+
body.controller-issues.action-show div.issue.details .iconEdit {
40+
opacity: 0;
41+
display: inline-block;
42+
transition: opacity .3s ease-in;
43+
font-weight: 700;
44+
}
45+
46+
body.controller-issues.action-show div.issue.details.showPencil .iconEdit,
47+
body.controller-issues.action-show div.issue.details .attribute:hover .iconEdit,
48+
body.controller-issues.action-show div.issue.details .description:hover .iconEdit,
49+
body.controller-issues.action-show div.issue.details .subject:hover .iconEdit {
3650
opacity: 1;
37-
cursor: pointer;
3851
}
3952

40-
body.controller-issues.action-show .dynamicEdit {
53+
body.controller-issues.action-show .dynamicEditField {
4154
display: inline-block;
4255
position:absolute;
4356
opacity: 0;
57+
transition: opacity .3s ease-in;
4458
/* left:0; correct position on top of icon */
4559
bottom: 100%;
4660
margin-bottom: 5px;
@@ -54,39 +68,36 @@ body.controller-issues.action-show .dynamicEdit {
5468
white-space: nowrap; /* force icons to stay on the same line */
5569
}
5670

57-
body.controller-issues.action-show #TitleInput.dynamicEdit {
58-
font-size: 0.57em;
59-
}
60-
61-
body.controller-issues.action-show .dynamicEdit.version {
62-
max-width: 100%;
71+
body.controller-issues.action-show .subject .dynamicEditField {
72+
bottom: initial;
73+
top:100%;
6374
}
6475

65-
body.controller-issues.action-show .edited .dynamicEdit {
66-
pointer-events: auto;
67-
}
68-
69-
body.controller-issues.action-show div.issue.details .value.edited .dynamicEdit {
76+
body.controller-issues.action-show .dynamicEditField.open {
7077
opacity: 1;
7178
z-index: 999;
79+
pointer-events: auto;
7280
}
7381

74-
body.controller-issues.action-show div.issue.details .btn-primary {
75-
color: white !important;
76-
border-radius: 3px;
77-
padding: 3px;
78-
vertical-align: middle;
82+
body.controller-issues.action-show #TitleInput.dynamicEditField {
83+
font-size: 0.57em;
7984
}
8085

81-
body.controller-issues.action-show div.issue.details .btn-primary.close {
82-
background: #c0392b;
86+
body.controller-issues.action-show .dynamicEditField button.action {
87+
margin-left: .5em;
88+
cursor: pointer;
89+
border: 0;
90+
background-color: #efefef;
91+
line-height: 0;
8392
}
8493

85-
body.controller-issues.action-show div.issue.details .btn-primary.validate {
86-
background: #27ae60;
94+
body.controller-issues.action-show .dynamicEditField button.action.valid {
95+
font-weight: 700;
96+
background-color: #27ae60;
97+
color: white;
8798
}
8899

89-
body.controller-issues.action-show .dynamicEdit select {
100+
body.controller-issues.action-show .dynamicEditField select {
90101
border:none;
91102
background-image:none;
92103
background-color:transparent;
@@ -99,41 +110,77 @@ body.controller-issues.action-show .dynamicEdit select {
99110
border-radius: 3px;
100111
}
101112

102-
body.controller-issues.action-show .dynamicEdit select option[disabled="disabled"]
103-
{
113+
body.controller-issues.action-show .dynamicEditField select option[disabled="disabled"] {
104114
display:none;
105115
}
106116

107-
body.controller-issues.action-show div.issue.details .attributes {
108-
display: table;
109-
width: 100%;
110-
}
111-
112-
body.controller-issues.action-show div.issue.details .splitcontent {
113-
display: table-row;
114-
}
115-
116-
div.issue div.subject h3 {
117+
body.controller-issues.action-show div.issue div.subject h3 {
117118
position:relative;
118119
display: inline-block;
120+
cursor: pointer;
119121
}
120122

121-
body.controller-issues.action-show .dynamicEdit input[type="text"] {
123+
body.controller-issues.action-show .dynamicEditField input[type="text"] {
122124
width: auto !important;
123125
}
124126

125-
body.controller-issues.action-show .dynamicEdit textarea {
127+
body.controller-issues.action-show .dynamicEditField textarea {
126128
width: 100%;
127129
display: block;
128130
margin-bottom: 10px;
129131
}
130132

131-
body.controller-issues.action-show .dynamicEdit input,
132-
body.controller-issues.action-show .dynamicEdit select {
133+
body.controller-issues.action-show .dynamicEditField input,
134+
body.controller-issues.action-show .dynamicEditField select {
133135
vertical-align: middle;
134136
}
135137

136-
body.controller-issues.action-show .dynamicEdit .check_box_group {
138+
body.controller-issues.action-show .dynamicEditField .check_box_group {
137139
border: 0px !important;
138140
margin-bottom: 10px;
139141
}
142+
143+
/* MOBILE MEDIAQUERY */
144+
@media screen and (max-width: 899px){
145+
146+
body.controller-issues.action-show div.issue.details .subject {
147+
display: block;
148+
}
149+
150+
body.controller-issues.action-show div.issue.details .subject .refreshData {
151+
display: none;
152+
}
153+
154+
body.controller-issues.action-show div.issue.details .value, body.controller-issues.action-show div.issue.details .attributes .attribute .value {
155+
display: block;
156+
}
157+
158+
body.controller-issues.action-show .dynamicEditField {
159+
display: block;
160+
position: relative;
161+
margin: 10px 0;
162+
white-space: normal;
163+
height: 0;
164+
overflow: hidden;
165+
padding: 0;
166+
}
167+
168+
body.controller-issues.action-show .dynamicEditField.open {
169+
height: auto;
170+
padding: 10px;
171+
}
172+
}
173+
174+
/* PRINT MEDIAQUERY */
175+
@media print {
176+
body.controller-issues.action-show div.issue.details .subject .refreshData,
177+
body.controller-issues.action-show div.issue.details .iconEdit,
178+
body.controller-issues.action-show .dynamicEditField {
179+
display : none !important;
180+
height: 0;
181+
width: 0;
182+
overflow: hidden;
183+
padding : 0;
184+
margin: 0;
185+
}
186+
}

config/locales/de.yml

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

config/locales/en.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
en:
2-
ide_txt_validation_btn : 'Validate the modification'
3-
ide_txt_error_positive_number : 'It must be a positive number'
4-
ide_txt_error_start_date : 'Start date must be anterior to due date'
5-
ide_txt_error_due_date : 'Due date must be posterior to start date'
6-
ide_txt_error_ajax_call : 'Error (check your JS console)'
7-
ide_txt_cancel_btn : 'Cancel the modification'
8-
ide_txt_required_field : 'This field is required to go to next step'
1+
en:
2+
ide_txt_notice_conflict_title : "This issue has been updated by someone else while you are editing it."
3+
ide_txt_notice_conflict_text : "<a href='#' class='refreshData'>Refresh the current page</a> to get the updated data. <strong>Your current modifications will be lost</strong>"

config/locales/fr.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
fr:
2-
ide_txt_validation_btn : 'Valider la modification'
3-
ide_txt_error_positive_number : 'Le nombre doit être positif'
4-
ide_txt_error_start_date : "La date de début doit être antérieure à la date d'échéance"
5-
ide_txt_error_due_date : "La date d'échéance doit être postérieure à la date de début"
6-
ide_txt_error_ajax_call : 'Erreur (logs dans la console JS)'
7-
ide_txt_cancel_btn : 'Annuler la modification'
8-
ide_txt_required_field : 'Ce champs est obligatoire pour passer au Statut suivant'
1+
fr:
2+
ide_txt_notice_conflict_title : "La demande a été mise à jour pendant que vous la modifiez."
3+
ide_txt_notice_conflict_text : "<a href='#' class='refreshData'>Rafraichissez la page</a> pour voir une version à jour de la demande. <strong>Vos modifications actuelles seront perdues</strong>"

init.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
name 'Redmine Dynamic edit Issue plugin'
77
author 'Hugo Zilliox'
88
description 'Allows users to dynamically update issue attributes in detailed view without refreshing the page (JIRA style)'
9-
version '0.7.2'
9+
version '0.8.0'
1010
url 'https://github.com/ilogeek/redmine_issue_dynamic_edit'
1111
author_url 'https://hzilliox.fr'
1212
end

0 commit comments

Comments
 (0)