Skip to content

Commit

Permalink
Show research icon and ID in edit mode
Browse files Browse the repository at this point in the history
  • Loading branch information
pvgennip committed Oct 6, 2020
1 parent 0949858 commit 7f16b4f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
16 changes: 10 additions & 6 deletions resources/views/research/form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@
</div>
<div class="col-xs-12">
<div class="form-group {{ $errors->has('image') ? 'has-error' : ''}}">
<label for="image" control-label>{{ 'Image' }}</label>
<div>
<image src="{{ isset($research->image) ? $research->image : ''}}">
<input class="form-control" name="image" type="file" id="image" >

{!! $errors->first('image', '<p class="help-block">:message</p>') !!}
<div class="row">
<div class="col-xs-6">
<label for="image" control-label>{{ 'Upload new image' }}</label>
<input class="form-control" name="image" type="file" id="image" >
{!! $errors->first('image', '<p class="help-block">:message</p>') !!}
</div>
<div class="col-xs-6">
<label for="image" control-label>{{ 'Current image' }}</label><br>
<img src="{{ isset($research->image_id) ? $research->thumb_url : '' }}" style="width:40px; height: 40px; border-radius: 20%; border: 1px solid #333; display: inline-block; overflow: hidden;">
</div>
</div>
</div>
</div><div class="col-xs-12">
Expand Down
4 changes: 2 additions & 2 deletions resources/views/research/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
@foreach($research as $item)
<tr>
{{-- <td>{{ $loop->iteration or $item->id }}</td> --}}
<td><a href="{{$item->url}}" target="_blank">@if(isset($item->thumb_url))<img src="{{$item->thumb_url}}" style="width:40px; height: 40px; border-radius: 20%; border: 1px solid #333; display: inline-block;">@endif</a></td>
<td><a href="{{$item->url}}" target="_blank">{{ $item->name }}</a></td>
<td><a href="{{ route('research.show', $item->id) }}">@if(isset($item->thumb_url))<img src="{{$item->thumb_url}}" style="width:40px; height: 40px; border-radius: 20%; border: 1px solid #333; display: inline-block; overflow: hidden;">@endif</a></td>
<td><a href="{{ route('research.show', $item->id) }}">{{ $item->name }}<br>(ID: {{ $item->id }})</a></td>
<td>{{ $item->description }}</td>
<td>{{ $item->type }}</td>
<td>{{ $item->institution }}</td>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/research/show.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@extends('layouts.app')

@section('page-title') {{ __('beep.Research').': '.(isset($research->name) ? $research->name : __('general.Item')).' ('.$research->id.')' }}
@section('page-title') {{ __('beep.Research').': '.(isset($research->name) ? $research->name : __('general.Item')).' (ID: '.$research->id.')' }}
@endsection

@section('content')
Expand Down

0 comments on commit 7f16b4f

Please sign in to comment.