Skip to content

Commit

Permalink
WIP on create ticket stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Crampton committed Jul 10, 2015
1 parent 3bc8df4 commit 6fb8bf3
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 23 deletions.
13 changes: 11 additions & 2 deletions app/controllers/TicketsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,16 @@ public function index()

public function create($create_type = null)
{

// Create array of vars for various ticket attributes
$attributes = [
'staff_users_list' => User::lists('users_username', 'users_id'),
'support_users_list' => User::lists('users_username', 'users_id'),
'categories_list' => Category::lists('categories_name', 'categories_id'),
'priorities_list' => Priority::lists('priorities_name', 'priorities_id'),
'statuses_list' => Status::lists('statuses_name', 'statuses_id'),
];

return View::make('tickets.create', ['attributes' => $attributes]);
}

public function show($ticket_id = null)
Expand Down Expand Up @@ -51,7 +60,7 @@ public function show($ticket_id = null)

public function store()
{

die('run checks and store in db');
}

public function update()
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/default.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="/">Home</a></li>
<li><a href="#">Create Ticket</a></li>
<li><a href="/tickets/create">Create Ticket</a></li>
<li><a href="/tickets">Show Tickets</a></li>
<li><a href="#">Admin Area</a></li>
<li><a href="/login">Login</a></li>
Expand Down
2 changes: 1 addition & 1 deletion app/views/pages/home.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<div class="row">
<div class="col-md-12">
<a class="btn btn-primary">Create a new ticket</a>
<a href="/tickets/create" class="btn btn-primary">Create a new ticket</a>
<a class="btn btn-primary">View my tickets</a>
</div>
</div>
Expand Down
33 changes: 14 additions & 19 deletions app/views/sessions/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,19 @@
@endif

<h1>Log In</h1>

{{ Form::open(['route' => 'sessions.store']) }}
<div class="input-group">
{{ Form::label('users_email', 'Email:') }}
{{ Form:: email('users_email', null, array('class' => 'form-control')) }}
</div>
<div class="input-group">
{{ Form::label('password', 'Password:') }}
{{ Form::password('password', array('class' => 'form-control')) }}
</div>

<div class="input-group">
{{ Form::submit('Go', array('class' => 'btn btn-default')) }}
<p>Please log in using the form below.</p>
<div class="row">
{{ Form::open(['route' => 'sessions.store']) }}
<div class="col-md-4">
<div class="form-group">
{{ Form::label('users_email', 'Email:') }}
{{ Form::email('users_email', null, array('class' => 'form-control')) }}
{{ Form::label('password', 'Password:') }}
{{ Form::password('password', array('class' => 'form-control')) }}
</div>
{{ Form::submit('Log in', array('class' => 'btn btn-primary')) }}
</div>
{{ Form::close() }}
</div>

<hr />
<p>Forgot your password? {{ link_to('/password/remind', 'Click here')}}</p>

{{ Form::close() }}


@stop
67 changes: 67 additions & 0 deletions app/views/tickets/create.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
@extends('layouts/default')

@section('content')


{{ Form::open(['method' => 'post', 'route' => 'tickets.store', 'files' => true]) }}

<div class="row">

<div class="col-md-8">
<p class="lead">Enter ticket details:</p>
<hr />
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('category', 'Category: ') }}
{{ Form::select('category', $attributes['categories_list'], null, ['class' => 'form-control']) }}
{{ $errors->first('category', '<span class="label label-danger">:message</span>') }}
</div>
</div>
<div class="col-md-6">
<div id="content_doc_container" class="form-group has-feedback">
{{ Form::label('related_files', 'Upload related files (max 8mb): ', ['class' => 'control-label']) }}
{{ Form::file('related_files', ['class' => 'form-control']) }}
<span id="content_doc_glyph" class="glyphicon glyphicon-ok form-control-feedback hide" aria-hidden="true"></span>
<span id="ajax-error-upload"></span>
</div>
</div>
</div>
<div class="form-group">
{{ Form::label('description', 'Description: ') }} {{ $errors->first('description', '<span class="label label-danger">:message</span>') }}
{{ Form::textarea('description', null, ['class' => 'form-control']) }}
</div>
</div>


<div class="col-md-4">
<p class="lead">Admin Options:</p>
<hr />
<div class="form-group">
{{ Form::label('submitted_by', 'Submitted By: ') }}
{{ Form::select('submitted_by', $attributes['staff_users_list'], null, ['class' => 'form-control']) }}
{{ $errors->first('submitted_by', '<span class="label label-danger">:message</span>') }}
</div>

<div class="form-group">
{{ Form::label('assigned_to', 'Assigned To: ') }}
{{ Form::select('assigned_to', $attributes['support_users_list'], null, ['class' => 'form-control']) }}
{{ $errors->first('assigned_to', '<span class="label label-danger">:message</span>') }}
</div>

<div class="form-group">
{{ Form::label('status', 'Status: ') }}
{{ Form::select('status', $attributes['statuses_list'], null, ['class' => 'form-control']) }}
{{ $errors->first('status', '<span class="label label-danger">:message</span>') }}
</div>
</div>
<div class="col-md-12">
<div class="form-group">
{{ Form::submit('Create ticket', ['class' => 'btn btn-success']) }}
</div>
</div>
{{ Form::close() }}

</div>

@stop

0 comments on commit 6fb8bf3

Please sign in to comment.