Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.0.0 maverick #115

Open
wants to merge 75 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
a0100ac
Revert repository pattern
Nov 24, 2016
dd67bbb
Fix PSR violations in control stuctures
Nov 24, 2016
c903f05
Fix #93 | Fix the contact button on the profile image
Nov 24, 2016
dfd96a2
Merge pull request #111 from Scouts-Sint-Joris/revert-repository
Tjoosten Nov 24, 2016
a770bfa
Merge pull request #112 from Scouts-Sint-Joris/PSR-control-structures
Tjoosten Nov 24, 2016
531da3b
Merge pull request #113 from Scouts-Sint-Joris/patch-93
Tjoosten Nov 24, 2016
4965e23
Set copyright docblocks on the seed classes
Nov 24, 2016
2e2729c
Fix several psr violations
Nov 24, 2016
afeb39b
psr violations
Nov 24, 2016
224d433
Merge pull request #117 from Scouts-Sint-Joris/psr-violations
Tjoosten Nov 24, 2016
b34082f
Merge pull request #116 from Scouts-Sint-Joris/copyright-seeds
Tjoosten Nov 24, 2016
79c19c8
Fix typo
Nov 26, 2016
37446d1
Add class docs to the validator classes
Nov 26, 2016
0023116
Change phpunit config
Nov 26, 2016
0a9b653
Add empty test classes
Nov 26, 2016
047b91d
Fix #101 | Set the flash messages for the api keys -> translate
Nov 30, 2016
590ce55
Fix #122 | Fix typo in gitattributes file.
Tjoosten Dec 17, 2016
59e830b
Update docblocks
Dec 18, 2016
ab03767
Update
Dec 18, 2016
bf2209f
Fix conflicts
Dec 19, 2016
b68ee87
Fix conflicts
Dec 19, 2016
c949e94
update
Dec 19, 2016
e3638b6
Register route
Dec 19, 2016
6ad5759
Add authorization section off the api
Dec 20, 2016
a6647d3
Merge branch '2.0.0-maverick' into api
Tjoosten Dec 20, 2016
96d0120
Merge pull request #120 from Scouts-Sint-Joris/api
Tjoosten Dec 20, 2016
ab68af8
Add empty test files"
Dec 22, 2016
959f8ca
Add migration
Dec 23, 2016
779ee99
Start on the members tool
Dec 23, 2016
afc8c05
Implemented the countries.
Dec 25, 2016
01f10f9
Selected the only needed db columns
Dec 25, 2016
2e96707
Add the request validator class to the controller
Dec 25, 2016
3b4d5f7
Remove composer lock
Dec 25, 2016
778fc4c
Add update lock file
Dec 25, 2016
7e1038a
Bugfix test controller
Dec 25, 2016
6e345e2
Add test to the docblock
Dec 25, 2016
f07c917
Fix codacy issues
Dec 25, 2016
b05308d
Update controller
Dec 25, 2016
0f1efb9
Change docblocks
Dec 25, 2016
30f30ac
Fix merge conflicts
Dec 25, 2016
e891d8a
Add country table factory
Dec 25, 2016
ae91d7e
Bugfix factory
Dec 25, 2016
19be748
Add members factory
Dec 25, 2016
3437178
Improve testing
Dec 26, 2016
1a3ed62
Update
Dec 27, 2016
83d71ff
Implement rss feed
Dec 28, 2016
b03eb1e
Reformat the gitattributes file
Dec 28, 2016
2714b84
fixed wrong directory name in .gitattributes
Dec 28, 2016
d6666d4
Fix phpunit error
Dec 28, 2016
11e7e4d
Clean up if else statement
Dec 29, 2016
32725e6
Add tests for the destroy method
Dec 29, 2016
b2b9c90
Need TravisCi to debug phpunit"
Dec 29, 2016
2a1cf80
Solve phphunit error"
Dec 29, 2016
7973386
Add Activity insert method
Dec 29, 2016
f12a26b
Work on activity show"
Dec 29, 2016
54c9c2e
Merge pull request #129 from Scouts-Sint-Joris/subscription-module
Tjoosten Dec 29, 2016
bde89f3
Fix activity! show
Dec 29, 2016
7e52a1f
Need travis to debug
Dec 29, 2016
f22cb50
Add activity edit tests
Dec 29, 2016
8982027
Add test for activity edit -> api"
Dec 29, 2016
5dc54fa
Add empty test classes"
Dec 30, 2016
8fe5a6f
Add tests for the api activity index
Dec 30, 2016
d73e231
Add dynamic access to the activity model"
Dec 30, 2016
42d2e3f
Fix wrong return
Dec 30, 2016
1c570d3
Merge pull request #130 from Scouts-Sint-Joris/api-activity
Tjoosten Dec 30, 2016
f4a6f41
Fix phpunit"
Dec 30, 2016
d95e074
Fix export bug"
Dec 30, 2016
920f6f9
Fix another phpunit error
Dec 30, 2016
29b888d
Extend testing
Dec 30, 2016
44a5c91
Merge pull request #128 from Scouts-Sint-Joris/Sprint-1
Tjoosten Dec 30, 2016
72ecf68
Add changelog
Dec 30, 2016
cab852f
Add fast finish
Jan 2, 2017
8737fac
Merge pull request #139 from Scouts-Sint-Joris/fast-finish
Tjoosten Jan 3, 2017
0e3232a
Update
Jan 5, 2017
ab31e68
Merge branch '2.0.0-maverick' of https://github.com/Scouts-Sint-Joris…
Jan 5, 2017
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
25 changes: 13 additions & 12 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#####################################################
# .gitaatributes | SIJOT platform #
# .gitattributes | SIJOT platform #
#####################################################

