Skip to content

Commit

Permalink
Merge pull request #15 from BiodataMiningGroup/largo
Browse files Browse the repository at this point in the history
Rename module to biigle/largo
  • Loading branch information
mzur authored Jan 18, 2017
2 parents c8f95fd + 924fa18 commit ceaf6df
Show file tree
Hide file tree
Showing 66 changed files with 379 additions and 379 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Biigle Ate Module
# Biigle Largo Module

Install the module:

Add the following to the repositories array of your `composer.json`:
```
{
"type": "vcs",
"url": "https://github.com/BiodataMiningGroup/biigle-ate.git"
"url": "https://github.com/BiodataMiningGroup/biigle-largo.git"
}
```

1. Run `php composer.phar require biigle/ate`.
2. Add `'Biigle\Modules\Ate\AteServiceProvider'` to the `providers` array in `config/app.php`.
3. Run `php artisan ate:publish` to refresh the public assets of this package. Do this for every update of the package.
4. Create a directory `storage/ate_patches` which is read-/writable for the application. To change the path, run `php artisan ate:config` and edit `patch_storage` in `config/ate.php`.
1. Run `php composer.phar require biigle/largo`.
2. Add `'Biigle\Modules\Largo\LargoServiceProvider'` to the `providers` array in `config/app.php`.
3. Run `php artisan largo:publish` to refresh the public assets of this package. Do this for every update of the package.
4. Create a directory `storage/largo_patches` which is read-/writable for the application. To change the path, run `php artisan largo:config` and edit `patch_storage` in `config/largo.php`.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "biigle/ate",
"name": "biigle/largo",
"require": {
"biigle/volumes": "~1.1",
"intervention/image": "~2.1",
Expand All @@ -9,7 +9,7 @@
},
"autoload": {
"psr-4": {
"Biigle\\Modules\\Ate\\": "src"
"Biigle\\Modules\\Largo\\": "src"
}
}
}
14 changes: 7 additions & 7 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var gulp = require('gulp');
var h = require('gulp-helpers');
var publish = h.publish('Biigle\\Modules\\Ate\\AteServiceProvider', 'public');
var publish = h.publish('Biigle\\Modules\\Largo\\LargoServiceProvider', 'public');

