Skip to content

Commit

Permalink
Merge pull request changeweb#181 from gerpollo2000/master
Browse files Browse the repository at this point in the history
Fixed translations and fixed Update Course function
  • Loading branch information
changeweb authored Jul 27, 2019
2 parents 5691f88 + ef7952f commit a6b5d6f
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/CourseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function updateNameAndTime(Request $request, $id)
'course_name' => 'required|string',
'course_time' => 'required|string',
]);
$this->courseService->updateCourseInfo($id);
$this->courseService->updateCourseInfo($id, $request);
return back()->with('status', __('Saved'));
}

Expand Down
2 changes: 1 addition & 1 deletion app/Services/Course/CourseService.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function getExamsBySchoolId(){
->get();
}

public function updateCourseInfo($id){
public function updateCourseInfo($id, $request){
$tb = Course::find($id);
$tb->course_name = $request->course_name;
$tb->course_time = $request->course_time;
Expand Down
16 changes: 8 additions & 8 deletions resources/views/schools/edit.blade.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
@extends('layouts.app')

@section('title', 'Edit School')
@section('title', __('Edit School'))

@section('content')
<div class="panel panel-default">
<div class="panel-body">
<h2 class="text-center">Edit {{$school->name}}</h2>
<h2 class="text-center">@lang('Edit') {{$school->name}}</h2>

<form class="form-horizontal" action="{{ route('schools.update', $school) }}" method="post">
<input type="hidden" name="_method" value="PUT">
{{ csrf_field() }}
<div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
<label for="name" class="col-md-4 control-label">School Name</label>
<label for="name" class="col-md-4 control-label">@lang('School Name')</label>

<div class="col-md-6">
<input id="name" type="text" class="form-control" name="name" value="{{ $school->name }}" placeholder="Form Field Name" required>
<input id="name" type="text" class="form-control" name="name" value="{{ $school->name }}" placeholder="@lang('School Name')" required>

@if ($errors->has('name'))
<span class="help-block">
Expand All @@ -25,11 +25,11 @@
</div>

<div class="form-group{{ $errors->has('about') ? ' has-error' : '' }}">
<label for="about" class="col-md-4 control-label">About School</label>
<label for="about" class="col-md-4 control-label">@lang('About School')</label>

<div class="col-md-6">
<textarea id="about" type="text" class="form-control" name="about"
placeholder="Form Field Name" required>{{ $school->about }}</textarea>
placeholder="@lang('About School')" required>{{ $school->about }}</textarea>

@if ($errors->has('about'))
<span class="help-block">
Expand All @@ -41,8 +41,8 @@

<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<a href="{{ route('schools.index') }}" class="btn btn-primary">back</a>
<button type="submit" class="btn btn-danger">Save</button>
<a href="{{ route('schools.index') }}" class="btn btn-primary">@lang('Back')</a>
<button type="submit" class="btn btn-danger">@lang('Save')</button>
</div>
</div>
</form>
Expand Down
18 changes: 9 additions & 9 deletions resources/views/schools/form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<label for="name" class="col-md-4 control-label">@lang('School Name')</label>

<div class="col-md-6">
<input id="name" type="text" class="form-control" name="name" value="{{ old('name') }}" placeholder="School Name" required>
<input id="name" type="text" class="form-control" name="name" value="{{ old('name') }}" placeholder="@lang('School Name')" required>

@if ($errors->has('name'))
<span class="help-block">
Expand All @@ -32,12 +32,12 @@

<div class="col-md-6">
<select id="medium" class="form-control" name="medium">
<option selected="selected">Bangla</option>
<option>English</option>
<option>Hindi</option>
<option>Spanish</option>
<option>Chinese</option>
<option>Arabic</option>
<option selected="selected">@lang('Bangla')</option>
<option>@lang('English')</option>
<option>@lang('Hindi')</option>
<option>@lang('Spanish')</option>
<option>@lang('Chinese')</option>
<option>@lang('Arabic')</option>
</select>

@if ($errors->has('medium'))
Expand All @@ -52,7 +52,7 @@
<label for="established" class="col-md-4 control-label">@lang('School Established')</label>

<div class="col-md-6">
<input id="established" type="text" class="form-control" name="established" value="{{ old('established') }}" placeholder="School Established" required>
<input id="established" type="text" class="form-control" name="established" value="{{ old('established') }}" placeholder="@lang('School Established')" required>

@if ($errors->has('established'))
<span class="help-block">
Expand All @@ -66,7 +66,7 @@
<label for="about" class="col-md-4 control-label">@lang('About')</label>

<div class="col-md-6">
<textarea id="about" class="form-control" rows="3" name="about" placeholder="About School" required>{{ old('about') }}</textarea>
<textarea id="about" class="form-control" rows="3" name="about" placeholder="@lang('About School')" required>{{ old('about') }}</textarea>

@if ($errors->has('about'))
<span class="help-block">
Expand Down
10 changes: 5 additions & 5 deletions resources/views/schools/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<th scope="col">@lang('Name')</th>
<th scope="col">@lang('Code')</th>
<th scope="col">@lang('About')</th>
<th scope="col">Edit</th>
<th scope="col">+Admin</th>
<th scope="col">View Admins</th>
<th scope="col">@lang('Edit')</th>
<th scope="col">+@lang('Admin')</th>
<th scope="col">@lang('View Admins')</th>
</tr>
</thead>
<tbody>
Expand All @@ -31,12 +31,12 @@
<td><small>{{$school->about}}</small></td>
<td>
<a class="btn btn-success btn-sm" role="button" href="{{ route('schools.edit', $school) }}" dusk="edit-school-link">
<small>Edit School</small>
<small>@lang('Edit School')</small>
</a>
</td>
<td>
<a class="btn btn-danger btn-sm" role="button" href="{{url('register/admin/'.$school->id.'/'.$school->code)}}">
<small>+ Create Admin</small>
<small>+ @lang('Create Admin')</small>
</a>
</td>
<td>
Expand Down
10 changes: 5 additions & 5 deletions resources/views/settings/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</div>
<div class="col-md-10" id="main-container">
<div class="panel panel-default">
<div class="page-panel-title">Academic Settings</div>
<div class="page-panel-title">@lang('Academic Settings')</div>
<div class="panel-body table-responsive">
<table class="table table-condensed">
<thead>
Expand Down Expand Up @@ -132,16 +132,16 @@
<tbody>
<tr>
<td>
<a class="btn btn-info btn-sm" href="{{url('register/student')}}">+ Add Student</a>
<a class="btn btn-info btn-sm" href="{{url('register/student')}}">+ @lang('Add Student')</a>
<br>
<h5>Or, Mass upload Excel</h5>
<h5>@lang('Or, Mass upload Excel')</h5>
@component('components.excel-upload-form', ['type'=>'student'])
@endcomponent
</td>
<td>
<a class="btn btn-success btn-sm" href="{{url('register/teacher')}}">+ Add Teacher</a>
<a class="btn btn-success btn-sm" href="{{url('register/teacher')}}">+ @lang('Add Teacher')</a>
<br>
<h5>Or, Mass upload Excel</h5>
<h5>@lang('Or, Mass upload Excel')</h5>
@component('components.excel-upload-form', ['type'=>'teacher'])
@endcomponent
</td>
Expand Down

0 comments on commit a6b5d6f

Please sign in to comment.