Skip to content

Commit

Permalink
Merge branch 'release/3.4.9' into v3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Augusti committed Sep 15, 2015
2 parents c09542f + 94b7ed5 commit 71ab159
Show file tree
Hide file tree
Showing 30 changed files with 120 additions and 124 deletions.
14 changes: 13 additions & 1 deletion app/TeenQuotes/Api/V1/Controllers/QuotesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function getQuotesForTag($tag_name)
public function store($doValidation = true)
{
$user = $this->retrieveUser();
$content = Input::get('content');
$content = $this->removeNewLines(Input::get('content'));
$quotesSubmittedToday = $this->quoteRepo->submittedTodayForUser($user);

if ($doValidation) {
Expand Down Expand Up @@ -312,4 +312,16 @@ private function tellUserWasNotFound($user_id)

return Response::json($data, 400);
}

/**
* Remove new lines and whitespaces from a string.
*
* @param string $string The original string
*
* @return string
*/
private function removeNewLines($string)
{
return preg_replace('/\s+/', ' ', trim($string));
}
}
5 changes: 3 additions & 2 deletions app/lang/en/quotes.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
'quoteHasBeenRefusedAlertSad' => "We found that your quote was very sad and we can't promote such sadness on ".Lang::get('layout.nameWebsite').". If you are personally going through some difficult times, please do get in touch with someone you can trust or <a href=':urlHelp'>call someone that can help you</a>. Life is something amazing. Don't do something you will definitely regret.",
'quoteHasBeenRefusedEnd' => "Please take into consideration that we refuse almost 75 % of the quotes because we want to keep the very best.<br/<br/>Don't worry, one of your quotes is gonna be approved soon. Remember: write an original quote, in proper English, and eventually you will be published on ".Lang::get('layout.nameWebsite').'!<br/><br/>Thanks a lot for submitting a quote :login.',
'quotePublishedSubjectEmail' => 'Your quote has been published!',
'quotesForTag' => 'Quotes for tag',
'quotesTagsIndexPageDescription' => 'Browse quotes for a specific tag, sharing a common topic on '.Lang::get('layout.nameWebsite').'.',
'quotesTagsIndexPageTitle' => 'Browse quotes for a tag | '.Lang::get('layout.nameWebsite'),
'quotesText' => 'quote|quotes',
Expand All @@ -45,16 +46,16 @@
'quoteUnapproveSubjectEmail' => 'Your quote has been rejected',
'randomPageDescription' => 'Random quotes released on '.Lang::get('layout.nameWebsite').'. Because some quotes are simply true. Your everyday life moments.',
'randomPageTitle' => 'Random quotes | '.Lang::get('layout.nameWebsite'),
'readyToInspire' => 'Ready to inspire the world? Write an amazing quote.',
'rulesAddQuote' => '<li>Your quote must be written in proper English</li><li>Your quote should not already be on '.Lang::get('layout.nameWebsite').'</li><li>Your quote should not be too sad</li>',
'sharePromotion' => 'Enjoying '.Lang::get('layout.nameWebsite').'? Share the love with your friends and share a quote!',
'sharePromotionTitle' => 'Share the love',
'signupPromotion' => "<a href=':url' id='js-promotion-signup'>Create an account</a> right now. You can save quotes in your favorites, add your own quote and a lot more.",
'signupPromotionTitle' => 'Enjoying '.Lang::get('layout.nameWebsite').'?',
'singleQuotePageTitle' => 'Quote #:id | '.Lang::get('layout.nameWebsite'),
'speakYourMind' => 'Speak your mind and share your thoughts with the world!',
'speakYourMind' => "Speak your mind, you're going to inspire others!",
'submitMyQuote' => 'Submit my quote!',
'topComments' => 'By comments',
'topFavorites' => 'By favorites',
'yourQuote' => 'Your quote',
'quotesForTag' => 'Quotes for tag',
];
3 changes: 1 addition & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var elixir = require('laravel-elixir');
var clean = require('gulp-clean');
var gulp = require('gulp');
require('laravel-elixir-compass');
require('laravel-elixir-sass-compass');

var inputJSDir = 'ressources/js',
inputSASSDir = 'ressources/sass/',
Expand All @@ -23,7 +23,6 @@ elixir(function(mix) {
.scripts([
'jquery-2.1.0.min.js',
'bootstrap.min.js',
'wow.min.js',
'mailgun-validator.js',
'app.js'
], outputJS + 'scripts.min.js', inputJSDir)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"gulp": "^3.8.8",
"gulp-clean": "^0.3.1",
"laravel-elixir": "*",
"laravel-elixir-compass": "*"
"laravel-elixir-sass-compass": "*"
}
}
15 changes: 0 additions & 15 deletions public/build/assets/css/styles.min-1ec395f5.css

