|
@@ -236,6 +236,11 @@ class HtmlDocument extends React.Component {
|
236
|
236
|
}))
|
237
|
237
|
}
|
238
|
238
|
|
|
239
|
+ handleClickLastVersion = () => {
|
|
240
|
+ this.loadContent()
|
|
241
|
+ this.setState({mode: MODE.VIEW})
|
|
242
|
+ }
|
|
243
|
+
|
239
|
244
|
render () {
|
240
|
245
|
const { isVisible, loggedUser, content, timeline, newComment, timelineWysiwyg, config, mode } = this.state
|
241
|
246
|
|
|
@@ -252,21 +257,36 @@ class HtmlDocument extends React.Component {
|
252
|
257
|
/>
|
253
|
258
|
|
254
|
259
|
<PopinFixedOption customClass={`${config.slug}`} i18n={i18n}>
|
255
|
|
- <div>
|
256
|
|
- <NewVersionBtn onClickNewVersionBtn={this.handleClickNewVersion} disabled={mode === MODE.REVISION} />
|
257
|
|
-
|
258
|
|
- <SelectStatus
|
259
|
|
- selectedStatus={config.availableStatuses.find(s => s.slug === content.status)}
|
260
|
|
- availableStatus={config.availableStatuses}
|
261
|
|
- onChangeStatus={this.handleChangeStatus}
|
262
|
|
- disabled={mode === MODE.REVISION}
|
263
|
|
- />
|
264
|
|
-
|
265
|
|
- <ArchiveDeleteContent
|
266
|
|
- onClickArchiveBtn={this.handleClickArchive}
|
267
|
|
- onClickDeleteBtn={this.handleClickDelete}
|
268
|
|
- disabled={mode === MODE.REVISION}
|
269
|
|
- />
|
|
260
|
+ <div /* this div in display flex, justify-content space-between */>
|
|
261
|
+ <div className='d-flex'>
|
|
262
|
+ <NewVersionBtn onClickNewVersionBtn={this.handleClickNewVersion} disabled={mode === MODE.REVISION} />
|
|
263
|
+
|
|
264
|
+ {mode === MODE.REVISION &&
|
|
265
|
+ <button
|
|
266
|
+ className='wsContentGeneric__option__menu__lastversion html-documents__lastversionbtn btn btn-default'
|
|
267
|
+ onClick={this.handleClickLastVersion}
|
|
268
|
+ style={{backgroundColor: config.hexcolor, color: '#fdfdfd'}}
|
|
269
|
+ >
|
|
270
|
+ <i className='fa fa-code-fork' />
|
|
271
|
+ Dernière version
|
|
272
|
+ </button>
|
|
273
|
+ }
|
|
274
|
+ </div>
|
|
275
|
+
|
|
276
|
+ <div className='d-flex'>
|
|
277
|
+ <SelectStatus
|
|
278
|
+ selectedStatus={config.availableStatuses.find(s => s.slug === content.status)}
|
|
279
|
+ availableStatus={config.availableStatuses}
|
|
280
|
+ onChangeStatus={this.handleChangeStatus}
|
|
281
|
+ disabled={mode === MODE.REVISION}
|
|
282
|
+ />
|
|
283
|
+
|
|
284
|
+ <ArchiveDeleteContent
|
|
285
|
+ onClickArchiveBtn={this.handleClickArchive}
|
|
286
|
+ onClickDeleteBtn={this.handleClickDelete}
|
|
287
|
+ disabled={mode === MODE.REVISION}
|
|
288
|
+ />
|
|
289
|
+ </div>
|
270
|
290
|
</div>
|
271
|
291
|
</PopinFixedOption>
|
272
|
292
|
|
|
@@ -276,11 +296,8 @@ class HtmlDocument extends React.Component {
|
276
|
296
|
wysiwygNewVersion={'wysiwygNewVersion'}
|
277
|
297
|
onClickCloseEditMode={this.handleCloseNewVersion}
|
278
|
298
|
onClickValidateBtn={this.handleSaveHtmlDocument}
|
279
|
|
- version={
|
280
|
|
- mode === MODE.REVISION
|
281
|
|
- ? content.number
|
282
|
|
- : timeline.filter(t => t.timelineType === 'revision').length
|
283
|
|
- }
|
|
299
|
+ version={content.number}
|
|
300
|
+ lastVersion={timeline.filter(t => t.timelineType === 'revision').length}
|
284
|
301
|
text={content.raw_content}
|
285
|
302
|
onChangeText={this.handleChangeText}
|
286
|
303
|
key={'html-documents'}
|