Skip to content

Commit

Permalink
Merge branch 'dev' into shashika-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkholic authored May 29, 2017
2 parents d3bdf00 + 92abfb3 commit 42abeee
Show file tree
Hide file tree
Showing 26 changed files with 345 additions and 3,445 deletions.
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,9 @@ PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=


INVISIBLE_RECAPTCHA_SITEKEY=6LfdQSMUAAAAAOP31dkmdZJeNvDghlBfqJsHT5M-
INVISIBLE_RECAPTCHA_SECRETKEY=6LfdQSMUAAAAAAT5cKXa7lI3koiFy4c5BP7BX3m8
INVISIBLE_RECAPTCHA_SECRETKEY=6LfdQSMUAAAAAAT5cKXa7lI3koiFy4c5BP7BX3m8

NOCAPTCHA_SECRET=6LfdQSMUAAAAAAT5cKXa7lI3koiFy4c5BP7BX3m8
NOCAPTCHA_SITEKEY=6LfdQSMUAAAAAOP31dkmdZJeNvDghlBfqJsHT5M-
19 changes: 10 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
/.idea
/.vagrant
node_modules/
storage/
public/hot
public/storage
storage/*.key
vendor/
.idea
.vagrant
Homestead.json
Homestead.yaml
npm-debug.log
.env
storage/
composer.lock
composer.lock
.DS_Store
20 changes: 10 additions & 10 deletions readme.md → README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# Relief Supports Project

This is a community driven Open Source project to support relief support activities conduct by volunteers.
This is a community-driven Open Source project to support relief support activities conducted by volunteers.
This project was originally created to support flood relief activities in Sri Lanka in May 2017.

We welcome your inovative ideas and suggestions to make a better solution for the community.
We welcome your innovative ideas and suggestions to make a better solution for the community.

http://reliefsupports.org

## Contribution Guide

### Setup the development environment

Clone the prject repository as belows;
* Clone the project repository as below:

```
git clone [email protected]:reliefsupports/web-app.git reliefsupports`
git clone [email protected]:reliefsupports/web-app.git reliefsupports
```

then, rename `.env.example` file as `.env`
* Then, rename `.env.example` file as `.env`

#### Docker

* Install Docker on your computer
* Install [Docker](https://www.docker.com/) on your computer
* Run following commands accordingly

```
Expand All @@ -30,18 +30,18 @@ docker-compose up -d
docker exec -it reliefsupports_php_1 bash
composer update
chmod 777 -R storage/
chmod 777 bootstrap/cache
chmod -R 777 storage/
chmod 777 bootstrap/cache
```

#### On WAMP / XAMPP or other server

```
composer update
chmod 777 -R storage/
chmod -R 777 storage/
chmod 777 bootstrap/cache
```

### Pull requests

Send all the PRs to `dev` branch. We keep `master` and `prod` branch only for final releases and all the development works on the `dev`.
Send all the PRs to `dev` branch. We keep `master` and `prod` branches only for final releases and all the development works on the `dev`.
31 changes: 29 additions & 2 deletions app/Http/Controllers/DonationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ public function save(Request $request)
if ($response) {
return redirect('/donations')
->with('isSuccess', true)
->with('message', 'Donation added.');
->with('message', 'සාර්ථකව ඇතුලත්කරන ලදී.');
} else {
return redirect('/donations/add')
->with('isSuccess', false)
->with('errors', ['Donation adding failed. Please try again.'])
->with('errors', ['ඇතුලත්කිරීම දෝෂ සහිතය.'])
->withInput();
}
}
Expand All @@ -112,4 +112,31 @@ public function show($id)
]);
}
}

public function get($id = null) {
$response = array(
'error' => true,
'data' => null
);
$donations = $this->donation->getDonations();
if (!$donations) {
$donations = [];
}
$response['data'] = $donations;
$response['error'] = false;

return json_encode($response, JSON_UNESCAPED_UNICODE);
}

public function post(Request $request) {
$response = array(
'error' => true,
'data' => null
);
if ( $this->donation->addDonation($request->all()) ) {
$response['error'] = false;
}

return json_encode($response, JSON_UNESCAPED_UNICODE);
}
}
27 changes: 27 additions & 0 deletions app/Http/Controllers/EntryController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class EntryController extends Controller
{
// private $need;

/*
* EntryController constructor.
*/
public function __construct()
{
}

/**
* List all donatiaons
*
* @return $this
*/
public function view()
{
return view('/frontend/entry/view');
}
}
32 changes: 30 additions & 2 deletions app/Http/Controllers/NeedsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ public function save(Request $request)
if ($response) {
return redirect('/needs')
->with('isSuccess', true)
->with('message', 'Needs added.');
->with('message', 'සාර්ථකව ඇතුලත්කරන ලදී.');
} else {
return redirect('/needs/add')
->with('isSuccess', false)
->with('errors', ['Needs adding failed. Please try again.'])
->with('errors', ['ඇතුලත්කිරීම දෝෂ සහිතය.'])
->withInput();
}
}
Expand All @@ -108,4 +108,32 @@ public function show($id)
]);
}
}

public function get($id = null) {
$response = array(
'error' => true,
'data' => null
);
$needs = $this->need->getNeeds();
if (!$needs) {
$needs = [];
}
$response['data'] = $needs;
$response['error'] = false;

return json_encode($response, JSON_UNESCAPED_UNICODE);
}

public function post(Request $request) {
$response = array(
'error' => true,
'data' => null
);
if ( $this->need->addNeed($request->all()) ) {
$response['error'] = false;
}

return json_encode($response, JSON_UNESCAPED_UNICODE);
}
}

Loading

0 comments on commit 42abeee

Please sign in to comment.