This file was deleted.

16 changes: 16 additions & 0 deletions public/build/assets/css/styles.min-34d8d28f67.css

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions public/build/assets/js/scripts.min-026f200b51.js

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions public/build/assets/js/scripts.min-4400cde9.js

This file was deleted.

4 changes: 2 additions & 2 deletions public/build/rev-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"assets/css/styles.min.css": "assets/css/styles.min-1ec395f5.css",
"assets/js/scripts.min.js": "assets/js/scripts.min-4400cde9.js"
"assets/css/styles.min.css": "assets/css/styles.min-34d8d28f67.css",
"assets/js/scripts.min.js": "assets/js/scripts.min-026f200b51.js"
}
11 changes: 0 additions & 11 deletions ressources/js/app.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
window.laravel = window.laravel || {};
var timeoutLoginSignup, timeoutPassword;

new WOW().init();

$(document).ready(function() {

// Signup view
Expand Down Expand Up @@ -38,13 +36,6 @@ $(document).ready(function() {
});

// Signin view
$("#listener-wants-account").mouseenter(function() {
$("#wants-account").addClass("animated shake");
})
.mouseleave(function() {
$("#wants-account").removeClass("animated shake");
});

$('#countLetters').css("display", "none");
$('#submit-quote, #submit-comment').attr('disabled', 'disabled');

Expand Down Expand Up @@ -510,8 +501,6 @@ function doneTypingLoginPassword() {
return;
}
timeoutPassword = null;

$("#submit-form").removeClass("animated fadeInUp").addClass("animated shake");
}

var updateWelcomeButton = function() {
Expand Down
2 changes: 0 additions & 2 deletions ressources/js/wow.min.js

This file was deleted.

9 changes: 8 additions & 1 deletion ressources/sass/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,11 @@
margin: 10px 0 0 5px;
font-style: italic;
font-size: .9em;
}
}

