Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/Http/Controllers/Web/IssueController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use GitScrum\Models\ConfigStatus;
use Carbon\Carbon;
use Auth;
use GitScrum\Http\Responses\Issue\Store as IssueStoreResponse;

class IssueController extends Controller
{
Expand Down Expand Up @@ -76,10 +77,9 @@ public function create($scope, $slug, $parent_id = null)

public function store(IssueRequest $request)
{
$response = resolve('IssueService')->create($request);
$issue = resolve('IssueService')->create($request);

return redirect()->route('issues.show', ['slug' => $response->slug])
->with('success', trans('gitscrum.congratulations-the-issue-has-been-created-with-successfully'));
return (new IssueStoreResponse())->response($request,$issue);
}

public function show($slug)
Expand Down
50 changes: 50 additions & 0 deletions app/Http/Responses/Issue/Store.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

namespace GitScrum\Http\Responses\Issue;

use GitScrum\Classes\Helper;

class Store
{
public function response($request,$issue)
{
return $request->ajax() ? $this->toAjax($request,$issue) : $this->toHtml($issue);
}

private function toHtml($issue)
{
return redirect()->route('issues.show', ['slug' => $issue->slug])
->with('success', trans('gitscrum.congratulations-the-issue-has-been-created-with-successfully'));

}

private function toAjax($request,$issue)
{
$relation = $request->input('user_story_id') ? 'userStory' : 'sprint';

$data = $this->data($relation,$issue->{$relation});

return response()->json(['data' => $data , 'message' => trans('gitscrum.congratulations-the-issue-has-been-created-with-successfully') ]);
}

private function data($relation,$relationModel)
{
$data = [
'issueStatusChart' => view('partials.boxes.chart-donut', ['list' => $relationModel->issueStatus()])->render(),
'issuesCount' => $relationModel->issues->count(),
'issuesBox' => view('partials.boxes.issue', ['list' => $relationModel->issues, 'messageEmpty' => trans('gitscrum.this-does-not-have-any-issue-yet')])->render()
];

return $relation == 'sprint' ? array_merge($data,$this->sprintData($relationModel)) : $data ;
}

private function sprintData($sprint)
{
return [
'issueTypes' => view('partials.boxes.issue-type', ['list' => $sprint->issueTypes()])->render(),
'issueBurndownChart' => view('partials.boxes.burndown', ['title' => ('Burndown Chart'), 'list' => Helper::burndown($sprint)])->render()
];
}


}
4 changes: 3 additions & 1 deletion resources/lang/ar/gitscrum.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* The MIT License (MIT)
* Copyright (c) 2017 Renato Marinho <renato.marinho@s2move.com>
*/
return array (

return array (
'sprints' => 'السبرنتز',
'issue-type' => 'نوع المسئله',
'search-issue-type-by-name...' => 'ابحث عن نوع المسئله بالأسم ...',
Expand Down Expand Up @@ -187,4 +188,5 @@
'congratulations-the-product-backlog-has-been-updated-with-successfully' => 'تهانينا ! لقد تم تعديل مهام المشروع بنجاح',
'favorited-successfully' => 'تم الاضافة الى المفضلة بنجاح',
'unfavorited-successfully' => 'تم الحذف من المفضلة بنجاح',
'keep-adding' => 'أستمر بالإضافه'
);
1 change: 1 addition & 0 deletions resources/lang/en/gitscrum.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
'congratulations-the-product-backlog-has-been-updated-with-successfully' => 'Congratulations! The Product Backlog has been successfully updated',
'favorited-successfully' => 'Favorited',
'unfavorited-successfully' => 'Unfavorited',
'keep-adding' => 'Keep Adding'
'private-sprint' => 'This sprint is private, only owner can access it',
'save' => 'Save',
'issue-status-updated' => '@:username updated the issue to: *:status*',
Expand Down
57 changes: 52 additions & 5 deletions resources/views/partials/forms/issue.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<form action="{{route($route, ['slug'=>@$issue->slug])}}" method="post" class="form-horizontal">
<form id="storeIssueForm" action="{{route($route, ['slug'=>@$issue->slug])}}" method="post" class="form-horizontal">
{{ csrf_field() }}
<input type="hidden" name="product_backlog_id" value="{{$obj->productBacklog->id or $issue->productBacklog->id}}">

Expand Down Expand Up @@ -86,18 +86,65 @@
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-sm-3 control-label">{{trans('gitscrum.planning-pocker')}}</label>
<div class="col-sm-9">
<label class="col-sm-2">{{trans('gitscrum.planning-pocker')}}</label>
<div class="col-sm-3">
<div class="i-checks"><input type="checkbox" value="" checked=""> <i></i></div>
<span class="help-block m-b-none">{{trans('gitscrum.collaborative-estimation')}}</span>
</div>
<div class="col-sm-3"></div>
<label class="col-sm-2">{{trans('gitscrum.keep-adding')}}</label>
<div class="col-sm-2">
<div class="i-checks"><input id="keepAddingIssue" type="checkbox" value="" checked=""> <i></i></div>
</div>
</div>
<div class="hr-line-dashed"></div>
<div id="issueModalMessage" style="display: none;" class="alert alert-success">

</div>
@include('partials.includes.form-btn-submit', ['action' => @$action])
</form>

<script>
$(function(){
$('[data-provide="markdown"]').markdown({autofocus:false,savable:false})
})
$('[data-provide="markdown"]').markdown({autofocus:false,savable:false});

$( "#storeIssueForm" ).on('submit',function( event ) {

if (!$('#keepAddingIssue').is(':checked'))
{
$(this).submit();
}

event.preventDefault();

$.ajax({
'url' : $(this).attr('action'),
'method' : 'POST',
'data' : $(this).serialize(),
'success' : function (response) {

for(classSelector in response.data)
{
$('.'+classSelector).html(response.data[classSelector]);
}

$('#storeIssueForm').find("input[type=text], textarea").val("");

$('#issueModalMessage').show().text('').attr('class','alert alert-success').text(response.message);
},
'error' : function(response){

errorMessages = [];

for (errorKey in response.responseJSON)
{
errorMessages.push(response.responseJSON[errorKey]);
}

$('#issueModalMessage').show().text('').attr('class','alert alert-danger').text(errorMessages.join(' , '));
}
});

});
});
</script>
12 changes: 6 additions & 6 deletions resources/views/sprints/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class="btn btn-lg btn-block btn-warning"><strong>{{trans('gitscrum.sprint-planni
class="btn btn-block btn-primary"
data-toggle="modal" data-target="#modalLarge"><strong>{{trans('gitscrum.create-issue')}}</strong></a>

@include('partials.boxes.chart-donut', ['list' => $sprint->issueStatus()])
<div class="issueStatusChart">@include('partials.boxes.chart-donut', ['list' => $sprint->issueStatus()])</div>

<div class="">
@include('partials.boxes.progress-bar', [ 'percentage' => Helper::percentage($sprint, 'issues')])
Expand All @@ -80,14 +80,14 @@ class="btn btn-block btn-primary"
</tr>
<tr>
<td width="50%">
<h6>{{$sprint->issues->count()}} {{trans('gitscrum.issues')}}</h6>
<h6><div class="issuesCount">{{$sprint->issues->count()}}</div> {{trans('gitscrum.issues')}}</h6>
</td>
<td width="50%"></td>
</tr>
</tbody>
</table>

@include('partials.boxes.issue-type', ['list' => $sprint->issueTypes()])
<div class="issueTypes">@include('partials.boxes.issue-type', ['list' => $sprint->issueTypes()])</div>

@include('partials.boxes.note', [ 'list' => $sprint,
'type'=> 'sprints', 'title' => trans('gitscrum.definition-of-done-checklist'),
Expand Down Expand Up @@ -124,7 +124,7 @@ class="btn btn-block btn-primary"
</p>
@endif

@include('partials.boxes.burndown', ['title' => ('Burndown Chart'), 'list' => Helper::burndown($sprint)])
<div class="issueBurndownChart">@include('partials.boxes.burndown', ['title' => ('Burndown Chart'), 'list' => Helper::burndown($sprint)])</div>

<div class="clearfix"></div>

Expand All @@ -133,7 +133,7 @@ class="btn btn-block btn-primary"
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#tab-issues">
<i class="fa fa-list-alt" aria-hidden="true"></i>
{{trans('gitscrum.issues')}} ({{$sprint->issues->count()}})</a></li>
{{trans('gitscrum.issues')}} (<div class="issuesCount">{{$sprint->issues->count()}}</div>)</a></li>
<li class=""><a data-toggle="tab" href="#tab-comments">
<i class="fa fa-comments" aria-hidden="true"></i>
{{trans('gitscrum.comments')}} ({{$sprint->comments->count()}})</a></li>
Expand All @@ -146,7 +146,7 @@ class="btn btn-block btn-primary"
<div id="tab-issues" class="tab-pane active">
<div class="panel-body">
@include('partials.boxes.search-min')
@include('partials.boxes.issue', ['list' => $sprint->issues, 'messageEmpty' => trans('gitscrum.this-does-not-have-any-issue-yet')])
<div class="issuesBox">@include('partials.boxes.issue', ['list' => $sprint->issues, 'messageEmpty' => trans('gitscrum.this-does-not-have-any-issue-yet')])</div>
</div>
</div>
<div id="tab-comments" class="tab-pane">
Expand Down
8 changes: 4 additions & 4 deletions resources/views/user_stories/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class="btn btn-block btn-primary"
{{trans('gitscrum.create-issue')}}</a>
</div>

<div class="">
<div class="issueStatusChart">
@include('partials.boxes.chart-donut', ['list'=>$userStory->issueStatus()])
</div>

Expand Down Expand Up @@ -95,7 +95,7 @@ class="btn btn-block btn-primary"

<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#tab-issues"> {{trans('gitscrum.issues')}}
({{$userStory->issues->count()}}) </a></li>
(<div class="issuesCount">{{$userStory->issues->count()}}</div>) </a></li>
<li class=""><a data-toggle="tab" href="#tab-comments"> {{trans('gitscrum.comments')}}
({{$userStory->comments->count()}}) </a></li>
<li class=""><a data-toggle="tab" href="#tab-activities"> {{trans('gitscrum.activities')}} </a></li>
Expand All @@ -104,8 +104,8 @@ class="btn btn-block btn-primary"
<div class="tab-content">
<div id="tab-issues" class="tab-pane active">
<div class="panel-body">
@include('partials.boxes.issue', ['list' => $userStory->issues, 'messageEmpty' => trans('gitscrum
.gitscrum.this-does-not-have-any-issue-yet')])
<div class="issuesBox">@include('partials.boxes.issue', ['list' => $userStory->issues, 'messageEmpty' => trans('gitscrum
.gitscrum.this-does-not-have-any-issue-yet')])</div>
</div>
</div>
<div id="tab-comments" class="tab-pane">
Expand Down