h.paths.sass = 'src/resources/assets/sass/';
h.paths.js = 'src/resources/assets/js/';
Expand All @@ -19,24 +19,24 @@ gulp.task('sass-annotations', function () {
gulp.task('sass', ['sass-main', 'sass-annotations']);

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

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

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

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

gulp.task('watch', function () {
gulp.watch(h.paths.sass + 'main.scss', ['sass-main']);
gulp.watch(h.paths.sass + 'annotations.scss', ['sass-annotations']);
gulp.watch(h.paths.js + 'ate/**/*.js', ['js-main']);
gulp.watch(h.paths.js + 'project-ate/**/*.js', ['js-project-ate']);
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 + 'annotations/**/*.js', ['js-annotations']);
gulp.watch(h.paths.public + '**/*', publish);
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "biigle-ate",
"name": "biigle-largo",
"version": "0.0.1",
"directories": {
"test": "tests"
Expand Down
83 changes: 0 additions & 83 deletions src/AteServiceProvider.php

This file was deleted.

6 changes: 3 additions & 3 deletions src/Console/Commands/Config.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Biigle\Modules\Ate\Console\Commands;
namespace Biigle\Modules\Largo\Console\Commands;

use Illuminate\Console\Command;
use Biigle\Modules\Ate\AteServiceProvider as ServiceProvider;
use Biigle\Modules\Largo\LargoServiceProvider as ServiceProvider;

class Config extends Command {

Expand All @@ -12,7 +12,7 @@ class Config extends Command {
*
* @var string
*/
protected $name = 'ate:config';
protected $name = 'largo:config';

/**
* The console command description.
Expand Down
6 changes: 3 additions & 3 deletions src/Console/Commands/Publish.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Biigle\Modules\Ate\Console\Commands;
namespace Biigle\Modules\Largo\Console\Commands;

use Illuminate\Console\Command;
use Biigle\Modules\Ate\AteServiceProvider as ServiceProvider;
use Biigle\Modules\Largo\LargoServiceProvider as ServiceProvider;

class Publish extends Command {

Expand All @@ -12,7 +12,7 @@ class Publish extends Command {
*
* @var string
*/
protected $name = 'ate:publish';
protected $name = 'largo:publish';

/**
* The console command description.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Biigle\Modules\Ate\Http\Controllers\Api;
namespace Biigle\Modules\Largo\Http\Controllers\Api;

use DB;
use Biigle\Role;
Expand All @@ -12,11 +12,11 @@
use Illuminate\Http\Request;
use Illuminate\Contracts\Auth\Guard;
use Biigle\Http\Controllers\Api\Controller;
use Biigle\Modules\Ate\Jobs\RemoveAnnotationPatches;
use Biigle\Modules\Largo\Jobs\RemoveAnnotationPatches;
use Illuminate\Auth\Access\AuthorizationException;
use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException;

class AteController extends Controller
class LargoController extends Controller
{
/**
* Show the patch image of an annotation
Expand All @@ -36,9 +36,9 @@ public function showPatch($id)
$annotation = Annotation::with('image')->findOrFail($id);
$this->authorize('access', $annotation);

$file = config('ate.patch_storage').'/'.
$file = config('largo.patch_storage').'/'.
$annotation->image->volume_id.'/'.
$annotation->id.'.'.config('ate.patch_format');
$annotation->id.'.'.config('largo.patch_format');

try {
return response()->download($file);
Expand All @@ -49,11 +49,11 @@ public function showPatch($id)


/**
* Save changes of an ATE session for a volume
* Save changes of an Largo session for a volume
*
* @api {post} volumes/:id/ate Save ATE session
* @apiGroup ATE
* @apiName VolumesStoreATE
* @api {post} volumes/:id/largo Save Largo session
* @apiGroup Largo
* @apiName VolumesStoreLargo
* @apiParam {Number} id The volume ID.
* @apiPermission projectEditor
* @apiDescription From the `dismissed` map only annotation labels that were attached by the requesting user will be detached. If the map contains annotation labels that were not attached by the user, the information will be ignored. From the `changed` map, new annotation labels will be created. If, after detaching `dismissed` annotation labels and attaching `changed` annotation labels, there is an annotation whithout any label, the annotation will be deleted. All affected annotations must belong to the same volume. If the user is not allowed to edit in this volume, the whole request will be denied.
Expand Down Expand Up @@ -83,7 +83,7 @@ public function saveVolume(Request $request, Guard $auth, $id)
{
$volume = Volume::findOrFail($id);
$this->authorize('edit-in', $volume);
$this->validateAteInput($request);
$this->validateLargoInput($request);

$user = $auth->user();

Expand Down Expand Up @@ -143,14 +143,14 @@ public function saveVolume(Request $request, Guard $auth, $id)
}

/**
* Save changes of an ATE session for a project
* Save changes of an Largo session for a project
*
* @api {post} projects/:id/ate Save ATE session
* @apiGroup ATE
* @apiName ProjectsStoreATE
* @api {post} projects/:id/largo Save Largo session
* @apiGroup Largo
* @apiName ProjectsStoreLargo
* @apiParam {Number} id The project ID.
* @apiPermission projectEditor
* @apiDescription see the 'Save ATE session' endpoint for a volume for more information
* @apiDescription see the 'Save Largo session' endpoint for a volume for more information
*
* @apiParam (Optional arguments) {Object} dismissed Map from a label ID to a list of IDs of annotations from which this label should be detached.
* @apiParam (Optional arguments) {Object} changed Map from annotation ID to a label ID that should be attached to the annotation.
Expand All @@ -164,7 +164,7 @@ public function saveProject(Request $request, Guard $auth, $id)
{
$project = Project::findOrFail($id);
$this->authorize('edit-in', $project);
$this->validateAteInput($request);
$this->validateLargoInput($request);

$volumeIds = $project->volumes()->pluck('id');

Expand Down Expand Up @@ -210,11 +210,11 @@ public function saveProject(Request $request, Guard $auth, $id)
}

/**
* Validates the input for saving an ATE session
* Validates the input for saving an Largo session
*
* @param Request $request
*/
protected function validateAteInput(Request $request)
protected function validateLargoInput(Request $request)
{
$this->validate($request, [
'dismissed' => 'array',
Expand Down Expand Up @@ -270,7 +270,7 @@ protected function getRequiredLabelTrees($changed)
}

/**
* Apply the changes of an ATE session
* Apply the changes of an Largo session
*
* Removes the dismissed annotation labels and creates the changed annotation labels.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/Api/ProjectsAnnotationsController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Biigle\Modules\Ate\Http\Controllers\Api;
namespace Biigle\Modules\Largo\Http\Controllers\Api;

use Biigle\Project;
use Biigle\Volume;
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/Api/VolumesAnnotationsController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Biigle\Modules\Ate\Http\Controllers\Api;
namespace Biigle\Modules\Largo\Http\Controllers\Api;

use Biigle\Volume;
use Biigle\Annotation;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

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

use DB;
use Biigle\Role;
Expand All @@ -11,10 +11,10 @@
use Illuminate\Contracts\Auth\Guard;
use Biigle\Http\Controllers\Views\Controller;

class AteController extends Controller
class LargoController extends Controller
{
/**
* Show the the ATE 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 +53,7 @@ public function indexVolume(Guard $auth, $id)
})
->get();

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

/**
* Show the ATE view for a project
* Show the Largo view for a project
*
* @param Guard $auth
* @param int $id Project ID
Expand All @@ -79,7 +79,7 @@ public function indexProject(Guard $auth, $id)
->select('id', 'name')
->get();

return view('ate::project', [
return view('largo::project', [
'user' => $user,
'project' => $project,
'labelTrees' => $labelTrees,
Expand Down
Loading

0 comments on commit ceaf6df

Please sign in to comment.