@mixin card-shadow {
background-color: #fefefe;
border: 1px solid #f1f1f1;
border-radius: 2px;
box-shadow: 0 2px 3px rgba(0,0,0,.05);
}
19 changes: 10 additions & 9 deletions ressources/sass/screen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,17 @@ h3 {

#addquote-page {

.addquote__form {
padding: 5px 15px 10px 15px;
@include card-shadow;
}

.addquote-text {
margin-bottom: 10px;
margin: 20px 0 10px 0;
}

ul {
margin: 40px 0 50px 0;
list-style: none;
padding: 0;

Expand All @@ -421,15 +427,10 @@ h3 {
}

.notice-email {
margin-top: 15px;

@media screen and (max-width: $breakpointSmartphone) {
margin-bottom: 2em;
}

margin-top: 50px;

i.fa {
color: $lightBlue;
color: $topbarColor;
margin-right: 10px;
}
}
Expand Down Expand Up @@ -868,7 +869,7 @@ h3 {
}

a, button {
@include element-transition;
@include element-transition;
}

// Different colors for quotes
Expand Down
6 changes: 3 additions & 3 deletions ressources/views/admin/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
@section('content')
<div id="admin-page">
<h2>Update quote <span>#{{{ $quote->id }}}</span></h2>
{{ Form::model($quote, array('route' => array('admin.quotes.update', $quote->id), 'class' => 'form-horizontal animated fadeInUp', 'method' => 'PUT')) }}
{{ Form::model($quote, ['route' => ['admin.quotes.update', $quote->id], 'class' => 'form-horizontal animated fadeInUp', 'method' => 'PUT']) }}

<!-- Quote's content -->
<div class="form-group">
{{ Form::label('content', 'Content of the quote', ['class' => 'col-sm-2 control-label']) }}

<div class="col-sm-10">
{{ Form::textarea('content', Input::old('content'), array('class' => 'form-control', 'rows' => '3')) }}
{{ Form::textarea('content', Input::old('content'), ['class' => 'form-control', 'rows' => '3', 'autofocus']) }}
@if ( ! empty($errors->first('content')))
{{ TextTools::warningTextForm($errors->first('content')) }}
@endif
Expand All @@ -26,4 +26,4 @@

{{ Form::close() }}
</div>
@stop
@stop
6 changes: 3 additions & 3 deletions ressources/views/auth/signupCall.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="animated fadeInRight col-md-6<?= $addClass ?>">
<h1>{{ Lang::get('auth.wantToBeCool') }}</h1>
{{ Lang::get('auth.dontOwnAccountYet') }}
<div class="text-center" id="listener-wants-account">
<a href="{{URL::route('signup')}}" class="transition btn btn-success btn-lg" id="wants-account">{{Lang::get('auth.wantsAnAccount')}}</a>
<div class="text-center">
<a href="{{ URL::route('signup') }}" class="transition btn btn-success btn-lg" id="wants-account">{{ Lang::get('auth.wantsAnAccount') }}</a>
</div>
</div>
</div>
20 changes: 6 additions & 14 deletions ressources/views/layouts/stories.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@include('layouts.header')

<div class="container stories-container">

<!-- Hero image -->
@if ( ! $heroHide)
<div id="hero" class="animated fadeInDown">
Expand All @@ -15,21 +15,13 @@
</div>
@endif

@if (Session::has('success'))
<div class="animated flipInX alert alert-success alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<i class="fa fa-smile-o"></i> {{ Session::get('success') }}
</div>
@endif
<!-- Success flash message -->
@include('layouts.flashMessages.success')

@if (Session::has('warning'))
<div class="animated lightSpeedIn alert alert-warning alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<i class="fa fa-meh-o"></i> {{ Session::get('warning') }}
</div>
@endif
<!-- Warning flash message -->
@include('layouts.flashMessages.warning')

@yield('content')
</div>

@include('layouts.footer')
@include('layouts.footer')
35 changes: 18 additions & 17 deletions ressources/views/quotes/addquote.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,30 @@

@section('content')
<div id="addquote-page" class="row">

<!-- RULES -->
<div class="col-sm-12 col-md-offset-2 col-md-8">
<h1><i class="fa fa-gavel"></i>{{ trans('quotes.fewRules') }}</h1>
<ul>
{{trans('quotes.rulesAddQuote')}}
</ul>
</div>

<!-- ADD A QUOTE -->
<div class="animated fadeInLeft col-md-6">
{{ Form::open(array('url' => URL::route('quotes.store'), 'class' => 'form-horizontal')) }}
<div class="animated fadeInUp col-sm-12 col-md-offset-2 col-md-8 addquote__form">
{{ Form::open(['url' => URL::route('quotes.store'), 'class' => 'form-horizontal']) }}

<h1><i class="fa fa-comment"></i>{{ Lang::get('quotes.addYourQuote') }}</h1>
<h1><i class="fa fa-comment"></i>{{ trans('quotes.addYourQuote') }}</h1>
<div class="addquote-text">
{{ Lang::get('quotes.speakYourMind') }}
{{ trans('quotes.speakYourMind') }}
</div>

<!-- Quote's content -->
<div class="form-group {{{ $errors->has('content') ? 'error' : '' }}}">
{{ Form::label('content', Lang::get('quotes.yourQuote'), ['class' => 'col-sm-2 control-label']) }}
{{ Form::label('content', trans('quotes.yourQuote'), ['class' => 'col-sm-2 control-label']) }}

<div class="col-sm-10">
{{ Form::textarea('content', Input::old('content'), array('class' => 'form-control', 'id' => 'content-quote', 'rows' => '3')) }}
{{ Form::textarea('content', Input::old('content'), ['class' => 'form-control', 'id' => 'content-quote', 'rows' => '3', 'placeholder' => trans('quotes.readyToInspire')]) }}
<span id="countLetters" class="orange">0 characters</span>
@if ( ! empty($errors->first('content')))
{{ TextTools::warningTextForm($errors->first('content')) }}
Expand All @@ -30,20 +39,12 @@
<!-- Submit button -->
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
{{ Form::submit(Lang::get('quotes.submitMyQuote'), array('class' => 'transition btn btn-primary btn-lg', 'id' => 'submit-quote')) }}
{{ Form::submit(trans('quotes.submitMyQuote'), ['class' => 'transition btn btn-primary btn-lg', 'id' => 'submit-quote']) }}
</div>
</div>
{{ Form::close() }}
</div>

<!-- RULES -->
<div class="animated fadeInRight col-md-6">
<h1><i class="fa fa-gavel"></i>{{ Lang::get('quotes.fewRules') }}</h1>
<ul>
{{Lang::get('quotes.rulesAddQuote')}}
</ul>
<div class="notice-email">
<i class="fa fa-info"></i> {{ Lang::get('quotes.noticeByEmail') }}
<i class="fa fa-info"></i> {{ trans('quotes.noticeByEmail') }}
</div>
</div>
</div>
Expand All @@ -52,4 +53,4 @@
<!-- Send event to Google Analytics -->
@section('add-js')
@include('js.sendEvent')
@stop
@stop
2 changes: 1 addition & 1 deletion ressources/views/quotes/partials/author.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
</span>
@endif
@endif
</div>
</div>
Loading

0 comments on commit 71ab159

Please sign in to comment.