<commit_before>@extends('layouts.app')

@php($isEditMode = isset($course))
@php($methodText = $isEditMode ? '編輯' : '新增')

@section('title', $methodText . '課程')

@section('content')
    <div class="card">
        <div class="card-header">
            @if($isEditMode)
                {{ $course->name }} - 編輯課程
            @else
                新增課程
            @endif
        </div>
        <div class="card-block">
            @if($isEditMode)
                {{ Form::model($course, ['route' => ['admin.course.update', $course], 'method' => 'put']) }}
            @else
                {{ Form::open(['route' => 'admin.course.store']) }}
            @endif
            <div class="form-group">
                {{ Form::label('year', '學年度', ['class' => 'form-control-label']) }}
                {{ Form::select('year', \App\Course::getYearRange(), null, ['placeholder' => '-', 'class' => 'form-control', 'required']) }}
            </div>
            <div class="form-group">
                {{ Form::label('semester', '學期', ['class' => 'form-control-label']) }}
                <div class="form-control">
                    <label class="custom-control custom-radio">
                        <input id="semester1" name="semester" type="radio" class="custom-control-input" value="1"
                               required
                               @if($isEditMode && $course->semester==1) checked @endif>
                        <span class="custom-control-indicator"></span>
                        <span class="custom-control-description">上學期</span>
                    </label>
                    <label class="custom-control custom-radio">
                        <input id="semester2" name="semester" type="radio" class="custom-control-input" value="2"
                               required
                               @if($isEditMode && $course->semester==2) checked @endif>
                        <span class="custom-control-indicator"></span>
                        <span class="custom-control-description">下學期</span>
                    </label>
                </div>
            </div>
            <div class="form-group">
                {{ Form::label('name', '名稱', ['class' => 'form-control-label']) }}
                {{ Form::text('name', null, ['class' => 'form-control', 'required']) }}
            </div>


            @if($errors->count())
                <div class="alert alert-danger">
                    @foreach($errors->all('<li>:message</li>') as $error)
                        {!! $error !!}
                    @endforeach
                </div>
            @endif
            <div class="form-group row">
                <div class="text-xs-center">
                    @if($isEditMode)<commit_msg>Use Form facade for radio<commit_after>@extends('layouts.app')

@php($isEditMode = isset($course))
@php($methodText = $isEditMode ? '編輯' : '新增')

@section('title', $methodText . '課程')

@section('content')
    <div class="card">
        <div class="card-header">
            @if($isEditMode)
                {{ $course->name }} - 編輯課程
            @else
                新增課程
            @endif
        </div>
        <div class="card-block">
            @if($isEditMode)
                {{ Form::model($course, ['route' => ['admin.course.update', $course], 'method' => 'put']) }}
            @else
                {{ Form::open(['route' => 'admin.course.store']) }}
            @endif
            <div class="form-group">
                {{ Form::label('year', '學年度', ['class' => 'form-control-label']) }}
                {{ Form::select('year', \App\Course::getYearRange(), null, ['placeholder' => '-', 'class' => 'form-control', 'required']) }}
            </div>
            <div class="form-group">
                {{ Form::label('semester', '學期', ['class' => 'form-control-label']) }}
                <div class="form-control">
                    <label class="custom-control custom-radio">
                        {{ Form::radio('semester', 1, null, ['class' => 'custom-control-input']) }}
                        <span class="custom-control-indicator"></span>
                        <span class="custom-control-description">上學期</span>
                    </label>
                    <label class="custom-control custom-radio">
                        {{ Form::radio('semester', 2, null, ['class' => 'custom-control-input']) }}
                        <span class="custom-control-indicator"></span>
                        <span class="custom-control-description">下學期</span>
                    </label>
                </div>
            </div>
            <div class="form-group">
                {{ Form::label('name', '名稱', ['class' => 'form-control-label']) }}
                {{ Form::text('name', null, ['class' => 'form-control', 'required']) }}
            </div>


            @if($errors->count())
                <div class="alert alert-danger">
                    @foreach($errors->all('<li>:message</li>') as $error)
                        {!! $error !!}
                    @endforeach
                </div>
            @endif
            <div class="form-group row">
                <div class="text-xs-center">
                    @if($isEditMode)
{'fraction_non_alphanumeric': 0.18314176245210728, 'fraction_numerical': 0.0015325670498084292, 'mean_word_length': 1.540632603406326, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 93, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3397171', 'n_tokens_mistral': 1474, 'n_tokens_neox': 1410, 'n_words': 243}