# Laravel specific.
Expand All @@ -10,24 +10,25 @@
# Exclude testing files. These files don't belong,
# in production environments.
# ---------------------------------------------------
/test export-ignore
/.travis.yml export-ignore
/phpunit.xml export-ignore
/tests export-ignore
/.travis.yml export-ignore
/phpunit.xml export-ignore
/CHANGELOG.md export-ignore

# Exclude general documentation files in the repo.
# ---------------------------------------------------
/contributing.md export-ignore
/LICENSE export-ignore
/readme.md export-ignore
/contributing.md export-ignore
/LICENSE export-ignore
/readme.md export-ignore

# Git repository files.
# ---------------------------------------------------
/.gitattributes export-ignore
/.gitignore export-ingore
/Vagrantfile export-ignore
/composer.lock export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/Vagrantfile export-ignore
/composer.lock export-ignore

# Line endings & standards
# ---------------------------------------------------
* text=auto
/.editorconfig export-ignore
/.editorconfig export-ignore
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ language: php
php:
- 5.6
- 7.0
- 7.1

matrix:
allow_failures:
- php: hhvm
fast_finish: true

before_script:
- touch .env
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Change Log

All notable changes to SIJOT-2.x will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## V0.0.3 - Beaver

### Added
- Changelog.

### Changed
- Noting
15 changes: 15 additions & 0 deletions app/Country.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Country extends Model
{
/**
* Mass-assign fields.
*
* @var array
*/
protected $fillable = ['capital', 'name', 'alpha2code', 'alpha3code'];
}
22 changes: 11 additions & 11 deletions app/Groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@
class Groups extends Model
{
/**
* Mass-assign fields.
*
* @var array
* Mass-assign fields.
*
* @var array
*/
protected $fillable = ['selector', 'sub_heading', 'heading', 'description'];

/**
* Hidden fields
*
* Hidden fields.
*
* @var array
*/
protected $hidden = ['created_at', 'updated_at'];
*/
protected $hidden = ['created_at', 'updated_at'];

/**
* Scope a query to only get the group selected by his selector.
* Scope a query to only get the group selected by his selector.
* ----
* USAGE: $group = \App\Groups::getGroup('<your group>')->get();
* QUERY: SELECT * FROM Groups WHERE selector = <your group>;
*
*
* @param void $query the query statement in the eloquent builder.
* @param string $group the group selector in the database.
* @return \Illuminate\Database\Eloquent\Builder
* @param string $group the group selector in the database.
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeGetGroup($query, $group)
{
Expand Down
54 changes: 51 additions & 3 deletions app/Http/Controllers/ActivityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use App\Http\Requests;
use App\Http\Requests\ActivityValidator;
use Illuminate\Http\Request;
use XMLWriter;

class ActivityController extends Controller
{
Expand All @@ -32,8 +33,8 @@ public function __construct()
$this->inputFilter = ['_token', 'group']; // Fill in the filter array for the inputs.
$this->dbRelations = ['groups', 'creator']; // The MySQL database relations.

$this->middleware('auth'); // See if the user is logged in.
$this->middleware('lang'); // Determine the language and get the correct trans. files.
$this->middleware('auth')->except('rssFeed'); // See if the user is logged in.
$this->middleware('lang'); // Determine the language and get the correct trans. files.
}

/**
Expand Down Expand Up @@ -93,6 +94,53 @@ public function store(ActivityValidator $input)
return redirect()->back();
}

/**
* Get the rss feed for the activity.
*
* @url:platform GET|HEAD: /activity/rss
* @see:phpunit ActivityControllerTest::testRssFeed();
*
* @return mixed
*/
public function rssFeed()
{
// Query.
$query = Activity::with($this->dbRelations)
->where('state', 1)
->orderBy('date', 'ASC')
->get();

// dd($query); // For debugging propose.
// die(); // For debugging propose.

// Start xml rendering.
$xml = new XMLWriter();
$xml->openMemory();
$xml->startDocument();
$xml->startElement('activiteiten');

foreach($query as $activity) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected 1 space after FOREACH keyword; 0 found

$start = strtotime('H:i', $activity->start_time);
$end = strtotime('H:i', $activity->end_time);

$xml->startElement('activiteit');
$xml->writeAttribute('id', $activity->id);
$xml->writeAttribute('Naam', $activity->heading);
$xml->writeAttribute('datum', strtotime('d/m/Y', $activity->date));
$xml->writeAttribute('uren', $start . ' - ' . $end);
$xml->writeAttribute('Beschrijving', $activity->description);
$xml->endElement();
}

$xml->endElement();
$xml->endDocument();

$content = $xml->outputMemory();
$xml = null;

return response($content)->header('Content-Type', 'text/xml');
}

/**
* [BACK-END]: Update view for a activity.
*
Expand Down Expand Up @@ -123,7 +171,7 @@ public function edit($id)
public function update(ActivityValidator $input, $id)
{
$activity = Activity::find($id);
$inputs = array_merge(['user_id' => auth()->user()->id], $input->except($this->inputFilter));
$inputs = array_merge(['user_id' => auth()->user()->id], $input->except($this->inputFilter));
$update = $activity->update($inputs);

if ($update) {
Expand Down
Loading