Skip to content

Commit

Permalink
Add league/csv package for upcoming importing and exporting
Browse files Browse the repository at this point in the history
Minor improvements
  • Loading branch information
daftspunk committed Jan 27, 2015
1 parent 1e7e953 commit c00d6f2
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"linkorb/jsmin-php": "~1.0",
"oyejorge/less.php": "~1.7",
"symfony/yaml": "2.5.*",
"twig/twig": "~1.13"
"twig/twig": "~1.13",
"league/csv": "~6.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
Expand Down
6 changes: 3 additions & 3 deletions src/Auth/Models/Throttle.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function getLoginAttempts()
public function addLoginAttempt()
{
$this->attempts++;
$this->last_attempt_at = $this->freshTimeStamp();
$this->last_attempt_at = $this->freshTimestamp();

if ($this->getLoginAttempts() >= static::$attemptLimit)
$this->suspend();
Expand Down Expand Up @@ -107,7 +107,7 @@ public function suspend()
{
if (!$this->is_suspended) {
$this->is_suspended = true;
$this->suspended_at = $this->freshTimeStamp();
$this->suspended_at = $this->freshTimestamp();
$this->save();
}
}
Expand Down Expand Up @@ -149,7 +149,7 @@ public function ban()
{
if (!$this->is_banned) {
$this->is_banned = true;
$this->banned_at = $this->freshTimeStamp();
$this->banned_at = $this->freshTimestamp();
$this->save();
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/Syntax/FieldParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class FieldParser
protected $registeredTags = [
'text',
'textarea',
'richeditor',
'markdown',
'fileupload'
];

Expand Down
8 changes: 6 additions & 2 deletions src/Syntax/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ protected function evalTwigViewField($field, $params)
case 'textarea':
$result = '{{ ' . $field . ' }}';
break;
case 'markdown':
$result = '{{ ' . $field . '|md }}';
break;
case 'richeditor':
$result = '{{ ' . $field . '|raw }}';
break;
}

return $result;
Expand All @@ -140,8 +146,6 @@ protected function evalSimpleViewField($field, $params)

switch ($type) {
default:
case 'text':
case 'textarea':
$result = static::CHAR_OPEN . $field . static::CHAR_CLOSE;
break;
}
Expand Down
16 changes: 16 additions & 0 deletions src/Syntax/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ Renders a multiple line editor field for larger blocks of text. The view value i

{textarea name="websiteDescription" label="Website Description"}This is our vision for things to come{/textarea}

### Rich editor

{richeditor name="content" label="Main content"}Default text{/checkbox}

Renders in Twig as

{{ content|raw }}

### Markdown

{markdown name="content" label="Markdown content"}Default text{/markdown}

Renders in Twig as

{{ content|md }}

### Checkbox

{checkbox name="showHeader" label="Show heading" default="true"}
Expand Down

0 comments on commit c00d6f2

Please sign in to comment.