Skip to content

Commit

Permalink
Merge branch 'release/3.4.10' into v3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Augusti committed Nov 28, 2015
2 parents 71ab159 + 60067ae commit b05f973
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 39 deletions.
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@ SERVER_PRODUCTION_KEYPHRASE=dummy
SERVER_PRODUCTION_ROOT=dummy

# BUGSNAG
BUGSNAG_API_KEY=dummy
BUGSNAG_API_KEY=dummy

# HELPSCOUT
HELPSCOUT_CONTACT_FORM=dummy
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ tests/integration/IntegrationTester.php
tests/search/SearchTester.php
tests/unit/UnitTester.php
Thumbs.db
vendor
updateEnv.sh
vendor
15 changes: 9 additions & 6 deletions app/TeenQuotes/AdminPanel/AdminPanelServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace TeenQuotes\AdminPanel;

use Illuminate\Support\ServiceProvider;
use TeenQuotes\AdminPanel\Helpers\Moderation;

class AdminPanelServiceProvider extends ServiceProvider
{
Expand All @@ -33,13 +34,15 @@ public function register()

private function registerRoutes()
{
$this->app['router']->pattern('decision', 'approve|unapprove|alert');
$this->app['router']->pattern('decision', Moderation::presentAvailableTypes());

$this->app['router']->group($this->getRouteGroupParams(), function () {
$this->app['router']->get('/', ['uses' => $this->getController().'@index', 'as' => 'admin.quotes.index']);
$this->app['router']->get('edit/{quote_id}', ['uses' => $this->getController().'@edit', 'as' => 'admin.quotes.edit']);
$this->app['router']->put('update/{quote_id}', ['uses' => $this->getController().'@update', 'as' => 'admin.quotes.update']);
$this->app['router']->post('moderate/{quote_id}/{decision}', ['uses' => $this->getController().'@postModerate', 'as' => 'admin.quotes.moderate']);
$controller = $this->getController();

$this->app['router']->group($this->getRouteGroupParams(), function () use ($controller) {
$this->app['router']->get('/', ['uses' => $controller.'@index', 'as' => 'admin.quotes.index']);
$this->app['router']->get('edit/{quote_id}', ['uses' => $controller.'@edit', 'as' => 'admin.quotes.edit']);
$this->app['router']->put('update/{quote_id}', ['uses' => $controller.'@update', 'as' => 'admin.quotes.update']);
$this->app['router']->post('moderate/{quote_id}/{decision}', ['uses' => $controller.'@postModerate', 'as' => 'admin.quotes.moderate']);
});
}

Expand Down
2 changes: 1 addition & 1 deletion app/TeenQuotes/AdminPanel/Helpers/Moderation.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static function getAvailableTypes()
*
* @return string
*/
private function presentAvailableTypes()
public static function presentAvailableTypes()
{
return implode('|', self::getAvailableTypes());
}
Expand Down
22 changes: 12 additions & 10 deletions app/TeenQuotes/Pages/Controllers/ContactController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace TeenQuotes\Pages\Controllers;

use Auth;
use BaseController;
use Lang;
use LaraSetting;
Expand All @@ -21,16 +22,17 @@ class ContactController extends BaseController
public function index()
{
$data = [
'chooseYourWeapon' => Lang::get('contact.chooseYourWeapon'),
'contactTitle' => Lang::get('contact.contactTitle'),
'emailAddress' => Lang::get('contact.emailAddress'),
'pageDescription' => Lang::get('contact.pageDescription'),
'pageTitle' => Lang::get('contact.pageTitle'),
'stayInTouchContent' => Lang::get('contact.stayInTouchContent'),
'stayInTouchTitle' => Lang::get('contact.stayInTouchTitle'),
'teamMembers' => LaraSetting::get('team'),
'teamTitle' => Lang::get('contact.teamTitle'),
'twitterAccount' => Lang::get('layout.twitterUsername'),
'chooseYourWeapon' => Lang::get('contact.chooseYourWeapon'),
'contactTitle' => Lang::get('contact.contactTitle'),
'emailAddress' => Lang::get('contact.emailAddress'),
'pageDescription' => Lang::get('contact.pageDescription'),
'pageTitle' => Lang::get('contact.pageTitle'),
'stayInTouchContent' => Lang::get('contact.stayInTouchContent'),
'stayInTouchTitle' => Lang::get('contact.stayInTouchTitle'),
'teamMembers' => LaraSetting::get('team'),
'teamTitle' => Lang::get('contact.teamTitle'),
'twitterAccount' => Lang::get('layout.twitterUsername'),
'user' => Auth::user(),
];

// Add description for each team member
Expand Down
4 changes: 2 additions & 2 deletions app/config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@

'comments.nbCommentsPerPage' => 10,

'quotes.nbQuotesToPublishPerDay' => 5,
'quotes.nbQuotesToPublishPerDay' => 3,

'quotes.nbQuotesPerPage' => 10,

Expand All @@ -275,7 +275,7 @@

'newsletters.nbQuotesToSendDaily' => 2,

'users.avatar.default' => 'http://teen-quotes.com/assets/images/chat.png',
'users.avatar.default' => 'https://account.teen-quotes.com/assets/images/chat.png',
'users.avatarPath' => 'uploads/avatar',
'users.avatarWidth' => 200,
'users.avatarHeight' => 200,
Expand Down
4 changes: 4 additions & 0 deletions app/config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,8 @@
'apiKey' => getenv('PUSHBULLET_APIKEY'),
'deviceIden' => getenv('PUSHBULLET_DEVICE_IDEN'),
],

'helpscout' => [
'form_id' => getenv('HELPSCOUT_CONTACT_FORM'),
],
];
17 changes: 9 additions & 8 deletions app/lang/en/contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@
*/

return [
'pageTitle' => 'Contact | '.Lang::get('layout.nameWebsite'),
'pageDescription' => 'Contact the team. Say hi, report a bug or propose a feature!',
'chooseYourWeapon' => 'Choose your weapon',
'contactTitle' => 'Contact us',
'teamTitle' => 'Our team',
'stayInTouchTitle' => 'Stay in touch',
'stayInTouchContent' => 'We are very concerned by you, our visitors. You are our top priority and this is the reason why we will be very happy to hear from you!<br/><br/>You have an idea? A suggestion? Something seems to be broken on the website? You want to show us your love? You want to drink a beer with us?<br/><br/>We will be very happy to answer to your message. Here are a few informations if you wish to contact us, by hook or by crook (but we do not accept carrier pigeons).',
'emailAddress' => 'support@'.Config::get('app.domain'),
'chooseYourWeapon' => 'Choose your weapon',
'teamDescriptionClara' => 'Clara is in charge of the Twitter account. She loves life. Since 2009 she tweets everyday to inspire us! Thanks to her we have build the '.Lang::get('layout.nameWebsite').' web suite.',
'helpscoutInfo' => 'We will get back to you shortly!',
'pageDescription' => 'Contact the team. Say hi, report a bug or propose a feature!',
'pageTitle' => 'Contact | '.Lang::get('layout.nameWebsite'),
'stayInTouchContent' => 'We are very concerned by you, our visitors. You are our top priority and this is the reason why we will be very happy to hear from you!<br/><br/>You have an idea? A suggestion? Something seems to be broken on the website? You want to show us your love? You want to drink a beer with us?<br/><br/>We will be very happy to answer to your message. Here are a few informations if you wish to contact us, by hook or by crook (but we do not accept carrier pigeons).',
'stayInTouchTitle' => 'Stay in touch',
'teamDescriptionAntoine' => 'Antoine is the lead developer. He likes when servers respond fast and when everything work as expected. He is always happy to have an impact on your life. He works hard to make things easy for you.',
'teamDescriptionMaxime' => 'Maxime is the iOS developer. Thanks to him you have '.Lang::get('layout.nameWebsite').' in your pocket, one tap away! He hates Antoine because he designs difficult-to-understand systems.',
'teamDescriptionClara' => 'Clara is in charge of the Twitter account. She loves life. Since 2009 she tweets everyday to inspire us! Thanks to her we have build the '.Lang::get('layout.nameWebsite').' web suite.',
'teamDescriptionJonathan' => 'Jonathan is the designer. Usually, Antoine designs something ugly and Jonathan makes it pretty. If you like the design then you will love Jonathan. And everybody loves Jonathan!',
'teamDescriptionMaxime' => 'Maxime is the iOS developer. Thanks to him you have '.Lang::get('layout.nameWebsite').' in your pocket, one tap away! He hates Antoine because he designs difficult-to-understand systems.',
'teamDescriptionMichel' => 'Michel is the tester. If something is not working or could be improved, he will find it for sure. A lot of software work thanks to him!',
'teamTitle' => 'Our team',
];
16 changes: 10 additions & 6 deletions ressources/views/contact/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<div id="contact-page">
<!-- CONTACT -->
<h1 class="animated fadeInDown">{{ $contactTitle }}</h1>
<div id="first-col" class="col-sm-6 animated fadeInDown">

<div id="first-col" class="col-sm-6 animated fadeInDown">
<div id="stay-in-touch">
<h2>{{ $stayInTouchTitle }}</h2>
{{ $stayInTouchContent }}
</div>
</div>
<div id="second-col" class="col-sm-6 animated fadeInDown">

<div id="second-col" class="col-sm-6 animated fadeInDown">
<div id="contact-info">
<h2>{{ $chooseYourWeapon }}</h2>
<ul>
Expand All @@ -30,7 +30,7 @@

<!-- TEAM LIST -->
<h1 id="team-title" class="animated fadeInUp">{{ $teamTitle }}</h1>

<div id="team-container" class="row animated fadeInUp">
@foreach ($teamMembers as $teamMember)
<?php
Expand All @@ -51,4 +51,8 @@
</div>

</div>
@stop
@stop

@section('add-js')
@include('js.helpscout', compact('user'))
@stop
25 changes: 25 additions & 0 deletions ressources/views/js/helpscout.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<script>
!function(e,o,n){window.HSCW=o,window.HS=n,n.beacon=n.beacon||{};var t=n.beacon;t.userConfig={},t.readyQueue=[],t.config=function(e){this.userConfig=e},t.ready=function(e){this.readyQueue.push(e)},o.config={docs:{enabled:!1,baseUrl:""},contact:{enabled:!0,formId:"{{ Config::get('services.helpscout.form_id') }}"}};var r=e.getElementsByTagName("script")[0],c=e.createElement("script");c.type="text/javascript",c.async=!0,c.src="https://djtflbt20bdde.cloudfront.net/",r.parentNode.insertBefore(c,r)}(document,window.HSCW||{},window.HS||{});
// http://developer.helpscout.net/beacons/
HS.beacon.config({
poweredBy: false,
color: '#2980B9',
icon: 'message',
instructions: "{{ trans('contact.helpscoutInfo') }}"
});
</script>

{{-- Current user details if available --}}
@if (!is_null($user))
<script>
// http://developer.helpscout.net/beacons/
HS.beacon.ready(function() {
HS.beacon.identify({
name: '{{ $user->login }}',
email: '{{ $user->email }}',
id: {{ $user->id }}
});
});
</script>
@endif
4 changes: 0 additions & 4 deletions updateEnv.sh

This file was deleted.

0 comments on commit b05f973

Please sign in to comment.