Skip to content

Commit 04d426a

Browse files
committed
polished revisions interface
1 parent 966bc71 commit 04d426a

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

src/app/Http/Controllers/CrudController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public function listRevisions($id)
193193
// get the info for that entry
194194
$this->data['entry'] = $this->crud->getEntry($id);
195195
$this->data['crud'] = $this->crud;
196-
$this->data['title'] = trans('backpack::crud.revisions').' '.$this->crud->entity_name;
196+
$this->data['title'] = ucfirst($this->crud->entity_name).' '.trans('backpack::crud.revisions');
197197
$this->data['id'] = $id;
198198
$this->data['revisions'] = $this->crud->listRevisions($id);
199199

src/resources/views/inc/revision_timeline.blade.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,20 @@
1515
<h3 class="timeline-header">{{ $history->userResponsible()->name }} {{ trans('backpack::crud.created_this') }} {{ $crud->entity_name }}</h3>
1616
@else
1717
<h3 class="timeline-header">{{ $history->userResponsible()->name }} {{ trans('backpack::crud.changed_the') }} {{ $history->fieldName() }}</h3>
18-
<div class="timeline-body">
19-
{{ ucfirst(trans('backpack::crud.from')) }}: <b>{{ $history->oldValue() }}</b>
20-
<br>
21-
{{ ucfirst(trans('backpack::crud.to')) }}: {{ $history->newValue() }}
18+
<div class="timeline-body p-b-0">
19+
<div class="row">
20+
<div class="col-md-6">{{ ucfirst(trans('backpack::crud.from')) }}:</div>
21+
<div class="col-md-6">{{ ucfirst(trans('backpack::crud.to')) }}:</div>
22+
</div>
23+
<div class="row">
24+
<div class="col-md-6"><div class="well well-sm" style="overflow: hidden;">{{ $history->oldValue() }}</div></div>
25+
<div class="col-md-6"><div class="well well-sm" style="overflow: hidden;">{{ $history->newValue() }}</div></div>
26+
</div>
2227
</div>
23-
<div class="timeline-footer">
28+
<div class="timeline-footer p-t-0">
2429
{!! Form::open(array('url' => \Request::url().'/'.$history->id.'/restore', 'method' => 'post')) !!}
25-
<button type="submit" class="btn btn-primary btn-xs restore-btn" data-entry-id="{{ $entry->id }}" data-revision-id="{{ $history->id }}" onclick="onRestoreClick(event)">
26-
<i class="fa fa-history"></i> {{ trans('backpack::crud.restore_this_value') }}</button>
30+
<button type="submit" class="btn btn-primary btn-sm restore-btn" data-entry-id="{{ $entry->id }}" data-revision-id="{{ $history->id }}" onclick="onRestoreClick(event)">
31+
<i class="fa fa-undo"></i> {{ trans('backpack::crud.undo') }}</button>
2732
{!! Form::close() !!}
2833
</div>
2934
@endif
@@ -58,7 +63,7 @@ function onRestoreClick(e) {
5863
// Animate the new revision in (by sliding)
5964
$('.timeline-item-wrap').first().addClass('fadein');
6065
new PNotify({
61-
title: '{{ trans('backpack::crud.revision_restored') }}',
66+
text: '{{ trans('backpack::crud.revision_restored') }}',
6267
type: 'success'
6368
});
6469
}

src/resources/views/revisions.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
@section('header')
44
<section class="content-header">
55
<h1>
6-
<span class="text-lowercase">{{ $crud->entity_name }}</span> {{ trans('backpack::crud.revisions') }}
6+
<span>{{ ucfirst($crud->entity_name) }}</span> {{ trans('backpack::crud.revisions') }}
77
</h1>
88
<ol class="breadcrumb">
99
<li><a href="{{ url(config('backpack.base.route_prefix'),'dashboard') }}">{{ trans('backpack::crud.admin') }}</a></li>
@@ -15,7 +15,7 @@
1515

1616
@section('content')
1717
<div class="row">
18-
<div class="col-md-8 col-md-offset-2">
18+
<div class="col-md-10 col-md-offset-1">
1919
<!-- Default box -->
2020
@if ($crud->hasAccess('list'))
2121
<a href="{{ url($crud->route) }}"><i class="fa fa-angle-double-left"></i> {{ trans('backpack::crud.back_to_all') }} <span class="text-lowercase">{{ $crud->entity_name_plural }}</span></a><br><br>

0 commit comments

Comments
 (0)