-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: app/start/artisan.php
- Loading branch information
Showing
34 changed files
with
1,835 additions
and
2,334 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
<?php | ||
|
||
use Illuminate\Console\Command; | ||
use Symfony\Component\Console\Input\InputOption; | ||
use Symfony\Component\Console\Input\InputArgument; | ||
|
||
class ActivityExport extends Command { | ||
|
||
/** | ||
* The console command name. | ||
* | ||
* @var string | ||
*/ | ||
protected $name = 'activity:export'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Export Annotations and Comments'; | ||
|
||
/** | ||
* Create a new command instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
} | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return mixed | ||
*/ | ||
public function fire() | ||
{ | ||
$doc_id = $this->argument('doc_id'); | ||
$filename = $this->argument('filename'); | ||
|
||
$doc = Doc::where('id', $doc_id)->first(); | ||
$this->info("Exporting activity for " . $doc->title); | ||
|
||
$annotations = Annotation::where('doc_id', $this->argument('doc_id'))->with('user')->with('comments')->get(); | ||
$comments = Comment::where('doc_id', $this->argument('doc_id'))->with('user')->get(); | ||
|
||
$headers = array("Created At", "Link", "Display Name", "Full Name", "Email", "Type", "Quote", "Text"); | ||
|
||
$toExport = array(); | ||
|
||
foreach($annotations as $annotation){ | ||
$annotationArray = array(); | ||
|
||
$annotationArray['date'] = $annotation->created_at; | ||
$annotationArray['link'] = URL::to('/') . $annotation->uri . '#annotation_' . $annotation->id; | ||
$annotationArray['display_name'] = $annotation->user->fname . " " . substr($annotation->user->lname, 0, 1); | ||
$annotationArray['full_name'] = $annotation->user->fname . " " . $annotation->user->lname; | ||
$annotationArray['email'] = $annotation->user->email; | ||
$annotationArray['type'] = 'Annotation'; | ||
$annotationArray['quote'] = $annotation->quote; | ||
$annotationArray['text'] = $annotation->text; | ||
|
||
array_push($toExport, $annotationArray); | ||
|
||
foreach($annotation->comments as $comment){ | ||
$user = User::find($comment->user_id); | ||
|
||
$commentArray = array(); | ||
|
||
$commentArray['date'] = $comment->created_at; | ||
$commentArray['link'] = ""; | ||
$commentArray['display_name'] = $user->fname . " " . substr($user->lname, 0, 1); | ||
$commentArray['full_name'] = $user->fname . " " . $user->lname; | ||
$commentArray['email'] = $user->email; | ||
$commentArray['type'] = "Annotation Comment"; | ||
$commentArray['quote'] = ""; | ||
$commentArray['text'] = $comment->text; | ||
|
||
array_push($toExport, $commentArray); | ||
} | ||
} | ||
|
||
foreach($comments as $comment){ | ||
$commentArray = array(); | ||
|
||
$commentArray['date'] = $comment->created_at; | ||
$commentArray['link'] = ""; | ||
$commentArray['display_name'] = $comment->user->fname . " " . substr($comment->user->lname, 0, 1); | ||
$commentArray['full_name'] = $comment->user->fname . " " . $comment->user->lname; | ||
$commentArray['email'] = $comment->user->email; | ||
$commentArray['type'] = $comment->parent_id === null ? "Comment" : "Sub-comment"; | ||
$commentArray['quote'] = ""; | ||
$commentArray['text'] = $comment->text; | ||
|
||
array_push($toExport, $commentArray); | ||
} | ||
|
||
$this->info('Saving export to ' . $filename); | ||
$fp = fopen($filename, 'w'); | ||
fputcsv($fp, $headers); | ||
|
||
foreach($toExport as $row){ | ||
fputcsv($fp, $row); | ||
} | ||
|
||
fclose($fp); | ||
$this->info('Done.'); | ||
} | ||
|
||
/** | ||
* Get the console command arguments. | ||
* | ||
* @return array | ||
*/ | ||
protected function getArguments() | ||
{ | ||
return array( | ||
array('doc_id', InputArgument::REQUIRED, 'Document id for exported activity.'), | ||
array('filename', InputArgument::REQUIRED, 'Filename to save csv as.'), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,6 @@ | ||
<h3>Activity</h3> | ||
<div class="activity-thread col-md-12"> | ||
<div class="row activity-item" ng-repeat="activity in activities | orderBy:activityOrder:true track by $id(activity)" ng-class="activity.label"> | ||
<div class="row"> | ||
<div class="activity-author col-md-9"> | ||
<span>@{{ activity.user.name || (activity.user.fname + ' ' + activity.user.lname.substr(0,1)) }}</span> | ||
</div> | ||
<div class="activity-icon col-md-3"> | ||
<a href="#@{{ activity.link }}" ng-if="activity.label==='annotation'"><span class="glyphicon glyphicon-screenshot" title="Jump to annotation"></span></a> | ||
<span class="glyphicon" ng-class="{'glyphicon-comment': activity.label=='comment', 'glyphicon-edit': activity.label=='annotation'}" title="@{{ activity.label }}"></span> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="activity-content col-md-12"> | ||
<span>@{{ activity.text }}</span> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
<span class="activity-replies-indicator" ng-click="collapseComments(activity)"><span class="glyphicon glyphicon-share-alt"></span>@{{ activity.comments.length || '0' }} Replies</span> | ||
</div> | ||
<div class="col-md-6 activity-actions"> | ||
<span class="glyphicon glyphicon-thumbs-up" ng-click="addAction(activity, 'likes', $event)">(@{{ activity.likes || '0' }})</span> | ||
<span class="glyphicon glyphicon-thumbs-down" ng-click="addAction(activity, 'dislikes', $event)">(@{{ activity.dislikes || '0' }})</span> | ||
<span class="glyphicon glyphicon-flag" ng-click="addAction(activity, 'flags', $event)">(@{{ activity.flags || '0' }})</span> | ||
</div> | ||
</div> | ||
<div class="activity-replies row" collapse="activity.commentsCollapsed"> | ||
<div class="activity-reply col-md-12" ng-repeat="comment in activity.comments"> | ||
<div class="reply-author row"> | ||
<div class="col-md-6"> | ||
<span class="glyphicon glyphicon-share-alt"></span> @{{ comment.user.name || (comment.user.fname + ' ' + comment.user.lname.substr(0,1)) }}: | ||
</div> | ||
</div> | ||
<div class="reply-text row"> | ||
<div class="col-md-12"> | ||
@{{ comment.text }} | ||
</div> | ||
</div> | ||
</div> | ||
@if(Auth::check()) | ||
<div class="subcomment-field col-md-12"> | ||
<form name="add-subcomment-form" ng-submit="subcommentSubmit(activity, subcomment)"> | ||
<input ng-model="subcomment.text" type="text" class="form-control centered" placeholder="Add a comment" required /> | ||
</form> | ||
</div> | ||
@endif | ||
</div> | ||
<div class="row sponsor-seen" ng-show="user.isSponsor && activity.user.id != user.id"> | ||
<div class="col-md-12"> | ||
<span class="btn btn-default" ng-if="activity.seen === 0" ng-click="notifyAuthor(activity)">Mark as seen</span> | ||
<span class="glyphicon glyphicon-ok" ng-if="activity.seen === 1"> Marked as seen!</span> | ||
</div> | ||
</div> | ||
<div class="row user-seen" ng-hide="user.isSponsor"> | ||
<div class="col-md-12"> | ||
<span class="glyphicon glyphicon-ok" ng-if="activity.seen === 1"> A sponsor marked this as seen!</span> | ||
</div> | ||
</div> | ||
</div> | ||
<div id="@{{ activity.label == 'comment' ? 'comment_' + activity.id : '' }}" class="row activity-item" ng-repeat="activity in activities | orderBy:activityOrder:true track by $id(activity)" ng-class="activity.label"> | ||
<div activity-item activity-item-link="@{{ activity.link }}"></div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"author": "Marco Rinck", | ||
"name": "angular-growl", | ||
"description": "growl like notifications for angularJS projects, using bootstrap alert classes", | ||
"version": "0.4.0", | ||
"homepage": "https://github.com/marcorinck/angular-growl", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/marcorinck/angular-growl" | ||
}, | ||
"license": "MIT", | ||
"main": "./build/angular-growl.js", | ||
"ignore": [ | ||
"src", | ||
"test", | ||
".jshintrc", | ||
"package.json", | ||
"gruntfile.js", | ||
"karma.conf.js", | ||
"bower.json", | ||
"demo", | ||
".gitignore" | ||
], | ||
"dependencies": { | ||
"angular": "1.2.1" | ||
}, | ||
"devDependencies": { | ||
"angular-mocks": "1.2.1" | ||
}, | ||
"_release": "0.4.0", | ||
"_resolution": { | ||
"type": "version", | ||
"tag": "v0.4.0", | ||
"commit": "e0e8b2cda660f28c75eefa7c9703952368547cdd" | ||
}, | ||
"_source": "git://github.com/marcorinck/angular-growl.git", | ||
"_target": "~0.4.0", | ||
"_originalSource": "angular-growl", | ||
"_direct": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2013 Marco Rinck | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
Oops, something went wrong.