Skip to content

Commit

Permalink
Merge pull request #19 from BiodataMiningGroup/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
mzur authored Apr 18, 2017
2 parents e19a2eb + e66d541 commit 6387b81
Show file tree
Hide file tree
Showing 61 changed files with 626 additions and 848 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "biigle/largo",
"require": {
"biigle/volumes": "~1.1",
"biigle/label-trees": "~1.3",
"biigle/volumes": "~1.5",
"intervention/image": "~2.1",
"intervention/imagecache": "~2.1"
},
Expand Down
13 changes: 4 additions & 9 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,19 @@ gulp.task('sass-annotations', function () {
gulp.task('sass', ['sass-main', 'sass-annotations']);

gulp.task('js-main', function (cb) {
h.angular('largo/**/*.js', 'main.js', cb);
});

gulp.task('js-project-largo', function (cb) {
h.angular('project-largo/**/*.js', 'project-largo.js', cb);
h.angular('vue/**/*.js', 'main.js', cb);
});

gulp.task('js-annotations', function (cb) {
h.angular('annotations/**/*.js', 'annotations.js', cb);
});

gulp.task('js', ['js-main', 'js-project-largo', 'js-annotations']);
gulp.task('js', ['js-main', 'js-annotations']);

gulp.task('watch', function () {
gulp.watch(h.paths.sass + 'main.scss', ['sass-main']);
gulp.watch(h.paths.sass + '**/*.scss', ['sass-main']);
gulp.watch(h.paths.sass + 'annotations.scss', ['sass-annotations']);
gulp.watch(h.paths.js + 'largo/**/*.js', ['js-main']);
gulp.watch(h.paths.js + 'project-largo/**/*.js', ['js-project-largo']);
gulp.watch(h.paths.js + 'vue/**/*.js', ['js-main']);
gulp.watch(h.paths.js + 'annotations/**/*.js', ['js-annotations']);
gulp.watch(h.paths.public + '**/*', publish);
});
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Commands/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use Illuminate\Console\Command;
use Biigle\Modules\Largo\LargoServiceProvider as ServiceProvider;

class Config extends Command {

class Config extends Command
{
/**
* The console command name.
*
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Commands/Publish.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use Illuminate\Console\Command;
use Biigle\Modules\Largo\LargoServiceProvider as ServiceProvider;

class Publish extends Command {

class Publish extends Command
{
/**
* The console command name.
*
Expand Down
17 changes: 8 additions & 9 deletions src/Http/Controllers/Api/LargoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class LargoController extends Controller
{
/**
* Show the patch image of an annotation
* Show the patch image of an annotation.
*
* @api {get} annotations/:id/patch Get an annotation patch
* @apiGroup Annotations
Expand Down Expand Up @@ -47,9 +47,8 @@ public function showPatch($id)
}
}


/**
* Save changes of an Largo session for a volume
* Save changes of an Largo session for a volume.
*
* @api {post} volumes/:id/largo Save Largo session
* @apiGroup Largo
Expand Down Expand Up @@ -143,7 +142,7 @@ public function saveVolume(Request $request, Guard $auth, $id)
}

/**
* Save changes of an Largo session for a project
* Save changes of an Largo session for a project.
*
* @api {post} projects/:id/largo Save Largo session
* @apiGroup Largo
Expand Down Expand Up @@ -210,7 +209,7 @@ public function saveProject(Request $request, Guard $auth, $id)
}

/**
* Validates the input for saving an Largo session
* Validates the input for saving an Largo session.
*
* @param Request $request
*/
Expand All @@ -223,7 +222,7 @@ protected function validateLargoInput(Request $request)
}

/**
* Get a list of unique annotation IDs that are either dismissed or changed
* Get a list of unique annotation IDs that are either dismissed or changed.
*
* @param array $dismissed Array of all dismissed annotation IDs for each label
* @param array $changed Array of IDs of changed annotations
Expand All @@ -240,7 +239,7 @@ protected function getAffectedAnnotations($dismissed, $changed)
}

/**
* Check if all given annotations belong to the given volumes
* Check if all given annotations belong to the given volumes.
*
* @param array $annotations Annotation IDs
* @param array $volumes Volume IDs
Expand All @@ -256,7 +255,7 @@ protected function anotationsBelongToVolumes($annotations, $volumes)
}

/**
* Returns the IDs of all label trees that must be available to apply the changes
* Returns the IDs of all label trees that must be available to apply the changes.
*
* @param array $changed Array of IDs of changed annotations
*
Expand All @@ -270,7 +269,7 @@ protected function getRequiredLabelTrees($changed)
}

/**
* Apply the changes of an Largo session
* Apply the changes of an Largo session.
*
* Removes the dismissed annotation labels and creates the changed annotation labels.
*
Expand Down
4 changes: 1 addition & 3 deletions src/Http/Controllers/Api/ProjectsAnnotationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
namespace Biigle\Modules\Largo\Http\Controllers\Api;

use Biigle\Project;
use Biigle\Volume;
use Biigle\Annotation;
use Illuminate\Http\Request;
use Biigle\Http\Controllers\Api\Controller;

class ProjectsAnnotationsController extends Controller
{
/**
* Show all annotations of the project that have a specific label attached
* Show all annotations of the project that have a specific label attached.
*
* @api {get} projects/:tid/annotations/filter/label/:lid Get annotations with a specific label
* @apiGroup Projects
Expand Down Expand Up @@ -48,5 +47,4 @@ public function filter(Request $request, $pid, $lid)
})
->pluck('annotations.id');
}

}
3 changes: 1 addition & 2 deletions src/Http/Controllers/Api/VolumesAnnotationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class VolumesAnnotationsController extends Controller
{
/**
* Show all annotations of the volume that have a specific label attached
* Show all annotations of the volume that have a specific label attached.
*
* @api {get} volumes/:tid/annotations/filter/label/:lid Get annotations with a specific label
* @apiGroup Volumes
Expand Down Expand Up @@ -57,5 +57,4 @@ public function filter(Request $request, Guard $auth, $tid, $lid)
})
->pluck('annotations.id');
}

}
8 changes: 3 additions & 5 deletions src/Http/Controllers/Views/LargoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@

namespace Biigle\Modules\Largo\Http\Controllers\Views;

use DB;
use Biigle\Role;
use Biigle\Project;
use Biigle\Volume;
use Biigle\LabelTree;
use Biigle\Annotation;
use Illuminate\Contracts\Auth\Guard;
use Biigle\Http\Controllers\Views\Controller;

class LargoController extends Controller
{
/**
* Show the the Largo view for a volume
* Show the the Largo view for a volume.
*
* @param Guard $auth
* @param int $id Volume ID
Expand Down Expand Up @@ -53,7 +51,7 @@ public function indexVolume(Guard $auth, $id)
})
->get();

return view('largo::index', [
return view('largo::show', [
'user' => $user,
'volume' => $volume,
'projects' => $projects,
Expand All @@ -62,7 +60,7 @@ public function indexVolume(Guard $auth, $id)
}

/**
* Show the Largo view for a project
* Show the Largo view for a project.
*
* @param Guard $auth
* @param int $id Project ID
Expand Down
2 changes: 1 addition & 1 deletion src/Http/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

$router->group([
'namespace' => 'Views',
'middleware' => 'auth'
'middleware' => 'auth',
], function ($router) {
$router->get('volumes/{id}/largo', [
'as' => 'largo',
Expand Down
2 changes: 1 addition & 1 deletion src/Jobs/GenerateAnnotationPatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class GenerateAnnotationPatch extends Job implements ShouldQueue
use InteractsWithQueue;

/**
* The ID of the annotation to generate a patch for
* The ID of the annotation to generate a patch for.
*
* @var int
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Jobs/RemoveAnnotationPatches.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ class RemoveAnnotationPatches extends Job implements ShouldQueue
use InteractsWithQueue, SerializesModels;

/**
* The volume ID of which the annotation patches should be removed
* The volume ID of which the annotation patches should be removed.
*
* @var int
*/
private $volumeId;

/**
* The annotation IDs whose patches should be removed
* The annotation IDs whose patches should be removed.
*
* @var array
*/
Expand Down
6 changes: 3 additions & 3 deletions src/LargoServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use Biigle\Modules\Largo\Listeners\ImagesCleanupListener;
use Biigle\Services\Modules;

class LargoServiceProvider extends ServiceProvider {

class LargoServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application events.
*
Expand Down Expand Up @@ -40,7 +40,7 @@ public function boot(Modules $modules, Router $router)

\Event::listen('images.cleanup', ImagesCleanupListener::class);

$modules->addMixin('largo', 'volumesMenubar');
$modules->addMixin('largo', 'volumesSidebar');
$modules->addMixin('largo', 'annotationsScripts');
$modules->addMixin('largo', 'annotationsStyles');
$modules->addMixin('largo', 'annotationsSidebar');
Expand Down
5 changes: 2 additions & 3 deletions src/Observers/AnnotationObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@

class AnnotationObserver
{

use DispatchesJobs;

/**
* Handle the event of creating/saving a single annotation
* Handle the event of creating/saving a single annotation.
*
* @param Annotation $annotation
*/
Expand All @@ -25,7 +24,7 @@ public function saved(Annotation $annotation)
}

/**
* Handle the event of deleting a single annotation
* Handle the event of deleting a single annotation.
*
* @param Annotation $annotation
* @return bool
Expand Down
2 changes: 1 addition & 1 deletion src/public/assets/scripts/annotations.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6387b81

Please sign in to comment.