diff --git a/.github/workflows/ci-notejam.yml b/.github/workflows/ci-notejam.yml new file mode 100644 index 000000000..1b0a7ecf4 --- /dev/null +++ b/.github/workflows/ci-notejam.yml @@ -0,0 +1,76 @@ +name: nodejam CI + +# Triggers the workflow on push or pull request events +on: [push, pull_request] + +#on: +# push: +# branches: +# - master +# pull_request: +# branches: +# - master + +defaults: + run: + working-directory: . + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'adopt' + - name: Cache Maven packages + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build with Maven + run: mvn --batch-mode --update-snapshots install + - name: 'Tar files' + run: tar -cvf app.tar target/*.jar + - uses: actions/upload-artifact@v2 + with: + name: app + path: app.tar + + docker: + runs-on: ubuntu-latest + needs: build +# if: github.ref == 'refs/heads/master' + + steps: + - name: Checkout + uses: actions/checkout@v2.3.4 + # share artifact across jobs + - uses: actions/download-artifact@v2 + with: + name: app + - name: 'Untar files' + run: mkdir -p target && tar -xvf app.tar target + # build + push docker img + # credentials needed: https://github.com/aws-actions/amazon-ecr-login + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: eu-west-1 + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v1 + - name: Build, tag, and push image to Amazon ECR + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + ECR_REPOSITORY: notejam + IMAGE_TAG: ${{ github.sha }} + run: | + docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . + docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG diff --git a/.gitignore b/.gitignore index aba103733..bccac361c 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,9 @@ bower_components .bak +# maven +target/ + +#idea +.idea/ +*.iml \ No newline at end of file diff --git a/CA_TECH b/CA_TECH deleted file mode 100644 index 3ef2665c8..000000000 --- a/CA_TECH +++ /dev/null @@ -1,84 +0,0 @@ -#!groovy - -node('slave_CA_notejam') { - /*stage('Clean Environment') { - cleanWs() - } - - stage('Code Check Out') { - withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'jenkins-service-account', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) { - sh label: '', script: '''git config --global credential.helper \'!aws --profile assume_mobile codecommit credential-helper $@\'''' - */// checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'jenkins-service-codecommit', url: 'https://git-codecommit.eu-central-1.amazonaws.com/v1/repos/ma_android-platform']]]) - /* } - }*/ - - /*stage('SonarQube Code Analysis') { - echo 'Analysing code...' - withSonarQubeEnv('SonarQube') { - sh returnStdout: true, script: ''' - gradle wrapper - ./gradlew sonarqube -x compileDebugAndroidTestKotlin -x compileDebugUnitTestKotlin -Dsonar.host.url=${SONAR_HOST_URL} -Dsonar.projectKey=${JOB_BASE_NAME} -Dsonar.projectName=$JOB_BASE_NAME -Dsonar.projectVersion=1.0-SNAPSHOT - ''' - sleep 10; - } - }*/ - - stage('SonarQube Code Analysis') { - echo 'Analysing code...' - withSonarQubeEnv('SonarQube') { - sh returnStdout: true, script: ''' - gradle wrapper - ./gradlew sonarqube -Dsonar.host.url=${SONAR_HOST_URL} -Dsonar.projectKey=${JOB_BASE_NAME} -Dsonar.projectName=$JOB_BASE_NAME -Dsonar.projectVersion=1.0-SNAPSHOT - ''' - sleep 10; - } - } - - stage("SonarQube Quality-Gate Validation") { - echo 'Quality Gate Verification...' - timeout(time: 1, unit: 'MINUTES') { - def qg = waitForQualityGate() - if (qg.status != 'OK') { - error "Pipeline aborted due to quality gate failure: ${qg.status}" - } - } - } - - stage('Build') { - echo 'Building ..' - sh returnStdout: true, script: ''' - ./gradlew clean assembleDebug - ''' - } - - stage('Push .APK to Nexus') { - withEnv([ - 'NEXUS_CREDS=nexus-service-account', - 'NEXUS_URL=artifacts.le.tnt.bank.ikano', - 'NEXUS_REPO=maven-snapshots', - 'NEXUS_PROTOCOL=https', - 'NEXUS_VERSION=nexus3' - ]) { - filesByGlob = findFiles(glob: "app/build/outputs/apk/debug/*.apk"); - artifactPath = filesByGlob[0].path; - artifactExists = fileExists artifactPath - if(artifactExists) { - nexusArtifactUploader( - nexusVersion: NEXUS_VERSION, - protocol: NEXUS_PROTOCOL, - nexusUrl: NEXUS_URL, - groupId: 'com.ikano.ipay.mobile', - version: '1.0-SNAPSHOT', - repository: NEXUS_REPO, - credentialsId: NEXUS_CREDS, - artifacts: [ - [artifactId: 'ma_android-platform', - type: 'apk', - file: artifactPath, - classifier: ''] - ] - ) - } - } - } -} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..4f1f5af6e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM openjdk:8-jdk-alpine +ARG JAR_FILE=target/*.jar +COPY ${JAR_FILE} app.jar +ENTRYPOINT ["java","-jar","/app.jar"] \ No newline at end of file diff --git a/README.rst b/README.rst index 07f28807c..2e3b57aa3 100644 --- a/README.rst +++ b/README.rst @@ -1,143 +1,103 @@ -******* -Notejam -******* +*************** +Notejam: Spring +*************** -**The easy way to learn web frameworks** +Notejam application implemented using `Spring `_ framework. -Do you know framework X and want to try framework Y? -The easy way to start with a new framework is to compare it with frameworks you already know. -The goal of the project is to help developers easily learn new frameworks by examples. +Spring version: 4.2.3 -Notejam is a unified sample web application (more than just "Hello World") implemented using different server-side frameworks. -Currently python, php, ruby and javascript frameworks are supported. +The full stack is: +- `Spring Boot `_ (Spring configuration) +- `Thymeleaf `_ (View) +- `Spring Security `_ (Security framework) +- `Spring`_ (DI and MVC framework) +- `Spring Data `_ (Persistence abstraction) +- `JPA `_ (Persistence API) +- `Hibernate `_ (JPA implementation) -==================== -Supported frameworks -==================== +The application is maintained by `@malkusch `_. -**Python** +========================== +Installation and launching +========================== +----- +Clone +----- -* `Django `_ -* `Flask `_ -* `Pyramid `_ +Clone the repo: -**PHP** +.. code-block:: bash -* `Laravel `_ -* `Yii `_ -* `CakePHP `_ -* `Nette `_ / `Nette + Doctrine `_ -* `Symfony `_ + $ git clone https://github.com/komarserjio/notejam YOUR_PROJECT_DIR/ -**Ruby** +------- +Install +------- -* `Padrino `_ -* `Ruby on Rails `_ +Install a `JDK `_ and `Maven `_. -**Java** +------------- +Configuration +------------- -* `Spring `_ +The application has a password recovery process which involves sending an email. +If you want to enable that, you have to create a local application.properties file +and set there the property spring.mail.host to your SMTP server (e.g. spring.mail.host = smtp.example.net). -**Javascript (node.js)** +.. code-block:: bash -* `Express `_ + $ cd YOUR_PROJECT_DIR/spring/ + $ vi application.properties +See `MailProperties `_ +for more mail properties. -In progress ------------ +------ +Launch +------ -**Scala** +Compile and launch the application: -* Play +.. code-block:: bash -**Clojure** + $ cd YOUR_PROJECT_DIR/spring/ + $ mvn spring-boot:run -* Compojure +Go to http://localhost:8080/ in your browser. -... and more frameworks are coming soon. +~~~~~~~~~~~~ +Localization +~~~~~~~~~~~~ -==================== -Application overview -==================== +This application comes with support for the languages German and English. The locale is +determined by the Accept-Language request header. If the header is not present the +content will be served with the default locale of the JVM. The application will not +start if the default locale is non of the supported languages. -Notejam is a web application which offers user to sign up/in/out and create/view/edit/delete notes. -Notes are grouped in pads. +--------- +Run tests +--------- -**Screenshots** +Run functional and unit tests: -.. image:: https://github.com/komarserjio/notejam/blob/master/html/screenshots/1p.png - :alt: Sign in - :width: 400 - :align: center - :target: https://github.com/komarserjio/notejam/tree/master/screenshots.rst +.. code-block:: bash -.. image:: https://github.com/komarserjio/notejam/blob/master/html/screenshots/2p.png - :alt: All notes - :width: 400 - :align: center - :target: https://github.com/komarserjio/notejam/tree/master/screenshots.rst - -.. image:: https://github.com/komarserjio/notejam/blob/master/html/screenshots/3p.png - :alt: New note - :width: 400 - :align: center - :target: https://github.com/komarserjio/notejam/tree/master/screenshots.rst - -See `more screenshots `_ -for look and feel. - -See `detailed overview `_. - -Typical application covers following topics: - -* Request/Response handling -* Routing -* Templates -* Configuration -* Authentication -* Forms -* Error handling -* Database/ORM -* Mailing -* Functional/unit testing - -============= -How to launch -============= - -All implementations are SQLite based and quickly launchable by built-in web servers. -Each implementation has instruction describing easy steps to install environment, launch and run tests. + $ cd YOUR_PROJECT_DIR/spring/ + $ mvn test ============ Contribution ============ -Contribution is more than welcome! -Contribute improvements to existing applications to help them follow best practices -or provide new implementation for unsupported framework. +Do you have Java/Spring experience? Help the application to follow Java and Spring best practices. +Please send your pull requests in the ``master`` branch. +Always prepend your commits with framework name: -**Do you want to improve one of the existing implementations?** +.. code-block:: bash -Each implementation has its own README with contribution details. - -**Do you want to add new framework?** + Spring: Implement sign in functionality Read `contribution guide `_ for details. - -======== -Contacts -======== - -* Twitter: `@komarserjio `_ -* Email: komarserjio gmail.com - -======= -License -======= - -MIT © Serhii Komar. - -See `license `_. diff --git a/cakephp/README.rst b/cakephp/README.rst deleted file mode 100644 index 606fd5e89..000000000 --- a/cakephp/README.rst +++ /dev/null @@ -1,88 +0,0 @@ -**************** -Notejam: CakePHP -**************** - -Notejam application implemented using `CakePHP `_ framework. - -CakePHP version: 3.1 - -PHP version required: 5.5+ - -========================== -Installation and launching -========================== - ------ -Clone ------ - -Clone the repo: - -.. code-block:: bash - - $ git clone git@github.com:komarserjio/notejam.git YOUR_PROJECT_DIR/ - -------- -Install -------- - -Install `composer `_ - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/cakephp/notejam - $ curl -s https://getcomposer.org/installer | php - -Install dependencies - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/cakephp/notejam - $ php composer.phar install - -Create database schema - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/cakephp/notejam - $ ./bin/cake migrations migrate - - ------- -Launch ------- - -Start built-in php web server: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/cakephp/notejam - $ ./bin/cake server - -Go to http://localhost:8765 in your browser. - ---------- -Run tests ---------- - -Run functional tests: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/cakephp/notejam/ - $ ./vendor/bin/phpunit - - -============ -Contribution -============ -Do you have CakePHP experience? Help the app to follow PHP and CakePHP best practices. - -Please send your pull requests in the ``master`` branch. -Always prepend your commits with framework name: - -.. code-block:: bash - - CakePHP: Implemented sign in functionality - -Read `contribution guide `_ for details. diff --git a/cakephp/notejam/.editorconfig b/cakephp/notejam/.editorconfig deleted file mode 100644 index 706190175..000000000 --- a/cakephp/notejam/.editorconfig +++ /dev/null @@ -1,18 +0,0 @@ -; This file is for unifying the coding style for different editors and IDEs. -; More information at http://editorconfig.org - -root = true - -[*] -indent_style = space -indent_size = 4 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true - -[*.bat] -end_of_line = crlf - -[*.yml] -indent_style = space -indent_size = 2 diff --git a/cakephp/notejam/.gitattributes b/cakephp/notejam/.gitattributes deleted file mode 100644 index 926a808fc..000000000 --- a/cakephp/notejam/.gitattributes +++ /dev/null @@ -1,36 +0,0 @@ -# Define the line ending behavior of the different file extensions -# Set default behaviour, in case users don't have core.autocrlf set. -* text=auto -* text eol=lf - -# Explicitly declare text files we want to always be normalized and converted -# to native line endings on checkout. -*.php text -*.default text -*.ctp text -*.sql text -*.md text -*.po text -*.js text -*.css text -*.ini text -*.properties text -*.txt text -*.xml text -*.yml text -.htaccess text - -# Declare files that will always have CRLF line endings on checkout. -*.bat eol=crlf - -# Declare files that will always have LF line endings on checkout. -*.pem eol=lf - -# Denote all files that are truly binary and should not be modified. -*.png binary -*.jpg binary -*.gif binary -*.ico binary -*.mo binary -*.pdf binary -*.phar binary diff --git a/cakephp/notejam/.gitignore b/cakephp/notejam/.gitignore deleted file mode 100644 index 46bc8c5c9..000000000 --- a/cakephp/notejam/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/vendor/* -/tmp/* -/logs/* -composer.lock diff --git a/cakephp/notejam/.htaccess b/cakephp/notejam/.htaccess deleted file mode 100644 index fc3aac4b2..000000000 --- a/cakephp/notejam/.htaccess +++ /dev/null @@ -1,5 +0,0 @@ - - RewriteEngine on - RewriteRule ^$ webroot/ [L] - RewriteRule (.*) webroot/$1 [L] - \ No newline at end of file diff --git a/cakephp/notejam/.travis.yml b/cakephp/notejam/.travis.yml deleted file mode 100644 index b9b337904..000000000 --- a/cakephp/notejam/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: php - -sudo: false - -php: - - 5.4 - - 5.5 - - 5.6 - -before_script: - - sh -c "composer require 'cakephp/cakephp-codesniffer:dev-master'" - - phpenv rehash - -script: - - sh -c "vendor/bin/phpcs -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests ./config ./webroot" - -notifications: - email: false diff --git a/cakephp/notejam/bin/cake b/cakephp/notejam/bin/cake deleted file mode 100755 index ffdacace9..000000000 --- a/cakephp/notejam/bin/cake +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash -################################################################################ -# -# Bake is a shell script for running CakePHP bake script -# -# CakePHP(tm) : Rapid Development Framework (http://cakephp.org) -# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) -# -# Licensed under The MIT License -# For full copyright and license information, please see the LICENSE.txt -# Redistributions of files must retain the above copyright notice. -# -# @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) -# @link http://cakephp.org CakePHP(tm) Project -# @since 1.2.0 -# @license http://www.opensource.org/licenses/mit-license.php MIT License -# -################################################################################ - -# Canonicalize by following every symlink of the given name recursively -canonicalize() { - NAME="$1" - if [ -f "$NAME" ] - then - DIR=$(dirname -- "$NAME") - NAME=$(cd -P "$DIR" > /dev/null && pwd -P)/$(basename -- "$NAME") - fi - while [ -h "$NAME" ]; do - DIR=$(dirname -- "$NAME") - SYM=$(readlink "$NAME") - NAME=$(cd "$DIR" > /dev/null && cd $(dirname -- "$SYM") > /dev/null && pwd)/$(basename -- "$SYM") - done - echo "$NAME" -} - -CONSOLE=$(dirname -- "$(canonicalize "$0")") -APP=$(dirname "$CONSOLE") - -exec php "$CONSOLE"/cake.php "$@" -exit diff --git a/cakephp/notejam/bin/cake.bat b/cakephp/notejam/bin/cake.bat deleted file mode 100644 index dd1d9a821..000000000 --- a/cakephp/notejam/bin/cake.bat +++ /dev/null @@ -1,30 +0,0 @@ -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: -:: Bake is a shell script for running CakePHP bake script -:: -:: CakePHP(tm) : Rapid Development Framework (http://cakephp.org) -:: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) -:: -:: Licensed under The MIT License -:: Redistributions of files must retain the above copyright notice. -:: -:: @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) -:: @link http://cakephp.org CakePHP(tm) Project -:: @since 2.0.0 -:: @license http://www.opensource.org/licenses/mit-license.php MIT License -:: -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: In order for this script to work as intended, the cake\console\ folder must be in your PATH - -@echo. -@echo off - -SET app=%0 -SET lib=%~dp0 - -php "%lib%cake.php" %* - -echo. - -exit /B %ERRORLEVEL% diff --git a/cakephp/notejam/bin/cake.php b/cakephp/notejam/bin/cake.php deleted file mode 100644 index 4c7d7cef8..000000000 --- a/cakephp/notejam/bin/cake.php +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/php -q -require->php)) { - $minVersion = preg_replace('/([^0-9\.])/', '', $composer->require->php); - } -} -if (version_compare(phpversion(), $minVersion, '<')) { - fwrite(STDERR, sprintf("Minimum PHP version: %s. You are using: %s.\n", $minVersion, phpversion())); - exit(-1); -} - -include dirname(__DIR__) . '/config/bootstrap.php'; - -exit(Cake\Console\ShellDispatcher::run($argv)); diff --git a/cakephp/notejam/composer.json b/cakephp/notejam/composer.json deleted file mode 100644 index 6f1107153..000000000 --- a/cakephp/notejam/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "cakephp/app", - "description": "Notejam app", - "homepage": "https://github.com/komarserjio/notejam", - "type": "project", - "license": "MIT", - "require": { - "php": ">=5.6.0", - "cakephp/cakephp": "^3.5", - "mobiledetect/mobiledetectlib": "2.*", - "cakephp/migrations": "~1.0", - "cakephp/plugin-installer": "*" - }, - "require-dev": { - "psy/psysh": "@stable", - "cakephp/debug_kit": "~3.0", - "cakephp/bake": "~1.0", - "phpunit/phpunit": "^5.7|^6.0" - }, - "suggest": { - "phpunit/phpunit": "Allows automated tests to be run without system-wide install.", - "cakephp/cakephp-codesniffer": "Allows to check the code against the coding standards used in CakePHP." - }, - "autoload": { - "psr-4": { - "App\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "App\\Test\\": "tests", - "Cake\\Test\\": "./vendor/cakephp/cakephp/tests" - } - }, - "scripts": { - "post-install-cmd": "App\\Console\\Installer::postInstall", - "post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump" - }, - "minimum-stability": "dev", - "prefer-stable": true -} diff --git a/cakephp/notejam/config/Migrations/20150928200943_initial.php b/cakephp/notejam/config/Migrations/20150928200943_initial.php deleted file mode 100644 index 7ba3488b1..000000000 --- a/cakephp/notejam/config/Migrations/20150928200943_initial.php +++ /dev/null @@ -1,141 +0,0 @@ -table('notes'); - $table - ->addColumn('pad_id', 'integer', [ - 'default' => null, - 'limit' => null, - 'null' => true, - ]) - ->addColumn('user_id', 'integer', [ - 'default' => null, - 'limit' => null, - 'null' => false, - ]) - ->addColumn('name', 'string', [ - 'default' => null, - 'limit' => 100, - 'null' => false, - ]) - ->addColumn('text', 'text', [ - 'default' => null, - 'limit' => null, - 'null' => false, - ]) - ->addColumn('created_at', 'datetime', [ - 'default' => null, - 'limit' => null, - 'null' => false, - ]) - ->addColumn('updated_at', 'datetime', [ - 'default' => null, - 'limit' => null, - 'null' => false, - ]) - ->addIndex( - [ - 'pad_id', - ] - ) - ->addIndex( - [ - 'user_id', - ] - ) - ->create(); - - $table = $this->table('pads'); - $table - ->addColumn('name', 'string', [ - 'default' => null, - 'limit' => 100, - 'null' => false, - ]) - ->addColumn('user_id', 'integer', [ - 'default' => null, - 'limit' => null, - 'null' => false, - ]) - ->addIndex( - [ - 'user_id', - ] - ) - ->create(); - - $table = $this->table('users'); - $table - ->addColumn('email', 'string', [ - 'default' => null, - 'limit' => 75, - 'null' => false, - ]) - ->addColumn('password', 'string', [ - 'default' => null, - 'limit' => 128, - 'null' => false, - ]) - ->create(); - - $this->table('notes') - ->addForeignKey( - 'pad_id', - 'pads', - 'id', - [ - 'update' => 'NO_ACTION', - 'delete' => 'NO_ACTION' - ] - ) - ->addForeignKey( - 'user_id', - 'users', - 'id', - [ - 'update' => 'NO_ACTION', - 'delete' => 'NO_ACTION' - ] - ) - ->update(); - - $this->table('pads') - ->addForeignKey( - 'user_id', - 'users', - 'id', - [ - 'update' => 'NO_ACTION', - 'delete' => 'NO_ACTION' - ] - ) - ->update(); - - } - - public function down() - { - $this->table('notes') - ->dropForeignKey( - 'pad_id' - ) - ->dropForeignKey( - 'user_id' - ) - ->update(); - - $this->table('pads') - ->dropForeignKey( - 'user_id' - ) - ->update(); - - $this->dropTable('notes'); - $this->dropTable('pads'); - $this->dropTable('users'); - } -} diff --git a/cakephp/notejam/config/app.default.php b/cakephp/notejam/config/app.default.php deleted file mode 100644 index 52722ccaf..000000000 --- a/cakephp/notejam/config/app.default.php +++ /dev/null @@ -1,326 +0,0 @@ - true, - - /** - * Configure basic information about the application. - * - * - namespace - The namespace to find app classes under. - * - encoding - The encoding used for HTML + database connections. - * - base - The base directory the app resides in. If false this - * will be auto detected. - * - dir - Name of app directory. - * - webroot - The webroot directory. - * - wwwRoot - The file path to webroot. - * - baseUrl - To configure CakePHP to *not* use mod_rewrite and to - * use CakePHP pretty URLs, remove these .htaccess - * files: - * /.htaccess - * /webroot/.htaccess - * And uncomment the baseUrl key below. - * - fullBaseUrl - A base URL to use for absolute links. - * - imageBaseUrl - Web path to the public images directory under webroot. - * - cssBaseUrl - Web path to the public css directory under webroot. - * - jsBaseUrl - Web path to the public js directory under webroot. - * - paths - Configure paths for non class based resources. Supports the - * `plugins`, `templates`, `locales` subkeys, which allow the definition of - * paths for plugins, view templates and locale files respectively. - */ - 'App' => [ - 'namespace' => 'App', - 'encoding' => 'UTF-8', - 'base' => false, - 'dir' => 'src', - 'webroot' => 'webroot', - 'wwwRoot' => WWW_ROOT, - // 'baseUrl' => env('SCRIPT_NAME'), - 'fullBaseUrl' => false, - 'imageBaseUrl' => 'img/', - 'cssBaseUrl' => 'css/', - 'jsBaseUrl' => 'js/', - 'paths' => [ - 'plugins' => [ROOT . DS . 'plugins' . DS], - 'templates' => [APP . 'Template' . DS], - 'locales' => [APP . 'Locale' . DS], - ], - ], - - /** - * Security and encryption configuration - * - * - salt - A random string used in security hashing methods. - * The salt value is also used as the encryption key. - * You should treat it as extremely sensitive data. - */ - 'Security' => [ - 'salt' => '__SALT__', - ], - - /** - * Apply timestamps with the last modified time to static assets (js, css, images). - * Will append a querystring parameter containing the time the file was modified. - * This is useful for busting browser caches. - * - * Set to true to apply timestamps when debug is true. Set to 'force' to always - * enable timestamping regardless of debug value. - */ - 'Asset' => [ - // 'timestamp' => true, - ], - - /** - * Configure the cache adapters. - */ - 'Cache' => [ - 'default' => [ - 'className' => 'File', - 'path' => CACHE, - ], - - /** - * Configure the cache used for general framework caching. Path information, - * object listings, and translation cache files are stored with this - * configuration. - */ - '_cake_core_' => [ - 'className' => 'File', - 'prefix' => 'myapp_cake_core_', - 'path' => CACHE . 'persistent/', - 'serialize' => true, - 'duration' => '+2 minutes', - ], - - /** - * Configure the cache for model and datasource caches. This cache - * configuration is used to store schema descriptions, and table listings - * in connections. - */ - '_cake_model_' => [ - 'className' => 'File', - 'prefix' => 'myapp_cake_model_', - 'path' => CACHE . 'models/', - 'serialize' => true, - 'duration' => '+2 minutes', - ], - ], - - /** - * Configure the Error and Exception handlers used by your application. - * - * By default errors are displayed using Debugger, when debug is true and logged - * by Cake\Log\Log when debug is false. - * - * In CLI environments exceptions will be printed to stderr with a backtrace. - * In web environments an HTML page will be displayed for the exception. - * With debug true, framework errors like Missing Controller will be displayed. - * When debug is false, framework errors will be coerced into generic HTTP errors. - * - * Options: - * - * - `errorLevel` - int - The level of errors you are interested in capturing. - * - `trace` - boolean - Whether or not backtraces should be included in - * logged errors/exceptions. - * - `log` - boolean - Whether or not you want exceptions logged. - * - `exceptionRenderer` - string - The class responsible for rendering - * uncaught exceptions. If you choose a custom class you should place - * the file for that class in src/Error. This class needs to implement a - * render method. - * - `skipLog` - array - List of exceptions to skip for logging. Exceptions that - * extend one of the listed exceptions will also be skipped for logging. - * E.g.: - * `'skipLog' => ['Cake\Network\Exception\NotFoundException', 'Cake\Network\Exception\UnauthorizedException']` - */ - 'Error' => [ - 'errorLevel' => E_ALL & ~E_DEPRECATED, - 'exceptionRenderer' => 'Cake\Error\ExceptionRenderer', - 'skipLog' => [], - 'log' => true, - 'trace' => true, - ], - - /** - * Email configuration. - * - * You can configure email transports and email delivery profiles here. - * - * By defining transports separately from delivery profiles you can easily - * re-use transport configuration across multiple profiles. - * - * You can specify multiple configurations for production, development and - * testing. - * - * ### Configuring transports - * - * Each transport needs a `className`. Valid options are as follows: - * - * Mail - Send using PHP mail function - * Smtp - Send using SMTP - * Debug - Do not send the email, just return the result - * - * You can add custom transports (or override existing transports) by adding the - * appropriate file to src/Network/Email. Transports should be named - * 'YourTransport.php', where 'Your' is the name of the transport. - * - * ### Configuring delivery profiles - * - * Delivery profiles allow you to predefine various properties about email - * messages from your application and give the settings a name. This saves - * duplication across your application and makes maintenance and development - * easier. Each profile accepts a number of keys. See `Cake\Network\Email\Email` - * for more information. - */ - 'EmailTransport' => [ - 'default' => [ - 'className' => 'Mail', - // The following keys are used in SMTP transports - 'host' => 'localhost', - 'port' => 25, - 'timeout' => 30, - 'username' => 'user', - 'password' => 'secret', - 'client' => null, - 'tls' => null, - ], - ], - - 'Email' => [ - 'default' => [ - 'transport' => 'default', - 'from' => 'you@localhost', - //'charset' => 'utf-8', - //'headerCharset' => 'utf-8', - ], - ], - - /** - * Connection information used by the ORM to connect - * to your application's datastores. - * Drivers include Mysql Postgres Sqlite Sqlserver - * See vendor\cakephp\cakephp\src\Database\Driver for complete list - */ - 'Datasources' => [ - 'default' => [ - 'className' => 'Cake\Database\Connection', - 'driver' => 'Cake\Database\Driver\Mysql', - 'persistent' => false, - 'host' => 'localhost', - /** - * CakePHP will use the default DB port based on the driver selected - * MySQL on MAMP uses port 8889, MAMP users will want to uncomment - * the following line and set the port accordingly - */ - //'port' => 'nonstandard_port_number', - 'username' => 'my_app', - 'password' => 'secret', - 'database' => 'my_app', - 'encoding' => 'utf8', - 'timezone' => 'UTC', - 'cacheMetadata' => true, - - /** - * Set identifier quoting to true if you are using reserved words or - * special characters in your table or column names. Enabling this - * setting will result in queries built using the Query Builder having - * identifiers quoted when creating SQL. It should be noted that this - * decreases performance because each query needs to be traversed and - * manipulated before being executed. - */ - 'quoteIdentifiers' => false, - - /** - * During development, if using MySQL < 5.6, uncommenting the - * following line could boost the speed at which schema metadata is - * fetched from the database. It can also be set directly with the - * mysql configuration directive 'innodb_stats_on_metadata = 0' - * which is the recommended value in production environments - */ - //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'], - ], - - /** - * The test connection is used during the test suite. - */ - 'test' => [ - 'className' => 'Cake\Database\Connection', - 'driver' => 'Cake\Database\Driver\Mysql', - 'persistent' => false, - 'host' => 'localhost', - //'port' => 'nonstandard_port_number', - 'username' => 'my_app', - 'password' => 'secret', - 'database' => 'test_myapp', - 'encoding' => 'utf8', - 'timezone' => 'UTC', - 'cacheMetadata' => true, - 'quoteIdentifiers' => false, - //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'], - ], - ], - - /** - * Configures logging options - */ - 'Log' => [ - 'debug' => [ - 'className' => 'Cake\Log\Engine\FileLog', - 'path' => LOGS, - 'file' => 'debug', - 'levels' => ['notice', 'info', 'debug'], - ], - 'error' => [ - 'className' => 'Cake\Log\Engine\FileLog', - 'path' => LOGS, - 'file' => 'error', - 'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'], - ], - ], - - /** - * - * Session configuration. - * - * Contains an array of settings to use for session configuration. The - * `defaults` key is used to define a default preset to use for sessions, any - * settings declared here will override the settings of the default config. - * - * ## Options - * - * - `cookie` - The name of the cookie to use. Defaults to 'CAKEPHP'. - * - `cookiePath` - The url path for which session cookie is set. Maps to the - * `session.cookie_path` php.ini config. Defaults to base path of app. - * - `timeout` - The time in minutes the session should be valid for. - * Pass 0 to disable checking timeout. - * - `defaults` - The default configuration set to use as a basis for your session. - * There are four built-in options: php, cake, cache, database. - * - `handler` - Can be used to enable a custom session handler. Expects an - * array with at least the `engine` key, being the name of the Session engine - * class to use for managing the session. CakePHP bundles the `CacheSession` - * and `DatabaseSession` engines. - * - `ini` - An associative array of additional ini values to set. - * - * The built-in `defaults` options are: - * - * - 'php' - Uses settings defined in your php.ini. - * - 'cake' - Saves session files in CakePHP's /tmp directory. - * - 'database' - Uses CakePHP's database sessions. - * - 'cache' - Use the Cache class to save sessions. - * - * To define a custom session handler, save it at src/Network/Session/.php. - * Make sure the class implements PHP's `SessionHandlerInterface` and set - * Session.handler to - * - * To use database sessions, load the SQL file located at config/Schema/sessions.sql - */ - 'Session' => [ - 'defaults' => 'php', - ], -]; diff --git a/cakephp/notejam/config/app.php b/cakephp/notejam/config/app.php deleted file mode 100644 index 3c36cdb55..000000000 --- a/cakephp/notejam/config/app.php +++ /dev/null @@ -1,313 +0,0 @@ - true, - - /** - * Configure basic information about the application. - * - * - namespace - The namespace to find app classes under. - * - encoding - The encoding used for HTML + database connections. - * - base - The base directory the app resides in. If false this - * will be auto detected. - * - dir - Name of app directory. - * - webroot - The webroot directory. - * - wwwRoot - The file path to webroot. - * - baseUrl - To configure CakePHP to *not* use mod_rewrite and to - * use CakePHP pretty URLs, remove these .htaccess - * files: - * /.htaccess - * /webroot/.htaccess - * And uncomment the baseUrl key below. - * - fullBaseUrl - A base URL to use for absolute links. - * - imageBaseUrl - Web path to the public images directory under webroot. - * - cssBaseUrl - Web path to the public css directory under webroot. - * - jsBaseUrl - Web path to the public js directory under webroot. - * - paths - Configure paths for non class based resources. Supports the - * `plugins`, `templates`, `locales` subkeys, which allow the definition of - * paths for plugins, view templates and locale files respectively. - */ - 'App' => [ - 'namespace' => 'App', - 'encoding' => 'UTF-8', - 'base' => false, - 'dir' => 'src', - 'webroot' => 'webroot', - 'wwwRoot' => WWW_ROOT, - // 'baseUrl' => env('SCRIPT_NAME'), - 'fullBaseUrl' => false, - 'imageBaseUrl' => 'img/', - 'cssBaseUrl' => 'css/', - 'jsBaseUrl' => 'js/', - 'paths' => [ - 'plugins' => [ROOT . DS . 'plugins' . DS], - 'templates' => [APP . 'Template' . DS], - 'locales' => [APP . 'Locale' . DS], - ], - ], - - /** - * Security and encryption configuration - * - * - salt - A random string used in security hashing methods. - * The salt value is also used as the encryption key. - * You should treat it as extremely sensitive data. - */ - 'Security' => [ - 'salt' => '5a7f2d28c26b43c1eca92cd2fabb1a18bbba049f43799f6399f701a0c3f074d3', - ], - - /** - * Apply timestamps with the last modified time to static assets (js, css, images). - * Will append a querystring parameter containing the time the file was modified. - * This is useful for busting browser caches. - * - * Set to true to apply timestamps when debug is true. Set to 'force' to always - * enable timestamping regardless of debug value. - */ - 'Asset' => [ - // 'timestamp' => true, - ], - - /** - * Configure the cache adapters. - */ - 'Cache' => [ - 'default' => [ - 'className' => 'File', - 'path' => CACHE, - ], - - /** - * Configure the cache used for general framework caching. Path information, - * object listings, and translation cache files are stored with this - * configuration. - */ - '_cake_core_' => [ - 'className' => 'File', - 'prefix' => 'myapp_cake_core_', - 'path' => CACHE . 'persistent/', - 'serialize' => true, - 'duration' => '+2 minutes', - ], - - /** - * Configure the cache for model and datasource caches. This cache - * configuration is used to store schema descriptions, and table listings - * in connections. - */ - '_cake_model_' => [ - 'className' => 'File', - 'prefix' => 'myapp_cake_model_', - 'path' => CACHE . 'models/', - 'serialize' => true, - 'duration' => '+2 minutes', - ], - ], - - /** - * Configure the Error and Exception handlers used by your application. - * - * By default errors are displayed using Debugger, when debug is true and logged - * by Cake\Log\Log when debug is false. - * - * In CLI environments exceptions will be printed to stderr with a backtrace. - * In web environments an HTML page will be displayed for the exception. - * With debug true, framework errors like Missing Controller will be displayed. - * When debug is false, framework errors will be coerced into generic HTTP errors. - * - * Options: - * - * - `errorLevel` - int - The level of errors you are interested in capturing. - * - `trace` - boolean - Whether or not backtraces should be included in - * logged errors/exceptions. - * - `log` - boolean - Whether or not you want exceptions logged. - * - `exceptionRenderer` - string - The class responsible for rendering - * uncaught exceptions. If you choose a custom class you should place - * the file for that class in src/Error. This class needs to implement a - * render method. - * - `skipLog` - array - List of exceptions to skip for logging. Exceptions that - * extend one of the listed exceptions will also be skipped for logging. - * E.g.: - * `'skipLog' => ['Cake\Network\Exception\NotFoundException', 'Cake\Network\Exception\UnauthorizedException']` - */ - 'Error' => [ - 'errorLevel' => E_ALL & ~E_DEPRECATED, - 'exceptionRenderer' => 'Cake\Error\ExceptionRenderer', - 'skipLog' => [], - 'log' => true, - 'trace' => true, - ], - - /** - * Email configuration. - * - * You can configure email transports and email delivery profiles here. - * - * By defining transports separately from delivery profiles you can easily - * re-use transport configuration across multiple profiles. - * - * You can specify multiple configurations for production, development and - * testing. - * - * ### Configuring transports - * - * Each transport needs a `className`. Valid options are as follows: - * - * Mail - Send using PHP mail function - * Smtp - Send using SMTP - * Debug - Do not send the email, just return the result - * - * You can add custom transports (or override existing transports) by adding the - * appropriate file to src/Network/Email. Transports should be named - * 'YourTransport.php', where 'Your' is the name of the transport. - * - * ### Configuring delivery profiles - * - * Delivery profiles allow you to predefine various properties about email - * messages from your application and give the settings a name. This saves - * duplication across your application and makes maintenance and development - * easier. Each profile accepts a number of keys. See `Cake\Network\Email\Email` - * for more information. - */ - 'EmailTransport' => [ - 'default' => [ - 'className' => 'Mail', - // The following keys are used in SMTP transports - 'host' => 'localhost', - 'port' => 25, - 'timeout' => 30, - 'username' => 'user', - 'password' => 'secret', - 'client' => null, - 'tls' => null, - ], - ], - - 'Email' => [ - 'default' => [ - 'transport' => 'default', - 'from' => 'you@localhost', - //'charset' => 'utf-8', - //'headerCharset' => 'utf-8', - ], - ], - - /** - * Connection information used by the ORM to connect - * to your application's datastores. - * Drivers include Mysql Postgres Sqlite Sqlserver - * See vendor\cakephp\cakephp\src\Database\Driver for complete list - */ - 'Datasources' => [ - 'default' => [ - 'className' => 'Cake\Database\Connection', - 'driver' => 'Cake\Database\Driver\Sqlite', - 'persistent' => false, - 'database' => 'notejam.db', - 'encoding' => 'utf8', - 'timezone' => 'UTC', - 'cacheMetadata' => true, - - /** - * Set identifier quoting to true if you are using reserved words or - * special characters in your table or column names. Enabling this - * setting will result in queries built using the Query Builder having - * identifiers quoted when creating SQL. It should be noted that this - * decreases performance because each query needs to be traversed and - * manipulated before being executed. - */ - 'quoteIdentifiers' => false, - - /** - * During development, if using MySQL < 5.6, uncommenting the - * following line could boost the speed at which schema metadata is - * fetched from the database. It can also be set directly with the - * mysql configuration directive 'innodb_stats_on_metadata = 0' - * which is the recommended value in production environments - */ - //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'], - ], - - /** - * The test connection is used during the test suite. - */ - 'test' => [ - 'className' => 'Cake\Database\Connection', - 'driver' => 'Cake\Database\Driver\Sqlite', - 'persistent' => false, - 'database' => 'tests/notejam.db', - 'encoding' => 'utf8', - 'timezone' => 'UTC', - 'cacheMetadata' => true, - 'quoteIdentifiers' => false, - //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'], - ], - ], - - /** - * Configures logging options - */ - 'Log' => [ - 'debug' => [ - 'className' => 'Cake\Log\Engine\FileLog', - 'path' => LOGS, - 'file' => 'debug', - 'levels' => ['notice', 'info', 'debug'], - ], - 'error' => [ - 'className' => 'Cake\Log\Engine\FileLog', - 'path' => LOGS, - 'file' => 'error', - 'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'], - ], - ], - - /** - * - * Session configuration. - * - * Contains an array of settings to use for session configuration. The - * `defaults` key is used to define a default preset to use for sessions, any - * settings declared here will override the settings of the default config. - * - * ## Options - * - * - `cookie` - The name of the cookie to use. Defaults to 'CAKEPHP'. - * - `cookiePath` - The url path for which session cookie is set. Maps to the - * `session.cookie_path` php.ini config. Defaults to base path of app. - * - `timeout` - The time in minutes the session should be valid for. - * Pass 0 to disable checking timeout. - * - `defaults` - The default configuration set to use as a basis for your session. - * There are four built-in options: php, cake, cache, database. - * - `handler` - Can be used to enable a custom session handler. Expects an - * array with at least the `engine` key, being the name of the Session engine - * class to use for managing the session. CakePHP bundles the `CacheSession` - * and `DatabaseSession` engines. - * - `ini` - An associative array of additional ini values to set. - * - * The built-in `defaults` options are: - * - * - 'php' - Uses settings defined in your php.ini. - * - 'cake' - Saves session files in CakePHP's /tmp directory. - * - 'database' - Uses CakePHP's database sessions. - * - 'cache' - Use the Cache class to save sessions. - * - * To define a custom session handler, save it at src/Network/Session/.php. - * Make sure the class implements PHP's `SessionHandlerInterface` and set - * Session.handler to - * - * To use database sessions, load the SQL file located at config/Schema/sessions.sql - */ - 'Session' => [ - 'defaults' => 'php', - ], -]; diff --git a/cakephp/notejam/config/bootstrap.php b/cakephp/notejam/config/bootstrap.php deleted file mode 100644 index 62d662ece..000000000 --- a/cakephp/notejam/config/bootstrap.php +++ /dev/null @@ -1,202 +0,0 @@ -getMessage() . "\n"); -} - -// Load an environment local configuration file. -// You can use a file like app_local.php to provide local overrides to your -// shared configuration. -//Configure::load('app_local', 'default'); - -// When debug = false the metadata cache should last -// for a very very long time, as we don't want -// to refresh the cache while users are doing requests. -if (!Configure::read('debug')) { - Configure::write('Cache._cake_model_.duration', '+1 years'); - Configure::write('Cache._cake_core_.duration', '+1 years'); -} - -/** - * Set server timezone to UTC. You can change it to another timezone of your - * choice but using UTC makes time calculations / conversions easier. - */ -date_default_timezone_set('UTC'); - -/** - * Configure the mbstring extension to use the correct encoding. - */ -mb_internal_encoding(Configure::read('App.encoding')); - -/** - * Set the default locale. This controls how dates, number and currency is - * formatted and sets the default language to use for translations. - */ -ini_set('intl.default_locale', 'en_US'); - -/** - * Register application error and exception handlers. - */ -$isCli = php_sapi_name() === 'cli'; -if ($isCli) { - (new ConsoleErrorHandler(Configure::read('Error')))->register(); -} else { - (new ErrorHandler(Configure::read('Error')))->register(); -} - -// Include the CLI bootstrap overrides. -if ($isCli) { - require __DIR__ . '/bootstrap_cli.php'; -} - -/** - * Set the full base URL. - * This URL is used as the base of all absolute links. - * - * If you define fullBaseUrl in your config file you can remove this. - */ -if (!Configure::read('App.fullBaseUrl')) { - $s = null; - if (env('HTTPS')) { - $s = 's'; - } - - $httpHost = env('HTTP_HOST'); - if (isset($httpHost)) { - Configure::write('App.fullBaseUrl', 'http' . $s . '://' . $httpHost); - } - unset($httpHost, $s); -} - -Cache::config(Configure::consume('Cache')); -ConnectionManager::config(Configure::consume('Datasources')); -Email::configTransport(Configure::consume('EmailTransport')); -Email::config(Configure::consume('Email')); -Log::config(Configure::consume('Log')); -Security::salt(Configure::consume('Security.salt')); - -/** - * The default crypto extension in 3.0 is OpenSSL. - * If you are migrating from 2.x uncomment this code to - * use a more compatible Mcrypt based implementation - */ -// Security::engine(new \Cake\Utility\Crypto\Mcrypt()); - -/** - * Setup detectors for mobile and tablet. - */ -Request::addDetector('mobile', function ($request) { - $detector = new \Detection\MobileDetect(); - return $detector->isMobile(); -}); -Request::addDetector('tablet', function ($request) { - $detector = new \Detection\MobileDetect(); - return $detector->isTablet(); -}); - -/** - * Custom Inflector rules, can be set to correctly pluralize or singularize - * table, model, controller names or whatever other string is passed to the - * inflection functions. - * - * Inflector::rules('plural', ['/^(inflect)or$/i' => '\1ables']); - * Inflector::rules('irregular', ['red' => 'redlings']); - * Inflector::rules('uninflected', ['dontinflectme']); - * Inflector::rules('transliteration', ['/å/' => 'aa']); - */ - -/** - * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call - * Uncomment one of the lines below, as you need. make sure you read the documentation on Plugin to use more - * advanced ways of loading plugins - * - * Plugin::loadAll(); // Loads all plugins at once - * Plugin::load('Migrations'); //Loads a single plugin named Migrations - * - */ - -Plugin::load('Migrations'); - -// Only try to load DebugKit in development mode -// Debug Kit should not be installed on a production system -if (Configure::read('debug')) { - Plugin::load('DebugKit', ['bootstrap' => true]); -} - -/** - * Connect middleware/dispatcher filters. - */ -DispatcherFactory::add('Asset'); -DispatcherFactory::add('Routing'); -DispatcherFactory::add('ControllerFactory'); - -/** - * Enable default locale format parsing. - * This is needed for matching the auto-localized string output of Time() class when parsing dates. - */ -Type::build('datetime')->useLocaleParser(); diff --git a/cakephp/notejam/config/bootstrap_cli.php b/cakephp/notejam/config/bootstrap_cli.php deleted file mode 100644 index 13cf979fa..000000000 --- a/cakephp/notejam/config/bootstrap_cli.php +++ /dev/null @@ -1,32 +0,0 @@ -connect('/', ['controller' => 'Notes', 'action' => 'index'], ['_name' => 'index']); - - $routes->connect('/signup', ['controller' => 'Users', 'action' => 'signup'], ['_name' => 'signup']); - $routes->connect('/signin', ['controller' => 'Users', 'action' => 'signin'], ['_name' => 'signin']); - $routes->connect('/signout', ['controller' => 'Users', 'action' => 'signout'], ['_name' => 'signout']); - $routes->connect('/settings', ['controller' => 'Users', 'action' => 'settings'], ['_name' => 'settings']); - $routes->connect('/forgot-password', ['controller' => 'Users', 'action' => 'forgotpassword'], ['_name' => 'forgot_password']); - - - $routes->scope('/pads', ['controller' => 'Pads'], function($routes) { - $routes->connect('/create', ['controller' => 'Pads', 'action' => 'create'], ['_name' => 'create_pad']); - $routes->connect('/:id/edit', ['controller' => 'Pads', 'action' => 'edit'], ['id' => '\d+', 'pass' => ['id'], '_name' => 'edit_pad']); - $routes->connect('/:id/delete', ['controller' => 'Pads', 'action' => 'delete'], ['id' => '\d+', 'pass' => ['id'], '_name' => 'delete_pad']); - $routes->connect('/:id', ['controller' => 'Pads', 'action' => 'view'], ['id' => '\d+', 'pass' => ['id'], '_name' => 'view_pad']); - }); - - $routes->scope('/notes', ['controller' => 'Notes'], function($routes) { - $routes->connect('/create', ['controller' => 'Notes', 'action' => 'create'], ['_name' => 'create_note']); - $routes->connect('/:id/edit', ['controller' => 'Notes', 'action' => 'edit'], ['id' => '\d+', 'pass' => ['id'], '_name' => 'edit_note']); - $routes->connect('/:id', ['controller' => 'Notes', 'action' => 'view'], ['id' => '\d+', 'pass' => ['id'], '_name' => 'view_note']); - $routes->connect('/:id/delete', ['controller' => 'Notes', 'action' => 'delete'], ['id' => '\d+', 'pass' => ['id'], '_name' => 'delete_note']); - }); -}); - -/** - * Load all plugin routes. See the Plugin documentation on - * how to customize the loading of plugin routes. - */ -Plugin::routes(); diff --git a/cakephp/notejam/config/schema/i18n.sql b/cakephp/notejam/config/schema/i18n.sql deleted file mode 100644 index 66a42bd19..000000000 --- a/cakephp/notejam/config/schema/i18n.sql +++ /dev/null @@ -1,27 +0,0 @@ -# $Id$ -# -# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) -# -# Licensed under The MIT License -# For full copyright and license information, please see the LICENSE.txt -# Redistributions of files must retain the above copyright notice. -# MIT License (http://www.opensource.org/licenses/mit-license.php) - -CREATE TABLE i18n ( - id int(10) NOT NULL auto_increment, - locale varchar(6) NOT NULL, - model varchar(255) NOT NULL, - foreign_key int(10) NOT NULL, - field varchar(255) NOT NULL, - content mediumtext, - PRIMARY KEY (id), -# UNIQUE INDEX I18N_LOCALE_FIELD(locale, model, foreign_key, field), -# INDEX I18N_LOCALE_ROW(locale, model, foreign_key), -# INDEX I18N_LOCALE_MODEL(locale, model), -# INDEX I18N_FIELD(model, foreign_key, field), -# INDEX I18N_ROW(model, foreign_key), - INDEX locale (locale), - INDEX model (model), - INDEX row_id (foreign_key), - INDEX field (field) -); \ No newline at end of file diff --git a/cakephp/notejam/config/schema/sessions.sql b/cakephp/notejam/config/schema/sessions.sql deleted file mode 100644 index 434e1aa1c..000000000 --- a/cakephp/notejam/config/schema/sessions.sql +++ /dev/null @@ -1,17 +0,0 @@ -# $Id$ -# -# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) -# 1785 E. Sahara Avenue, Suite 490-204 -# Las Vegas, Nevada 89104 -# -# Licensed under The MIT License -# For full copyright and license information, please see the LICENSE.txt -# Redistributions of files must retain the above copyright notice. -# MIT License (http://www.opensource.org/licenses/mit-license.php) - -CREATE TABLE sessions ( - id varchar(40) NOT NULL default '', - data text, - expires INT(11) NOT NULL, - PRIMARY KEY (id) -); diff --git a/cakephp/notejam/index.php b/cakephp/notejam/index.php deleted file mode 100644 index fc5e39ccb..000000000 --- a/cakephp/notejam/index.php +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - ./tests/TestCase - - - - - - - - - - - - - - diff --git a/cakephp/notejam/src/Console/Installer.php b/cakephp/notejam/src/Console/Installer.php deleted file mode 100644 index 06d1115f7..000000000 --- a/cakephp/notejam/src/Console/Installer.php +++ /dev/null @@ -1,192 +0,0 @@ -getIO(); - - $rootDir = dirname(dirname(__DIR__)); - - static::createAppConfig($rootDir, $io); - static::createWritableDirectories($rootDir, $io); - - // ask if the permissions should be changed - if ($io->isInteractive()) { - $validator = function ($arg) { - if (in_array($arg, ['Y', 'y', 'N', 'n'])) { - return $arg; - } - throw new Exception('This is not a valid answer. Please choose Y or n.'); - }; - $setFolderPermissions = $io->askAndValidate( - 'Set Folder Permissions ? (Default to Y) [Y,n]? ', - $validator, - 10, - 'Y' - ); - - if (in_array($setFolderPermissions, ['Y', 'y'])) { - static::setFolderPermissions($rootDir, $io); - } - } else { - static::setFolderPermissions($rootDir, $io); - } - - static::setSecuritySalt($rootDir, $io); - - if (class_exists('\Cake\Codeception\Console\Installer')) { - \Cake\Codeception\Console\Installer::customizeCodeceptionBinary($event); - } - } - - /** - * Create the config/app.php file if it does not exist. - * - * @param string $dir The application's root directory. - * @param \Composer\IO\IOInterface $io IO interface to write to console. - * @return void - */ - public static function createAppConfig($dir, $io) - { - $appConfig = $dir . '/config/app.php'; - $defaultConfig = $dir . '/config/app.default.php'; - if (!file_exists($appConfig)) { - copy($defaultConfig, $appConfig); - $io->write('Created `config/app.php` file'); - } - } - - /** - * Create the `logs` and `tmp` directories. - * - * @param string $dir The application's root directory. - * @param \Composer\IO\IOInterface $io IO interface to write to console. - * @return void - */ - public static function createWritableDirectories($dir, $io) - { - $paths = [ - 'logs', - 'tmp', - 'tmp/cache', - 'tmp/cache/models', - 'tmp/cache/persistent', - 'tmp/cache/views', - 'tmp/sessions', - 'tmp/tests' - ]; - - foreach ($paths as $path) { - $path = $dir . '/' . $path; - if (!file_exists($path)) { - mkdir($path); - $io->write('Created `' . $path . '` directory'); - } - } - } - - /** - * Set globally writable permissions on the "tmp" and "logs" directory. - * - * This is not the most secure default, but it gets people up and running quickly. - * - * @param string $dir The application's root directory. - * @param \Composer\IO\IOInterface $io IO interface to write to console. - * @return void - */ - public static function setFolderPermissions($dir, $io) - { - // Change the permissions on a path and output the results. - $changePerms = function ($path, $perms, $io) { - // Get current permissions in decimal format so we can bitmask it. - $currentPerms = octdec(substr(sprintf('%o', fileperms($path)), -4)); - if (($currentPerms & $perms) == $perms) { - return; - } - - $res = chmod($path, $currentPerms | $perms); - if ($res) { - $io->write('Permissions set on ' . $path); - } else { - $io->write('Failed to set permissions on ' . $path); - } - }; - - $walker = function ($dir, $perms, $io) use (&$walker, $changePerms) { - $files = array_diff(scandir($dir), ['.', '..']); - foreach ($files as $file) { - $path = $dir . '/' . $file; - - if (!is_dir($path)) { - continue; - } - - $changePerms($path, $perms, $io); - $walker($path, $perms, $io); - } - }; - - $worldWritable = bindec('0000000111'); - $walker($dir . '/tmp', $worldWritable, $io); - $changePerms($dir . '/tmp', $worldWritable, $io); - $changePerms($dir . '/logs', $worldWritable, $io); - } - - /** - * Set the security.salt value in the application's config file. - * - * @param string $dir The application's root directory. - * @param \Composer\IO\IOInterface $io IO interface to write to console. - * @return void - */ - public static function setSecuritySalt($dir, $io) - { - $config = $dir . '/config/app.php'; - $content = file_get_contents($config); - - $newKey = hash('sha256', $dir . php_uname() . microtime(true)); - $content = str_replace('__SALT__', $newKey, $content, $count); - - if ($count == 0) { - $io->write('No Security.salt placeholder to replace.'); - return; - } - - $result = file_put_contents($config, $content); - if ($result) { - $io->write('Updated Security.salt value in config/app.php'); - return; - } - $io->write('Unable to update Security.salt value.'); - } -} diff --git a/cakephp/notejam/src/Controller/AppController.php b/cakephp/notejam/src/Controller/AppController.php deleted file mode 100644 index 2207fda8d..000000000 --- a/cakephp/notejam/src/Controller/AppController.php +++ /dev/null @@ -1,88 +0,0 @@ -loadComponent('Flash'); - $this->loadComponent('Auth', [ - 'authenticate' => [ - 'Form' => [ - 'fields' => [ - 'username' => 'email', - 'password' => 'password' - ] - ] - ], - 'loginAction' => [ - 'controller' => 'Users', - 'action' => 'signin' - ] - ]); - $this->Auth->allow(['signup', 'forgotpassword']); - } - - /** - * Get authenticated user - * - * @return App\Model\Entity\User - */ - protected function getUser() - { - $id = $this->request->session()->read('Auth.User.id'); - return TableRegistry::get('Users')->get($id, [ - 'contain' => ['Pads', 'Notes'] - ]); - } - - /** - * Build order statetment - * - * @param string $order Order param - * @return array - */ - public function buildOrderBy($order) - { - $config = [ - 'name' => ['Notes.name' => 'ASC'], - '-name' => ['Notes.name' => 'DESC'], - 'updated_at' => ['Notes.updated_at' => 'ASC'], - '-updated_at' => ['Notes.updated_at' => 'DESC'], - ]; - return $config[$order ? $order : 'updated_at']; - } -} diff --git a/cakephp/notejam/src/Controller/NotesController.php b/cakephp/notejam/src/Controller/NotesController.php deleted file mode 100644 index 18740fc06..000000000 --- a/cakephp/notejam/src/Controller/NotesController.php +++ /dev/null @@ -1,138 +0,0 @@ -viewBuilder()->layout('user'); - } - - /** - * Index method - * - * @return void - */ - public function index() - { - $this->set( - 'notes', - $this->Notes->find('all', ['contain' => 'Pads']) - ->where(['Notes.user_id' => $this->getUser()->id]) - ->order($this->buildOrderBy($this->request->query('order'))) - ); - } - - /** - * View note - * - * @param string|null $id Note id. - * @return void - * @throws \Cake\Network\Exception\NotFoundException When record not found. - */ - public function view($id = null) - { - $note = $this->getNote($id); - $this->set('note', $note); - } - - /** - * Create note action - * - * @return void Redirects on successful add, renders view otherwise. - */ - public function create() - { - $note = $this->Notes->newEntity(); - if ($this->request->is('post')) { - $note = $this->Notes->patchEntity($note, array_merge( - $this->request->data, - ['user_id' => $this->getUser()->id] - )); - if ($this->Notes->save($note)) { - $this->Flash->success(__('The note has been saved.')); - return $this->redirect(['action' => 'index']); - } else { - $this->Flash->error(__('The note could not be saved. Please, try again.')); - } - } - // current pad - $pad = $this->request->query('pad'); - - $pads = collection($this->getUser()->pads)->combine('id', 'name')->toArray(); - $this->set(compact('note', 'pads', 'pad')); - } - - - /** - * Edit note - * - * @param string|null $id Note id. - * @return void Redirects on successful edit, renders view otherwise. - * @throws \Cake\Network\Exception\NotFoundException When record not found. - */ - public function edit($id = null) - { - $note = $this->getNote($id); - if ($this->request->is(['patch', 'post', 'put'])) { - $note = $this->Notes->patchEntity($note, $this->request->data); - if ($this->Notes->save($note)) { - $this->Flash->success(__('The note has been saved.')); - return $this->redirect(['action' => 'view', 'id' => $note->id]); - } else { - $this->Flash->error(__('The note could not be saved. Please, try again.')); - } - } - $pads = collection($this->getUser()->pads)->combine('id', 'name')->toArray(); - $this->set(compact('note', 'pads')); - } - - /** - * Delete method - * - * @param string|null $id Note id. - * @return void Redirects to index. - * @throws \Cake\Network\Exception\NotFoundException When record not found. - */ - public function delete($id = null) - { - $note = $this->getNote($id); - if ($this->request->is('post')) { - $this->Notes->delete($note); - $this->Flash->success(__('The note has been deleted.')); - return $this->redirect(['action' => 'index']); - } - $this->set(compact('note')); - } - - /** - * Get note - * - * @param int $id Note id - * @return Note - */ - protected function getNote($id) - { - return TableRegistry::get('Notes')->find() - ->contain(['Pads', 'Users']) - ->where(['Notes.id' => $id]) - ->where(['Notes.user_id' => $this->getUser()->id]) - ->firstOrFail(); - } -} diff --git a/cakephp/notejam/src/Controller/PadsController.php b/cakephp/notejam/src/Controller/PadsController.php deleted file mode 100644 index 246b98430..000000000 --- a/cakephp/notejam/src/Controller/PadsController.php +++ /dev/null @@ -1,121 +0,0 @@ -viewBuilder()->layout('user'); - } - - /** - * View pad - * - * @param string|null $id Pad id. - * @return void - * @throws \Cake\Network\Exception\NotFoundException When record not found. - */ - public function view($id = null) - { - $pad = $this->getPad($id); - $notes = TableRegistry::get('Notes')->find('all', ['contain' => 'Pads']) - ->where(['Notes.pad_id' => $id]) - ->where(['Notes.user_id' => $this->getUser()->id]) - ->order($this->buildOrderBy($this->request->query('order'))); - - $this->set('pad', $pad); - $this->set('notes', $notes); - } - - /** - * Create a pad - * - * @return void Redirects on successful add, renders view otherwise. - */ - public function create() - { - $pad = $this->Pads->newEntity(); - if ($this->request->is('post')) { - $pad = $this->Pads->patchEntity($pad, array_merge( - $this->request->data, - ['user_id' => $this->Auth->user('id')] - )); - if ($this->Pads->save($pad)) { - $this->Flash->success(__('The pad has been created.')); - return $this->redirect(['action' => 'view', 'id' => $pad->id]); - } - } - $this->set(compact('pad')); - } - - /** - * Edit pad - * - * @param string|null $id Pad id. - * @return void Redirects on successful edit, renders view otherwise. - * @throws \Cake\Network\Exception\NotFoundException When record not found. - */ - public function edit($id = null) - { - $pad = $this->getPad($id); - if ($this->request->is(['patch', 'post', 'put'])) { - $pad = $this->Pads->patchEntity($pad, $this->request->data); - if ($this->Pads->save($pad)) { - $this->Flash->success(__('The pad has been saved.')); - return $this->redirect(['action' => 'view', 'id' => $pad->id]); - } else { - $this->Flash->error(__('The pad could not be saved. Please, try again.')); - } - } - $this->set(compact('pad')); - } - - /** - * Delete method - * - * @param string|null $id Pad id. - * @return void Redirects to index. - * @throws \Cake\Network\Exception\NotFoundException When record not found. - */ - public function delete($id = null) - { - $pad = $this->getPad($id); - if ($this->request->is('post')) { - $this->Pads->delete($pad); - $this->Flash->success(__('The pad has been deleted.')); - return $this->redirect(['_name' => 'index']); - } - $this->set(compact('pad')); - } - - /** - * Get pad - * - * @param int $id Pad id - * @return Pad - */ - protected function getPad($id) - { - return TableRegistry::get('Pads')->find() - ->contain(['Users']) - ->where(['Pads.id' => $id]) - ->where(['Pads.user_id' => $this->getUser()->id]) - ->firstOrFail(); - } -} diff --git a/cakephp/notejam/src/Controller/UsersController.php b/cakephp/notejam/src/Controller/UsersController.php deleted file mode 100644 index 00b1afb37..000000000 --- a/cakephp/notejam/src/Controller/UsersController.php +++ /dev/null @@ -1,145 +0,0 @@ -viewBuilder()->layout('anonymous'); - } - - /** - * Signup action - * - * @return void Redirects on successful signup, renders errors otherwise. - */ - public function signup() - { - $user = $this->Users->newEntity(); - if ($this->request->is('post')) { - $user = $this->Users->patchEntity($user, $this->request->data); - if ($this->Users->save($user)) { - $this->Flash->success(__('Now you can signin')); - return $this->redirect(['action' => 'signin']); - } else { - $this->Flash->error(__('The user could not be saved. Please, try again.')); - } - } - $this->set(compact('user')); - } - - /** - * Signin action - * - * @return void Redirects on successful signup, renders errors otherwise. - */ - public function signin() - { - if ($this->request->is('post')) { - $user = $this->Auth->identify(); - if ($user) { - $this->Auth->setUser($user); - return $this->redirect($this->Auth->redirectUrl()); - } - $this->Flash->error('Your username or password is incorrect.'); - } - } - - /** - * Sign out action - * - * @return void Redirects on successful signin - */ - public function signout() - { - return $this->redirect($this->Auth->logout()); - } - - /** - * Account settings action - * - * @return void - */ - public function settings() - { - $settings = new SettingsForm(); - if ($this->request->is('post') && - $settings->validate($this->request->data)) { - - $user = $this->getUser(); - if ($user->checkPassword($this->request->data['current_password'])) { - $user->password = $this->request->data['new_password']; - $this->Users->save($user); - $this->Flash->success('Password is successfully changed.'); - return $this->redirect(['_name' => 'index']); - } - $this->Flash->error('Current password is not correct.'); - } - $this->set(compact('settings')); - } - - /** - * Forgot password action - * - * @return void - */ - public function forgotPassword() - { - $form = new ForgotPasswordForm(); - if ($this->request->is('post') && - $form->validate($this->request->data)) { - - $user = $this->Users->find() - ->where(['email' => $this->request->data['email']]) - ->first(); - if ($user) { - $this->resetPassword($user); - $this->Flash->success('New temp password is sent to your inbox.'); - return $this->redirect(['_name' => 'index']); - } - $this->Flash->error('User with given email does not exist.'); - } - $this->set(compact('form')); - } - - /** - * Reset user's password - * - * @param App\Model\Entity\User $user User - * @return void - */ - protected function resetPassword($user) - { - // primitive way to generate temporary password - $user->password = $password = substr( - sha1(time() . rand() . Configure::read('Security.salt')), 0, 8 - ); - $this->Users->save($user); - - Email::deliver( - $user->email, - "New notejam password", - "Your new temporary password is {$password}. - We recommend you to change it after signing in.", - ["from" => "noreply@notejamapp.com", "transport" => "default"] - ); - } -} diff --git a/cakephp/notejam/src/Form/ForgotPasswordForm.php b/cakephp/notejam/src/Form/ForgotPasswordForm.php deleted file mode 100644 index 5b7a3d2c8..000000000 --- a/cakephp/notejam/src/Form/ForgotPasswordForm.php +++ /dev/null @@ -1,35 +0,0 @@ -addField('email', ['type' => 'string']); - } - - /** - * Default validation rules. - * - * @param \Cake\Validation\Validator $validator Validator instance. - * @return \Cake\Validation\Validator - */ - protected function _buildValidator(Validator $validator) - { - return $validator - ->requirePresence('email', 'create') - ->add('email', 'valid', ['rule' => 'email']); - } -} - diff --git a/cakephp/notejam/src/Form/SettingsForm.php b/cakephp/notejam/src/Form/SettingsForm.php deleted file mode 100644 index ef7391a58..000000000 --- a/cakephp/notejam/src/Form/SettingsForm.php +++ /dev/null @@ -1,47 +0,0 @@ -addField('current_password', ['type' => 'password']) - ->addField('new_password', ['type' => 'password']) - ->addField('confirm_new_password', ['type' => 'password']); - } - - /** - * Default validation rules. - * - * @param \Cake\Validation\Validator $validator Validator instance. - * @return \Cake\Validation\Validator - */ - protected function _buildValidator(Validator $validator) - { - return $validator - ->requirePresence('current_password', 'create') - ->notEmpty('current_password') - ->requirePresence('new_password', 'create') - ->notEmpty('new_password') - ->add('new_password', [ - 'length' => [ - 'rule' => ['minLength', 6] - ], - 'compare' => [ - 'rule' => ['compareWith', 'confirm_new_password'], - 'message' => 'Passwords do not match' - ], - ]); - } -} diff --git a/cakephp/notejam/src/Model/Entity/Note.php b/cakephp/notejam/src/Model/Entity/Note.php deleted file mode 100644 index 56c772790..000000000 --- a/cakephp/notejam/src/Model/Entity/Note.php +++ /dev/null @@ -1,41 +0,0 @@ - true, - 'user_id' => true, - 'name' => true, - 'text' => true, - 'created_at' => true, - 'updated_at' => true, - 'pad' => true, - 'user' => true, - ]; - - /** - * Get pretty date like "Yesterday", "2 days ago", "etc" - * - * @return string - */ - public function getPrettyDate() - { - $time = new Time($this->_properties['updated_at']); - return $time->timeAgoInWords([ - 'format' => 'd' - ]); - } -} diff --git a/cakephp/notejam/src/Model/Entity/Pad.php b/cakephp/notejam/src/Model/Entity/Pad.php deleted file mode 100644 index 30163e110..000000000 --- a/cakephp/notejam/src/Model/Entity/Pad.php +++ /dev/null @@ -1,23 +0,0 @@ - true, - 'user_id' => true, - 'user' => true, - 'notes' => true, - ]; -} diff --git a/cakephp/notejam/src/Model/Entity/User.php b/cakephp/notejam/src/Model/Entity/User.php deleted file mode 100644 index 14dc77f42..000000000 --- a/cakephp/notejam/src/Model/Entity/User.php +++ /dev/null @@ -1,50 +0,0 @@ - true, - 'password' => true, - 'notes' => true, - 'pads' => true, - ]; - - - /** - * Password setter - * - * @param string $value password - * @return string - */ - protected function _setPassword($value) - { - $hasher = new DefaultPasswordHasher(); - return $hasher->hash($value); - } - - /** - * Check if passwords matches - * - * @param string $password Password - * @return boolean - */ - public function checkPassword($password) - { - $hasher = new DefaultPasswordHasher(); - return $hasher->check($password, $this->password); - } -} diff --git a/cakephp/notejam/src/Model/Table/NotesTable.php b/cakephp/notejam/src/Model/Table/NotesTable.php deleted file mode 100644 index bcf9415a2..000000000 --- a/cakephp/notejam/src/Model/Table/NotesTable.php +++ /dev/null @@ -1,82 +0,0 @@ -table('notes'); - $this->displayField('name'); - $this->primaryKey('id'); - $this->addBehavior('Timestamp', [ - 'events' => [ - 'Model.beforeSave' => [ - 'created_at' => 'new', - 'updated_at' => 'always' - ] - ] - ]); - $this->belongsTo('Pads', [ - 'foreignKey' => 'pad_id' - ]); - $this->belongsTo('Users', [ - 'foreignKey' => 'user_id', - 'joinType' => 'INNER' - ]); - } - - /** - * Default validation rules. - * - * @param \Cake\Validation\Validator $validator Validator instance. - * @return \Cake\Validation\Validator - */ - public function validationDefault(Validator $validator) - { - $validator - ->add('id', 'valid', ['rule' => 'numeric']) - ->allowEmpty('id', 'create'); - - $validator - ->requirePresence('name', 'create') - ->notEmpty('name'); - - $validator - ->requirePresence('text', 'create') - ->notEmpty('text'); - - return $validator; - } - - /** - * Returns a rules checker object that will be used for validating - * application integrity. - * - * @param \Cake\ORM\RulesChecker $rules The rules object to be modified. - * @return \Cake\ORM\RulesChecker - */ - public function buildRules(RulesChecker $rules) - { - $rules->add($rules->existsIn(['user_id'], 'Users')); - return $rules; - } -} diff --git a/cakephp/notejam/src/Model/Table/PadsTable.php b/cakephp/notejam/src/Model/Table/PadsTable.php deleted file mode 100644 index 921e2a328..000000000 --- a/cakephp/notejam/src/Model/Table/PadsTable.php +++ /dev/null @@ -1,70 +0,0 @@ -table('pads'); - $this->displayField('name'); - $this->primaryKey('id'); - $this->belongsTo('Users', [ - 'foreignKey' => 'user_id', - 'joinType' => 'INNER' - ]); - $this->hasMany('Notes', [ - 'foreignKey' => 'pad_id' - ]); - } - - /** - * Default validation rules. - * - * @param \Cake\Validation\Validator $validator Validator instance. - * @return \Cake\Validation\Validator - */ - public function validationDefault(Validator $validator) - { - $validator - ->add('id', 'valid', ['rule' => 'numeric']) - ->allowEmpty('id', 'create'); - - $validator - ->requirePresence('name', 'create') - ->notEmpty('name'); - - return $validator; - } - - /** - * Returns a rules checker object that will be used for validating - * application integrity. - * - * @param \Cake\ORM\RulesChecker $rules The rules object to be modified. - * @return \Cake\ORM\RulesChecker - */ - public function buildRules(RulesChecker $rules) - { - $rules->add($rules->existsIn(['user_id'], 'Users')); - return $rules; - } -} diff --git a/cakephp/notejam/src/Model/Table/UsersTable.php b/cakephp/notejam/src/Model/Table/UsersTable.php deleted file mode 100644 index ba359d614..000000000 --- a/cakephp/notejam/src/Model/Table/UsersTable.php +++ /dev/null @@ -1,80 +0,0 @@ -table('users'); - $this->displayField('id'); - $this->primaryKey('id'); - $this->hasMany('Notes', [ - 'foreignKey' => 'user_id' - ]); - $this->hasMany('Pads', [ - 'foreignKey' => 'user_id' - ]); - } - - /** - * Default validation rules. - * - * @param \Cake\Validation\Validator $validator Validator instance. - * @return \Cake\Validation\Validator - */ - public function validationDefault(Validator $validator) - { - $validator - ->add('email', 'valid', ['rule' => 'email']) - ->requirePresence('email', 'create') - ->notEmpty('email'); - - $validator - ->requirePresence('password', 'create') - ->notEmpty('password') - ->add('password', [ - 'length' => [ - 'rule' => ['minLength', 6] - ], - 'compare' => [ - 'rule' => ['compareWith', 'confirm_password'], - 'message' => 'Passwords do not match' - ], - ]); - - - return $validator; - } - - /** - * Returns a rules checker object that will be used for validating - * application integrity. - * - * @param \Cake\ORM\RulesChecker $rules The rules object to be modified. - * @return \Cake\ORM\RulesChecker - */ - public function buildRules(RulesChecker $rules) - { - $rules->add($rules->isUnique(['email'])); - return $rules; - } -} diff --git a/cakephp/notejam/src/Shell/ConsoleShell.php b/cakephp/notejam/src/Shell/ConsoleShell.php deleted file mode 100644 index 97c797443..000000000 --- a/cakephp/notejam/src/Shell/ConsoleShell.php +++ /dev/null @@ -1,79 +0,0 @@ -err('Unable to load Psy\Shell.'); - $this->err(''); - $this->err('Make sure you have installed psysh as a dependency,'); - $this->err('and that Psy\Shell is registered in your autoloader.'); - $this->err(''); - $this->err('If you are using composer run'); - $this->err(''); - $this->err('$ php composer.phar require --dev psy/psysh'); - $this->err(''); - return 1; - } - - $this->out("You can exit with `CTRL-C` or `exit`"); - $this->out(''); - - Log::drop('debug'); - Log::drop('error'); - $this->_io->setLoggers(false); - restore_error_handler(); - restore_exception_handler(); - - $psy = new PsyShell(); - $psy->run(); - } - - /** - * Display help for this console. - * - * @return ConsoleOptionParser - */ - public function getOptionParser() - { - $parser = new ConsoleOptionParser('console', false); - $parser->description( - 'This shell provides a REPL that you can use to interact ' . - 'with your application in an interactive fashion. You can use ' . - 'it to run adhoc queries with your models, or experiment ' . - 'and explore the features of CakePHP and your application.' . - "\n\n" . - 'You will need to have psysh installed for this Shell to work.' - ); - return $parser; - } -} diff --git a/cakephp/notejam/src/Template/Cell/Pads/display.ctp b/cakephp/notejam/src/Template/Cell/Pads/display.ctp deleted file mode 100644 index 51181b443..000000000 --- a/cakephp/notejam/src/Template/Cell/Pads/display.ctp +++ /dev/null @@ -1,16 +0,0 @@ -
- - -
diff --git a/cakephp/notejam/src/Template/Element/Flash/default.ctp b/cakephp/notejam/src/Template/Element/Flash/default.ctp deleted file mode 100644 index bc1e2c369..000000000 --- a/cakephp/notejam/src/Template/Element/Flash/default.ctp +++ /dev/null @@ -1,7 +0,0 @@ - -
diff --git a/cakephp/notejam/src/Template/Element/Flash/error.ctp b/cakephp/notejam/src/Template/Element/Flash/error.ctp deleted file mode 100644 index d3995ad10..000000000 --- a/cakephp/notejam/src/Template/Element/Flash/error.ctp +++ /dev/null @@ -1,3 +0,0 @@ -
-
-
diff --git a/cakephp/notejam/src/Template/Element/Flash/success.ctp b/cakephp/notejam/src/Template/Element/Flash/success.ctp deleted file mode 100644 index 3ce1cc159..000000000 --- a/cakephp/notejam/src/Template/Element/Flash/success.ctp +++ /dev/null @@ -1,3 +0,0 @@ -
-
-
diff --git a/cakephp/notejam/src/Template/Element/notes/form.ctp b/cakephp/notejam/src/Template/Element/notes/form.ctp deleted file mode 100644 index 8351ee735..000000000 --- a/cakephp/notejam/src/Template/Element/notes/form.ctp +++ /dev/null @@ -1,6 +0,0 @@ -Form->create($note, ['class' => 'note']); ?> - Form->input('name'); ?> - Form->textarea('text'); ?> - Form->input('pad_id', ['type' => 'select', 'empty' => '---------', 'options' => $pads, 'default' => !empty($pad) ? $pad : 0]); ?> - Form->submit(__('Save')); ?> -Form->end(); ?> diff --git a/cakephp/notejam/src/Template/Element/pads/form.ctp b/cakephp/notejam/src/Template/Element/pads/form.ctp deleted file mode 100644 index dc9460c87..000000000 --- a/cakephp/notejam/src/Template/Element/pads/form.ctp +++ /dev/null @@ -1,4 +0,0 @@ -Form->create($pad, ['class' => 'pad']); ?> - Form->input('name'); ?> - Form->submit(__('Save')); ?> -Form->end(); ?> diff --git a/cakephp/notejam/src/Template/Email/html/default.ctp b/cakephp/notejam/src/Template/Email/html/default.ctp deleted file mode 100644 index 386674a1a..000000000 --- a/cakephp/notejam/src/Template/Email/html/default.ctp +++ /dev/null @@ -1,22 +0,0 @@ - - ' . $line . "

\n"; -endforeach; -?> diff --git a/cakephp/notejam/src/Template/Email/text/default.ctp b/cakephp/notejam/src/Template/Email/text/default.ctp deleted file mode 100644 index 704b46f03..000000000 --- a/cakephp/notejam/src/Template/Email/text/default.ctp +++ /dev/null @@ -1,16 +0,0 @@ - - diff --git a/cakephp/notejam/src/Template/Error/error400.ctp b/cakephp/notejam/src/Template/Error/error400.ctp deleted file mode 100644 index 5cd7ce6ee..000000000 --- a/cakephp/notejam/src/Template/Error/error400.ctp +++ /dev/null @@ -1,38 +0,0 @@ -layout = 'dev_error'; - - $this->assign('title', $message); - $this->assign('templateName', 'error400.ctp'); - - $this->start('file'); -?> -queryString)) : ?> -

- SQL Query: - queryString) ?> -

- -params)) : ?> - SQL Query Params: - params) ?> - -element('auto_table_warning') ?> -end(); -endif; -?> -

-

- : - '{$url}'" - ) ?> -

diff --git a/cakephp/notejam/src/Template/Error/error500.ctp b/cakephp/notejam/src/Template/Error/error500.ctp deleted file mode 100644 index d2b7d92a1..000000000 --- a/cakephp/notejam/src/Template/Error/error500.ctp +++ /dev/null @@ -1,37 +0,0 @@ -layout = 'dev_error'; - - $this->assign('title', $message); - $this->assign('templateName', 'error500.ctp'); - - $this->start('file'); -?> -queryString)) : ?> -

- SQL Query: - queryString) ?> -

- -params)) : ?> - SQL Query Params: - params) ?> - -element('auto_table_warning'); - - if (extension_loaded('xdebug')): - xdebug_print_function_stack(); - endif; - - $this->end(); -endif; -?> -

-

- : - -

diff --git a/cakephp/notejam/src/Template/Layout/Email/html/default.ctp b/cakephp/notejam/src/Template/Layout/Email/html/default.ctp deleted file mode 100644 index 2b4397008..000000000 --- a/cakephp/notejam/src/Template/Layout/Email/html/default.ctp +++ /dev/null @@ -1,24 +0,0 @@ - - - - - <?= $this->fetch('title') ?> - - - fetch('content') ?> - - diff --git a/cakephp/notejam/src/Template/Layout/Email/text/default.ctp b/cakephp/notejam/src/Template/Layout/Email/text/default.ctp deleted file mode 100644 index 871dcfb48..000000000 --- a/cakephp/notejam/src/Template/Layout/Email/text/default.ctp +++ /dev/null @@ -1,16 +0,0 @@ - -fetch('content') ?> diff --git a/cakephp/notejam/src/Template/Layout/ajax.ctp b/cakephp/notejam/src/Template/Layout/ajax.ctp deleted file mode 100644 index 871dcfb48..000000000 --- a/cakephp/notejam/src/Template/Layout/ajax.ctp +++ /dev/null @@ -1,16 +0,0 @@ - -fetch('content') ?> diff --git a/cakephp/notejam/src/Template/Layout/anonymous.ctp b/cakephp/notejam/src/Template/Layout/anonymous.ctp deleted file mode 100644 index 42db077f5..000000000 --- a/cakephp/notejam/src/Template/Layout/anonymous.ctp +++ /dev/null @@ -1,6 +0,0 @@ -extend('/Layout/default'); ?> - -
- Flash->render() ?> - fetch('content') ?> -
diff --git a/cakephp/notejam/src/Template/Layout/default.ctp b/cakephp/notejam/src/Template/Layout/default.ctp deleted file mode 100644 index 9c9a7cc8d..000000000 --- a/cakephp/notejam/src/Template/Layout/default.ctp +++ /dev/null @@ -1,39 +0,0 @@ - - - - Html->charset() ?> - <?= $this->fetch('title') ?> - - Html->css('http://cdnjs.cloudflare.com/ajax/libs/skeleton/1.2/base.min.css') ?> - Html->css('http://cdnjs.cloudflare.com/ajax/libs/skeleton/1.2/skeleton.min.css') ?> - Html->css('http://cdnjs.cloudflare.com/ajax/libs/skeleton/1.2/layout.css') ?> - Html->css('style.css') ?> - - fetch('css') ?> - - -
-
- -
-
-

notejam: fetch('title') ?>

-
- - fetch('content') ?> - - - -
- Fork me on GitHub - - diff --git a/cakephp/notejam/src/Template/Layout/error.ctp b/cakephp/notejam/src/Template/Layout/error.ctp deleted file mode 100644 index e6945a8ad..000000000 --- a/cakephp/notejam/src/Template/Layout/error.ctp +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Html->charset() ?> - - <?= $cakeDescription ?>: - <?= $this->fetch('title') ?> - - Html->meta('icon') ?> - - Html->css('base.css') ?> - Html->css('cake.css') ?> - - fetch('meta') ?> - fetch('css') ?> - fetch('script') ?> - - -
- -
- Flash->render() ?> - - fetch('content') ?> -
- -
- - diff --git a/cakephp/notejam/src/Template/Layout/rss/default.ctp b/cakephp/notejam/src/Template/Layout/rss/default.ctp deleted file mode 100644 index fdadcbf78..000000000 --- a/cakephp/notejam/src/Template/Layout/rss/default.ctp +++ /dev/null @@ -1,14 +0,0 @@ -fetch('title'); -endif; - -echo $this->Rss->document( - $this->Rss->channel( - array(), $channel, $this->fetch('content') - ) -); -?> diff --git a/cakephp/notejam/src/Template/Layout/user.ctp b/cakephp/notejam/src/Template/Layout/user.ctp deleted file mode 100644 index 0ae6e9478..000000000 --- a/cakephp/notejam/src/Template/Layout/user.ctp +++ /dev/null @@ -1,8 +0,0 @@ -extend('/Layout/default'); ?> - -cell('Pads', ['auth' => 'auth_param']); ?> - -
- Flash->render() ?> - fetch('content') ?> -
diff --git a/cakephp/notejam/src/Template/Notes/create.ctp b/cakephp/notejam/src/Template/Notes/create.ctp deleted file mode 100644 index 8c191f354..000000000 --- a/cakephp/notejam/src/Template/Notes/create.ctp +++ /dev/null @@ -1,3 +0,0 @@ -assign('title', __('New note')); ?> - -element('notes/form'); ?> diff --git a/cakephp/notejam/src/Template/Notes/delete.ctp b/cakephp/notejam/src/Template/Notes/delete.ctp deleted file mode 100644 index cc79d7d9e..000000000 --- a/cakephp/notejam/src/Template/Notes/delete.ctp +++ /dev/null @@ -1,7 +0,0 @@ -

name};") ?>

-Form->create(); ?> - - " ?> -   - Html->link(__('Cancel'), ['_name' => 'view_note', 'id' => $note->id]) ?> -Form->end(); ?> diff --git a/cakephp/notejam/src/Template/Notes/edit.ctp b/cakephp/notejam/src/Template/Notes/edit.ctp deleted file mode 100644 index 24faf5dee..000000000 --- a/cakephp/notejam/src/Template/Notes/edit.ctp +++ /dev/null @@ -1,3 +0,0 @@ -assign('title', __('Edit ' . $note->name)); ?> - -element('notes/form'); ?> diff --git a/cakephp/notejam/src/Template/Notes/index.ctp b/cakephp/notejam/src/Template/Notes/index.ctp deleted file mode 100644 index db767a984..000000000 --- a/cakephp/notejam/src/Template/Notes/index.ctp +++ /dev/null @@ -1,20 +0,0 @@ -assign('title', __("All notes ({$notes->count()})")); ?> -count()): ?> - - - - - - - - - - - - - -
Html->link('↑', ['_name' => 'index', 'order' => '-name'], ['class' => 'sort_arrow']) ?>Html->link('↓', ['_name' => 'index', 'order' => 'name'], ['class' => 'sort_arrow']) ?> Html->link('↑', ['_name' => 'index', 'order' => '-updated_at'], ['class' => 'sort_arrow']) ?>Html->link('↓', ['_name' => 'index', 'order' => 'updated_at'], ['class' => 'sort_arrow']) ?>
Html->link($note->name, ['id' => $note->id, '_name' => 'view_note']) ?>pad) ? $this->Html->link($note->pad->name, ['id' => $note->pad->id, '_name' => 'view_pad']) : 'No pad'; ?>getPrettyDate(); ?>
- -

- -Html->link(__("New note"), ["_name" => "create_note"], ["class" => "button"]); ?> diff --git a/cakephp/notejam/src/Template/Notes/view.ctp b/cakephp/notejam/src/Template/Notes/view.ctp deleted file mode 100644 index 3c48c2362..000000000 --- a/cakephp/notejam/src/Template/Notes/view.ctp +++ /dev/null @@ -1,9 +0,0 @@ -assign('title', h($note->name)); ?> -

Last edited at getPrettyDate(); ?>

-
-

- text); ?> -

-
-Html->link('Edit note', ['id' => $note->id, '_name' => 'edit_note'], ['class' => 'button']) ?> -Html->link('Delete it', ['id' => $note->id, '_name' => 'delete_note'], ['class' => 'delete-note']) ?> diff --git a/cakephp/notejam/src/Template/Pads/create.ctp b/cakephp/notejam/src/Template/Pads/create.ctp deleted file mode 100644 index 236e80839..000000000 --- a/cakephp/notejam/src/Template/Pads/create.ctp +++ /dev/null @@ -1,3 +0,0 @@ -assign('title', __('New pad')); ?> - -element('pads/form'); ?> diff --git a/cakephp/notejam/src/Template/Pads/delete.ctp b/cakephp/notejam/src/Template/Pads/delete.ctp deleted file mode 100644 index b6f307d19..000000000 --- a/cakephp/notejam/src/Template/Pads/delete.ctp +++ /dev/null @@ -1,6 +0,0 @@ -

name};") ?>

-Form->create(); ?> - " ?> -   - Html->link(__('Cancel'), ['_name' => 'index']) ?> -Form->end(); ?> diff --git a/cakephp/notejam/src/Template/Pads/edit.ctp b/cakephp/notejam/src/Template/Pads/edit.ctp deleted file mode 100644 index 7fba45ec6..000000000 --- a/cakephp/notejam/src/Template/Pads/edit.ctp +++ /dev/null @@ -1,4 +0,0 @@ -assign('title', __('Edit ' . $pad->name)); ?> - -element('pads/form'); ?> -Html->link('Delete pad', ['id' => $pad->id, '_name' => 'delete_pad'], ['class' => 'small-red']) ?> diff --git a/cakephp/notejam/src/Template/Pads/view.ctp b/cakephp/notejam/src/Template/Pads/view.ctp deleted file mode 100644 index 4766dc3f1..000000000 --- a/cakephp/notejam/src/Template/Pads/view.ctp +++ /dev/null @@ -1,19 +0,0 @@ -assign('title', __($pad->name . " ({$notes->count()})")); ?> -count()): ?> - - - - - - - - - - - -
Html->link('↑', ['_name' => 'view_pad', 'order' => '-name', 'id' => $pad->id], ['class' => 'sort_arrow']) ?>Html->link('↓', ['_name' => 'view_pad', 'order' => 'name', 'id' => $pad->id], ['class' => 'sort_arrow']) ?> Html->link('↑', ['_name' => 'view_pad', 'order' => '-updated_at', 'id' => $pad->id], ['class' => 'sort_arrow']) ?>Html->link('↓', ['_name' => 'view_pad', 'order' => 'updated_at', 'id' => $pad->id], ['class' => 'sort_arrow']) ?>
Html->link($note->name, ['id' => $note->id, '_name' => 'view_note']) ?>getPrettyDate(); ?>
- -

- -Html->link(__("New note"), ["_name" => "create_note", "pad" => $pad->id], ["class" => "button"]); ?>
-Html->link(__("Pad settings"), ["_name" => "edit_pad", "id" => $pad->id]); ?> diff --git a/cakephp/notejam/src/Template/Users/forgotpassword.ctp b/cakephp/notejam/src/Template/Users/forgotpassword.ctp deleted file mode 100644 index da2eafa98..000000000 --- a/cakephp/notejam/src/Template/Users/forgotpassword.ctp +++ /dev/null @@ -1,6 +0,0 @@ -assign('title', __('Forgot password?')); ?> - -Form->create($form, ['class' => 'offset-by-six sign-in']); ?> - Form->input('email', ['type' => 'text']); ?> - Form->submit(__('Generate password')); ?> -Form->end(); ?> diff --git a/cakephp/notejam/src/Template/Users/index.ctp b/cakephp/notejam/src/Template/Users/index.ctp deleted file mode 100644 index 7a4b50039..000000000 --- a/cakephp/notejam/src/Template/Users/index.ctp +++ /dev/null @@ -1,45 +0,0 @@ -
-

-
    -
  • Html->link(__('New User'), ['action' => 'add']) ?>
  • -
  • Html->link(__('List Notes'), ['controller' => 'Notes', 'action' => 'index']) ?>
  • -
  • Html->link(__('New Note'), ['controller' => 'Notes', 'action' => 'add']) ?>
  • -
  • Html->link(__('List Pads'), ['controller' => 'Pads', 'action' => 'index']) ?>
  • -
  • Html->link(__('New Pad'), ['controller' => 'Pads', 'action' => 'add']) ?>
  • -
-
-
- - - - - - - - - - - - - - - - - - - - -
Paginator->sort('id') ?>Paginator->sort('email') ?>Paginator->sort('password') ?>
Number->format($user->id) ?>email) ?>password) ?> - Html->link(__('View'), ['action' => 'view', $user->id]) ?> - Html->link(__('Edit'), ['action' => 'edit', $user->id]) ?> - Form->postLink(__('Delete'), ['action' => 'delete', $user->id], ['confirm' => __('Are you sure you want to delete # {0}?', $user->id)]) ?> -
-
-
    - Paginator->prev('< ' . __('previous')) ?> - Paginator->numbers() ?> - Paginator->next(__('next') . ' >') ?> -
-

Paginator->counter() ?>

-
-
diff --git a/cakephp/notejam/src/Template/Users/settings.ctp b/cakephp/notejam/src/Template/Users/settings.ctp deleted file mode 100644 index 9e6424874..000000000 --- a/cakephp/notejam/src/Template/Users/settings.ctp +++ /dev/null @@ -1,8 +0,0 @@ -assign('title', __('Account settings')); ?> - -Form->create($settings, ['class' => 'offset-by-six sign-in']); ?> - Form->input('current_password', ['type' => 'password']); ?> - Form->input('new_password', ['type' => 'password']); ?> - Form->input('confirm_new_password', ['type' => 'password']); ?> - Form->submit(__('Save')); ?> -Form->end(); ?> diff --git a/cakephp/notejam/src/Template/Users/signin.ctp b/cakephp/notejam/src/Template/Users/signin.ctp deleted file mode 100644 index 7138e35eb..000000000 --- a/cakephp/notejam/src/Template/Users/signin.ctp +++ /dev/null @@ -1,9 +0,0 @@ -assign('title', __('Sign in')); ?> - -Form->create(null, ['class' => 'offset-by-six sign-in']); ?> - Form->input('email'); ?> - Form->input('password', ['label' => __('Password')]); ?> - or Html->link(__('Sign Up'), ['_name' => 'signup']) ?> -
-

Html->link(__('Forgot password?'), ['_name' => 'forgot_password'], ['class' => 'small-red']) ?>

-Form->end(); ?> diff --git a/cakephp/notejam/src/Template/Users/signup.ctp b/cakephp/notejam/src/Template/Users/signup.ctp deleted file mode 100644 index 770953124..000000000 --- a/cakephp/notejam/src/Template/Users/signup.ctp +++ /dev/null @@ -1,7 +0,0 @@ -assign('title', __('Sign up')); ?> -Form->create($user, ['class' => 'offset-by-six sign-in']); ?> - Form->input('email'); ?> - Form->input('password', ['label' => __('Password')]); ?> - Form->input('confirm_password', ['label' => __('Confirm password'), 'type' => 'password']); ?> - or Html->link(__('Sign In'), ['_name' => 'signin']) ?> -Form->end(); ?> diff --git a/cakephp/notejam/src/View/AppView.php b/cakephp/notejam/src/View/AppView.php deleted file mode 100644 index e8bb1118c..000000000 --- a/cakephp/notejam/src/View/AppView.php +++ /dev/null @@ -1,35 +0,0 @@ -loadHelper('Html');` - * - * @return void - */ - public function initialize() - { - } -} diff --git a/cakephp/notejam/src/View/Cell/PadsCell.php b/cakephp/notejam/src/View/Cell/PadsCell.php deleted file mode 100644 index 10d2d301a..000000000 --- a/cakephp/notejam/src/View/Cell/PadsCell.php +++ /dev/null @@ -1,33 +0,0 @@ -request->session()->read('Auth.User.id'); - $user = \Cake\ORM\TableRegistry::get('Users')->get($id, [ - 'contain' => ['Pads'] - ]); - $this->set('pads', $user->pads); - } -} diff --git a/cakephp/notejam/tests/Fixture/NotesFixture.php b/cakephp/notejam/tests/Fixture/NotesFixture.php deleted file mode 100644 index 5252801d2..000000000 --- a/cakephp/notejam/tests/Fixture/NotesFixture.php +++ /dev/null @@ -1,51 +0,0 @@ - ['type' => 'integer', 'length' => null, 'unsigned' => false, 'null' => false, 'default' => null, 'autoIncrement' => true, 'precision' => null, 'comment' => null], - 'pad_id' => ['type' => 'integer', 'length' => null, 'unsigned' => false, 'null' => true, 'default' => null, 'precision' => null, 'comment' => null, 'autoIncrement' => null], - 'user_id' => ['type' => 'integer', 'length' => null, 'unsigned' => false, 'null' => false, 'default' => null, 'precision' => null, 'comment' => null, 'autoIncrement' => null], - 'name' => ['type' => 'string', 'length' => 100, 'null' => false, 'default' => null, 'precision' => null, 'comment' => null, 'fixed' => null], - 'text' => ['type' => 'text', 'length' => null, 'null' => false, 'default' => null, 'precision' => null, 'comment' => null], - 'created_at' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'precision' => null, 'comment' => null], - 'updated_at' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'precision' => null, 'comment' => null], - '_constraints' => [ - 'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []], - 'user_id_fk' => ['type' => 'foreign', 'columns' => ['user_id'], 'references' => ['users', 'id'], 'update' => 'noAction', 'delete' => 'noAction', 'length' => []], - 'pad_id_fk' => ['type' => 'foreign', 'columns' => ['pad_id'], 'references' => ['pads', 'id'], 'update' => 'noAction', 'delete' => 'noAction', 'length' => []], - ], - ]; - // @codingStandardsIgnoreEnd - - /** - * Records - * - * @var array - */ - public $records = [ - [ - 'id' => 1, - 'pad_id' => 1, - 'user_id' => 1, - 'name' => 'Note #1', - 'text' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.', - 'created_at' => '2015-07-12 19:07:40', - 'updated_at' => '2015-07-12 19:07:40' - ], - ]; -} diff --git a/cakephp/notejam/tests/Fixture/PadsFixture.php b/cakephp/notejam/tests/Fixture/PadsFixture.php deleted file mode 100644 index 27da918d4..000000000 --- a/cakephp/notejam/tests/Fixture/PadsFixture.php +++ /dev/null @@ -1,42 +0,0 @@ - ['type' => 'integer', 'length' => null, 'unsigned' => false, 'null' => false, 'default' => null, 'autoIncrement' => true, 'precision' => null, 'comment' => null], - 'name' => ['type' => 'string', 'length' => 100, 'null' => false, 'default' => null, 'precision' => null, 'comment' => null, 'fixed' => null], - 'user_id' => ['type' => 'integer', 'length' => null, 'unsigned' => false, 'null' => false, 'default' => null, 'precision' => null, 'comment' => null, 'autoIncrement' => null], - '_constraints' => [ - 'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []], - 'user_id_fk' => ['type' => 'foreign', 'columns' => ['user_id'], 'references' => ['users', 'id'], 'update' => 'noAction', 'delete' => 'noAction', 'length' => []], - ], - ]; - // @codingStandardsIgnoreEnd - - /** - * Records - * - * @var array - */ - public $records = [ - [ - 'id' => 1, - 'name' => 'Pad', - 'user_id' => 1 - ], - ]; -} diff --git a/cakephp/notejam/tests/Fixture/UsersFixture.php b/cakephp/notejam/tests/Fixture/UsersFixture.php deleted file mode 100644 index 6731d3a4f..000000000 --- a/cakephp/notejam/tests/Fixture/UsersFixture.php +++ /dev/null @@ -1,48 +0,0 @@ - ['type' => 'integer', 'length' => null, 'unsigned' => false, 'null' => false, 'default' => null, 'autoIncrement' => true, 'precision' => null, 'comment' => null], - 'email' => ['type' => 'string', 'length' => 75, 'null' => false, 'default' => null, 'precision' => null, 'comment' => null, 'fixed' => null], - 'password' => ['type' => 'string', 'length' => 128, 'null' => false, 'default' => null, 'precision' => null, 'comment' => null, 'fixed' => null], - '_constraints' => [ - 'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []], - ], - ]; - // @codingStandardsIgnoreEnd - - /** - * Records - * - * @var array - */ - public $records = [ - [ - 'id' => 1, - 'email' => 'user1@example.com', - // password is 111111 - 'password' => '$2y$10$0hoGWxcL.dC6WWrhCDQUVezLFlxMkguhXDziDi.yQSLjhoBaI9FDO' - ], - [ - 'id' => 2, - 'email' => 'user2@example.com', - // password is 111111 - 'password' => '$2y$10$0hoGWxcL.dC6WWrhCDQUVezLFlxMkguhXDziDi.yQSLjhoBaI9FDO' - ], - ]; -} diff --git a/cakephp/notejam/tests/TestCase/Controller/NotesControllerTest.php b/cakephp/notejam/tests/TestCase/Controller/NotesControllerTest.php deleted file mode 100644 index 5fc33976f..000000000 --- a/cakephp/notejam/tests/TestCase/Controller/NotesControllerTest.php +++ /dev/null @@ -1,151 +0,0 @@ -signin($this->user); - $data = ['name' => 'New note', 'text' => 'Text']; - $this->post('/notes/create', $data); - $this->assertResponseSuccess(); - $this->assertRedirect('/'); - $this->assertEquals( - TableRegistry::get('Notes')->get(2)->name, - $data['name'] - ); - } - - /** - * Test if validation works when create a note - * - * @return void - */ - public function testCreateFailRequiredFields() - { - $this->signin($this->user); - $this->post('/notes/create', ['name' => '']); - $this->assertResponseContains('This field cannot be left empty'); - } - - /** - * Test if note can be successfully edited - * - * @return void - */ - public function testEditSuccess() - { - $this->signin($this->user); - $data = ['name' => 'New note name']; - $this->post('/notes/1/edit', $data); - $this->assertResponseSuccess(); - $this->assertRedirect('/notes/1'); - $this->assertEquals( - TableRegistry::get('Notes')->get(1)->name, - $data['name'] - ); - } - - /** - * Test if validation works when edit a note - * - * @return void - */ - public function testEditFailRequiredFields() - { - $this->signin($this->user); - $this->post('/notes/1/edit', ['name' => '']); - $this->assertResponseContains('This field cannot be left empty'); - } - - /** - * Test if note cannot be successfully viewed by not an owner - * - * @return void - */ - public function testEditFailNotAnOwner() - { - $this->signin(['id' => 2, 'email' => 'user2@example.com']); - $data = ['name' => 'New note name']; - $this->post('/notes/1/edit', $data); - $this->assertResponseError(); - } - - /** - * Test if note can be successfully viewed - * - * @return void - */ - public function testViewSuccess() - { - $this->signin($this->user); - $this->get('/notes/1'); - $this->assertResponseSuccess(); - $this->assertResponseContains('Note #1'); - } - - /** - * Test if note cannot be viewed by not an owner - * - * @return void - */ - public function testViewFailNotAnOwner() - { - $this->signin(['id' => 2, 'email' => 'user2@example.com']); - $this->get('/notes/1/'); - $this->assertResponseError(); - } - - /** - * Test if note can be successfully deleted - * - * @return void - */ - public function testDeleteSuccess() - { - $this->signin($this->user); - $this->post('/notes/1/delete', []); - $this->assertResponseSuccess(); - $this->assertRedirect('/'); - $this->assertEquals( - TableRegistry::get('Notes')->find('all')->count(), - 0 - ); - } - - /** - * Test if note cannot be deleted by not an owner - * - * @return void - */ - public function testDeleteFailNotAnOwner() - { - $this->signin(['id' => 2, 'email' => 'user2@example.com']); - $this->post('/notes/1/delete', []); - $this->assertResponseError(); - } -} diff --git a/cakephp/notejam/tests/TestCase/Controller/PadsControllerTest.php b/cakephp/notejam/tests/TestCase/Controller/PadsControllerTest.php deleted file mode 100644 index d1921f7cb..000000000 --- a/cakephp/notejam/tests/TestCase/Controller/PadsControllerTest.php +++ /dev/null @@ -1,151 +0,0 @@ -signin($this->user); - $data = ['name' => 'New pad']; - $this->post('/pads/create', $data); - $this->assertResponseSuccess(); - $this->assertRedirect('/pads/2'); - $this->assertEquals( - TableRegistry::get('Pads')->get(2)->name, - $data['name'] - ); - } - - /** - * Test if validation works when create a pad - * - * @return void - */ - public function testCreateFailRequiredFields() - { - $this->signin($this->user); - $this->post('/pads/create', ['name' => '']); - $this->assertResponseContains('This field cannot be left empty'); - } - - /** - * Test if pad can be successfully edited - * - * @return void - */ - public function testEditSuccess() - { - $this->signin($this->user); - $data = ['name' => 'New pad name']; - $this->post('/pads/1/edit', $data); - $this->assertResponseSuccess(); - $this->assertRedirect('/pads/1'); - $this->assertEquals( - TableRegistry::get('Pads')->get(1)->name, - $data['name'] - ); - } - - /** - * Test if validation works when edit a pad - * - * @return void - */ - public function testEditFailRequiredFields() - { - $this->signin($this->user); - $this->post('/pads/1/edit', ['name' => '']); - $this->assertResponseContains('This field cannot be left empty'); - } - - /** - * Test if pad cannot be edited by not an owner - * - * @return void - */ - public function testEditFailNotAnOwner() - { - $this->signin(['id' => 2, 'email' => 'user2@example.com']); - $data = ['name' => 'New pad name']; - $this->post('/pads/1/edit', $data); - $this->assertResponseError(); - } - - /** - * Test if pad can be successfully viewed - * - * @return void - */ - public function testViewSuccess() - { - $this->signin($this->user); - $this->get('/pads/1'); - $this->assertResponseSuccess(); - $this->assertResponseContains('Pad (1)'); - } - - /** - * Test if pad cannot be viewed by not an owner - * - * @return void - */ - public function testViewFailNotAnOwner() - { - $this->signin(['id' => 2, 'email' => 'user2@example.com']); - $this->get('/pads/1'); - $this->assertResponseError(); - } - - /** - * Test if pad can be successfully deleted - * - * @return void - */ - public function testDeleteSuccess() - { - $this->signin($this->user); - $this->post('/pads/1/delete', []); - $this->assertResponseSuccess(); - $this->assertRedirect('/'); - $this->assertEquals( - TableRegistry::get('Pads')->find('all')->count(), - 0 - ); - } - - /** - * Test if pad cannot be deleted by not an owner - * - * @return void - */ - public function testDeleteFailNotAnOwner() - { - $this->signin(['id' => 2, 'email' => 'user2@example.com']); - $this->post('/pads/1/delete', []); - $this->assertResponseError(); - } -} diff --git a/cakephp/notejam/tests/TestCase/Controller/UsersControllerTest.php b/cakephp/notejam/tests/TestCase/Controller/UsersControllerTest.php deleted file mode 100644 index 15ce28ec3..000000000 --- a/cakephp/notejam/tests/TestCase/Controller/UsersControllerTest.php +++ /dev/null @@ -1,139 +0,0 @@ - 'user@example.com', - 'password' => 'pa$$word', - 'confirm_password' => 'pa$$word' - ]; - $this->post('/signup', $data); - $this->assertResponseSuccess(); - $users = TableRegistry::get('Users'); - $query = $users->find()->where(['email' => $data['email']]); - $this->assertEquals(1, $query->count()); - } - - /** - * Test if signup fails if required fields are missing - * - * @return void - */ - public function testSignupFailRequiredFields() - { - $data = [ - 'email' => '', - 'password' => '', - 'confirm_password' => '' - ]; - $this->post('/signup', $data); - $this->assertResponseSuccess(); - $this->assertResponseContains('This field cannot be left empty'); - } - - /** - * Test if signup fails if email is invalid - * - * @return void - */ - public function testSignupFailInvalidEmail() - { - $data = [ - 'email' => 'invalid email' - ]; - $this->post('/signup', $data); - $this->assertResponseSuccess(); - $this->assertResponseContains('The provided value is invalid'); - } - - /** - * Test if signup fails if email already exists - * - * @return void - */ - public function testSignupFailEmailExists() - { - $data = [ - 'email' => 'user1@example.com', - 'password' => 'pa$$word', - 'confirm_password' => 'pa$$word' - ]; - $this->post('/signup', $data); - $this->assertResponseSuccess(); - $this->assertResponseContains('This value is already in use'); - } - - /** - * Test if signup fails if passwords do not match - * - * @return void - */ - public function testSignupFailPasswordsNotMatch() - { - $data = [ - 'email' => 'user1@example.com', - 'password' => 'pa$$word1', - 'confirm_password' => 'pa$$word2' - ]; - $this->post('/signup', $data); - $this->assertResponseSuccess(); - $this->assertResponseContains('Passwords do not match'); - } - - /** - * Test if signin success - * - * @return void - */ - public function testSigninSuccess() - { - $data = [ - 'email' => 'user1@example.com', - 'password' => '111111' - ]; - $this->post('/signin', $data); - $this->assertResponseSuccess(); - $this->assertRedirect(['controller' => 'Notes', 'action' => 'index']); - $this->assertSession('user1@example.com', 'Auth.User.email'); - - } - - /** - * Test if signin fails if provided credentials are wroing - * - * @return void - */ - public function testSigninFailWrongCredentials() - { - $data = [ - 'email' => 'user2@example.com', - 'password' => 'wrong password' - ]; - $this->post('/signin', $data); - $this->assertResponseContains('Your username or password is incorrect.'); - } -} diff --git a/cakephp/notejam/tests/TestCase/NotejamTestCase.php b/cakephp/notejam/tests/TestCase/NotejamTestCase.php deleted file mode 100644 index d8d5f468c..000000000 --- a/cakephp/notejam/tests/TestCase/NotejamTestCase.php +++ /dev/null @@ -1,44 +0,0 @@ - 1, - 'email' => 'user@example.com' - ]; - - /** - * Sign in user - * - * @param array $user User - * @return void - */ - public function signin($user) - { - $this->session([ - 'Auth' => [ - 'User' => [ - 'id' => $user['id'], - 'username' => $user['email'] - ] - ] - ]); - } - - /** - * Create a user - * - * @param array $userData User data - * @return User - */ - public function createUser($userData) - { - $user = TableRegistry::get('Users')->newEntity($userData); - TableRegistry::get('Users')->save($user); - return $user; - } -} diff --git a/cakephp/notejam/tests/bootstrap.php b/cakephp/notejam/tests/bootstrap.php deleted file mode 100644 index e56aa9df2..000000000 --- a/cakephp/notejam/tests/bootstrap.php +++ /dev/null @@ -1,8 +0,0 @@ - - RewriteEngine On - RewriteCond %{REQUEST_FILENAME} !-f - RewriteRule ^ index.php [L] - diff --git a/cakephp/notejam/webroot/css/style.css b/cakephp/notejam/webroot/css/style.css deleted file mode 100644 index 5748e0390..000000000 --- a/cakephp/notejam/webroot/css/style.css +++ /dev/null @@ -1,396 +0,0 @@ -/* -* Skeleton V1.0.3 -* Copyright 2011, Dave Gamache -* www.getskeleton.com -* Free to use under the MIT license. -* http://www.opensource.org/licenses/mit-license.php -* 7/17/2011 -*/ - - -/* Documentation Styles -================================================== */ - div.container { - padding-top: 40px; } - - /* Doc nav */ - nav { - width: 160px; } - #logo, .bold-header { - margin-bottom: 30px; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - letter-spacing: -1px; - color: #555; - font-weight: bold; } - .bold-header span { - font-weight: normal; - font-size: 23px; - } - .bold-header a.header { - text-decoration: none; - color: inherit; - } - .bold-header span.jam { - font-size: 46px; - line-height: 50px; - } - nav ul { - float: left; } - nav ul li { - display: block; - margin-bottom: 10px; } - nav ul li a, - nav ul li a:visited, - nav ul li a:active { - font-size: 14px; - color: #555; - text-decoration: none; - font-weight: bold; } - nav ul li a:hover, - nav ul li a:focus { - color: #222; } - header h1 { - font-size: 52px; - line-height: 61px; - letter-spacing: -1px; - font-weight: normal; - font-family: "Georgia", "Times New Roman", Helvetica, Arial, sans-serif; } - hr.large { - border: none; - height: 8px; - background: #ebebeb; - margin: 50px 0; } - div.doc-section { - margin: 30px 0; } - - #whatAndWhy .row { - padding: 30px 0 0; } - - #typography blockquote { - margin-top: 20px; } - - .hidden-code a { - font-size: 12px; - color: #999; } - .hidden-code>div { - display: none; } - - - /* Grid */ - #grid .column, - #grid .columns { - background: #ddd; - height: 25px; - line-height: 25px; - margin-bottom: 10px; - text-align: center; - text-transform: uppercase; - color: #555; - font-size: 12px; - font-weight: bold; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; } - #grid .column:hover, - #grid .columns:hover { - background: #bbb; - color: #333; } - #grid .example-grid { overflow: hidden; } - - .post-button-note, - .post-button-note a { - font-size: 11px; - color: #999; } - - #examples .four.columns a { - text-decoration: none; - } - #examples .four.columns a:hover { - text-decoration: underline; - } - - - .resize { - position: fixed; - bottom: 0; - right: 0; - height: 80px; - width: 80px; - background: url(images/resize.png); } - - - img { - max-width: 100%; - height: auto; } - - .gist-meta { display: none !important;} - - ul ul ul li { margin-bottom: 3px; } - - .twitter-share-button { margin-bottom: -18px; } - - /* Table stylesheets */ - table { - width: 100%; - border-collapse: collapse; - } - - table th, table td { - padding: 10px 10px 9px; - font-size: 13px; - line-height: 18px; - text-align: left; - } - - table td { - vertical-align: top; - border-top: solid 1px #ddd; - } - - table th { - padding-top: 9px; - font-weight: bold; - vertical-align: middle; - } - - table.condensed th, table.condensed td { - padding: 5px 5px 4px; - } - - table.bordered { - border-collapse: separate; - border: solid 1px #ddd; - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; - } - - table.bordered th + th, - table.bordered th + td, - table.bordered td + td { - border-left: solid 1px #ddd; - } - - .zebra-striped tbody tr:nth-child(odd) td, - .zebra-striped tbody tr:nth-child(odd) th { - background: #f5f5f5; - } - -.carbonad, -.carbonad-image, -.carbonad-text, -.carbonad-tag { - background: none !important; - border: none !important; - margin-left: 0 !important; -} -.carbonad-tag { - margin-top: 6px !important; - padding-top: 0 !important; -} -.carbonad-text { - height: auto !important; -} -.carbonad-image { - margin-top: 0 !important; -} - -.hidden-text { - font-size: 12px; - color: #999; -} - -td.date, th.date { - text-align: right; -} - -td.date { - font-style: italic; -} - -form.note input[type="text"], form.note textarea { - width: 100%; -} - -form hr { - width: 218px; - margin: 10px 0px; -} - -form.note textarea { - height: 250px; -} - -div.content-area { - min-height: 600px; -} - -hr.footer { - margin-bottom: 10px; -} - -div.footer { - margin-bottom: 10px; - text-align: center; - font-size: 12px; -} - -form.sign-in { - margin: 50px 0 0 0; -} - -.sort_arrow { - text-decoration: none; -} - -.sort_arrow:hover { - text-decoration: none; - color: red; -} - -div.sign-in-out-block { - position: absolute; - right: 14px; - top: 8px; - font-size: 12px; -} - -div.sign-in-out-block a { - /*text-decoration: none;*/ -} - -a.small-red { - color: red; - font-size: 12px; -} - -table.notes { - margin: 0 0 20px 0; -} - -table.notes th.note { - width: 72%; -} - -table.notes td.pad { - color: grey; -} - -table.notes td.pad a { - color: grey; - text-decoration: underline; - font-style: normal; -} - - -table.notes td.pad a:hover { - color: black; -} - -p.empty { - color: grey; - font-style: italic; -} - -a.delete-note { - float: right; - font-size: 12px; - color: red; -} - -.red, input.red { - color: red !important; -} - -ul.errorlist, ul.errors, .error-message { - margin: -18px 0 0 0; -} - -ul.errorlist li, ul.errors li, .error-message { - color: red; -} - -.alert-area { - text-align: center; -} - -.alert { - padding: 5px 8px; - margin: 0 0 12px 0; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; -} - -.alert-success { - color: #468847; - background-color: #dff0d8; - border: 1px solid #d6e9c6; -} - -.alert-error { - color: #b94a48; - background-color: #f2dede; - border: 1px solid #eed3d7; -} - - /* Mobile */ - @media only screen and (max-width: 767px) { - header h1 { font-size: 34px; line-height: 37px; } - nav { position: relative; } - nav ul, - .carbonad { - display: none; - } - #logo { text-align: left; } - #examples .four.columns { - padding-top: 30px; - } - } - - /* Mobile Landscape */ - @media only screen and (min-width: 480px) and (max-width: 767px) { - nav ul { - display: none; - } - } - - /* Non 960 */ - @media only screen and (max-width: 959px) { - #logo { - font-size: 21px; - margin-bottom: 15px; } - nav .button { - padding: 9px 20px 11px; } - } - - /* iPad Portrait/Browser */ - @media only screen and (min-width: 768px) and (max-width: 959px) { - nav { - width: 124px; } - } - - /* Mobile/Browser */ - @media only screen and (max-width: 767px) {} - - /* Mobile Landscape/Browser */ - @media only screen and (min-width: 480px) and (max-width: 767px) {} - - /* Anything smaller than standard 960 */ - @media only screen and (max-width: 959px) {} - - - /* iPad Portrait Only */ - @media only screen and (min-width: 768px) and (max-width: 959px) and (max-device-width: 1000px) {} - - /* Mobile Only */ - @media only screen and (max-width: 767px) and (max-device-width: 1000px) {} - - /* Mobile Landscape Only */ - @media only screen and (min-width: 480px) and (max-width: 767px) and (max-device-width: 1000px) {} - - /* Anything smaller than standard 960 on a device */ - @media only screen and (max-width: 959px) and (max-device-width: 1000px) { - .resize { display: none; } - } - diff --git a/cakephp/notejam/webroot/favicon.ico b/cakephp/notejam/webroot/favicon.ico deleted file mode 100644 index aaac9c853..000000000 Binary files a/cakephp/notejam/webroot/favicon.ico and /dev/null differ diff --git a/cakephp/notejam/webroot/img/cake.icon.png b/cakephp/notejam/webroot/img/cake.icon.png deleted file mode 100644 index 394fa42d5..000000000 Binary files a/cakephp/notejam/webroot/img/cake.icon.png and /dev/null differ diff --git a/cakephp/notejam/webroot/img/cake.power.gif b/cakephp/notejam/webroot/img/cake.power.gif deleted file mode 100644 index 8f8d570a2..000000000 Binary files a/cakephp/notejam/webroot/img/cake.power.gif and /dev/null differ diff --git a/cakephp/notejam/webroot/index.php b/cakephp/notejam/webroot/index.php deleted file mode 100644 index d1e7b66db..000000000 --- a/cakephp/notejam/webroot/index.php +++ /dev/null @@ -1,37 +0,0 @@ -dispatch( - Request::createFromGlobals(), - new Response() -); diff --git a/cakephp/notejam/webroot/js/empty b/cakephp/notejam/webroot/js/empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/contribute.rst b/contribute.rst deleted file mode 100644 index 4272d6c7f..000000000 --- a/contribute.rst +++ /dev/null @@ -1,152 +0,0 @@ -****************** -Contribution guide -****************** - -========================= -Pull requests and commits -========================= - -Send your pull requests in the ``master`` branch. - -Please prepend commit messages with framework name. - -**Good** commit messages: - -.. code-block:: - - Django: Implemented signout functionality - -.. code-block:: - - Symfony: Fixed broken pad tests - -**Bad** commit messages: - -.. code-block:: - - Implemented signout functionality in django - -.. code-block:: - - Fixed broken symfony pad tests - - -========== -Code style -========== - -Please follow code style guidelines and best practices for your programming language and framework. -Specify guidelines in a README file in a code style section. - - -==================== -Application overview -==================== - -Notejam is a web application which allows user to sign up/in/out and create/view/edit/delete notes. -Notes are grouped in pads. See `screenshots `_ -for look and feel. - ------------------------ -Objects/Models/Entities ------------------------ - -Structure of objects (aka models or entities) used in the app: - -* Note: id, pad_id, user_id, name, text, created_at, updated_at -* Pad: id, user_id, name -* User: id, email, password - -See recommended `database schema `_ for details. - - ------ -Pages ------ - -All html layouts are sliced and available in the `html `_ folder. - -**User pages** - -* ``GET /signup/`` - Show Sign Up form -* ``POST /signup/`` - Sign Up -* ``GET /signin/`` - Show Sign In form -* ``POST /signin/`` - Sign In -* ``GET /signout/`` - Sign out -* ``GET /forgot-password/`` - Show Forgot password form -* ``POST /forgot-password/`` - Forgot Password request -* ``GET /settings/`` - Show user settings form -* ``POST /settings/`` - Change user settings - - -**Note pages** - - -* ``GET /notes/create/`` - Show Create note form -* ``POST /notes/create/`` - Create note -* ``GET /notes//`` - View note -* ``GET /notes//edit/`` - Show Edit note form -* ``POST /notes//edit/`` - Edit note -* ``GET /notes//delete/`` - Show confirmation delete page -* ``POST /notes//delete/`` - Delete note - - -**Pad pages** - - -* ``GET /pads/create/`` - Show Create pad form -* ``POST /pads/create/`` - Create pad -* ``GET /pads//`` - View pad notes -* ``GET /pads//edit/`` - Show Edit pad form -* ``POST /pads//edit/`` - Edit pad -* ``GET /pads//delete/`` - Show confirmation delete page -* ``POST /pads//delete/`` - Delete pad - - ---------------------- -Functional/unit tests ---------------------- - -Any kind of tests are very desirable. - -**Recommended test cases** - -Sign Up: - -* user can successfully sign up -* user can't sign up if required fields are missing -* user can't sign up if email is invalid -* user can't sign up if email already exists -* user can't sign up if passwords do not match - -Sign In: - -* user can successfully sign in -* user can't sign in if required fields are missing -* user can't sign in if credentials are wrong - -Notes: - -* note can be successfully created -* note can't be created by anonymous user -* note can't be created if required fields are missing -* note can be edited by its owner -* note can't be edited if required fields are missing -* note can't be edited by not an owner -* note can't be added into another's user pad -* note can be viewed by its owner -* note can't be viewed by not an owner -* note can be deleted by its owner -* note can't be deleted by not an owner - -Pads: - -* pad can be successfully created -* pad can't be created if required fields are missing -* pad can be edited by its owner -* pad can't be edited if required fields are missing -* pad can't be edited by not an owner -* pad can be viewed by its owner -* pad can't be viewed by not an owner -* pad can be deleted by its owner -* pad can't be deleted by not an owner diff --git a/django/README.rst b/django/README.rst deleted file mode 100644 index bfcdd1ba2..000000000 --- a/django/README.rst +++ /dev/null @@ -1,83 +0,0 @@ -*************** -Notejam: Django -*************** - -Notejam application implemented using `Django `_ framework. - -Django version: 1.6 - -========================== -Installation and launching -========================== - ------ -Clone ------ - -Clone the repo: - -.. code-block:: bash - - $ git clone git@github.com:komarserjio/notejam.git YOUR_PROJECT_DIR/ - -------- -Install -------- -Use `virtualenv `_ or `virtualenvwrapper `_ -for `environment management `_. - -Install dependencies: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/django/ - $ virtualenv .venv -p python2.7 # This version of Django only works on python2 - $ source .venv/bin/activate - $ pip install -r requirements.txt - -Create database schema: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/django/notejam/ - $ ./manage.py syncdb - $ ./manage.py migrate - ------- -Launch ------- - -Start django web server: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/django/notejam/ - $ ./manage.py runserver - -Go to http://127.0.0.1:8000/ in your browser. - ---------- -Run tests ---------- - -Run functional and unit tests: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/django/notejam/ - $ ./manage.py test - - -============ -Contribution -============ -Do you have python/django experience? Help the app to follow python and django best practices. - -Please send your pull requests in the ``master`` branch. -Always prepend your commits with framework name: - -.. code-block:: bash - - Django: Implemented sign in functionality - -Read `contribution guide `_ for details. diff --git a/django/notejam/manage.py b/django/notejam/manage.py deleted file mode 100755 index 6b90f3bb6..000000000 --- a/django/notejam/manage.py +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "notejam.settings") - - from django.core.management import execute_from_command_line - - execute_from_command_line(sys.argv) diff --git a/django/notejam/notejam/__init__.py b/django/notejam/notejam/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/django/notejam/notejam/settings.py b/django/notejam/notejam/settings.py deleted file mode 100644 index 19991825b..000000000 --- a/django/notejam/notejam/settings.py +++ /dev/null @@ -1,184 +0,0 @@ -import os - -DEBUG = True -TEMPLATE_DEBUG = DEBUG -ALLOWED_HOSTS = [] - -PROJECT_DIR = "{}/../".format(os.path.dirname(__file__)) - -ADMINS = ( - ('Sergey Komar', 'komarserjio@gmail.com'), -) - -MANAGERS = ADMINS - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': 'notejam.db', - 'USER': '', - 'PASSWORD': '', - 'HOST': '', - 'PORT': '', - } -} - -# Local time zone for this installation. Choices can be found here: -# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name -# although not all choices may be available on all operating systems. -# In a Windows environment this must be set to your system time zone. -TIME_ZONE = 'Europe/Kiev' - -# Language code for this installation. All choices can be found here: -# http://www.i18nguy.com/unicode/language-identifiers.html -LANGUAGE_CODE = 'en-us' - -SITE_ID = 1 - -# If you set this to False, Django will make some optimizations so as not -# to load the internationalization machinery. -USE_I18N = True - -# If you set this to False, Django will not format dates, numbers and -# calendars according to the current locale. -USE_L10N = True - -# If you set this to False, Django will not use timezone-aware datetimes. -USE_TZ = True - -# Absolute filesystem path to the directory that will hold user-uploaded files. -# Example: "/home/media/media.lawrence.com/media/" -MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media/') - -# URL that handles the media served from MEDIA_ROOT. Make sure to use a -# trailing slash. -# Examples: "http://media.lawrence.com/media/", "http://example.com/media/" -MEDIA_URL = '' - -# Absolute path to the directory static files should be collected to. -# Don't put anything in this directory yourself; store your static files -# in apps' "static/" subdirectories and in STATICFILES_DIRS. -# Example: "/home/media/media.lawrence.com/static/" -STATIC_ROOT = os.path.join(PROJECT_DIR, 'static/') - -# URL prefix for static files. -# Example: "http://media.lawrence.com/static/" -STATIC_URL = '/static/' - -# Additional locations of static files -STATICFILES_DIRS = ( - os.path.join(PROJECT_DIR, 'static_files/'), -) - -# List of finder classes that know how to find static files in -# various locations. -STATICFILES_FINDERS = ( - 'django.contrib.staticfiles.finders.FileSystemFinder', - 'django.contrib.staticfiles.finders.AppDirectoriesFinder', -# 'django.contrib.staticfiles.finders.DefaultStorageFinder', -) - -# Make this unique, and don't share it with anybody. -SECRET_KEY = 'g+cy2q816xje*f#k=9z!e*t%h-7tt(tbo$q^1n)l0gd1=x8$65' - -# List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', -# 'django.template.loaders.eggs.Loader', -) - -TEMPLATE_CONTEXT_PROCESSORS = ( - "django.contrib.auth.context_processors.auth", - "django.core.context_processors.debug", - "django.core.context_processors.i18n", - "django.core.context_processors.media", - "django.core.context_processors.static", - "django.core.context_processors.tz", - "django.core.context_processors.request", - "django.contrib.messages.context_processors.messages" -) - -MIDDLEWARE_CLASSES = ( - 'django.middleware.common.CommonMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - # Uncomment the next line for simple clickjacking protection: - # 'django.middleware.clickjacking.XFrameOptionsMiddleware', -) - -ROOT_URLCONF = 'notejam.urls' - -APPEND_SLASH = True - -# Python dotted path to the WSGI application used by Django's runserver. -WSGI_APPLICATION = 'notejam.wsgi.application' - -TEMPLATE_DIRS = ( - os.path.join(PROJECT_DIR, 'templates/'), -) - -INSTALLED_APPS = ( - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.sites', - 'django.contrib.messages', - 'django.contrib.staticfiles', - #'django.contrib.admin', - 'pads', - 'notes', - 'users', - 'south', -) - -AUTHENTICATION_BACKENDS = ( - 'users.auth_backends.EmailModelBackend', - 'django.contrib.auth.backends.ModelBackend', -) - -LOGIN_URL = '/signin/' -LOGOUT_URL = '/signout/' - -# development email file-based backend -EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend' -EMAIL_FILE_PATH = '/tmp' - -# A sample logging configuration. The only tangible logging -# performed by this configuration is to send an email to -# the site admins on every HTTP 500 error when DEBUG=False. -# See http://docs.djangoproject.com/en/dev/topics/logging for -# more details on how to customize your logging configuration. -LOGGING = { - 'version': 1, - 'disable_existing_loggers': False, - 'filters': { - 'require_debug_false': { - '()': 'django.utils.log.RequireDebugFalse' - } - }, - 'handlers': { - 'mail_admins': { - 'level': 'ERROR', - 'filters': ['require_debug_false'], - 'class': 'django.utils.log.AdminEmailHandler' - } - }, - 'loggers': { - 'django.request': { - 'handlers': ['mail_admins'], - 'level': 'ERROR', - 'propagate': True, - }, - } -} - -# custom test runner -TEST_RUNNER = 'notejam.tests.AdvancedTestSuiteRunner' - -# exclude non app tests -TEST_EXCLUDE = ( - 'django', -) diff --git a/django/notejam/notejam/tests.py b/django/notejam/notejam/tests.py deleted file mode 100644 index af2615253..000000000 --- a/django/notejam/notejam/tests.py +++ /dev/null @@ -1,36 +0,0 @@ -from django.test.simple import DjangoTestSuiteRunner -from django.conf import settings -from django.contrib.auth.models import User - - -EXCLUDED_APPS = getattr(settings, 'TEST_EXCLUDE', []) - - -# based on http://djangosnippets.org/snippets/2211/ -# main approach is to ignore library tests -class AdvancedTestSuiteRunner(DjangoTestSuiteRunner): - def __init__(self, *args, **kwargs): - # to avoid circular import - from django.conf import settings - settings.TESTING = True - super(AdvancedTestSuiteRunner, self).__init__(*args, **kwargs) - - def build_suite(self, *args, **kwargs): - suite = super(AdvancedTestSuiteRunner, self).build_suite(*args, - **kwargs) - if not args[0] and not getattr(settings, 'RUN_ALL_TESTS', False): - tests = [] - for case in suite: - pkg = case.__class__.__module__.split('.')[0] - if pkg not in EXCLUDED_APPS: - tests.append(case) - suite._tests = tests - return suite - - -# helper test functions -def create_user(user_data): - user = User.objects.create(username=user_data['email'], **user_data) - user.set_password(user_data['password']) - user.save() - return user diff --git a/django/notejam/notejam/urls.py b/django/notejam/notejam/urls.py deleted file mode 100644 index d3be6875b..000000000 --- a/django/notejam/notejam/urls.py +++ /dev/null @@ -1,25 +0,0 @@ -from django.conf.urls import patterns, include, url -from django.contrib.auth.decorators import login_required - -from users.views import (SignupView, SigninView, AccountSettingsView, -ForgotPasswordView) -from notes.views import NoteListView - -urlpatterns = patterns('', - # user relates urls - url(r'^signup/', SignupView.as_view(), name='signup'), - url(r'^signin/', SigninView.as_view(), name='signin'), - url(r'^account/', login_required(AccountSettingsView.as_view()), - name='account_settings'), - url(r'^forgot-password/', ForgotPasswordView.as_view(), - name='forgot_password'), - url(r'^signout/$', 'django.contrib.auth.views.logout', - {'next_page': '/'}, name='signout'), - - # notes - url(r'^notes/', include('notes.urls')), - # pads - url(r'^pads/', include('pads.urls')), - - url(r'^$', login_required(NoteListView.as_view()), name='home'), -) diff --git a/django/notejam/notejam/wsgi.py b/django/notejam/notejam/wsgi.py deleted file mode 100644 index 1a69fe50f..000000000 --- a/django/notejam/notejam/wsgi.py +++ /dev/null @@ -1,28 +0,0 @@ -""" -WSGI config for notejam project. - -This module contains the WSGI application used by Django's development server -and any production WSGI deployments. It should expose a module-level variable -named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover -this application via the ``WSGI_APPLICATION`` setting. - -Usually you will have the standard Django WSGI application here, but it also -might make sense to replace the whole Django WSGI application with a custom one -that later delegates to the Django one. For example, you could introduce WSGI -middleware here, or combine a Django application with an application of another -framework. - -""" -import os - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "notejam.settings") - -# This application object is used by any WSGI server configured to use this -# file. This includes Django's development server, if the WSGI_APPLICATION -# setting points here. -from django.core.wsgi import get_wsgi_application -application = get_wsgi_application() - -# Apply WSGI middleware here. -# from helloworld.wsgi import HelloWorldApplication -# application = HelloWorldApplication(application) diff --git a/django/notejam/notes/__init__.py b/django/notejam/notes/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/django/notejam/notes/forms.py b/django/notejam/notes/forms.py deleted file mode 100644 index f42e6a4bc..000000000 --- a/django/notejam/notes/forms.py +++ /dev/null @@ -1,9 +0,0 @@ -from django import forms - -from notes.models import Note - - -class NoteForm(forms.ModelForm): - class Meta: - model = Note - exclude = ('created_at', 'updated_at', 'user') diff --git a/django/notejam/notes/migrations/0001_initial.py b/django/notejam/notes/migrations/0001_initial.py deleted file mode 100644 index 9c1489759..000000000 --- a/django/notejam/notes/migrations/0001_initial.py +++ /dev/null @@ -1,84 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'Note' - db.create_table('notes_note', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('pad', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['pads.Pad'], null=True)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('name', self.gf('django.db.models.fields.CharField')(max_length=100)), - ('text', self.gf('django.db.models.fields.TextField')()), - ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('updated_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)), - )) - db.send_create_signal('notes', ['Note']) - - - def backwards(self, orm): - # Deleting model 'Note' - db.delete_table('notes_note') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'notes.note': { - 'Meta': {'object_name': 'Note'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'pad': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['pads.Pad']", 'null': 'True'}), - 'text': ('django.db.models.fields.TextField', [], {}), - 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - }, - 'pads.pad': { - 'Meta': {'object_name': 'Pad'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['notes'] \ No newline at end of file diff --git a/django/notejam/notes/migrations/__init__.py b/django/notejam/notes/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/django/notejam/notes/models.py b/django/notejam/notes/models.py deleted file mode 100644 index 055ab8000..000000000 --- a/django/notejam/notes/models.py +++ /dev/null @@ -1,13 +0,0 @@ -from django.contrib.auth.models import User -from django.db import models - -from pads.models import Pad - - -class Note(models.Model): - pad = models.ForeignKey(Pad, null=True, blank=True) - user = models.ForeignKey(User) - name = models.CharField(max_length=100) - text = models.TextField() - created_at = models.DateTimeField(auto_now_add=True) - updated_at = models.DateTimeField(auto_now=True) diff --git a/django/notejam/notes/templates/notes/note_confirm_delete.html b/django/notejam/notes/templates/notes/note_confirm_delete.html deleted file mode 100644 index c06b5f5e5..000000000 --- a/django/notejam/notes/templates/notes/note_confirm_delete.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "base.html" %} - -{% block title %}{{ note.name }}{% endblock %} -{% block page_title %}{{ note.name }}{% endblock %} - -{% block content %} -

Are you sure you want to delete {{ note.name }}?

-
- {% csrf_token %} -   - Cancel -
-{% endblock %} diff --git a/django/notejam/notes/templates/notes/note_create.html b/django/notejam/notes/templates/notes/note_create.html deleted file mode 100644 index fd38ecb14..000000000 --- a/django/notejam/notes/templates/notes/note_create.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "base.html" %} - -{% block title %}New note{% endblock %} -{% block page_title %}New note{% endblock %} - -{% block content %} - {% include "notes/note_form.html" %} -{% endblock %} diff --git a/django/notejam/notes/templates/notes/note_detail.html b/django/notejam/notes/templates/notes/note_detail.html deleted file mode 100644 index 2390b9df9..000000000 --- a/django/notejam/notes/templates/notes/note_detail.html +++ /dev/null @@ -1,14 +0,0 @@ -{% extends "base.html" %} -{% load date_tags %} - -{% block title %}{{note.name}}{%endblock%} -{% block page_title %}{{note.name}}{%endblock%} - -{% block content %} -

Last edited {{ note.updated_at|smart_date }}

-
- {{ note.text }} -
- Edit - Delete it -{% endblock %} diff --git a/django/notejam/notes/templates/notes/note_edit.html b/django/notejam/notes/templates/notes/note_edit.html deleted file mode 100644 index 145216fa0..000000000 --- a/django/notejam/notes/templates/notes/note_edit.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "base.html" %} - -{% block title %}{{ note.name }}{% endblock %} -{% block page_title %}{{ note.name }}{% endblock %} - -{% block content %} - {% include "notes/note_form.html" %} -{% endblock %} diff --git a/django/notejam/notes/templates/notes/note_form.html b/django/notejam/notes/templates/notes/note_form.html deleted file mode 100644 index 120e87efc..000000000 --- a/django/notejam/notes/templates/notes/note_form.html +++ /dev/null @@ -1,13 +0,0 @@ -
- {% csrf_token %} - - {{ form.name }} - {{ form.name.errors }} - - {{ form.text }} - {{ form.text.errors }} - - {{ form.pad }} - {{ form.pad.errors }} - -
diff --git a/django/notejam/notes/templates/notes/note_list.html b/django/notejam/notes/templates/notes/note_list.html deleted file mode 100644 index f1c9f5080..000000000 --- a/django/notejam/notes/templates/notes/note_list.html +++ /dev/null @@ -1,33 +0,0 @@ -{% extends "base.html" %} -{% load date_tags %} - -{% block title %}All notes ({{ notes.count }}){% endblock %} -{% block page_title %}All notes ({{ notes.count }}){% endblock %} - -{% block content %} - {% if notes %} - - - - - - - {% for note in notes %} - - - - - - {% endfor %} -
Note PadLast modified
{{ note.name }} - {% if note.pad %} - {{ note.pad.name }} - {% else %} - No pad - {% endif %} - {{ note.updated_at|smart_date }}
- {% else %} -

Create your first note.

- {% endif %} - New note -{% endblock %} diff --git a/django/notejam/notes/templatetags/__init__.py b/django/notejam/notes/templatetags/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/django/notejam/notes/templatetags/date_tags.py b/django/notejam/notes/templatetags/date_tags.py deleted file mode 100644 index acc17a0c0..000000000 --- a/django/notejam/notes/templatetags/date_tags.py +++ /dev/null @@ -1,17 +0,0 @@ -from datetime import date -from django import template - -register = template.Library() - - -@register.filter -def smart_date(updated_at): - delta = date.today() - updated_at.date() - if delta.days == 0: - return 'Today at {}'.format(updated_at.strftime("%H:%M")) - elif delta.days == 1: - return 'Yesterday at {}'.format(updated_at.strftime("%H:%M")) - elif 1 > delta.days > 4: - return '{} days ago'.format(abs(delta.days)) - else: - return updated_at.date() diff --git a/django/notejam/notes/tests.py b/django/notejam/notes/tests.py deleted file mode 100644 index e99e18798..000000000 --- a/django/notejam/notes/tests.py +++ /dev/null @@ -1,110 +0,0 @@ -from django.core.urlresolvers import reverse -from django.test import TestCase, Client - -from notejam.tests import create_user -from notes.models import Note - - -class NoteTest(TestCase): - def setUp(self): - user_data = { - 'email': 'user@example.com', - 'password': 'secure_password' - } - self.user = create_user(user_data) - self.client.login(**user_data) - - def test_create_success(self): - self.client.post( - reverse('create_note'), {'name': 'pad', 'text': 'pad text'}) - self.assertEqual(1, Note.objects.count()) - - def test_create_fail_required_fields(self): - response = self.client.post(reverse('create_note'), {}) - self.assertEqual( - set(['name', 'text']), set(response.context['form'].errors.keys())) - - def test_edit_success(self): - note_data = { - 'name': 'note name', - 'text': 'note text' - } - note = Note.objects.create(user=self.user, **note_data) - - note_data['name'] = 'new name' - response = self.client.post( - reverse('edit_note', args=(note.id,)), note_data) - self.assertRedirects(response, reverse('home')) - self.assertEqual(note_data['name'], Note.objects.get(id=note.id).name) - - def test_another_user_cant_edit(self): - user_data = { - 'email': 'another_user@example.com', - 'password': 'another_secure_password' - } - create_user(user_data) - - note_data = { - 'name': 'note name', - 'text': 'note text' - } - note = Note.objects.create(user=self.user, **note_data) - - client = Client() - client.login(**user_data) - response = client.post(reverse('edit_note', args=(note.id,)), {}) - self.assertEqual(404, response.status_code) - - def test_view_success(self): - note_data = { - 'name': 'note name', - 'text': 'note text' - } - note = Note.objects.create(user=self.user, **note_data) - response = self.client.get(reverse('view_note', args=(note.id,)), {}) - self.assertEqual(note, response.context['note']) - - def test_another_user_cant_view(self): - user_data = { - 'email': 'another_user@example.com', - 'password': 'another_secure_password' - } - create_user(user_data) - - note_data = { - 'name': 'note name', - 'text': 'note text' - } - note = Note.objects.create(user=self.user, **note_data) - - client = Client() - client.login(**user_data) - response = client.get(reverse('view_note', args=(note.id,)), {}) - self.assertEqual(404, response.status_code) - - def test_delete_success(self): - note_data = { - 'name': 'note name', - 'text': 'note text' - } - note = Note.objects.create(user=self.user, **note_data) - self.client.post(reverse('delete_note', args=(note.id,)), {}) - self.assertEqual(0, Note.objects.count()) - - def test_another_user_cant_delete(self): - user_data = { - 'email': 'another_user@example.com', - 'password': 'another_secure_password' - } - create_user(user_data) - - note_data = { - 'name': 'note name', - 'text': 'note text' - } - note = Note.objects.create(user=self.user, **note_data) - - client = Client() - client.login(**user_data) - response = client.get(reverse('view_note', args=(note.id,)), {}) - self.assertEqual(404, response.status_code) diff --git a/django/notejam/notes/urls.py b/django/notejam/notes/urls.py deleted file mode 100644 index 8f12af5c5..000000000 --- a/django/notejam/notes/urls.py +++ /dev/null @@ -1,21 +0,0 @@ -from django.conf.urls import patterns, url -from django.contrib.auth.decorators import login_required - -from notes.views import (NoteCreateView, NoteDeleteView, -NoteDetailView, NoteUpdateView) - - -# Uncomment the next two lines to enable the admin: -# from django.contrib import admin -# admin.autodiscover() - -urlpatterns = patterns('notes.views', - url(r'^create/$', login_required(NoteCreateView.as_view()), - name='create_note'), - url(r'^(?P\d+)/$', login_required(NoteDetailView.as_view()), - name='view_note'), - url(r'^(?P\d+)/edit/$', login_required(NoteUpdateView.as_view()), - name='edit_note'), - url(r'^(?P\d+)/delete/$', login_required(NoteDeleteView.as_view()), - name='delete_note'), -) diff --git a/django/notejam/notes/views.py b/django/notejam/notes/views.py deleted file mode 100644 index 36fa8ebe2..000000000 --- a/django/notejam/notes/views.py +++ /dev/null @@ -1,110 +0,0 @@ -from django.contrib import messages -from django.core.urlresolvers import reverse_lazy -from django.shortcuts import redirect -from django.views.generic.edit import CreateView, UpdateView, DeleteView -from django.views.generic.detail import DetailView -from django.views.generic import ListView - - -from notes.models import Note, Pad -from notes.forms import NoteForm - - -class NoteCreateView(CreateView): - model = Note - form_class = NoteForm - template_name_suffix = '_create' - success_message = 'Note is successfully created' - - def get_initial(self): - return {'pad': self.request.GET.get('pad', None)} - - def get_form(self, form_class): - form = super(NoteCreateView, self).get_form(self.get_form_class()) - # limit pad choice - form.fields['pad'].queryset = Pad.objects.filter( - user=self.request.user - ) - return form - - def form_valid(self, form): - self.object = form.save(commit=False) - self.object.user = self.request.user - self.object.save() - messages.success(self.request, self.success_message) - return redirect(self.get_success_url()) - - def get_success_url(self): - if self.object.pad is not None: - return reverse_lazy( - 'view_pad_notes', kwargs={'pk': self.object.pad.id} - ) - else: - return reverse_lazy('home') - - -class NoteUpdateView(UpdateView): - model = Note - form_class = NoteForm - success_url = reverse_lazy('home') - template_name_suffix = '_edit' - success_message = 'Note is successfully updated' - - def form_valid(self, form): - messages.success(self.request, self.success_message) - return super(NoteUpdateView, self).form_valid(form) - - def get_queryset(self): - qs = super(NoteUpdateView, self).get_queryset() - return qs.filter(user=self.request.user) - - def get_form(self, form_class): - form = super(NoteUpdateView, self).get_form(self.get_form_class()) - # limit pad choice - form.fields['pad'].queryset = Pad.objects.filter( - user=self.request.user - ) - return form - - def get_success_url(self): - if self.object.pad is not None: - return reverse_lazy( - 'view_pad_notes', kwargs={'pk': self.object.pad.id} - ) - else: - return reverse_lazy('home') - - -class NoteDeleteView(DeleteView): - model = Note - - def get_queryset(self): - qs = super(NoteDeleteView, self).get_queryset() - return qs.filter(user=self.request.user) - - def get_success_url(self): - if self.object.pad is not None: - return reverse_lazy( - 'view_pad_notes', kwargs={'pk': self.object.pad.id} - ) - else: - return reverse_lazy('home') - - -class NoteDetailView(DetailView): - model = Note - - def get_queryset(self): - qs = super(NoteDetailView, self).get_queryset() - return qs.filter(user=self.request.user) - - -class NoteListView(ListView): - model = Note - context_object_name = 'notes' - order_by = '-updated_at' - - def get_queryset(self): - qs = super(NoteListView, self).get_queryset() - order_by = self.request.GET.get('order', self.order_by) - return qs.filter(user=self.request.user).order_by(order_by) diff --git a/django/notejam/pads/__init__.py b/django/notejam/pads/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/django/notejam/pads/forms.py b/django/notejam/pads/forms.py deleted file mode 100644 index b2bf2665a..000000000 --- a/django/notejam/pads/forms.py +++ /dev/null @@ -1,9 +0,0 @@ -from django import forms - -from pads.models import Pad - - -class PadForm(forms.ModelForm): - class Meta: - model = Pad - exclude = ('user',) diff --git a/django/notejam/pads/migrations/0001_initial.py b/django/notejam/pads/migrations/0001_initial.py deleted file mode 100644 index 095fb8c12..000000000 --- a/django/notejam/pads/migrations/0001_initial.py +++ /dev/null @@ -1,70 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'Pad' - db.create_table('pads_pad', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=100)), - ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - )) - db.send_create_signal('pads', ['Pad']) - - - def backwards(self, orm): - # Deleting model 'Pad' - db.delete_table('pads_pad') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'pads.pad': { - 'Meta': {'object_name': 'Pad'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) - } - } - - complete_apps = ['pads'] \ No newline at end of file diff --git a/django/notejam/pads/migrations/__init__.py b/django/notejam/pads/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/django/notejam/pads/models.py b/django/notejam/pads/models.py deleted file mode 100644 index 673c1e9ce..000000000 --- a/django/notejam/pads/models.py +++ /dev/null @@ -1,10 +0,0 @@ -from django.contrib.auth.models import User -from django.db import models - - -class Pad(models.Model): - name = models.CharField(max_length=100) - user = models.ForeignKey(User) - - def __unicode__(self): - return self.name diff --git a/django/notejam/pads/templates/pads/pad_confirm_delete.html b/django/notejam/pads/templates/pads/pad_confirm_delete.html deleted file mode 100644 index 4a2270905..000000000 --- a/django/notejam/pads/templates/pads/pad_confirm_delete.html +++ /dev/null @@ -1,14 +0,0 @@ -{% extends "base.html" %} - -{% block breadcrumbs %}Delete {{ pad.name }}{% endblock %} -{% block content %} -

Are you sure you want to delete {{ pad.name }} and all related notes?

-
- {% csrf_token %} -   - Cancel -
-{% endblock %} - - - diff --git a/django/notejam/pads/templates/pads/pad_create.html b/django/notejam/pads/templates/pads/pad_create.html deleted file mode 100644 index 77506cf8c..000000000 --- a/django/notejam/pads/templates/pads/pad_create.html +++ /dev/null @@ -1,9 +0,0 @@ -{% extends "base.html" %} - -{% block title %}New pad{% endblock %} -{% block page_title %}New pad{% endblock %} - -{% block content %} - {% include "pads/pad_form.html" %} -{% endblock %} - diff --git a/django/notejam/pads/templates/pads/pad_edit.html b/django/notejam/pads/templates/pads/pad_edit.html deleted file mode 100644 index 1e7fa62cf..000000000 --- a/django/notejam/pads/templates/pads/pad_edit.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends "base.html" %} - -{% block title %}{{ pad.name }}{% endblock %} -{% block page_title %}{{ pad.name }}{% endblock %} - -{% block content %} - {% include "pads/pad_form.html" %} - Delete pad -{% endblock %} - - diff --git a/django/notejam/pads/templates/pads/pad_form.html b/django/notejam/pads/templates/pads/pad_form.html deleted file mode 100644 index fd678c0b9..000000000 --- a/django/notejam/pads/templates/pads/pad_form.html +++ /dev/null @@ -1,7 +0,0 @@ -
- {% csrf_token %} - - {{ form.name }} - {{ form.name.errors }} - -
diff --git a/django/notejam/pads/templates/pads/pad_note_list.html b/django/notejam/pads/templates/pads/pad_note_list.html deleted file mode 100644 index c04602836..000000000 --- a/django/notejam/pads/templates/pads/pad_note_list.html +++ /dev/null @@ -1,29 +0,0 @@ -{% extends "base.html" %} -{% load date_tags %} - -{% block title %}{{ pad.name }} ({{ notes.count }}){%endblock%} -{% block page_title %}{{ pad.name }} ({{ notes.count }}){%endblock%} - -{% block content %} - {% if notes %} - - - - - - {% for note in notes %} - - - - - {% endfor %} -
Note Last modified
{{ note.name }}{{ note.updated_at|smart_date }}
- {% else %} -

Create your first note in the pad.

- {% endif %} - New note  - Pad settings -{% endblock %} - - - diff --git a/django/notejam/pads/templatetags/__init__.py b/django/notejam/pads/templatetags/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/django/notejam/pads/templatetags/pad_tags.py b/django/notejam/pads/templatetags/pad_tags.py deleted file mode 100644 index eb029b146..000000000 --- a/django/notejam/pads/templatetags/pad_tags.py +++ /dev/null @@ -1,31 +0,0 @@ -from django import template - -from pads.models import Pad - -register = template.Library() - - -def do_get_pads(parser, token): - try: - tag_name, as_, var_name = token.split_contents() - except ValueError: - raise template.TemplateSyntaxError( - "%r tag requires a single argument - var name" - % token.contents.split()[0] - ) - if as_ != 'as': - raise template.TemplateSyntaxError( - "Format is: %r as VARNAME" % tag_name - ) - return GetPadsNode(var_name) - - -class GetPadsNode(template.Node): - def __init__(self, var_name): - self.var_name = var_name - - def render(self, context): - context[self.var_name] = Pad.objects.filter(user=context['user']) - return '' - -register.tag('get_pads', do_get_pads) diff --git a/django/notejam/pads/tests.py b/django/notejam/pads/tests.py deleted file mode 100644 index d76e87109..000000000 --- a/django/notejam/pads/tests.py +++ /dev/null @@ -1,49 +0,0 @@ -from django.core.urlresolvers import reverse -from django.test import TestCase, Client - -from notejam.tests import create_user -from pads.models import Pad - - -class PadTest(TestCase): - def setUp(self): - user_data = { - 'email': 'user@example.com', - 'password': 'secure_password' - } - self.user = create_user(user_data) - self.client.login(**user_data) - - def _create_pads(self, pads): - return [ - (lambda pad: Pad.objects.create(name=pad, user=self.user).id)(pad) - for pad in pads - ] - - def test_create_success(self): - self.client.post(reverse('create_pad'), {'name': 'pad'}) - self.assertEqual(1, Pad.objects.count()) - - def test_create_fail_required_name(self): - response = self.client.post(reverse('create_pad'), {}) - self.assertIn('name', response.context['form'].errors) - - def test_edit_success(self): - id = self._create_pads(['pad'])[0] - data = {'name': 'new name'} - response = self.client.post(reverse('edit_pad', args=(id,)), data) - self.assertRedirects(response, reverse('view_pad_notes', args=(id,))) - self.assertEqual(data['name'], Pad.objects.get(id=id).name) - - def test_another_user_cant_edit_pad(self): - user_data = { - 'email': 'another_user@example.com', - 'password': 'another_secure_password' - } - create_user(user_data) - - client = Client() - client.login(**user_data) - id = self._create_pads(['pad'])[0] - response = client.post(reverse('edit_pad', args=(id,)), {}) - self.assertEqual(404, response.status_code) diff --git a/django/notejam/pads/urls.py b/django/notejam/pads/urls.py deleted file mode 100644 index bec671a6a..000000000 --- a/django/notejam/pads/urls.py +++ /dev/null @@ -1,16 +0,0 @@ -from django.conf.urls import patterns, url -from django.contrib.auth.decorators import login_required - -from pads.views import (PadCreateView, PadNotesListView, PadUpdateView, -PadDeleteView) - -urlpatterns = patterns('', - url(r'^create/$', login_required(PadCreateView.as_view()), - name='create_pad'), - url(r'^(?P\d+)/$', login_required(PadNotesListView.as_view()), - name='view_pad_notes'), - url(r'^(?P\d+)/edit/$', login_required(PadUpdateView.as_view()), - name='edit_pad'), - url(r'^(?P\d+)/delete/$', login_required(PadDeleteView.as_view()), - name='delete_pad'), -) diff --git a/django/notejam/pads/views.py b/django/notejam/pads/views.py deleted file mode 100644 index 8d3211462..000000000 --- a/django/notejam/pads/views.py +++ /dev/null @@ -1,79 +0,0 @@ -from django.contrib import messages -from django.core.urlresolvers import reverse_lazy -from django.shortcuts import redirect -from django.shortcuts import get_object_or_404 -from django.views.generic.edit import CreateView, UpdateView, DeleteView -from django.views.generic import ListView - - -from pads.models import Pad -from notes.models import Note -from pads.forms import PadForm - - -class PadCreateView(CreateView): - model = Pad - form_class = PadForm - template_name_suffix = '_create' - success_url = reverse_lazy('home') - success_message = 'Pad is successfully created' - - def form_valid(self, form): - self.object = form.save(commit=False) - self.object.user = self.request.user - self.object.save() - messages.success(self.request, self.success_message) - return redirect(self.get_success_url()) - - def get_success_url(self): - return reverse_lazy("view_pad_notes", kwargs={'pk': self.object.pk}) - - -class PadUpdateView(UpdateView): - model = Pad - form_class = PadForm - template_name_suffix = '_edit' - success_url = reverse_lazy('home') - success_message = 'Pad is successfully updated' - - def form_valid(self, form): - messages.success(self.request, self.success_message) - return super(PadUpdateView, self).form_valid(form) - - def get_queryset(self): - qs = super(PadUpdateView, self).get_queryset() - return qs.filter(user=self.request.user) - - def get_success_url(self): - return reverse_lazy("view_pad_notes", kwargs={'pk': self.object.pk}) - - -# Note list mixed with pad details data -class PadNotesListView(ListView): - model = Note - context_object_name = 'notes' - order_by = '-updated_at' - template_name = 'pads/pad_note_list.html' - - def get_queryset(self): - order_by = self.request.GET.get('order', self.order_by) - return self.get_pad().note_set.all().order_by(order_by) - - def get_pad(self): - return get_object_or_404( - Pad, pk=int(self.kwargs.get('pk')), user=self.request.user - ) - - def get_context_data(self, **kwargs): - context = super(PadNotesListView, self).get_context_data(**kwargs) - context['pad'] = self.get_pad() - return context - - -class PadDeleteView(DeleteView): - model = Pad - success_url = reverse_lazy("home") - - def get_queryset(self): - qs = super(PadDeleteView, self).get_queryset() - return qs.filter(user=self.request.user) diff --git a/django/notejam/static_files/css/style.css b/django/notejam/static_files/css/style.css deleted file mode 100644 index 86cd131ff..000000000 --- a/django/notejam/static_files/css/style.css +++ /dev/null @@ -1,395 +0,0 @@ -/* -* Skeleton V1.0.3 -* Copyright 2011, Dave Gamache -* www.getskeleton.com -* Free to use under the MIT license. -* http://www.opensource.org/licenses/mit-license.php -* 7/17/2011 -*/ - - -/* Documentation Styles -================================================== */ - div.container { - padding-top: 40px; } - - /* Doc nav */ - nav { - width: 160px; } - #logo, .bold-header { - margin-bottom: 30px; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - letter-spacing: -1px; - color: #555; - font-weight: bold; } - .bold-header span { - font-weight: normal; - font-size: 23px; - } - .bold-header a.header { - text-decoration: none; - color: inherit; - } - .bold-header span.jam { - font-size: 46px; - line-height: 50px; - } - nav ul { - float: left; } - nav ul li { - display: block; - margin-bottom: 10px; } - nav ul li a, - nav ul li a:visited, - nav ul li a:active { - font-size: 14px; - color: #555; - text-decoration: none; - font-weight: bold; } - nav ul li a:hover, - nav ul li a:focus { - color: #222; } - header h1 { - font-size: 52px; - line-height: 61px; - letter-spacing: -1px; - font-weight: normal; - font-family: "Georgia", "Times New Roman", Helvetica, Arial, sans-serif; } - hr.large { - border: none; - height: 8px; - background: #ebebeb; - margin: 50px 0; } - div.doc-section { - margin: 30px 0; } - - #whatAndWhy .row { - padding: 30px 0 0; } - - #typography blockquote { - margin-top: 20px; } - - .hidden-code a { - font-size: 12px; - color: #999; } - .hidden-code>div { - display: none; } - - - /* Grid */ - #grid .column, - #grid .columns { - background: #ddd; - height: 25px; - line-height: 25px; - margin-bottom: 10px; - text-align: center; - text-transform: uppercase; - color: #555; - font-size: 12px; - font-weight: bold; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; } - #grid .column:hover, - #grid .columns:hover { - background: #bbb; - color: #333; } - #grid .example-grid { overflow: hidden; } - - .post-button-note, - .post-button-note a { - font-size: 11px; - color: #999; } - - #examples .four.columns a { - text-decoration: none; - } - #examples .four.columns a:hover { - text-decoration: underline; - } - - - .resize { - position: fixed; - bottom: 0; - right: 0; - height: 80px; - width: 80px; - background: url(images/resize.png); } - - - img { - max-width: 100%; - height: auto; } - - .gist-meta { display: none !important;} - - ul ul ul li { margin-bottom: 3px; } - - .twitter-share-button { margin-bottom: -18px; } - - /* Table stylesheets */ - table { - width: 100%; - border-collapse: collapse; - } - - table th, table td { - padding: 10px 10px 9px; - font-size: 13px; - line-height: 18px; - text-align: left; - } - - table td { - vertical-align: top; - border-top: solid 1px #ddd; - } - - table th { - padding-top: 9px; - font-weight: bold; - vertical-align: middle; - } - - table.condensed th, table.condensed td { - padding: 5px 5px 4px; - } - - table.bordered { - border-collapse: separate; - border: solid 1px #ddd; - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; - } - - table.bordered th + th, - table.bordered th + td, - table.bordered td + td { - border-left: solid 1px #ddd; - } - - .zebra-striped tbody tr:nth-child(odd) td, - .zebra-striped tbody tr:nth-child(odd) th { - background: #f5f5f5; - } - -.carbonad, -.carbonad-image, -.carbonad-text, -.carbonad-tag { - background: none !important; - border: none !important; - margin-left: 0 !important; -} -.carbonad-tag { - margin-top: 6px !important; - padding-top: 0 !important; -} -.carbonad-text { - height: auto !important; -} -.carbonad-image { - margin-top: 0 !important; -} - -.hidden-text { - font-size: 12px; - color: #999; -} - -td.date, th.date { - text-align: right; -} - -td.date { - font-style: italic; -} - -form.note input[type="text"], form.note textarea { - width: 100%; -} - -form hr { - width: 218px; - margin: 10px 0px; -} - -form.note textarea { - height: 250px; -} - -div.content-area { - min-height: 600px; -} - -hr.footer { - margin-bottom: 10px; -} - -div.footer { - margin-bottom: 10px; - text-align: center; - font-size: 12px; -} - -form.sign-in { - margin: 50px 0 0 0; -} - -.sort_arrow { - text-decoration: none; -} - -.sort_arrow:hover { - text-decoration: none; - color: red; -} - -div.sign-in-out-block { - position: absolute; - right: 14px; - top: 8px; - font-size: 12px; -} - -div.sign-in-out-block a { - /*text-decoration: none;*/ -} - -a.small-red { - color: red; - font-size: 12px; -} - -table.notes { - margin: 0 0 20px 0; -} - -table.notes th.note { - width: 72%; -} - -table.notes td.pad { - color: grey; -} - -table.notes td.pad a { - color: grey; - text-decoration: underline; - font-style: normal; -} - - -table.notes td.pad a:hover { - color: black; -} - -p.empty { - color: grey; - font-style: italic; -} - -a.delete-note { - float: right; - font-size: 12px; - color: red; -} - -.red, input.red { - color: red !important; -} - -ul.errorlist, ul.errors { - margin: -18px 0 0 0; -} - -ul.errorlist li, ul.errors li { - color: red; -} - -.alert-area { - text-align: center; -} - -.alert { - padding: 5px 8px; - margin: 0 0 12px 0; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; -} - -.alert-success { - color: #468847; - background-color: #dff0d8; - border: 1px solid #d6e9c6; -} - -.alert-error { - color: #b94a48; - background-color: #f2dede; - border: 1px solid #eed3d7; -} - - /* Mobile */ - @media only screen and (max-width: 767px) { - header h1 { font-size: 34px; line-height: 37px; } - nav { position: relative; } - nav ul, - .carbonad { - display: none; - } - #logo { text-align: left; } - #examples .four.columns { - padding-top: 30px; - } - } - - /* Mobile Landscape */ - @media only screen and (min-width: 480px) and (max-width: 767px) { - nav ul { - display: none; - } - } - - /* Non 960 */ - @media only screen and (max-width: 959px) { - #logo { - font-size: 21px; - margin-bottom: 15px; } - nav .button { - padding: 9px 20px 11px; } - } - - /* iPad Portrait/Browser */ - @media only screen and (min-width: 768px) and (max-width: 959px) { - nav { - width: 124px; } - } - - /* Mobile/Browser */ - @media only screen and (max-width: 767px) {} - - /* Mobile Landscape/Browser */ - @media only screen and (min-width: 480px) and (max-width: 767px) {} - - /* Anything smaller than standard 960 */ - @media only screen and (max-width: 959px) {} - - - /* iPad Portrait Only */ - @media only screen and (min-width: 768px) and (max-width: 959px) and (max-device-width: 1000px) {} - - /* Mobile Only */ - @media only screen and (max-width: 767px) and (max-device-width: 1000px) {} - - /* Mobile Landscape Only */ - @media only screen and (min-width: 480px) and (max-width: 767px) and (max-device-width: 1000px) {} - - /* Anything smaller than standard 960 on a device */ - @media only screen and (max-width: 959px) and (max-device-width: 1000px) { - .resize { display: none; } - } diff --git a/django/notejam/templates/404.html b/django/notejam/templates/404.html deleted file mode 100644 index e69de29bb..000000000 diff --git a/django/notejam/templates/base.html b/django/notejam/templates/base.html deleted file mode 100644 index 5b84e65d2..000000000 --- a/django/notejam/templates/base.html +++ /dev/null @@ -1,92 +0,0 @@ -{% load pad_tags %} - - - - - - - - - - {% block title %}Notejam{% endblock %} - - - - - - - - - - - - - - - {% block extrahead %}{% endblock %} - - -
-
- -
-
-

- notejam: - {% block page_title %} - All notes - {% endblock %} -

-
- {% block pads %} -
- - - - -
- {% endblock %} -
- {% if messages %} -
- {% for message in messages %} -
{{ message }}
- {% endfor %} -
- {% endif %} - {% block content %} - {% endblock %} -
- - -
- Fork me on GitHub - - diff --git a/django/notejam/templates/user.html b/django/notejam/templates/user.html deleted file mode 100644 index 39a93a045..000000000 --- a/django/notejam/templates/user.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "base.html" %} - -{% block pads %}{% endblock %} - -{% block content_class %}sixteen columns content-area{% endblock %} diff --git a/django/notejam/users/__init__.py b/django/notejam/users/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/django/notejam/users/auth_backends.py b/django/notejam/users/auth_backends.py deleted file mode 100644 index ada5ecd92..000000000 --- a/django/notejam/users/auth_backends.py +++ /dev/null @@ -1,18 +0,0 @@ -from django.contrib.auth.models import User - - -class EmailModelBackend(object): - ''' Custom backend to be able to use email for authentication ''' - def authenticate(self, email=None, password=None): - try: - user = User.objects.get(email=email) - if user.check_password(password): - return user - except User.DoesNotExist: - return None - - def get_user(self, user_id): - try: - return User.objects.get(pk=user_id) - except User.DoesNotExist: - return None diff --git a/django/notejam/users/forms.py b/django/notejam/users/forms.py deleted file mode 100644 index 0079708fb..000000000 --- a/django/notejam/users/forms.py +++ /dev/null @@ -1,56 +0,0 @@ -from django import forms -from django.contrib.auth.models import User - - -class SignupForm(forms.ModelForm): - email = forms.EmailField() - password = forms.CharField(widget=forms.PasswordInput()) - repeat_password = forms.CharField(widget=forms.PasswordInput()) - - class Meta: - model = User - fields = ('email',) - - def save(self, force_insert=False, force_update=False, commit=True): - user = super(SignupForm, self).save(commit=False) - # username hack (we don't need username, but django requires it ?) - user.username = user.email - - user.set_password(self.cleaned_data['password']) - if commit: - user.save() - return user - - def clean_email(self): - email = self.cleaned_data.get('email') - - if User.objects.filter(email=email).count(): - raise forms.ValidationError( - 'User with this email is already signed up' - ) - - return email - - def clean_repeat_password(self): - password = self.cleaned_data.get('password') - repeat_password = self.cleaned_data.get('repeat_password') - - if password != repeat_password: - raise forms.ValidationError("Your passwords do not match") - - -class SigninForm(forms.Form): - email = forms.EmailField() - password = forms.CharField(widget=forms.PasswordInput()) - - -class ForgotPasswordForm(forms.Form): - email = forms.EmailField() - - def clean_email(self): - email = self.cleaned_data.get('email') - try: - User.objects.get(email=email) - return email - except User.DoesNotExist: - raise forms.ValidationError("No user with given email") diff --git a/django/notejam/users/models.py b/django/notejam/users/models.py deleted file mode 100644 index 71a836239..000000000 --- a/django/notejam/users/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/django/notejam/users/templates/forgot_password.html b/django/notejam/users/templates/forgot_password.html deleted file mode 100644 index 8851e0f07..000000000 --- a/django/notejam/users/templates/forgot_password.html +++ /dev/null @@ -1,15 +0,0 @@ -{% extends "user.html" %} - -{% block title %}Forgot password?{% endblock %} -{% block page_title %}Forgot password?{% endblock %} - -{% block content %} - -{% endblock %} - diff --git a/django/notejam/users/templates/settings.html b/django/notejam/users/templates/settings.html deleted file mode 100644 index 699e780ee..000000000 --- a/django/notejam/users/templates/settings.html +++ /dev/null @@ -1,20 +0,0 @@ -{% extends "user.html" %} - -{% block title %}Account Settings{% endblock %} -{% block page_title %}Account Settings{% endblock %} - -{% block content %} -
- {% csrf_token %} - - {{ form.old_password }} - {{ form.old_password.errors }} - - {{ form.new_password1 }} - {{ form.new_password1.errors }} - - {{ form.new_password2 }} - {{ form.new_password2.errors }} - -
-{% endblock %} diff --git a/django/notejam/users/templates/signin.html b/django/notejam/users/templates/signin.html deleted file mode 100644 index faee87030..000000000 --- a/django/notejam/users/templates/signin.html +++ /dev/null @@ -1,19 +0,0 @@ -{% extends "user.html" %} - -{% block title %}Sign In{% endblock %} -{% block page_title %}Sign In{% endblock %} - -{% block content %} - -{% endblock %} diff --git a/django/notejam/users/templates/signup.html b/django/notejam/users/templates/signup.html deleted file mode 100644 index ba717ced7..000000000 --- a/django/notejam/users/templates/signup.html +++ /dev/null @@ -1,21 +0,0 @@ -{% extends "user.html" %} - -{% block title %}Sign Up{% endblock %} -{% block page_title %}Sign Up{% endblock %} - -{% block content %} - -{% endblock %} - diff --git a/django/notejam/users/tests.py b/django/notejam/users/tests.py deleted file mode 100644 index 5923a6a83..000000000 --- a/django/notejam/users/tests.py +++ /dev/null @@ -1,83 +0,0 @@ -from django.contrib.auth.models import User -from django.core.urlresolvers import reverse -from django.test import TestCase - - -class SignUpTest(TestCase): - def _get_user_data(self, **kwargs): - user_data = { - 'email': 'email@example.com', - 'password': 'secure_password', - 'repeat_password': 'secure_password' - } - user_data.update(**kwargs) - return user_data - - def test_signup_success(self): - response = self.client.post( - reverse('signup'), self._get_user_data()) - self.assertRedirects(response, reverse('signin')) - self.assertEqual(1, User.objects.all().count()) - - def test_signup_fail_required_fields(self): - response = self.client.post(reverse('signup'), {}) - self.assertEqual( - response.context['form'].errors.keys(), - self._get_user_data().keys() - ) - - def test_signup_fail_invalid_email(self): - invalid_data = self._get_user_data(email='invalid email') - response = self.client.post(reverse('signup'), invalid_data) - self.assertIn('email', response.context['form'].errors) - - def test_signup_fail_passwords_dont_match(self): - invalid_data = self._get_user_data(password='another pass') - response = self.client.post(reverse('signup'), invalid_data) - self.assertIn('repeat_password', response.context['form'].errors) - - def test_signup_fail_email_exists(self): - data = self._get_user_data() - User.objects.create( - email=data['email'], - username=data['email'], - password=data['password'] - ) - - response = self.client.post(reverse('signup'), data) - self.assertIn('email', response.context['form'].errors) - - -class SignInTest(TestCase): - def _get_user_data(self, **kwargs): - user_data = { - 'email': 'email@example.com', - 'password': 'secure_password' - } - user_data.update(**kwargs) - return user_data - - def test_signin_success(self): - data = self._get_user_data() - user = User.objects.create(email=data['email'], username=data['email']) - user.set_password(data['password']) - user.save() - - response = self.client.post(reverse('signin'), data) - self.assertRedirects(response, reverse('home')) - - def test_signin_fail(self): - response = self.client.post(reverse('signin'), self._get_user_data()) - self.assertContains(response, 'Wrong email or password') - - def test_signin_fail_required_fields(self): - response = self.client.post(reverse('signin'), {}) - self.assertEqual( - response.context['form'].errors.keys(), - self._get_user_data().keys() - ) - - def test_signin_fail_invalid_email(self): - invalid_data = self._get_user_data(email='invalid email') - response = self.client.post(reverse('signin'), invalid_data) - self.assertIn('email', response.context['form'].errors) diff --git a/django/notejam/users/views.py b/django/notejam/users/views.py deleted file mode 100644 index 51ac56d38..000000000 --- a/django/notejam/users/views.py +++ /dev/null @@ -1,106 +0,0 @@ -import hashlib -from datetime import datetime - -from django.conf import settings -from django.contrib import messages -from django.contrib.auth import authenticate, login -from django.contrib.auth.forms import PasswordChangeForm -from django.contrib.auth.models import User -from django.core.mail import send_mail -from django.core.urlresolvers import reverse_lazy -from django.shortcuts import redirect -from django.views.generic.edit import FormView -from django.views.generic.edit import CreateView - -from users.forms import SignupForm, SigninForm, ForgotPasswordForm - - -class SignupView(CreateView): - model = User - form_class = SignupForm - template_name = "signup.html" - success_url = reverse_lazy('signin') - success_message = "Account is created. Now you can sign in." - - def form_valid(self, form): - messages.success(self.request, self.success_message) - return super(SignupView, self).form_valid(form) - - -class SigninView(FormView): - template_name = "signin.html" - form_class = SigninForm - success_url = reverse_lazy('home') - error_message = "Wrong email or password" - - def post(self, request, *args, **kwargs): - form_class = self.get_form_class() - form = self.get_form(form_class) - if form.is_valid(): - user = authenticate( - email=form.cleaned_data['email'], - password=form.cleaned_data['password'] - ) - if user is not None: - login(request, user) - return redirect(reverse_lazy('home')) - else: - messages.error(request, self.error_message) - - return self.render_to_response( - self.get_context_data(form=form) - ) - else: - return self.form_invalid(form, **kwargs) - - -class ForgotPasswordView(FormView): - form_class = ForgotPasswordForm - template_name = 'forgot_password.html' - success_url = reverse_lazy('signin') - success_message = 'New password is sent in your email inbox' - - def form_valid(self, form): - m = hashlib.md5() - m.update( - "{email}{secret}{date}".format( - email=form.cleaned_data['email'], - secret=settings.SECRET_KEY, - date=str(datetime.today()) - ) - ) - new_password = m.hexdigest()[:8] - - user = User.objects.get(email=form.cleaned_data['email']) - user.set_password(new_password) - user.save() - - send_mail( - 'Notejam password reset', - 'Hi, {}. Your new password is {}.'.format( - form.cleaned_data['email'], - new_password - ), - 'from@notejamapp.com', - [form.cleaned_data['email']], - fail_silently=False - ) - messages.success(self.request, self.success_message) - - return super(ForgotPasswordView, self).form_valid(form) - - -class AccountSettingsView(FormView): - form_class = PasswordChangeForm - template_name = 'settings.html' - success_url = reverse_lazy('home') - success_message = 'Password is successfully changed' - - def get_form_kwargs(self): - kwargs = super(AccountSettingsView, self).get_form_kwargs() - kwargs['user'] = self.request.user - return kwargs - - def form_valid(self, form): - messages.success(self.request, self.success_message) - return super(AccountSettingsView, self).form_valid(form) diff --git a/django/requirements.txt b/django/requirements.txt deleted file mode 100644 index 4c05c817f..000000000 --- a/django/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -Django==1.6.5 -South==1.0 diff --git a/express/README.rst b/express/README.rst deleted file mode 100644 index a851fa182..000000000 --- a/express/README.rst +++ /dev/null @@ -1,83 +0,0 @@ -**************** -Notejam: Express -**************** - -Notejam application implemented using `Express.js `_ microframework. - -Express version: 4.2 - -Middlewares/extentions used: - -* `Passport.js `_ for authentication -* `Node ORM 2 `_ for database -* `Mocha `_ and `Superagent `_ for testing -* ... and `others `_ - -========================== -Installation and launching -========================== - -------- -Cloning -------- - -Clone the repo: - -.. code-block:: bash - - $ git clone git@github.com:komarserjio/notejam.git YOUR_PROJECT_DIR/ - -------------------- -Install environment -------------------- -Use `npm `_ to manage dependencies. - -Install dependencies - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/express/notejam/ - $ npm install - -Create database schema - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/express/notejam/ - $ node db.js - ------- -Launch ------- - -Start built-in web server: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/express/notejam/ - $ DEBUG=* ./bin/www - -Go to http://127.0.0.1:3000/ in your browser - ------------------- -Running unit tests ------------------- - -Run unit tests: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/express/notejam/ - $ ./node_modules/mocha/bin/mocha tests - -============ -Contribution -============ - -Please send your pull requests in the ``master`` branch. - -Always prepend your commits with a framework name: - -.. code-block:: bash - - Express: Implemented sign in functionality diff --git a/express/notejam/app.js b/express/notejam/app.js deleted file mode 100644 index f78635800..000000000 --- a/express/notejam/app.js +++ /dev/null @@ -1,110 +0,0 @@ -var express = require('express'); -var session = require('express-session'); -var path = require('path'); -var favicon = require('static-favicon'); -var logger = require('morgan'); -var cookieParser = require('cookie-parser'); -var flash = require('connect-flash'); -var bodyParser = require('body-parser'); -var orm = require('orm'); -var expressValidator = require('express-validator'); -var passport = require('passport'); -var LocalStrategy = require('passport-local').Strategy; - -var users = require('./routes/users'); -var pads = require('./routes/pads'); -var notes = require('./routes/notes'); -var settings = require('./settings') - -var app = express(); - - -// view engine setup -app.set('views', path.join(__dirname, 'views')); -app.set('view engine', 'jade'); - -app.use(favicon()); -app.use(logger('dev')); -app.use(bodyParser.json()); -app.use(bodyParser.urlencoded()); -app.use(expressValidator()); -app.use(cookieParser()); -app.use(session({cookie: { maxAge: 60000 }, secret: 'secret'})); -app.use(flash()); -app.use(passport.initialize()); -app.use(passport.session()); -app.use(express.static(path.join(__dirname, 'public'))); - -// DB configuration -var sqlite3 = require('sqlite3').verbose(); -var db = new sqlite3.Database(settings.db); - -orm.settings.set("instance.returnAllErrors", true); -app.use(orm.express(settings.dsn, { - define: function (db, models, next) { - db.load("./models", function (err) { - models.User = db.models.users; - models.Pad = db.models.pads; - models.Note = db.models.notes; - next(); - }); - } -})); - -// Flash Messages configuration -app.use(function(req, res, next){ - res.locals.flash_messages = { - 'success': req.flash('success'), - 'error': req.flash('error') - } - next(); -}); - -// Inject request object and user pads in view scope -app.use(function(req, res, next){ - res.locals.req = req; - - if (req.isAuthenticated()) { - req.user.getPads(function(i, pads) { - res.locals.pads = pads; - next(); - }); - } else { - next(); - } -}); - -app.use('/', users); -app.use('/', pads); -app.use('/', notes); - -/// catch 404 and forward to error handler -app.use(function(req, res, next) { - var err = new Error('Not Found'); - err.status = 404; - next(err); -}); - -// development error handler -// will print stacktrace -if (app.get('env') === 'development') { - app.use(function(err, req, res, next) { - res.status(err.status || 500); - res.render('error', { - message: err.message, - error: err - }); - }); -} - -// production error handler -// no stacktraces leaked to user -app.use(function(err, req, res, next) { - res.status(err.status || 500); - res.render('error', { - message: err.message, - error: {} - }); -}); - -module.exports = app; diff --git a/express/notejam/bin/www b/express/notejam/bin/www deleted file mode 100755 index 5e193192b..000000000 --- a/express/notejam/bin/www +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env node -var debug = require('debug')('notejam'); -var app = require('../app'); - -app.set('port', process.env.PORT || 3000); - -var server = app.listen(app.get('port'), function() { - debug('Express server listening on port ' + server.address().port); -}); diff --git a/express/notejam/db.js b/express/notejam/db.js deleted file mode 100644 index d0d4a0dec..000000000 --- a/express/notejam/db.js +++ /dev/null @@ -1,105 +0,0 @@ -var sqlite3 = require('sqlite3').verbose(); -var async = require('async'); - -var settings = require('./settings'); -var db = new sqlite3.Database(settings.db); - -var functions = { - createTables: function(next) { - async.series({ - createUsers: function(callback) { - db.run("CREATE TABLE IF NOT EXISTS users (" + - "id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL," + - "email VARCHAR(75) NOT NULL," + - "password VARCHAR(128) NOT NULL);", [], - function() { callback(null); }); - }, - createPads: function(callback) { - db.run("CREATE TABLE IF NOT EXISTS pads (" + - "id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL," + - "name VARCHAR(100) NOT NULL," + - "user_id INTEGER NOT NULL REFERENCES users(id));", [], - function() { callback(null); }) - }, - createNotes: function(callback) { - db.run("CREATE TABLE IF NOT EXISTS notes (" + - "id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL," + - "pad_id INTEGER REFERENCES pads(id)," + - "user_id INTEGER NOT NULL REFERENCES users(id)," + - "name VARCHAR(100) NOT NULL," + - "text text NOT NULL," + - "created_at default current_timestamp," + - "updated_at default current_timestamp);", [], - function() { callback(null); }); - } - }, - function(err, results) { - next(); - }); - }, - - applyFixtures: function(next) { - this.truncateTables(function() { - async.series([ - function(callback) { - db.run("INSERT INTO users VALUES (1, 'user1@example.com', " + - "'$2a$10$mhkqpUvPPs.zoRSTiGAEKODOJMljkOY96zludIIw.Pop1UvQCTx8u')", [], - function() { callback(null) }); - }, - function(callback) { - db.run("INSERT INTO users VALUES (2, 'user2@example.com', " + - "'$2a$10$mhkqpUvPPs.zoRSTiGAEKODOJMljkOY96zludIIw.Pop1UvQCTx8u')", [], - function() { callback(null) }); - - }, - function(callback) { - db.run("INSERT INTO pads VALUES (1, 'Pad 1', 1)", [], - function() { callback(null) }); - }, - function(callback) { - db.run("INSERT INTO pads VALUES (2, 'Pad 2', 1)", [], - function() { callback(null) }); - }, - function(callback) { - db.run("INSERT INTO notes VALUES (1, 1, 1, 'Note 1', 'Text', 1, 1)", [], - function() { callback(null) }); - }, - function(callback) { - db.run("INSERT INTO notes VALUES (2, 1, 1, 'Note 2', 'Text', 1, 1)", [], - function() { callback(null) }); - } - ], function(err, results) { - next(); - }) - }); - }, - - truncateTables: function(next) { - async.series([ - function(callback) { - db.run("DELETE FROM users;", [], - function() { callback(null) }); - }, - function(callback) { - db.run("DELETE FROM notes;", [], - function() { callback(null) }); - - }, - function(callback) { - db.run("DELETE FROM pads;", [], - function(result) { callback(null); }); - } - ], function(err, results) { - next(); - }) - } -} - - -if (require.main === module) { - functions.createTables(function() { - console.log("DB successfully initialized"); - }); -} - -module.exports = functions; diff --git a/express/notejam/helpers.js b/express/notejam/helpers.js deleted file mode 100644 index 21fe0a575..000000000 --- a/express/notejam/helpers.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = { - formatFormErrors: function(errors) { - formatted = {}; - errors.forEach(function(e) { - formatted[e.param] = e.msg; - }); - return formatted; - }, - - formatModelErrors: function(errors) { - formatted = {}; - errors.forEach(function(e) { - formatted[e.property] = e.msg; - }); - return formatted; - }, - - loginRequired: function (req, res, next) { - if (req.isAuthenticated()) { return next(); } - res.redirect('/signin') - } -} diff --git a/express/notejam/models.js b/express/notejam/models.js deleted file mode 100644 index aa5b3ab11..000000000 --- a/express/notejam/models.js +++ /dev/null @@ -1,49 +0,0 @@ -var orm = require('orm'); -var moment = require('moment'); - -module.exports = function (db, cb) { - var User = db.define("users", { - id : { type: "serial", key: true }, - email : { type: "text" }, - password: { type: "text" } - }, { - validations: { - email: [orm.enforce.unique("User with given email already exists!"), - orm.enforce.patterns.email("Invalid email")], - password: orm.enforce.notEmptyString("Password is required"), - // @TODO add "match passwords" validation - } - }); - - var Pad = db.define("pads", { - id : { type: "serial", key: true }, - name : { type: "text" }, - }, { - validations: { - name: orm.enforce.notEmptyString("Name is required"), - } - }); - Pad.hasOne("user", User, { required: true, reverse: 'pads' }); - - var Note = db.define("notes", { - id : { type: "serial", key: true }, - name : { type: "text" }, - text : { type: "text" }, - created_at : { type: "date", time: true }, - updated_at : { type: "date", time: true } - }, { - methods: { - updatedAt: function () { - return moment(this.updated_at).fromNow(); - } - }, - validations: { - name: orm.enforce.notEmptyString("Name is required"), - text: orm.enforce.notEmptyString("Text is required"), - } - }); - Note.hasOne("user", User, { required: true, reverse: 'notes' }); - Note.hasOne("pad", Pad, { required: false, reverse: 'notes' }); - - return cb(); -}; diff --git a/express/notejam/package.json b/express/notejam/package.json deleted file mode 100644 index cd4cb3a00..000000000 --- a/express/notejam/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "notejam", - "version": "0.0.1", - "private": true, - "scripts": { - "start": "node ./bin/www" - }, - "dependencies": { - "express": "~4.2.0", - "sqlite3": "*", - "static-favicon": "~1.0.0", - "morgan": "~1.0.0", - "cookie-parser": "~1.0.1", - "body-parser": "~1.0.0", - "debug": "~0.7.4", - "jade": "~1.3.0", - "orm": "~2.1.19", - "connect-flash": "~0.1.1", - "express-session": "~1.0.2", - "express-validator": "~2.6.0", - "passport": "0.2.1", - "passport-local": "1.0.0", - "mocha": "1.*.*", - "supertest": "0.*.*", - "superagent": "*", - "should": "*", - "should-http": "*", - "async": "*", - "moment": "*", - "bcrypt": "*", - "nodemailer": "*", - "nodemailer-stub-transport": "*" - } -} diff --git a/express/notejam/public/stylesheets/style.css b/express/notejam/public/stylesheets/style.css deleted file mode 100644 index f2cf7f5de..000000000 --- a/express/notejam/public/stylesheets/style.css +++ /dev/null @@ -1,397 +0,0 @@ -/* -* Skeleton V1.0.3 -* Copyright 2011, Dave Gamache -* www.getskeleton.com -* Free to use under the MIT license. -* http://www.opensource.org/licenses/mit-license.php -* 7/17/2011 -*/ - - -/* Documentation Styles -================================================== */ - div.container { - padding-top: 40px; } - - /* Doc nav */ - nav { - width: 160px; } - #logo, .bold-header { - margin-bottom: 30px; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - letter-spacing: -1px; - color: #555; - font-weight: bold; } - .bold-header span { - font-weight: normal; - font-size: 23px; - } - .bold-header a.header { - text-decoration: none; - color: inherit; - } - .bold-header span.jam { - font-size: 46px; - line-height: 50px; - } - nav ul { - float: left; } - nav ul li { - display: block; - margin-bottom: 10px; } - nav ul li a, - nav ul li a:visited, - nav ul li a:active { - font-size: 14px; - color: #555; - text-decoration: none; - font-weight: bold; } - nav ul li a:hover, - nav ul li a:focus { - color: #222; } - header h1 { - font-size: 52px; - line-height: 61px; - letter-spacing: -1px; - font-weight: normal; - font-family: "Georgia", "Times New Roman", Helvetica, Arial, sans-serif; } - hr.large { - border: none; - height: 8px; - background: #ebebeb; - margin: 50px 0; } - div.doc-section { - margin: 30px 0; } - - #whatAndWhy .row { - padding: 30px 0 0; } - - #typography blockquote { - margin-top: 20px; } - - .hidden-code a { - font-size: 12px; - color: #999; } - .hidden-code>div { - display: none; } - - - /* Grid */ - #grid .column, - #grid .columns { - background: #ddd; - height: 25px; - line-height: 25px; - margin-bottom: 10px; - text-align: center; - text-transform: uppercase; - color: #555; - font-size: 12px; - font-weight: bold; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; } - #grid .column:hover, - #grid .columns:hover { - background: #bbb; - color: #333; } - #grid .example-grid { overflow: hidden; } - - .post-button-note, - .post-button-note a { - font-size: 11px; - color: #999; } - - #examples .four.columns a { - text-decoration: none; - } - #examples .four.columns a:hover { - text-decoration: underline; - } - - - .resize { - position: fixed; - bottom: 0; - right: 0; - height: 80px; - width: 80px; - background: url(images/resize.png); } - - - img { - max-width: 100%; - height: auto; } - - .gist-meta { display: none !important;} - - ul ul ul li { margin-bottom: 3px; } - - .twitter-share-button { margin-bottom: -18px; } - - /* Table stylesheets */ - table { - width: 100%; - border-collapse: collapse; - } - - table th, table td { - padding: 10px 10px 9px; - font-size: 13px; - line-height: 18px; - text-align: left; - } - - table td { - vertical-align: top; - border-top: solid 1px #ddd; - } - - table th { - padding-top: 9px; - font-weight: bold; - vertical-align: middle; - } - - table.condensed th, table.condensed td { - padding: 5px 5px 4px; - } - - table.bordered { - border-collapse: separate; - border: solid 1px #ddd; - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; - } - - table.bordered th + th, - table.bordered th + td, - table.bordered td + td { - border-left: solid 1px #ddd; - } - - .zebra-striped tbody tr:nth-child(odd) td, - .zebra-striped tbody tr:nth-child(odd) th { - background: #f5f5f5; - } - -.carbonad, -.carbonad-image, -.carbonad-text, -.carbonad-tag { - background: none !important; - border: none !important; - margin-left: 0 !important; -} -.carbonad-tag { - margin-top: 6px !important; - padding-top: 0 !important; -} -.carbonad-text { - height: auto !important; -} -.carbonad-image { - margin-top: 0 !important; -} - -.hidden-text { - font-size: 12px; - color: #999; -} - -td.date, th.date { - text-align: right; -} - -td.date { - font-style: italic; -} - -form.note input[type="text"], form.note textarea { - width: 100%; -} - -form hr { - width: 218px; - margin: 10px 0px; -} - -form.note textarea { - height: 250px; -} - -div.content-area { - min-height: 600px; -} - -hr.footer { - margin-bottom: 10px; -} - -div.footer { - margin-bottom: 10px; - text-align: center; - font-size: 12px; -} - -form.sign-in { - margin: 50px 0 0 0; -} - -.sort_arrow { - text-decoration: none; -} - -.sort_arrow:hover { - text-decoration: none; - color: red; -} - -div.sign-in-out-block { - position: absolute; - right: 14px; - top: 8px; - font-size: 12px; -} - -div.sign-in-out-block a { - /*text-decoration: none;*/ -} - -a.small-red { - color: red; - font-size: 12px; -} - -table.notes { - margin: 0 0 20px 0; -} - -table.notes th.note { - width: 72%; -} - -table.notes td.pad { - color: grey; -} - -table.notes td.pad a { - color: grey; - text-decoration: underline; - font-style: normal; -} - - -table.notes td.pad a:hover { - color: black; -} - -p.empty { - color: grey; - font-style: italic; -} - -a.delete-note { - float: right; - font-size: 12px; - color: red; -} - -.red, input.red { - color: red !important; -} - -ul.errorlist, ul.errors { - margin: -18px 0 0 0; -} - -ul.errorlist li, ul.errors li { - color: red; -} - -.alert-area { - text-align: center; -} - -.alert { - padding: 5px 8px; - margin: 0 0 12px 0; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; -} - -.alert-success { - color: #468847; - background-color: #dff0d8; - border: 1px solid #d6e9c6; -} - -.alert-error { - color: #b94a48; - background-color: #f2dede; - border: 1px solid #eed3d7; -} - - /* Mobile */ - @media only screen and (max-width: 767px) { - header h1 { font-size: 34px; line-height: 37px; } - nav { position: relative; } - nav ul, - .carbonad { - display: none; - } - #logo { text-align: left; } - #examples .four.columns { - padding-top: 30px; - } - } - - /* Mobile Landscape */ - @media only screen and (min-width: 480px) and (max-width: 767px) { - nav ul { - display: none; - } - } - - /* Non 960 */ - @media only screen and (max-width: 959px) { - #logo { - font-size: 21px; - margin-bottom: 15px; } - nav .button { - padding: 9px 20px 11px; } - } - - /* iPad Portrait/Browser */ - @media only screen and (min-width: 768px) and (max-width: 959px) { - nav { - width: 124px; } - } - - /* Mobile/Browser */ - @media only screen and (max-width: 767px) {} - - /* Mobile Landscape/Browser */ - @media only screen and (min-width: 480px) and (max-width: 767px) {} - - /* Anything smaller than standard 960 */ - @media only screen and (max-width: 959px) {} - - - /* iPad Portrait Only */ - @media only screen and (min-width: 768px) and (max-width: 959px) and (max-device-width: 1000px) {} - - /* Mobile Only */ - @media only screen and (max-width: 767px) and (max-device-width: 1000px) {} - - /* Mobile Landscape Only */ - @media only screen and (min-width: 480px) and (max-width: 767px) and (max-device-width: 1000px) {} - - /* Anything smaller than standard 960 on a device */ - @media only screen and (max-width: 959px) and (max-device-width: 1000px) { - .resize { display: none; } - } - - diff --git a/express/notejam/routes/notes.js b/express/notejam/routes/notes.js deleted file mode 100644 index 339e21228..000000000 --- a/express/notejam/routes/notes.js +++ /dev/null @@ -1,108 +0,0 @@ -var express = require('express'); -var router = express.Router(); -var orm = require('orm'); -var async = require('async'); - -var helpers = require('../helpers'); - -// All notes (main page) -router.get('/', helpers.loginRequired, function(req, res) { - req.user.getNotes(req.param("order", "-updated_at"), function(i, notes) { - async.map(notes, function(item, cb) { - item.getPad(function(err, pad) { - item.pad = pad; - return cb(null, item); - }) - }, function(err, results) { - res.render( - 'notes/list', - {title: 'All notes (' + results.length + ')', notes: results} - ); - }); - }) -}); - -// Create new note -router.get('/notes/create', helpers.loginRequired, function(req, res) { - res.render('notes/create', {padId: req.param('pad')}); -}); - -router.post('/notes/create', helpers.loginRequired, function(req, res) { - var data = req.body; - data['user_id'] = req.user.id; - req.models.Note.create(data, function(err, message) { - if (err) { - res.locals.errors = helpers.formatModelErrors(err); - } else { - req.flash( - 'success', - 'Note is successfully created' - ); - return res.redirect('/'); - } - res.render('notes/create'); - }); -}); - -// Inject note in request -router.use('/notes/:id', function(req, res, next) { - if (req.user) { - req.models.Note.one( - {id: req.param('id'), user_id: req.user.id}, - function(err, note) { - if (note == null) { - res.send(404); - return; - }; - req.note = note; - next(); - }); - } else { - next(); - } -}); - - -// View note -router.get('/notes/:id', helpers.loginRequired, function(req, res) { - res.render('notes/view', {note: req.note}); -}); - - - -// Edit note -router.get('/notes/:id/edit', helpers.loginRequired, function(req, res) { - res.render('notes/edit', {note: req.note}); -}); - -router.post('/notes/:id/edit', helpers.loginRequired, function(req, res) { - req.note.save(req.body, function(err) { - if (err) { - res.locals.errors = helpers.formatModelErrors(err); - res.render('notes/edit', {note: req.note}); - } else { - req.flash( - 'success', - 'Note is successfully updated' - ); - res.redirect('/notes/' + req.note.id); - } - }); -}); - -// Delete note -router.get('/notes/:id/delete', helpers.loginRequired, function(req, res) { - res.render('notes/delete', {note: req.note}); -}); - -router.post('/notes/:id/delete', helpers.loginRequired, function(req, res) { - req.note.remove(function(err) { - req.flash( - 'success', - 'Note is successfully deleted' - ); - res.redirect('/'); - }); -}); - -module.exports = router; diff --git a/express/notejam/routes/pads.js b/express/notejam/routes/pads.js deleted file mode 100644 index c9d1ceee4..000000000 --- a/express/notejam/routes/pads.js +++ /dev/null @@ -1,93 +0,0 @@ -var express = require('express'); -var router = express.Router(); -var orm = require('orm'); - -var helpers = require('../helpers') - -// Create new pad -router.get('/pads/create', helpers.loginRequired, function(req, res) { - res.render('pads/create'); -}); - -router.post('/pads/create', helpers.loginRequired, function(req, res) { - var data = req.body; - data['user_id'] = req.user.id; - req.models.Pad.create(data, function(err, message) { - if (err) { - res.locals.errors = helpers.formatModelErrors(err); - } else { - req.flash( - 'success', - 'Pad is successfully created' - ); - return res.redirect('/'); - } - res.render('pads/create'); - }); -}); - -// Inject pad in request -router.use('/pads/:id', function(req, res, next) { - if (req.user) { - req.models.Pad.one( - {id: req.param('id'), user_id: req.user.id}, - function(err, pad) { - if (pad == null) { - res.send(404); - return; - }; - req.pad = pad; - next(); - }); - } else { - next(); - } -}); - -// Pad notes -router.get('/pads/:id', helpers.loginRequired, function(req, res) { - req.pad.getNotes(req.param("order", "-updated_at"), function(i, notes) { - res.render( - 'pads/list', - {title: req.pad.name + ' (' + notes.length + ')', - pad: req.pad, notes: notes} - ); - }); -}); - -// Edit pad -router.get('/pads/:id/edit', helpers.loginRequired, function(req, res) { - res.render('pads/edit', {pad: req.pad}); -}); - -router.post('/pads/:id/edit', helpers.loginRequired, function(req, res) { - req.pad.save({name: req.param('name')}, function(err) { - if (err) { - res.locals.errors = helpers.formatModelErrors(err); - res.render('pads/edit', {pad: req.pad}); - } else { - req.flash( - 'success', - 'Pad is successfully updated' - ); - res.redirect('/'); - } - }); -}); - -// Delete pad -router.get('/pads/:id/delete', helpers.loginRequired, function(req, res) { - res.render('pads/delete', {pad: req.pad}); -}); - -router.post('/pads/:id/delete', helpers.loginRequired, function(req, res) { - req.pad.remove(function(err) { - req.flash( - 'success', - 'Pad is successfully deleted' - ); - res.redirect('/'); - }); -}); - -module.exports = router; diff --git a/express/notejam/routes/users.js b/express/notejam/routes/users.js deleted file mode 100644 index e1e72dc06..000000000 --- a/express/notejam/routes/users.js +++ /dev/null @@ -1,230 +0,0 @@ -var express = require('express'); -var router = express.Router(); -var debug = require('debug')('http') -var orm = require('orm'); -var passport = require('passport'); -var LocalStrategy = require('passport-local').Strategy; -var bcrypt = require('bcrypt'); -var nodemailer = require('nodemailer'); -var stubTransport = require('nodemailer-stub-transport'); - -var helpers = require('../helpers') -var settings = require('../settings'); - -// Sign Up -router.get('/signup', function(req, res) { - res.render('users/signup'); -}); - -router.post('/signup', function(req, res) { - var data = req.body; - if (data['password']) { - data['password'] = generateHash(data['password']); - }; - req.models.User.create(data, function(err, message) { - if (err) { - res.locals.errors = helpers.formatModelErrors(err); - } else { - req.flash( - 'success', - 'User is successfully created. Now you can sign in.' - ); - return res.redirect('/signin'); - } - res.render('users/signup'); - }); -}); - -// Sign In -router.get('/signin', function(req, res) { - res.render('users/signin'); -}); - -router.post('/signin', function(req, res, next) { - req.checkBody('email', 'Email is required').notEmpty(); - req.checkBody('password', 'Password is required').notEmpty(); - if (req.validationErrors()) { - var errors = helpers.formatFormErrors(req.validationErrors()); - } - - if (!errors) { - passport.authenticate('local', function(err, user, info) { - if (err) { return next(err) } - if (!user) { - req.flash('error', info.message); - return res.redirect('/signin') - } - req.logIn(user, function(err) { - if (err) { return next(err); } - return res.redirect('/'); - }); - })(req, res, next); - } else { - res.locals.errors = errors; - res.render('users/signin'); - } -}); - -// Account settings -router.get('/settings', helpers.loginRequired, function(req, res) { - res.render('users/settings'); -}); - -router.post('/settings', function(req, res, next) { - req.checkBody('password', 'Password is required').notEmpty(); - req.checkBody('new_password', 'New password is required').notEmpty(); - req.checkBody('confirm_new_password', 'Passwords do not match').equals( - req.body.new_password - ); - if (req.validationErrors()) { - var errors = helpers.formatFormErrors(req.validationErrors()); - } - - if (!errors) { - if (!checkPassword(req.user, req.param('password'))) { - req.flash( - 'error', - 'Current password is not correct' - ); - return res.redirect('/settings'); - } - var hash = generateHash(req.param('password')); - req.user.save({password: hash}, function(err) { - req.flash( - 'success', - 'Password is successfully changed' - ); - return res.redirect('/'); - }) - } else { - res.locals.errors = errors; - res.render('users/settings'); - } -}); - -// Forgot password -router.get('/forgot-password', function(req, res) { - res.render('users/forgot-password'); -}); - -router.post('/forgot-password', function(req, res) { - req.checkBody('email', 'Email is required').notEmpty(); - if (req.validationErrors()) { - res.locals.errors = helpers.formatFormErrors(req.validationErrors()); - res.render('users/forgot-password'); - return; - } - if (req.models.User.one({email: req.param('email')}, function(err, user) { - if (user) { - var password = generateRandomPassword(); - var hash = generateHash(password); - user.save({password: hash}, function() { - sendNewPassword(user, password); - req.flash( - 'success', - 'New password sent to your inbox' - ); - return res.redirect('/signin'); - }); - } else { - req.flash( - 'error', - 'No user with given email found' - ); - return res.redirect('/forgot-password'); - } - })); -}); - -// Sign Out -router.get('/signout', function(req, res) { - req.logout(); - res.redirect('/signin'); -}); - - -// Helper user functions -// Auth settings -passport.serializeUser(function(user, done) { - done(null, user.id); -}); - -passport.deserializeUser(function(id, done) { - findById(id, function (err, user) { - done(err, user); - }); -}); - -passport.use(new LocalStrategy( - {usernameField: 'email', passwordField: 'password'}, - function(username, password, done) { - findByUsername(username, function(err, user) { - if (err) { - return done(err); - } - if (!user) { - return done(null, false, { message: 'Unknown user ' + username }); - } - if (!checkPassword(user, password)) { - return done(null, false, { message: 'Invalid password' }); - } - return done(null, user); - }) - } -)); - -function findByUsername(username, fn) { - orm.connect(settings.dsn, function(err, db) { - db.load("../models", function (err) { - var User = db.models.users; - db.models.users.find({email: username}, function (err, users) { - if (users.length) { - return fn(null, users[0]); - } else { - return fn(null, null); - } - }); - }); - }); -} - -function findById(id, fn) { - orm.connect(settings.dsn, function(err, db) { - db.load("../models", function (err) { - var User = db.models.users; - User.get(id, function (err, user) { - if (err) { - fn(new Error('User ' + id + ' does not exist')); - } - return fn(null, user); - }); - }); - }); -} - -function generateHash(password) { - return bcrypt.hashSync(password, bcrypt.genSaltSync(10)); -} - -function checkPassword(user, password) { - return bcrypt.compareSync(password, user.password); -} - -function generateRandomPassword() { - return Math.random().toString(36).replace(/[^a-z]+/g, ''); -} - -function sendNewPassword(user, password) { - var mailer = nodemailer.createTransport(stubTransport()); - mailer.sendMail({ - from: 'norepy@notejamapp.com', - to: user.email, - subject: 'New notejam password', - text: 'Your new password: ' + password - }, function(err, info) { - // sent mail to console output - console.log(info.response.toString()); - }); -} - -module.exports = router; diff --git a/express/notejam/settings.js b/express/notejam/settings.js deleted file mode 100644 index 0350717b8..000000000 --- a/express/notejam/settings.js +++ /dev/null @@ -1,17 +0,0 @@ -var settings = { - development: { - db: "notejam.db", - dsn: "sqlite://notejam.db" - }, - test: { - db: "notejam_test.db", - dsn: "sqlite://notejam_test.db" - } -}; - - -var env = process.env.NODE_ENV -if (!env) { - env = 'development' -}; -module.exports = settings[env]; diff --git a/express/notejam/tests/config.js b/express/notejam/tests/config.js deleted file mode 100644 index dfd5a09c9..000000000 --- a/express/notejam/tests/config.js +++ /dev/null @@ -1,25 +0,0 @@ -module.exports = { - host: 'http://localhost', - port: 3000, - - // build absolute url - url: function(url) { - return this.host + ":" + this.port + url; - }, - - // sign in user/agent - signInUser: function (agent, user) { - var self = this; - return function(done) { - agent - .post(self.url('/signin')) - .send(user) - .end(onResponse); - - function onResponse(err, res) { - res.should.have.status(200); - return done(); - } - }; - } -} diff --git a/express/notejam/tests/notes.js b/express/notejam/tests/notes.js deleted file mode 100644 index da60c9aac..000000000 --- a/express/notejam/tests/notes.js +++ /dev/null @@ -1,141 +0,0 @@ -// Enable test environment -process.env.NODE_ENV = 'test'; - -var request = require('superagent'); -var should = require('should'); -require('should-http'); - -var db = require('../db'); -var config = require('./config') -var app = require('../app'); - -app.listen(config.port); - -before(function(done) { - db.createTables(function() { - db.applyFixtures(done); - }); -}); - -describe('Note', function() { - - var agent = request.agent(); - before( - config.signInUser( - agent, {email: 'user1@example.com', password: 'password'} - ) - ); - - describe('can be', function() { - it('successfully created', function(done) { - agent - .post(config.url('/notes/create')) - .send({name: 'New note', text: 'text', pad_id: 1}) - .end(function(error, res){ - res.redirects.should.eql([config.url('/')]); - res.text.should.containEql('Note is successfully created'); - done(); - }); - }); - - it('successfully edited', function(done) { - agent - .post(config.url('/notes/1/edit')) - .send({name: 'New name', text: 'New text'}) - .end(function(error, res){ - res.redirects.should.eql([config.url('/notes/1')]); - res.text.should.containEql('Note is successfully updated'); - done(); - }); - }); - - it('successfully deleted', function(done) { - agent - .post(config.url('/notes/2/delete')) - .end(function(error, res){ - res.redirects.should.eql([config.url('/')]); - res.text.should.containEql('Note is successfully deleted'); - done(); - }); - }); - - it('successfully viewed', function(done) { - agent - .get(config.url('/notes/1')) - .end(function(error, res){ - res.should.have.status(200); - done(); - }); - }); - }); - - describe('can not be', function() { - it('created if required fields are missing', function(done) { - agent - .post(config.url('/notes/create')) - .send({name: '', text: ''}) - .end(function(error, res){ - res.text.should.containEql('Name is required'); - res.text.should.containEql('Text is required'); - done(); - }); - }); - - it('edited if required fields are missing', function(done) { - agent - .post(config.url('/notes/1/edit')) - .send({name: '', text: ''}) - .end(function(error, res){ - res.text.should.containEql('Name is required'); - res.text.should.containEql('Text is required'); - done(); - }); - }); - - it('edited by not an owner', function(done) { - var agent = request.agent(); - var signed = config.signInUser( - agent, {email: 'user2@example.com', password: 'password'} - ); - signed(function() { - agent - .post(config.url('/notes/1/edit')) - .send({name: 'new name', text: 'new text'}) - .end(function(error, res){ - res.should.have.status(404); - done(); - }); - }) - }); - - it('deleted by not an owner', function(done) { - var agent = request.agent(); - var signed = config.signInUser( - agent, {email: 'user2@example.com', password: 'password'} - ); - signed(function() { - agent - .post(config.url('/notes/1/delete')) - .end(function(error, res){ - res.should.have.status(404); - done(); - }); - }) - }); - - it('viewed by not an owner', function(done) { - var agent = request.agent(); - var signed = config.signInUser( - agent, {email: 'user2@example.com', password: 'password'} - ); - signed(function() { - agent - .get(config.url('/notes/1')) - .end(function(error, res){ - res.should.have.status(404); - done(); - }); - }) - }); - }); -}); diff --git a/express/notejam/tests/pads.js b/express/notejam/tests/pads.js deleted file mode 100644 index 00f1dab2c..000000000 --- a/express/notejam/tests/pads.js +++ /dev/null @@ -1,138 +0,0 @@ -// Enable test environment -process.env.NODE_ENV = 'test'; - -var request = require('superagent'); -var should = require('should'); -require('should-http'); - -var db = require('../db'); -var config = require('./config'); -var app = require('../app'); - -app.listen(3000); - -before(function(done) { - db.createTables(function() { - db.applyFixtures(done); - }); -}); - -describe('Pad', function() { - - var agent = request.agent(); - before( - config.signInUser(agent, {email: 'user1@example.com', password: 'password'}) - ); - - describe('can be', function() { - it('successfully created', function(done) { - agent - .post(config.url('/pads/create')) - .send({name: 'New pad'}) - .end(function(error, res){ - res.redirects.should.eql([config.url('/')]); - res.text.should.containEql('Pad is successfully created'); - done(); - }); - }); - - it('successfully edited', function(done) { - agent - .post(config.url('/pads/1/edit')) - .send({name: 'New pad name'}) - .end(function(error, res){ - res.redirects.should.eql([config.url('/')]); - res.text.should.containEql('Pad is successfully updated'); - done(); - }); - }); - - it('successfully deleted', function(done) { - agent - .post(config.url('/pads/2/delete')) - .end(function(error, res){ - res.redirects.should.eql([config.url('/')]); - res.text.should.containEql('Pad is successfully deleted'); - done(); - }); - }); - - it('successfully viewed', function(done) { - agent - .get(config.url('/pads/1')) - .end(function(error, res){ - res.should.have.status(200); - res.text.should.containEql('Pad settings'); - done(); - }); - }); - }); - - describe('can not be', function() { - it('created if required fields are missing', function(done) { - agent - .post(config.url('/pads/create')) - .send({name: ''}) - .end(function(error, res){ - res.text.should.containEql('Name is required'); - done(); - }); - }); - - it('edited if required fields are missing', function(done) { - agent - .post(config.url('/pads/1/edit')) - .send({name: ''}) - .end(function(error, res){ - res.text.should.containEql('Name is required'); - done(); - }); - }); - - it('edited by not an owner', function(done) { - var agent = request.agent(); - var signed = config.signInUser( - agent, {email: 'user2@example.com', password: 'password'} - ); - signed(function() { - agent - .post(config.url('/pads/1/edit')) - .send({name: 'new name'}) - .end(function(error, res){ - res.should.have.status(404); - done(); - }); - }) - }); - - it('deleted by not an owner', function(done) { - var agent = request.agent(); - var signed = config.signInUser( - agent, {email: 'user2@example.com', password: 'password'} - ); - signed(function() { - agent - .post(config.url('/pads/1/delete')) - .end(function(error, res){ - res.should.have.status(404); - done(); - }); - }) - }); - - it('viewed by not an owner', function(done) { - var agent = request.agent(); - var signed = config.signInUser( - agent, {email: 'user2@example.com', password: 'password'} - ); - signed(function() { - agent - .get(config.url('/pads/1')) - .end(function(error, res){ - res.should.have.status(404); - done(); - }); - }) - }); - }); -}); diff --git a/express/notejam/tests/users.js b/express/notejam/tests/users.js deleted file mode 100644 index 958f6caaa..000000000 --- a/express/notejam/tests/users.js +++ /dev/null @@ -1,106 +0,0 @@ -// Enable test environment -process.env.NODE_ENV = 'test'; - -var request = require('superagent'); -var should = require('should'); -require('should-http'); - -var db = require('../db'); -var config = require('./config'); -var app = require('../app'); - -app.listen(3000); - -before(function(done) { - db.createTables(function() { - db.applyFixtures(done); - }); -}); - -describe('User', function(){ - - it('can successfully sign in', function(done){ - var agent = request.agent(); - agent - .post(config.url('/signin')) - .send({email: 'user1@example.com', password: 'password' }) - .end(function(error, res){ - res.redirects.should.eql([config.url('/')]); - done(); - }); - }); - - describe('cant sign in', function() { - it('with wrong credentials', function(done) { - var agent = request.agent(); - agent - .post(config.url('/signin')) - .send({email: 'unknown@email.com', password: 'unknown' }) - .end(function(error, res){ - res.text.should.containEql('Unknown user'); - done(); - }); - }); - - it('if required fields are missing', function(done){ - var agent = request.agent(); - agent - .post(config.url('/signin')) - .send({email: '', password: '' }) - .end(function(error, res){ - res.text.should.containEql('Email is required'); - res.text.should.containEql('Password is required'); - done(); - }); - }); - }); - - it('can successfully sign up', function(done) { - var agent = request.agent(); - agent - .post(config.url('/signup')) - .send({email: 'usersadfasdf@example.com', password: 'password'}) - .end(function(error, res){ - res.redirects.should.eql([config.url('/signin')]); - done(); - }); - }); - - describe('cant signup', function() { - it('if email is invalid', function(done) { - var agent = request.agent(); - agent - .post(config.url('/signup')) - .send({email: 'invalid', password: 'password' }) - .end(function(error, res){ - res.text.should.containEql('Invalid email'); - done(); - }); - }); - - it('if required fields are missing', function(done) { - var agent = request.agent(); - agent - .post(config.url('/signup')) - .send({email: '', password: '' }) - .end(function(error, res){ - res.text.should.containEql('Invalid email'); - res.text.should.containEql('Password is required'); - done(); - }); - }); - - it('if user already exists', function(done) { - var agent = request.agent(); - agent - .post(config.url('/signup')) - .send({email: 'user1@example.com', password: 'password' }) - .end(function(error, res){ - res.text.should.containEql('User with given email already exists'); - done(); - }); - }); - - // @TODO implement "if passwords do not match" case - }); -}) diff --git a/express/notejam/views/error.jade b/express/notejam/views/error.jade deleted file mode 100644 index db0601f24..000000000 --- a/express/notejam/views/error.jade +++ /dev/null @@ -1,6 +0,0 @@ -extends layout - -block content_area - h1= message - h2= error.status - pre #{error.stack} diff --git a/express/notejam/views/layout.jade b/express/notejam/views/layout.jade deleted file mode 100644 index f94fa8bcb..000000000 --- a/express/notejam/views/layout.jade +++ /dev/null @@ -1,44 +0,0 @@ -include mixins.jade - -doctype html -html(lang='en') - meta(charset='utf-8') - title - block title - meta(name='description', content='Notejam: Unified sample app') - meta(name='author', content='Notejam') - meta(name='viewport', content='width=device-width, initial-scale=1, maximum-scale=1') - link(rel='stylesheet', href='http://cdnjs.cloudflare.com/ajax/libs/skeleton/1.2/base.min.css') - link(rel='stylesheet', href='http://cdnjs.cloudflare.com/ajax/libs/skeleton/1.2/skeleton.min.css') - link(rel='stylesheet', href='http://cdnjs.cloudflare.com/ajax/libs/skeleton/1.2/layout.css') - link(rel='stylesheet', href='/stylesheets/style.css') - body - .container - .sixteen.columns - .sign-in-out-block - if req.isAuthenticated() - | #{req.user.email}:   - a(href='/settings') Account settings - |     - a(href='/signout') Sign out - else - a(href='/signup') Sign up - |     - a(href='/signin') Sign in - .sixteen.columns - h1.bold-header - a.header(href="/") - | note - span.jam - | jam:  - span - block title - block content_area - hr.footer - .footer - div - | Notejam: Express application - div - Github, Twitter, created by Serhii Komar - a(href='https://github.com/komarserjio/notejam') - img(style='position: absolute; top: 0; right: 0; border: 0;', src='https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png', alt='Fork me on GitHub') diff --git a/express/notejam/views/main.jade b/express/notejam/views/main.jade deleted file mode 100644 index 2441f8ff2..000000000 --- a/express/notejam/views/main.jade +++ /dev/null @@ -1,18 +0,0 @@ -extends layout - -block content_area - .three.columns - h4#logo My pads - nav - if pads.length - ul - each pad in pads - li - a(href='/pads/#{pad.id}') #{pad.name} - else - p.empty= 'No pads yet' - hr - a(href='/pads/create') New pad - .thirteen.columns.content-area - +render_flash_messages(flash_messages) - block content diff --git a/express/notejam/views/mixins.jade b/express/notejam/views/mixins.jade deleted file mode 100644 index acfb1a12d..000000000 --- a/express/notejam/views/mixins.jade +++ /dev/null @@ -1,13 +0,0 @@ -mixin error(field, errors) - if errors && (field in errors) - ul.errors - li= errors[field] - -// render flash messages -mixin render_flash_messages(messages) - if messages.success.length || messages.error.length - div.alert-area - each message in messages.success - div.alert.alert-success= message - each message in messages.error - div.alert.alert-error= message diff --git a/express/notejam/views/notes/create.jade b/express/notejam/views/notes/create.jade deleted file mode 100644 index 8a3dd27f4..000000000 --- a/express/notejam/views/notes/create.jade +++ /dev/null @@ -1,19 +0,0 @@ -extends ../main - -block title - | New note - -block content - form.note(method='POST') - label(for='name') Name - input#name(type='text', name='name') - +error('name', errors) - label(for='text') Text - textarea(name='text') - +error('text', errors) - label(for='pad_id') Pad - select(name='pad_id') - option -------------- - each pad in req.user.pads - option(value=pad.id, selected=pad.id == padId) #{pad.name} - input(type='submit', value='Save') diff --git a/express/notejam/views/notes/delete.jade b/express/notejam/views/notes/delete.jade deleted file mode 100644 index 61224f24d..000000000 --- a/express/notejam/views/notes/delete.jade +++ /dev/null @@ -1,12 +0,0 @@ -extends ../main - -block title - | #{note.name} - -block content - p Are you sure you want to delete the note? - form(method='post') - input(type='submit', class="red", value='Yes, delete I want to delete this note') - |   - a(href='/notes/#{note.id}') Cancel - diff --git a/express/notejam/views/notes/edit.jade b/express/notejam/views/notes/edit.jade deleted file mode 100644 index 95b1233e6..000000000 --- a/express/notejam/views/notes/edit.jade +++ /dev/null @@ -1,20 +0,0 @@ -extends ../main - -block title - | #{note.name} - -block content - form.note(method='POST') - label(for='name') Name - input#name(type='text', name='name', value='#{note.name}') - +error('name', errors) - label(for='text') Text - textarea(name='text') #{note.text} - +error('text', errors) - label(for='pad_id') Pad - select(name='pad_id') - option ---------- - each pad in req.user.pads - option(value=pad.id, selected=pad.id == note.pad_id) #{pad.name} - input(type='submit', value='Save') - diff --git a/express/notejam/views/notes/list.jade b/express/notejam/views/notes/list.jade deleted file mode 100644 index 868dfa47b..000000000 --- a/express/notejam/views/notes/list.jade +++ /dev/null @@ -1,33 +0,0 @@ -extends ../main - -block title - | #{title} - -block content - if notes.length - table.notes - tr - th.note - | Note - a.sort_arrow(href='/?order=-name') ↑ - a.sort_arrow(href='/?order=name') ↓ - th - | Pad - th.date - | Last modified - a.sort_arrow(href='/?order=-updated_at') ↑ - a.sort_arrow(href='/?order=updated_at') ↓ - each note in notes - tr - td - a(href='/notes/#{note.id}') #{note.name} - td.pad - if note.pad - a(href='/pads/#{note.pad.id}') #{note.pad.name} - else - | No pad - td.hidden-text.date #{note.updatedAt()} - else - p.empty Create your first note - a.button(href='/notes/create') New note - diff --git a/express/notejam/views/notes/view.jade b/express/notejam/views/notes/view.jade deleted file mode 100644 index 79a7c933a..000000000 --- a/express/notejam/views/notes/view.jade +++ /dev/null @@ -1,12 +0,0 @@ -extends ../main - -block title - | #{note.name} - -block content - p.hidden-text Last edited #{note.updatedAt()} - div.note - p #{note.text} - - a.button(href='/notes/#{note.id}/edit') Edit - a.delete-note(href='/notes/#{note.id}/delete') Delete it diff --git a/express/notejam/views/pads/create.jade b/express/notejam/views/pads/create.jade deleted file mode 100644 index 416c94bce..000000000 --- a/express/notejam/views/pads/create.jade +++ /dev/null @@ -1,11 +0,0 @@ -extends ../main - -block title - | New pad - -block content - form(method='POST') - label(for='name') Name - input#name(type='text', name='name') - +error('name', errors) - input(type='submit', value='Save') diff --git a/express/notejam/views/pads/delete.jade b/express/notejam/views/pads/delete.jade deleted file mode 100644 index 09597cc8e..000000000 --- a/express/notejam/views/pads/delete.jade +++ /dev/null @@ -1,11 +0,0 @@ -extends ../main - -block title - | #{pad.name} - -block content - p Are you sure you want to delete the pad? - form(method='post') - input(type='submit', class="red", value='Yes, delete I want to delete this pad') - |   - a(href="/pads/#{pad.id}/edit") Cancel diff --git a/express/notejam/views/pads/edit.jade b/express/notejam/views/pads/edit.jade deleted file mode 100644 index 0d6b013b0..000000000 --- a/express/notejam/views/pads/edit.jade +++ /dev/null @@ -1,14 +0,0 @@ -extends ../main - -block title - | #{pad.name} - -block content - form(method='POST') - label(for='name') Name - input#name(type='text', name='name', value='#{pad.name}') - +error('name', errors) - input(type='submit', value='Save') - div - a.red(href="/pads/#{pad.id}/delete") Delete pad - diff --git a/express/notejam/views/pads/list.jade b/express/notejam/views/pads/list.jade deleted file mode 100644 index 95f248233..000000000 --- a/express/notejam/views/pads/list.jade +++ /dev/null @@ -1,27 +0,0 @@ -extends ../main - -block title - | #{title} - -block content - if notes.length - table.notes - tr - th.note - | Note - a.sort_arrow(href='/pads/#{pad.id}/?order=-name') ↑ - a.sort_arrow(href='/pads/#{pad.id}/?order=name') ↓ - th.date - | Last modified - a.sort_arrow(href='/pads/#{pad.id}/?order=-updated_at') ↑ - a.sort_arrow(href='/pads/#{pad.id}/?order=updated_at') ↓ - each note in notes - tr - td - a(href='/notes/#{note.id}') #{note.name} - td.hidden-text.date #{note.updatedAt()} - else - p.empty Create your first note in the pad - a.button(href='/notes/create?pad=#{pad.id}') New note - |   - a(href="/pads/#{pad.id}/edit") Pad settings diff --git a/express/notejam/views/user.jade b/express/notejam/views/user.jade deleted file mode 100644 index f6c3513d2..000000000 --- a/express/notejam/views/user.jade +++ /dev/null @@ -1,6 +0,0 @@ -extends layout - -block content_area - .sixteen.columns.content-area - +render_flash_messages(flash_messages) - block content diff --git a/express/notejam/views/users/forgot-password.jade b/express/notejam/views/users/forgot-password.jade deleted file mode 100644 index 70a856e3d..000000000 --- a/express/notejam/views/users/forgot-password.jade +++ /dev/null @@ -1,11 +0,0 @@ -extends ../user - -block title - | Forgot password? - -block content - form.offset-by-six.sign-in(method='POST') - label(for='email') Email - input#email(type='text', name='email') - +error('email', errors) - input(type='submit', value='Get new password') diff --git a/express/notejam/views/users/settings.jade b/express/notejam/views/users/settings.jade deleted file mode 100644 index bda9ec5f3..000000000 --- a/express/notejam/views/users/settings.jade +++ /dev/null @@ -1,18 +0,0 @@ -extends ../user - -block title - | Account settings - -block content - form.offset-by-six.sign-in(method='POST') - label(for='password') Current password - input#email(type='password', name='password') - +error('password', errors) - label(for='new_password') New Password - input#password(type='password', name='new_password') - +error('new_password', errors) - label(for='confirm_new_password') Confirm New Password - input#confirm_password(type='password', name='confirm_new_password') - +error('confirm_new_password', errors) - input(type='submit', value='Change password') - diff --git a/express/notejam/views/users/signin.jade b/express/notejam/views/users/signin.jade deleted file mode 100644 index dcd13b36f..000000000 --- a/express/notejam/views/users/signin.jade +++ /dev/null @@ -1,18 +0,0 @@ -extends ../user - -block title - | Sign In - -block content - form.offset-by-six.sign-in(method='POST') - label(for='email') Email - input#email(type='text', name='email') - +error('email', errors) - label(for='password') Password - input#password(type='password', name='password') - +error('password', errors) - input(type='submit', value='Sign In') - | or Sign Up - hr - p - a.small-red(href='/forgot-password') Forgot password? diff --git a/express/notejam/views/users/signup.jade b/express/notejam/views/users/signup.jade deleted file mode 100644 index c7e487d80..000000000 --- a/express/notejam/views/users/signup.jade +++ /dev/null @@ -1,22 +0,0 @@ -extends ../user - -block title - | Sign Up - -block content - form.offset-by-six.sign-in(method='POST') - label(for='email') Email - input#email(type='text', name='email') - +error('email', errors) - label(for='password') Password - input#password(type='password', name='password') - +error('password', errors) - label(for='confirm_password') Confirm Password - input#confirm_password(type='password', name='confirm_password') - +error('confirm_password', errors) - input(type='submit', value='Sign Up') - | or Sign In - hr - p - a.small-red(href='#forgot-password') Forgot password? - diff --git a/flask/README.rst b/flask/README.rst deleted file mode 100644 index f9924f074..000000000 --- a/flask/README.rst +++ /dev/null @@ -1,89 +0,0 @@ -************** -Notejam: Flask -************** - -Notejam application implemented using `Flask `_ microframework. - -Flask version: 1.1.1 - -Flask extension used: - -* Flask-Login -* Flask-Mail -* Flask-SQLAlchemy -* Flask-Testing -* Flask-WTF - -========================== -Installation and launching -========================== - ------ -Clone ------ - -Clone the repo: - -.. code-block:: bash - - $ git clone git@github.com:nordcloud/notejam.git YOUR_PROJECT_DIR/ - -------- -Install -------- -Use `virtualenv `_ or `virtualenvwrapper `_ -for `environment management `_. - -Install dependencies: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/flask/ - $ pip install -r requirements.txt - -Create database schema: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/flask/ - $ python db.py - ------- -Launch ------- - -Start flask web server: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/flask/ - $ python runserver.py - -Go to http://127.0.0.1:5000/ in your browser - ---------- -Run tests ---------- - -Run functional and unit tests: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/flask/ - $ python tests.py - - -============ -Contribution -============ - -Do you have python/flask experience? Help the app to follow python and flask best practices. - -Please send your pull requests in the ``master`` branch. -Always prepend your commits with framework name: - -.. code-block:: bash - - Flask: Implemented sign in functionality - -Read `contribution guide `_ for details. diff --git a/flask/db.py b/flask/db.py deleted file mode 100644 index 4190c769a..000000000 --- a/flask/db.py +++ /dev/null @@ -1,4 +0,0 @@ -from notejam import db - -# Create db schema -db.create_all() diff --git a/flask/notejam/__init__.py b/flask/notejam/__init__.py deleted file mode 100644 index 4257505a3..000000000 --- a/flask/notejam/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -from flask import Flask -from flask_sqlalchemy import SQLAlchemy -from flask_login import LoginManager -from flask_mail import Mail - -# @TODO use application factory approach -app = Flask(__name__) -app.config.from_object('notejam.config.Config') -app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False -db = SQLAlchemy(app) - -login_manager = LoginManager() -login_manager.login_view = "signin" -login_manager.init_app(app) - -mail = Mail() -mail.init_app(app) - -from notejam import views diff --git a/flask/notejam/config.py b/flask/notejam/config.py deleted file mode 100644 index de9c901fd..000000000 --- a/flask/notejam/config.py +++ /dev/null @@ -1,24 +0,0 @@ -import os -basedir = os.path.abspath(os.path.dirname(__file__)) - -class Config(object): - DEBUG = False - TESTING = False - SECRET_KEY = 'notejam-flask-secret-key' - WTF_CSRF_ENABLED = True - CSRF_SESSION_KEY = 'notejam-flask-secret-key' - SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'notejam.db') - - -class ProductionConfig(Config): - DEBUG = False - - -class DevelopmentConfig(Config): - DEVELOPMENT = True - DEBUG = True - - -class TestingConfig(Config): - TESTING = True - WTF_CSRF_ENABLED = False diff --git a/flask/notejam/forms.py b/flask/notejam/forms.py deleted file mode 100644 index 6b13bc53a..000000000 --- a/flask/notejam/forms.py +++ /dev/null @@ -1,84 +0,0 @@ -from flask_wtf import FlaskForm -from wtforms import StringField, PasswordField, SelectField, TextAreaField -from wtforms.validators import Required, Email, EqualTo, ValidationError - -from notejam.models import User, Pad - - -class SigninForm(FlaskForm): - email = StringField('Email', validators=[Required(), Email()]) - password = PasswordField('Password', validators=[Required()]) - - -class SignupForm(FlaskForm): - email = StringField('Email', validators=[Required(), Email()]) - password = PasswordField('Password', validators=[Required()]) - repeat_password = PasswordField( - 'Repeat Password', - validators=[ - Required(), EqualTo( - 'password', message="Your passwords do not match" - ) - ] - ) - - def validate_email(self, field): - if User.query.filter_by(email=field.data).count(): - raise ValidationError( - 'User with this email is already signed up' - ) - - -class NoteForm(FlaskForm): - name = StringField('Name', validators=[Required()]) - text = TextAreaField('Note', validators=[Required()]) - pad = SelectField('Pad', choices=[], coerce=int) - - # @TODO use wtforms.ext.sqlalchemy.fields.QuerySelectField? - def __init__(self, user=None, **kwargs): - super(NoteForm, self).__init__(**kwargs) - self.pad.choices = [(0, '---------')] + [ - (p.id, p.name) for p in Pad.query.filter_by(user=user) - ] - - -class PadForm(FlaskForm): - name = StringField('Name', validators=[Required()]) - - -# dummy form -class DeleteForm(FlaskForm): - pass - - -class ChangePasswordForm(FlaskForm): - old_password = PasswordField('Old Password', validators=[Required()]) - new_password = PasswordField('New Password', validators=[Required()]) - repeat_new_password = PasswordField( - 'Repeat New Password', - validators=[ - Required(), EqualTo( - 'new_password', message="Your passwords don't match" - ) - ] - ) - - def __init__(self, **kwargs): - super(ChangePasswordForm, self).__init__(**kwargs) - self.user = kwargs['user'] - - def validate_old_password(self, field): - if not self.user.check_password(field.data): - raise ValidationError( - 'Incorrect old password' - ) - - -class ForgotPasswordForm(FlaskForm): - email = StringField('Email', validators=[Required(), Email()]) - - def validate_email(self, field): - if not User.query.filter_by(email=field.data).count(): - raise ValidationError( - 'No user with given email found' - ) diff --git a/flask/notejam/models.py b/flask/notejam/models.py deleted file mode 100755 index fa717ffba..000000000 --- a/flask/notejam/models.py +++ /dev/null @@ -1,66 +0,0 @@ -import datetime - -from werkzeug.security import (generate_password_hash, -check_password_hash) -from flask_login import UserMixin - -from notejam import db - - -class User(db.Model, UserMixin): - id = db.Column(db.Integer, primary_key=True) - email = db.Column(db.String(120), unique=True) - password = db.Column(db.String(100)) - - @staticmethod - def authenticate(email, password): - user = User.query.filter_by(email=email).first() - if user and user.check_password(password): - return user - - def set_password(self, password): - self.password = generate_password_hash(password) - - def check_password(self, password): - return check_password_hash(self.password, password) - - def __repr__(self): - return '' % self.email - - -class Note(db.Model): - id = db.Column(db.Integer, primary_key=True) - name = db.Column(db.String(100)) - text = db.Column(db.Text) - created_at = db.Column(db.DateTime, default=datetime.datetime.now) - updated_at = db.Column( - db.DateTime, - default=datetime.datetime.now, - onupdate=datetime.datetime.now - ) - - user_id = db.Column(db.Integer, db.ForeignKey('user.id')) - user = db.relationship('User', backref=db.backref('notes', lazy='dynamic')) - - pad_id = db.Column(db.Integer, db.ForeignKey('pad.id')) - pad = db.relationship( - 'Pad', - backref=db.backref('notes', lazy='dynamic', cascade='all') - ) - - def __repr__(self): - return '' % self.name - - -class Pad(db.Model): - id = db.Column(db.Integer, primary_key=True) - name = db.Column(db.String(100)) - - user_id = db.Column(db.Integer, db.ForeignKey('user.id')) - user = db.relationship( - 'User', - backref=db.backref('pads', lazy='dynamic', cascade='all') - ) - - def __repr__(self): - return '' % self.name diff --git a/flask/notejam/static/css/style.css b/flask/notejam/static/css/style.css deleted file mode 100644 index b800e615d..000000000 --- a/flask/notejam/static/css/style.css +++ /dev/null @@ -1,350 +0,0 @@ -/* -* Skeleton V1.0.3 -* Copyright 2011, Dave Gamache -* www.getskeleton.com -* Free to use under the MIT license. -* http://www.opensource.org/licenses/mit-license.php -* 7/17/2011 -*/ - - -/* Documentation Styles -================================================== */ - div.container { - padding-top: 40px; } - - /* Doc nav */ - nav { - width: 160px; } - #logo, .bold-header { - margin-bottom: 30px; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - letter-spacing: -1px; - color: #555; - font-weight: bold; } - .bold-header span { - font-weight: normal; - font-size: 23px; - } - .bold-header a.header { - text-decoration: none; - color: inherit; - } - .bold-header span.jam { - font-size: 46px; - line-height: 50px; - } - nav ul { - float: left; } - nav ul li { - display: block; - margin-bottom: 10px; } - nav ul li a, - nav ul li a:visited, - nav ul li a:active { - font-size: 14px; - color: #555; - text-decoration: none; - font-weight: bold; } - nav ul li a:hover, - nav ul li a:focus { - color: #222; } - header h1 { - font-size: 52px; - line-height: 61px; - letter-spacing: -1px; - font-weight: normal; - font-family: "Georgia", "Times New Roman", Helvetica, Arial, sans-serif; } - hr.large { - border: none; - height: 8px; - background: #ebebeb; - margin: 50px 0; } - div.doc-section { - margin: 30px 0; } - - #whatAndWhy .row { - padding: 30px 0 0; } - - #typography blockquote { - margin-top: 20px; } - - .hidden-code a { - font-size: 12px; - color: #999; } - .hidden-code>div { - display: none; } - - - /* Grid */ - #grid .column, - #grid .columns { - background: #ddd; - height: 25px; - line-height: 25px; - margin-bottom: 10px; - text-align: center; - text-transform: uppercase; - color: #555; - font-size: 12px; - font-weight: bold; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; } - #grid .column:hover, - #grid .columns:hover { - background: #bbb; - color: #333; } - #grid .example-grid { overflow: hidden; } - - .post-button-note, - .post-button-note a { - font-size: 11px; - color: #999; } - - #examples .four.columns a { - text-decoration: none; - } - #examples .four.columns a:hover { - text-decoration: underline; - } - - - .resize { - position: fixed; - bottom: 0; - right: 0; - height: 80px; - width: 80px; - background: url(images/resize.png); } - - - img { - max-width: 100%; - height: auto; } - - .gist-meta { display: none !important;} - - ul ul ul li { margin-bottom: 3px; } - - .twitter-share-button { margin-bottom: -18px; } - -.carbonad, -.carbonad-image, -.carbonad-text, -.carbonad-tag { - background: none !important; - border: none !important; - margin-left: 0 !important; -} -.carbonad-tag { - margin-top: 6px !important; - padding-top: 0 !important; -} -.carbonad-text { - height: auto !important; -} -.carbonad-image { - margin-top: 0 !important; -} - -.hidden-text { - font-size: 12px; - color: #999; -} - -td.date, th.date { - text-align: right; -} - -td.date { - font-style: italic; -} - -form.note input[type="text"], form.note textarea { - width: 100%; -} - -form hr { - width: 218px; - margin: 10px 0px; -} - -form.note textarea { - height: 250px; -} - -div.content-area { - min-height: 600px; -} - -hr.footer { - margin-bottom: 10px; -} - -div.footer { - margin-bottom: 10px; - text-align: center; - font-size: 12px; -} - -form.sign-in { - margin: 50px 0 0 0; -} - -.sort_arrow { - text-decoration: none; -} - -.sort_arrow:hover { - text-decoration: none; - color: red; -} - -div.sign-in-out-block { - position: absolute; - right: 14px; - top: 8px; - font-size: 12px; -} - -div.sign-in-out-block a { - /*text-decoration: none;*/ -} - -a.small-red { - color: red; - font-size: 12px; -} - -table.notes { - margin: 0 0 20px 0; -} - -table.notes th.note { - width: 72%; -} - -table.notes td.pad { - color: grey; -} - -table.notes td.pad a { - color: grey; - text-decoration: underline; - font-style: normal; -} - - -table.notes td.pad a:hover { - color: black; -} - -p.empty { - color: grey; - font-style: italic; -} - -a.delete-note { - float: right; - font-size: 12px; - color: red; -} - -.red, input.red { - color: red !important; -} - -ul.errorlist, ul.errors { - margin: -18px 0 0 0; -} - -ul.errorlist li, ul.errors li { - color: red; -} - -.alert-area { - text-align: center; -} - -.alert { - padding: 5px 8px; - margin: 0 0 12px 0; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; -} - -.alert-success { - color: #468847; - background-color: #dff0d8; - border: 1px solid #d6e9c6; -} - -.alert-error { - color: #b94a48; - background-color: #f2dede; - border: 1px solid #eed3d7; -} - - /* Mobile */ - @media only screen and (max-width: 767px) { - header h1 { font-size: 34px; line-height: 37px; } - nav { position: relative; } - nav ul, - .carbonad { - display: none; - } - #logo { text-align: left; } - #examples .four.columns { - padding-top: 30px; - } - } - - /* Mobile Landscape */ - @media only screen and (min-width: 480px) and (max-width: 767px) { - nav ul { - display: none; - } - } - - /* Non 960 */ - @media only screen and (max-width: 959px) { - #logo { - font-size: 21px; - margin-bottom: 15px; } - nav .button { - padding: 9px 20px 11px; } - } - - /* iPad Portrait/Browser */ - @media only screen and (min-width: 768px) and (max-width: 959px) { - nav { - width: 124px; } - } - - /* Mobile/Browser */ - @media only screen and (max-width: 767px) {} - - /* Mobile Landscape/Browser */ - @media only screen and (min-width: 480px) and (max-width: 767px) {} - - /* Anything smaller than standard 960 */ - @media only screen and (max-width: 959px) {} - - - /* iPad Portrait Only */ - @media only screen and (min-width: 768px) and (max-width: 959px) and (max-device-width: 1000px) {} - - /* Mobile Only */ - @media only screen and (max-width: 767px) and (max-device-width: 1000px) {} - - /* Mobile Landscape Only */ - @media only screen and (min-width: 480px) and (max-width: 767px) and (max-device-width: 1000px) {} - - /* Anything smaller than standard 960 on a device */ - @media only screen and (max-width: 959px) and (max-device-width: 1000px) { - .resize { display: none; } - } - - diff --git a/flask/notejam/static/css/tables.css b/flask/notejam/static/css/tables.css deleted file mode 100644 index fb4441935..000000000 --- a/flask/notejam/static/css/tables.css +++ /dev/null @@ -1,45 +0,0 @@ -table { - width: 100%; - border-collapse: collapse; -} - -table th, table td { - padding: 10px 10px 9px; - font-size: 13px; - line-height: 18px; - text-align: left; -} - -table td { - vertical-align: top; - border-top: solid 1px #ddd; -} - -table th { - padding-top: 9px; - font-weight: bold; - vertical-align: middle; -} - -table.condensed th, table.condensed td { - padding: 5px 5px 4px; -} - -table.bordered { - border-collapse: separate; - border: solid 1px #ddd; - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; -} - -table.bordered th + th, -table.bordered th + td, -table.bordered td + td { - border-left: solid 1px #ddd; -} - -.zebra-striped tbody tr:nth-child(odd) td, -.zebra-striped tbody tr:nth-child(odd) th { - background: #f5f5f5; -} diff --git a/flask/notejam/templates/_helpers.html b/flask/notejam/templates/_helpers.html deleted file mode 100644 index bea460a16..000000000 --- a/flask/notejam/templates/_helpers.html +++ /dev/null @@ -1,11 +0,0 @@ -{% macro render_field(field) %} - - {{ field }} - {% if field.errors %} -
    - {% for error in field.errors %} -
  • {{ error }}
  • - {% endfor %} -
- {% endif %} -{% endmacro %} diff --git a/flask/notejam/templates/base.html b/flask/notejam/templates/base.html deleted file mode 100644 index 5a061688b..000000000 --- a/flask/notejam/templates/base.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - {% block title %}Notejam{% endblock %} - - - - - - - - - - - - - - - - - {% block extrahead %}{% endblock %} - - -
-
- -
-
-

- notejam: - {% block page_title %} - All notes - {% endblock %} -

-
- {% block pads %} -
- - - - -
- {% endblock %} -
- {% with messages = get_flashed_messages(with_categories=true) %} - {% if messages %} -
    - {% for category, message in messages %} -
    {{ message }}
    - {% endfor %} -
- {% endif %} - {% endwith %} - {% block content %} - {% endblock %} -
- - -
- Fork me on GitHub - - - diff --git a/flask/notejam/templates/notes/create.html b/flask/notejam/templates/notes/create.html deleted file mode 100644 index 2a83b0914..000000000 --- a/flask/notejam/templates/notes/create.html +++ /dev/null @@ -1,10 +0,0 @@ -{% extends "base.html" %} - -{% block title %}New note{% endblock %} -{% block page_title %}New note{% endblock %} - -{% block content %} - {% include "notes/form.html" %} -{% endblock %} - - diff --git a/flask/notejam/templates/notes/delete.html b/flask/notejam/templates/notes/delete.html deleted file mode 100644 index c52cf550f..000000000 --- a/flask/notejam/templates/notes/delete.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "base.html" %} - -{% block title %}{{ note.name }}{% endblock %} -{% block page_title %}{{ note.name }}{% endblock %} - -{% block content %} -

Are you sure you want to delete {{ note.name }}?

-
- {{ form.hidden_tag() }} -   - Cancel -
-{% endblock %} diff --git a/flask/notejam/templates/notes/edit.html b/flask/notejam/templates/notes/edit.html deleted file mode 100644 index 292ce8f97..000000000 --- a/flask/notejam/templates/notes/edit.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends "base.html" %} - -{% block title %}{{ form.name.data }}{% endblock %} -{% block page_title %}{{ form.name.data }}{% endblock %} - -{% block content %} - {% include "notes/form.html" %} -{% endblock %} - - - diff --git a/flask/notejam/templates/notes/form.html b/flask/notejam/templates/notes/form.html deleted file mode 100644 index b83c5f9e7..000000000 --- a/flask/notejam/templates/notes/form.html +++ /dev/null @@ -1,10 +0,0 @@ -{% from "_helpers.html" import render_field %} - -
- {{ form.hidden_tag() }} - {{ render_field(form.name) }} - {{ render_field(form.text) }} - {{ render_field(form.pad) }} - -
- diff --git a/flask/notejam/templates/notes/list.html b/flask/notejam/templates/notes/list.html deleted file mode 100644 index fffc9f61f..000000000 --- a/flask/notejam/templates/notes/list.html +++ /dev/null @@ -1,34 +0,0 @@ -{% extends "base.html" %} - -{% block title %}All notes ({{ notes|length }}){% endblock %} -{% block page_title %} All notes ({{ notes|length }}) {% endblock %} - -{% block content %} - {% if notes %} - - - - - - - {% for note in notes %} - - - - - - {% endfor %} -
Note PadLast modified
{{ note.name }} - {% if note.pad %} - {{ note.pad.name }} - {% else %} - No pad - {% endif %} - {{ note.updated_at|smart_date }}
- {% else %} -

Create your first note.

- {% endif %} - New note -{% endblock %} - - diff --git a/flask/notejam/templates/notes/view.html b/flask/notejam/templates/notes/view.html deleted file mode 100644 index f73a5fe81..000000000 --- a/flask/notejam/templates/notes/view.html +++ /dev/null @@ -1,14 +0,0 @@ -{% extends "base.html" %} - -{% block title %}{{ note.name }}{% endblock %} -{% block page_title %}{{ note.name }}{% endblock %} - -{% block content %} -

Last edited at {{ note.updated_at|smart_date }}

-
- {{ note.text }} -
- Edit - Delete it -{% endblock %} - diff --git a/flask/notejam/templates/pads/create.html b/flask/notejam/templates/pads/create.html deleted file mode 100644 index e43ed38b1..000000000 --- a/flask/notejam/templates/pads/create.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends "base.html" %} - -{% block title %}New pad{% endblock %} -{% block page_title %}New pad{% endblock %} - -{% block content %} - {% include "pads/form.html" %} -{% endblock %} - - - diff --git a/flask/notejam/templates/pads/delete.html b/flask/notejam/templates/pads/delete.html deleted file mode 100644 index d93d979b7..000000000 --- a/flask/notejam/templates/pads/delete.html +++ /dev/null @@ -1,17 +0,0 @@ -{% extends "base.html" %} - -{% block title %}{{ pad.name }}{% endblock %} -{% block page_title %}{{ pad.name }}{% endblock %} - -{% block content %} -

Are you sure you want to delete {{ pad.name }}?

-
- {{ form.hidden_tag() }} -   - Cancel -
-{% endblock %} - - - - diff --git a/flask/notejam/templates/pads/edit.html b/flask/notejam/templates/pads/edit.html deleted file mode 100644 index 56b30dddd..000000000 --- a/flask/notejam/templates/pads/edit.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "base.html" %} - -{% block title %}{{ pad.name }}{% endblock %} -{% block page_title %}{{ pad.name }}{% endblock %} - -{% block content %} - {% include "pads/form.html" %} - Delete pad -{% endblock %} - - - - diff --git a/flask/notejam/templates/pads/form.html b/flask/notejam/templates/pads/form.html deleted file mode 100644 index d6895e3bc..000000000 --- a/flask/notejam/templates/pads/form.html +++ /dev/null @@ -1,9 +0,0 @@ -{% from "_helpers.html" import render_field %} - -
- {{ form.hidden_tag() }} - {{ render_field(form.name) }} - -
- - diff --git a/flask/notejam/templates/pads/note_list.html b/flask/notejam/templates/pads/note_list.html deleted file mode 100644 index 31bd5fb41..000000000 --- a/flask/notejam/templates/pads/note_list.html +++ /dev/null @@ -1,26 +0,0 @@ -{% extends "base.html" %} - -{% block title %}{{ pad.name }} ({{ pad.notes.count() }}){% endblock %} -{% block page_title %}{{ pad.name }} ({{ pad.notes.count() }}){% endblock %} - -{% block content %} - {% if notes %} - - - - - - {% for note in notes %} - - - - - {% endfor %} -
Note - Last modified
{{ note.name }}{{ note.updated_at|smart_date }}
- {% else %} -

Create first note in the pad.

- {% endif %} - New note  - Pad settings -{% endblock %} diff --git a/flask/notejam/templates/user.html b/flask/notejam/templates/user.html deleted file mode 100644 index 8e556e310..000000000 --- a/flask/notejam/templates/user.html +++ /dev/null @@ -1,4 +0,0 @@ -{% extends "base.html" %} - -{% block pads %}{% endblock %} -{% block content_class %}sixteen columns content-area{% endblock %} diff --git a/flask/notejam/templates/users/forgot_password.html b/flask/notejam/templates/users/forgot_password.html deleted file mode 100644 index 0635ad68a..000000000 --- a/flask/notejam/templates/users/forgot_password.html +++ /dev/null @@ -1,14 +0,0 @@ -{% extends "user.html" %} -{% from "_helpers.html" import render_field %} - -{% block title %}Forgot Password?{% endblock %} -{% block page_title %}Forgot Password?{% endblock %} - -{% block content %} - -{% endblock %} - diff --git a/flask/notejam/templates/users/settings.html b/flask/notejam/templates/users/settings.html deleted file mode 100644 index 0de132d2f..000000000 --- a/flask/notejam/templates/users/settings.html +++ /dev/null @@ -1,16 +0,0 @@ -{% extends "user.html" %} -{% from "_helpers.html" import render_field %} - -{% block title %}Account Settings{% endblock %} -{% block page_title %}Account Settings{% endblock %} - -{% block content %} -
- {{ form.hidden_tag() }} - {{ render_field(form.old_password) }} - {{ render_field(form.new_password) }} - {{ render_field(form.repeat_new_password) }} - -
-{% endblock %} - diff --git a/flask/notejam/templates/users/signin.html b/flask/notejam/templates/users/signin.html deleted file mode 100644 index 58c5e494c..000000000 --- a/flask/notejam/templates/users/signin.html +++ /dev/null @@ -1,16 +0,0 @@ -{% extends "user.html" %} -{% from "_helpers.html" import render_field %} - -{% block title %}Sign In{% endblock %} -{% block page_title %}Sign In{% endblock %} - -{% block content %} - -{% endblock %} diff --git a/flask/notejam/templates/users/signup.html b/flask/notejam/templates/users/signup.html deleted file mode 100644 index 19ae825ac..000000000 --- a/flask/notejam/templates/users/signup.html +++ /dev/null @@ -1,16 +0,0 @@ -{% extends "user.html" %} -{% from "_helpers.html" import render_field %} - -{% block title %}Sign Up{% endblock %} -{% block page_title %}Sign Up{% endblock %} - -{% block content %} - -{% endblock %} - diff --git a/flask/notejam/views.py b/flask/notejam/views.py deleted file mode 100644 index 0064053b8..000000000 --- a/flask/notejam/views.py +++ /dev/null @@ -1,264 +0,0 @@ -from datetime import date -import hashlib - -from flask import render_template, flash, request, redirect, url_for, abort -from flask_login import (login_user, login_required, logout_user, -current_user) -from flask_mail import Message - -from notejam import app, db, login_manager, mail -from notejam.models import User, Note, Pad -from notejam.forms import (SigninForm, SignupForm, NoteForm, PadForm, -DeleteForm, ChangePasswordForm, ForgotPasswordForm) - - -@login_manager.user_loader -def load_user(user_id): - return User.query.get(user_id) - - -@app.route('/') -@login_required -def home(): - notes = (Note.query - .filter_by(user=current_user) - .order_by(_get_order_by(request.args.get('order'))) - .all()) - return render_template('notes/list.html', notes=notes) - - -@app.route('/notes/create/', methods=['GET', 'POST']) -@login_required -def create_note(): - note_form = NoteForm(user=current_user, pad=request.args.get('pad')) - if note_form.validate_on_submit(): - note = Note( - name=note_form.name.data, - text=note_form.text.data, - pad_id=note_form.pad.data, - user=current_user - ) - db.session.add(note) - db.session.commit() - flash('Note is successfully created', 'success') - return redirect(_get_note_success_url(note)) - return render_template('notes/create.html', form=note_form) - - -@app.route('/notes//edit/', methods=['GET', 'POST']) -@login_required -def edit_note(note_id): - note = _get_user_object_or_404(Note, note_id, current_user) - note_form = NoteForm(user=current_user, obj=note) - if note_form.validate_on_submit(): - note.name = note_form.name.data - note.text = note_form.text.data - note.pad_id = note_form.pad.data - - db.session.commit() - flash('Note is successfully updated', 'success') - return redirect(_get_note_success_url(note)) - if note.pad: - note_form.pad.data = note.pad.id # XXX ? - return render_template('notes/edit.html', form=note_form) - - -@app.route('/notes//') -@login_required -def view_note(note_id): - note = _get_user_object_or_404(Note, note_id, current_user) - return render_template('notes/view.html', note=note) - - -@app.route('/notes//delete/', methods=['GET', 'POST']) -@login_required -def delete_note(note_id): - note = _get_user_object_or_404(Note, note_id, current_user) - delete_form = DeleteForm() - if request.method == 'POST': - db.session.delete(note) - db.session.commit() - flash('Note is successfully deleted', 'success') - return redirect(url_for('home')) - return render_template('notes/delete.html', note=note, form=delete_form) - - -@app.route('/pads/create/', methods=['GET', 'POST']) -@login_required -def create_pad(): - pad_form = PadForm() - if pad_form.validate_on_submit(): - pad = Pad( - name=pad_form.name.data, - user=current_user - ) - db.session.add(pad) - db.session.commit() - flash('Pad is successfully created', 'success') - return redirect(url_for('home')) - return render_template('pads/create.html', form=pad_form) - - -@app.route('/pads//edit/', methods=['GET', 'POST']) -@login_required -def edit_pad(pad_id): - pad = _get_user_object_or_404(Pad, pad_id, current_user) - pad_form = PadForm(obj=pad) - if pad_form.validate_on_submit(): - pad.name = pad_form.name.data - db.session.commit() - flash('Pad is successfully updated', 'success') - return redirect(url_for('pad_notes', pad_id=pad.id)) - return render_template('pads/edit.html', form=pad_form, pad=pad) - - -@app.route('/pads//') -@login_required -def pad_notes(pad_id): - pad = _get_user_object_or_404(Pad, pad_id, current_user) - notes = (Note.query - .filter_by(user=current_user, pad=pad) - .order_by(_get_order_by(request.args.get('order'))) - .all()) - return render_template('pads/note_list.html', pad=pad, notes=notes) - - -@app.route('/pads//delete/', methods=['GET', 'POST']) -@login_required -def delete_pad(pad_id): - pad = _get_user_object_or_404(Pad, pad_id, current_user) - delete_form = DeleteForm() - if request.method == 'POST': - db.session.delete(pad) - db.session.commit() - flash('Note is successfully deleted', 'success') - return redirect(url_for('home')) - return render_template('pads/delete.html', pad=pad, form=delete_form) - - -# @TODO use macro for form fields in template -@app.route('/signin/', methods=['GET', 'POST']) -def signin(): - form = SigninForm() - if form.validate_on_submit(): - auth_user = User.authenticate(form.email.data, form.password.data) - if auth_user: - login_user(auth_user) - flash('You are signed in!', 'success') - return redirect(url_for('home')) - else: - flash('Wrong email or password', 'error') - return render_template('users/signin.html', form=form) - - -@app.route('/signout/') -def signout(): - logout_user() - return redirect(url_for('signin')) - - -@app.route('/signup/', methods=['GET', 'POST']) -def signup(): - form = SignupForm() - if form.validate_on_submit(): - user = User(email=form.email.data) - user.set_password(form.password.data) - db.session.add(user) - db.session.commit() - flash('Account is created. Now you can sign in.', 'success') - return redirect(url_for('signin')) - return render_template('users/signup.html', form=form) - - -@app.route('/settings/', methods=['GET', 'POST']) -@login_required -def account_settings(): - form = ChangePasswordForm(user=current_user) - if form.validate_on_submit(): - current_user.set_password(form.new_password.data) - db.session.commit() - flash("Your password is successfully changed.", 'success') - return redirect(url_for('home')) - return render_template('users/settings.html', form=form) - - -@app.route('/forgot-password/', methods=['GET', 'POST']) -def forgot_password(): - form = ForgotPasswordForm() - if form.validate_on_submit(): - user = User.query.filter_by(email=form.email.data).first() - new_password = _generate_password(user) - user.set_password(new_password) - - message = Message( - subject="Notejam password", - body="Your new password is {}".format(new_password), - sender="from@notejamapp.com", - recipients=[user.email] - ) - mail.send(message) - - db.session.commit() - flash("Find new password in your inbox", 'success') - return redirect(url_for('home')) - return render_template('users/forgot_password.html', form=form) - - -# context processors and filters -@app.context_processor -def inject_user_pads(): - ''' inject list of user pads in template context ''' - if not current_user.is_anonymous: - return dict(pads=current_user.pads.all()) - return dict(pads=[]) - - -@app.template_filter('smart_date') -def smart_date_filter(updated_at): - delta = date.today() - updated_at.date() - if delta.days == 0: - return 'Today at {}'.format(updated_at.strftime("%H:%M")) - elif delta.days == 1: - return 'Yesterday at {}'.format(updated_at.strftime("%H:%M")) - elif 1 > delta.days > 4: - return '{} days ago'.format(abs(delta.days)) - else: - return updated_at.date() - - -# helper functions, @TODO move to helpers.py? -def _get_note_success_url(note): - ''' get note success redirect url depends on note's pad ''' - if note.pad is None: - return url_for('home') - else: - return url_for('pad_notes', pad_id=note.pad.id) - - -def _get_user_object_or_404(model, object_id, user, code=404): - ''' get an object by id and owner user or raise an abort ''' - result = model.query.filter_by(id=object_id, user=user).first() - return result or abort(code) - - -def _get_order_by(param='-updated_at'): - ''' get model order param by string description ''' - return { - 'name': Note.name.asc(), - '-name': Note.name.desc(), - 'updated_at': Note.updated_at.asc(), - '-updated_at': Note.updated_at.desc(), - }.get(param, Note.updated_at.desc()) - - -def _generate_password(user): - ''' generate new user password ''' - m = hashlib.md5() - m.update( - "{email}{secret}{date}".format( - email=user.email, - secret=app.secret_key, - date=str(date.today()) - ) - ) - return m.hexdigest()[:8] diff --git a/flask/notejam/wsgi.py b/flask/notejam/wsgi.py deleted file mode 100644 index 83370f350..000000000 --- a/flask/notejam/wsgi.py +++ /dev/null @@ -1,7 +0,0 @@ -from notejam import app as application -from notejam.config import DevelopmentConfig - -application.config.from_object(DevelopmentConfig) - -if __name__ == '__main__': - application.run() diff --git a/flask/requirements.txt b/flask/requirements.txt deleted file mode 100644 index 55908cf95..000000000 --- a/flask/requirements.txt +++ /dev/null @@ -1,15 +0,0 @@ -Flask==1.1.1 -Flask-Login==0.4.1 -Flask-Mail==0.9.1 -Flask-SQLAlchemy==2.4.1 -Flask-Testing==0.6.1 -Flask-WTF==0.14.2 -Jinja2==2.10.3 -SQLAlchemy==1.3.10 -Tempita==0.5.2 -WTForms==2.2.1 -Werkzeug==0.16.0 -blinker==1.4 -decorator==4.4.1 -ipython==5.8.0 -sqlalchemy-migrate==0.13.0 diff --git a/flask/runserver.py b/flask/runserver.py deleted file mode 100755 index 6cb3c5663..000000000 --- a/flask/runserver.py +++ /dev/null @@ -1,7 +0,0 @@ -from notejam import app -from notejam.config import DevelopmentConfig - -app.config.from_object(DevelopmentConfig) - -if __name__ == '__main__': - app.run() diff --git a/flask/tests.py b/flask/tests.py deleted file mode 100644 index b5fcf6aef..000000000 --- a/flask/tests.py +++ /dev/null @@ -1,336 +0,0 @@ -import os -import tempfile -import unittest -import urllib.parse - -from contextlib import contextmanager - -from flask import url_for -from flask_testing import TestCase - -from notejam import app, db -from notejam.config import TestingConfig -from notejam.models import User, Pad, Note - -app.config.from_object(TestingConfig) - - -class NotejamBaseTestCase(TestCase): - def setUp(self): - db.create_all() - - def tearDown(self): - db.session.remove() - db.drop_all() - os.close(self.fd) - os.unlink(self.db) - - def create_app(self): - self.fd, self.db = tempfile.mkstemp() - test_app = app - test_app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///" + self.db - test_app.config['TESTING'] = True - test_app.config['CSRF_ENABLED'] = False - return test_app - - def create_user(self, **kwargs): - user = User(email=kwargs['email']) - user.set_password(kwargs['password']) - db.session.add(user) - db.session.commit() - return user - - def create_pad(self, **kwargs): - pad = Pad(**kwargs) - db.session.add(pad) - db.session.commit() - return pad - - def create_note(self, **kwargs): - note = Note(**kwargs) - db.session.add(note) - db.session.commit() - return note - - -class SignupTestCase(NotejamBaseTestCase): - def _get_user_data(self, **kwargs): - user_data = { - 'email': 'email@example.com', - 'password': 'secure_password', - 'repeat_password': 'secure_password' - } - user_data.update(**kwargs) - return user_data - - def test_signup_success(self): - response = self.client.post( - url_for("signup"), data=self._get_user_data()) - self.assertRedirects(response, url_for('signin')) - self.assertEqual(1, User.query.count()) - - def test_signup_fail_required_fields(self): - self.client.post(url_for("signup"), data={}) - self.assertEqual( - set(self._get_user_data().keys()), - set(self.get_context_variable('form').errors.keys()) - ) - - def test_signup_fail_email_exists(self): - data = self._get_user_data() - self.create_user(**data) - - self.client.post(url_for("signup"), data=self._get_user_data()) - self.assertEqual( - ['email'], list(self.get_context_variable('form').errors.keys())) - - def test_signup_fail_invalid_email(self): - data = self._get_user_data() - data['email'] = 'invalid email' - - self.client.post(url_for("signup"), data=data) - self.assertEqual( - ['email'], list(self.get_context_variable('form').errors.keys())) - - def test_signup_fail_passwords_dont_match(self): - invalid_data = self._get_user_data(password='another pass') - self.client.post(url_for('signup'), data=invalid_data) - self.assertEqual( - ['repeat_password'], - list(self.get_context_variable('form').errors.keys()) - ) - - -class SigninTestCase(NotejamBaseTestCase): - def _get_user_data(self, **kwargs): - user_data = { - 'email': 'email@example.com', - 'password': 'secure_password' - } - user_data.update(**kwargs) - return user_data - - def test_signin_success(self): - data = self._get_user_data() - self.create_user(**data) - - response = self.client.post(url_for('signin'), data=data) - self.assertRedirects(response, url_for('home')) - - def test_signin_fail(self): - response = self.client.post( - url_for('signin'), data=self._get_user_data()) - self.assertIn('Wrong email or password', str(response.data)) - - def test_signin_fail_required_fields(self): - self.client.post(url_for("signin"), data={}) - self.assertEqual( - set(self._get_user_data().keys()), - set(self.get_context_variable('form').errors.keys()) - ) - - def test_signup_fail_invalid_email(self): - data = self._get_user_data() - data['email'] = 'invalid email' - - self.client.post(url_for("signin"), data=data) - self.assertEqual( - ['email'], list(self.get_context_variable('form').errors.keys())) - - -class PadTestCase(NotejamBaseTestCase): - - def test_create_success(self): - user = self.create_user(email='email@example.com', password='password') - with signed_in_user(user) as c: - response = c.post(url_for('create_pad'), data={'name': 'pad'}) - self.assertRedirects(response, '/') - self.assertEqual(1, Pad.query.count()) - - def test_create_fail_required_name(self): - user = self.create_user(email='email@example.com', password='password') - with signed_in_user(user) as c: - c.post(url_for('create_pad'), data={}) - self.assertEqual( - ['name'], list(self.get_context_variable('form').errors.keys())) - - def test_create_fail_anonymous_user(self): - response = self.client.post( - url_for('create_pad'), data={'name': 'pad'}) - self.assertRedirects( - response, - "{signin}?next={redirect_to}".format( - signin=url_for('signin'), redirect_to=urllib.parse.quote( - url_for('create_pad'), '')) - ) - - def test_edit_success(self): - user = self.create_user(email='email@example.com', password='password') - pad = self.create_pad(name='pad', user=user) - with signed_in_user(user) as c: - new_name = 'new pad name' - response = c.post( - url_for('edit_pad', pad_id=pad.id), data={'name': new_name}) - self.assertRedirects(response, url_for('pad_notes', pad_id=pad.id)) - self.assertEqual(new_name, Pad.query.get(pad.id).name) - - def test_edit_fail_required_name(self): - user = self.create_user(email='email@example.com', password='password') - pad = self.create_pad(name='pad', user=user) - with signed_in_user(user) as c: - c.post(url_for('edit_pad', pad_id=pad.id), data={'name': ''}) - self.assertEqual( - ['name'], list(self.get_context_variable('form').errors.keys())) - - def test_edit_fail_anothers_user(self): - user = self.create_user(email='email@example.com', password='password') - pad = self.create_pad(name='pad', user=user) - another_user = self.create_user( - email='another@example.com', password='password') - with signed_in_user(another_user) as c: - new_name = 'new pad name' - response = c.post( - url_for('edit_pad', pad_id=pad.id), data={'name': new_name}) - self.assertEqual(404, response.status_code) - - def test_delete_success(self): - user = self.create_user(email='email@example.com', password='password') - pad = self.create_pad(name='pad', user=user) - with signed_in_user(user) as c: - response = c.post( - url_for('delete_pad', pad_id=pad.id)) - self.assertRedirects(response, url_for('home')) - self.assertEqual(0, Pad.query.count()) - - def test_delete_fail_anothers_user(self): - user = self.create_user(email='email@example.com', password='password') - pad = self.create_pad(name='pad', user=user) - another_user = self.create_user( - email='another@example.com', password='password') - with signed_in_user(another_user) as c: - response = c.post( - url_for('delete_pad', pad_id=pad.id)) - self.assertEqual(404, response.status_code) - - -class NoteTestCase(NotejamBaseTestCase): - def _get_note_data(self, **kwargs): - note_data = { - 'name': 'note', 'pad': 0, 'text': 'text' - } - note_data.update(**kwargs) - return note_data - - def test_create_success(self): - user = self.create_user(email='email@example.com', password='password') - with signed_in_user(user) as c: - response = c.post( - url_for('create_note'), data=self._get_note_data()) - self.assertRedirects(response, '/') - self.assertEqual(1, Note.query.count()) - - def test_create_fail_required_fields(self): - user = self.create_user(email='email@example.com', password='password') - with signed_in_user(user) as c: - c.post(url_for('create_note'), data={}) - self.assertEqual( - set(self._get_note_data().keys()), - set(self.get_context_variable('form').errors.keys()) - ) - - def test_create_fail_anothers_pad(self): - user = self.create_user(email='email@example.com', password='password') - another_user = self.create_user( - email='another@example.com', password='password') - pad = self.create_pad(name='pad', user=another_user) - with signed_in_user(user) as c: - c.post( - url_for('create_note'), data=self._get_note_data(pad=pad.id)) - self.assertEqual( - ['pad'], list(self.get_context_variable('form').errors.keys()) - ) - - def test_create_fail_anonymous_user(self): - response = self.client.post( - url_for('create_note'), data=self._get_note_data()) - self.assertRedirects( - response, - "{signin}?next={redirect_to}".format( - signin=url_for('signin'), redirect_to=urllib.parse.quote( - url_for('create_note'), '')) - ) - - def test_edit_success(self): - user = self.create_user(email='email@example.com', password='password') - note_data = {'name': 'note', 'text': 'text', 'user': user} - note = self.create_note(**note_data) - with signed_in_user(user) as c: - new_name = 'new pad name' - c.post( - url_for('edit_note', note_id=note.id), - data=self._get_note_data(name=new_name) - ) - self.assertEqual(new_name, Note.query.get(note.id).name) - - def test_edit_fail_required_fields(self): - user = self.create_user(email='email@example.com', password='password') - note_data = {'name': 'note', 'text': 'text', 'user': user} - note = self.create_note(**note_data) - with signed_in_user(user) as c: - c.post( - url_for('edit_note', note_id=note.id), - data={'pad': '', 'name': '', 'text': ''} - ) - self.assertEqual( - set(self._get_note_data().keys()), - set(self.get_context_variable('form').errors.keys()) - ) - - def test_edit_fail_anothers_user(self): - user = self.create_user(email='email@example.com', password='password') - note_data = {'name': 'note', 'text': 'text', 'user': user} - note = self.create_note(**note_data) - another_user = self.create_user( - email='another@example.com', password='password') - with signed_in_user(another_user) as c: - response = c.post( - url_for('edit_note', note_id=note.id), data={}) - self.assertEqual(404, response.status_code) - - def test_delete_success(self): - user = self.create_user(email='email@example.com', password='password') - note = self.create_note(name='note', text='text', user=user) - with signed_in_user(user) as c: - response = c.post( - url_for('delete_note', note_id=note.id)) - self.assertRedirects(response, url_for('home')) - self.assertEqual(0, Note.query.count()) - - def test_delete_fail_anothers_user(self): - user = self.create_user(email='email@example.com', password='password') - note = self.create_note(name='note', text='text', user=user) - another_user = self.create_user( - email='another@example.com', password='password') - with signed_in_user(another_user) as c: - response = c.post( - url_for('delete_note', note_id=note.id)) - self.assertEqual(404, response.status_code) - - -@contextmanager -def signed_in_user(user): - ''' - Signed in user context - Usage: - user = get_user() - with signed_in_user(user) as c: - response = c.get(...) - ''' - with app.test_client() as c: - with c.session_transaction() as sess: - sess['user_id'] = user.id - sess['_fresh'] = True - yield c - -if __name__ == '__main__': - unittest.main() diff --git a/html/account-settings.html b/html/account-settings.html deleted file mode 100644 index f4c90b375..000000000 --- a/html/account-settings.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - Notejam: Account Settings - - - - - - - - - - - - - - - -
-
- -
-
-

notejam: Account Settings

-
-
- -
- - -
- Fork me on GitHub - - diff --git a/html/alerts-and-errors.html b/html/alerts-and-errors.html deleted file mode 100644 index ffd621420..000000000 --- a/html/alerts-and-errors.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - Notejam: Alerts and errors - - - - - - - - - - - - - - - -
-
- -
-
-

notejam: Alerts and errors examples

-
-
-
-
Everything is OK
-
Something is wrong
-
- -
- - -
- Fork me on GitHub - - diff --git a/html/create-pad.html b/html/create-pad.html deleted file mode 100644 index 431ea2a9d..000000000 --- a/html/create-pad.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - Notejam: New pad - - - - - - - - - - - - - - - -
-
- -
-
-

notejam: New pad

-
-
- - -
-
-
- - - -
-
- - -
- Fork me on GitHub - - - - - diff --git a/html/create.html b/html/create.html deleted file mode 100644 index 71ed1af73..000000000 --- a/html/create.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - Notejam: New note - - - - - - - - - - - - - - - -
-
- -
-
-

notejam: New note

-
-
- - -
-
-
- - - - - - - -
-
- - -
- Fork me on GitHub - - - - diff --git a/html/css/style.css b/html/css/style.css deleted file mode 100644 index 76326fc39..000000000 --- a/html/css/style.css +++ /dev/null @@ -1,400 +0,0 @@ -/* -* Skeleton V1.0.3 -* Copyright 2011, Dave Gamache -* www.getskeleton.com -* Free to use under the MIT license. -* http://www.opensource.org/licenses/mit-license.php -* 7/17/2011 -*/ - - -/* Documentation Styles -================================================== */ - div.container { - padding-top: 40px; } - - /* Doc nav */ - nav { - width: 160px; } - #logo, .bold-header { - margin-bottom: 30px; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - letter-spacing: -1px; - color: #555; - font-weight: bold; } - .bold-header span { - font-weight: normal; - font-size: 23px; - } - .bold-header a.header { - text-decoration: none; - color: inherit; - } - .bold-header span.jam { - font-size: 46px; - line-height: 50px; - } - nav ul { - float: left; } - nav ul li { - display: block; - margin-bottom: 10px; } - nav ul li a, - nav ul li a:visited, - nav ul li a:active { - font-size: 14px; - color: #555; - text-decoration: none; - font-weight: bold; } - nav ul li a:hover, - nav ul li a:focus { - color: #222; } - header h1 { - font-size: 52px; - line-height: 61px; - letter-spacing: -1px; - font-weight: normal; - font-family: "Georgia", "Times New Roman", Helvetica, Arial, sans-serif; } - hr.large { - border: none; - height: 8px; - background: #ebebeb; - margin: 50px 0; } - div.doc-section { - margin: 30px 0; } - - #whatAndWhy .row { - padding: 30px 0 0; } - - #typography blockquote { - margin-top: 20px; } - - .hidden-code a { - font-size: 12px; - color: #999; } - .hidden-code>div { - display: none; } - - - /* Grid */ - #grid .column, - #grid .columns { - background: #ddd; - height: 25px; - line-height: 25px; - margin-bottom: 10px; - text-align: center; - text-transform: uppercase; - color: #555; - font-size: 12px; - font-weight: bold; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; } - #grid .column:hover, - #grid .columns:hover { - background: #bbb; - color: #333; } - #grid .example-grid { overflow: hidden; } - - .post-button-note, - .post-button-note a { - font-size: 11px; - color: #999; } - - #examples .four.columns a { - text-decoration: none; - } - #examples .four.columns a:hover { - text-decoration: underline; - } - - - .resize { - position: fixed; - bottom: 0; - right: 0; - height: 80px; - width: 80px; - background: url(images/resize.png); } - - - img { - max-width: 100%; - height: auto; } - - .gist-meta { display: none !important;} - - ul ul ul li { margin-bottom: 3px; } - - .twitter-share-button { margin-bottom: -18px; } - - /* Table stylesheets */ - table { - width: 100%; - border-collapse: collapse; - } - - table th, table td { - padding: 10px 10px 9px; - font-size: 13px; - line-height: 18px; - text-align: left; - } - - table td { - vertical-align: top; - border-top: solid 1px #ddd; - } - - table th { - padding-top: 9px; - font-weight: bold; - vertical-align: middle; - } - - table.condensed th, table.condensed td { - padding: 5px 5px 4px; - } - - table.bordered { - border-collapse: separate; - border: solid 1px #ddd; - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; - } - - table.bordered th + th, - table.bordered th + td, - table.bordered td + td { - border-left: solid 1px #ddd; - } - - .zebra-striped tbody tr:nth-child(odd) td, - .zebra-striped tbody tr:nth-child(odd) th { - background: #f5f5f5; - } - -.carbonad, -.carbonad-image, -.carbonad-text, -.carbonad-tag { - background: none !important; - border: none !important; - margin-left: 0 !important; -} -.carbonad-tag { - margin-top: 6px !important; - padding-top: 0 !important; -} -.carbonad-text { - height: auto !important; -} -.carbonad-image { - margin-top: 0 !important; -} - -.hidden-text { - font-size: 12px; - color: #999; -} - -td.date, th.date { - text-align: right; -} - -td.date { - font-style: italic; -} - -form.note input[type="text"], form.note textarea { - width: 100%; -} - -form hr { - width: 218px; - margin: 10px 0px; -} - -form.note textarea { - height: 250px; -} - -div.content-area { - min-height: 600px; -} - -hr.footer { - margin-bottom: 10px; -} - -div.footer { - margin-bottom: 10px; - text-align: center; - font-size: 12px; -} - -form.sign-in { - margin: 50px 0 0 0; -} - -.sort_arrow { - text-decoration: none; -} - -.sort_arrow:hover { - text-decoration: none; - color: red; -} - -div.sign-in-out-block { - position: absolute; - right: 14px; - top: 8px; - font-size: 12px; -} - -div.sign-in-out-block a { - /*text-decoration: none;*/ -} - -a.small-red { - color: red; - font-size: 12px; -} - -table.notes { - margin: 0 0 20px 0; -} - -table.notes th.note { - width: 72%; -} - -table.notes td.pad { - color: grey; -} - -table.notes td.pad a { - color: grey; - text-decoration: underline; - font-style: normal; -} - - -table.notes td.pad a:hover { - color: black; -} - -p.empty { - color: grey; - font-style: italic; -} - -a.delete-note { - float: right; - font-size: 12px; - color: red; -} - -.red, input.red { - color: red !important; -} - -ul.errorlist, ul.errors { - margin: -18px 0 0 0; -} - -ul.errorlist li, ul.errors li { - color: red; -} - -.alert-area { - text-align: center; -} - -.alert { - padding: 5px 8px; - margin: 0 0 12px 0; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; -} - -.alert-success { - color: #468847; - background-color: #dff0d8; - border: 1px solid #d6e9c6; -} - -.alert-error { - color: #b94a48; - background-color: #f2dede; - border: 1px solid #eed3d7; -} - -.pagination { - text-align: center; -} - - /* Mobile */ - @media only screen and (max-width: 767px) { - header h1 { font-size: 34px; line-height: 37px; } - nav { position: relative; } - nav ul, - .carbonad { - display: none; - } - #logo { text-align: left; } - #examples .four.columns { - padding-top: 30px; - } - } - - /* Mobile Landscape */ - @media only screen and (min-width: 480px) and (max-width: 767px) { - nav ul { - display: none; - } - } - - /* Non 960 */ - @media only screen and (max-width: 959px) { - #logo { - font-size: 21px; - margin-bottom: 15px; } - nav .button { - padding: 9px 20px 11px; } - } - - /* iPad Portrait/Browser */ - @media only screen and (min-width: 768px) and (max-width: 959px) { - nav { - width: 124px; } - } - - /* Mobile/Browser */ - @media only screen and (max-width: 767px) {} - - /* Mobile Landscape/Browser */ - @media only screen and (min-width: 480px) and (max-width: 767px) {} - - /* Anything smaller than standard 960 */ - @media only screen and (max-width: 959px) {} - - - /* iPad Portrait Only */ - @media only screen and (min-width: 768px) and (max-width: 959px) and (max-device-width: 1000px) {} - - /* Mobile Only */ - @media only screen and (max-width: 767px) and (max-device-width: 1000px) {} - - /* Mobile Landscape Only */ - @media only screen and (min-width: 480px) and (max-width: 767px) and (max-device-width: 1000px) {} - - /* Anything smaller than standard 960 on a device */ - @media only screen and (max-width: 959px) and (max-device-width: 1000px) { - .resize { display: none; } - } - diff --git a/html/delete.html b/html/delete.html deleted file mode 100644 index 44a00fbf8..000000000 --- a/html/delete.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - Notejam - - - - - - - - - - - - - - - -
-
- -
-
-

notejam: My sport

-
-
- - -
-
-

Are you sure you want to delete My sport note?

- Yes, delete I want to delete this note  - Cancel -
- - -
- Fork me on GitHub - - - - - diff --git a/html/edit.html b/html/edit.html deleted file mode 100644 index b24216c88..000000000 --- a/html/edit.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - Notejam: My sport - - - - - - - - - - - - - - - -
-
- -
-
-

notejam: My sport

-
-
- - -
-
-
- - - - - - - -
-
- - -
- Fork me on GitHub - - diff --git a/html/empty-list.html b/html/empty-list.html deleted file mode 100644 index d522c16e4..000000000 --- a/html/empty-list.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - Notejam - - - - - - - - - - - - - - - -
-
- -
-
-

notejam: 0 notes

-
-
- - -
-
-

Create your first note.

- New note -
- - -
- Fork me on GitHub - - - diff --git a/html/forgot-password.html b/html/forgot-password.html deleted file mode 100644 index 95da65c85..000000000 --- a/html/forgot-password.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - Notejam: Forgot password? - - - - - - - - - - - - - - - -
-
- -
-
-

notejam: Forgot password?

-
-
- -
- - -
- Fork me on GitHub - - diff --git a/html/index.html b/html/index.html deleted file mode 100644 index 821b25f47..000000000 --- a/html/index.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - Notejam - - - - - - - - - - - - - - - -
-
- -
-
-

notejam: All notes (8)

-
-
- - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Note PadLast modified
My sport activitesNo padToday at 10:51
February reportsPadYesterday
Budget planPad2 days ago
Visit Agenda for all customersPad02 Feb. 2013
GiftsPad29 Jan. 2013
Calendar eventsPad29 Jan. 2013
TV seriesPad01 Dec. 2012
Daily postPad28 Nov. 2012
- New note - -
- - -
- Fork me on GitHub - - diff --git a/html/pad-notes.html b/html/pad-notes.html deleted file mode 100644 index 280cf518b..000000000 --- a/html/pad-notes.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - Notejam: Business (8 notes) - - - - - - - - - - - - - - - -
-
- -
-
-

notejam: Business (8 notes)

-
-
- - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Note PadLast modified
My sport activitesNo padToday at 10:51
February reportsPadYesterday
Budget planPad2 days ago
Visit Agenda for all customersPad02 Feb. 2013
GiftsPad29 Jan. 2013
Calendar eventsPad29 Jan. 2013
TV seriesPad01 Dec. 2012
Daily postPad28 Nov. 2012
- New note -
- - -
- Fork me on GitHub - - - - diff --git a/html/screenshots/1.png b/html/screenshots/1.png deleted file mode 100644 index b927f5e20..000000000 Binary files a/html/screenshots/1.png and /dev/null differ diff --git a/html/screenshots/1p.png b/html/screenshots/1p.png deleted file mode 100644 index b200eaf68..000000000 Binary files a/html/screenshots/1p.png and /dev/null differ diff --git a/html/screenshots/2.png b/html/screenshots/2.png deleted file mode 100644 index 2edb3d87d..000000000 Binary files a/html/screenshots/2.png and /dev/null differ diff --git a/html/screenshots/2p.png b/html/screenshots/2p.png deleted file mode 100644 index 6df1c840f..000000000 Binary files a/html/screenshots/2p.png and /dev/null differ diff --git a/html/screenshots/3.png b/html/screenshots/3.png deleted file mode 100644 index d22546010..000000000 Binary files a/html/screenshots/3.png and /dev/null differ diff --git a/html/screenshots/3p.png b/html/screenshots/3p.png deleted file mode 100644 index 8882527b5..000000000 Binary files a/html/screenshots/3p.png and /dev/null differ diff --git a/html/screenshots/4.png b/html/screenshots/4.png deleted file mode 100644 index 59f37a6a3..000000000 Binary files a/html/screenshots/4.png and /dev/null differ diff --git a/html/screenshots/5.png b/html/screenshots/5.png deleted file mode 100644 index 9dad30f93..000000000 Binary files a/html/screenshots/5.png and /dev/null differ diff --git a/html/screenshots/6.png b/html/screenshots/6.png deleted file mode 100644 index f98f5e0f9..000000000 Binary files a/html/screenshots/6.png and /dev/null differ diff --git a/html/signin.html b/html/signin.html deleted file mode 100644 index d0240a84c..000000000 --- a/html/signin.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - Notejam: Sign In - - - - - - - - - - - - - - - -
-
- -
-
-

notejam: Sign In

-
-
- - - - -
- - -
- Fork me on GitHub - - - - - diff --git a/html/signup.html b/html/signup.html deleted file mode 100644 index 14c3b9e67..000000000 --- a/html/signup.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - Notejam: Sign Up - - - - - - - - - - - - - - - -
-
- -
-
-

notejam: Sign Up

-
-
- -
- - -
- Fork me on GitHub - - diff --git a/html/view.html b/html/view.html deleted file mode 100644 index 4990d806b..000000000 --- a/html/view.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - Notejam: My sport - - - - - - - - - - - - - - - -
-
- -
-
-

notejam: My sport

-
-
- - -
-
-

Last edited at 10:32

-
-

- The typography of Skeleton is designed to create a strong hierarchy with basic styles. The primary font is the classic Helvetica Neue, but the font stack can be easily changed with just a couple adjustments. Regular paragraphs are set at a 14px base with 21px line height. -

-

- The typography of Skeleton is designed to create a strong hierarchy with basic styles. The primary font is the classic Helvetica Neue, but the font stack can be easily changed with just a couple adjustments. Regular paragraphs are set at a 14px base with 21px line height. -

-
- - Delete it -
- - -
- Fork me on GitHub - - - - - diff --git a/index.html b/index.html deleted file mode 100644 index e69de29bb..000000000 diff --git a/laravel/README.rst b/laravel/README.rst deleted file mode 100644 index f547c6009..000000000 --- a/laravel/README.rst +++ /dev/null @@ -1,90 +0,0 @@ -**************** -Notejam: Laravel -**************** - -Notejam application implemented using `Laravel `_ framework. - -Laravel version: 4.1 - - -========================== -Installation and launching -========================== - ------ -Clone ------ - -Clone the repo: - -.. code-block:: bash - - $ git clone git@github.com:komarserjio/notejam.git YOUR_PROJECT_DIR/ - -------- -Install -------- - -Install `composer `_ - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/laravel/notejam/ - $ curl -s https://getcomposer.org/installer | php - -Install dependencies - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/laravel/notejam/ - $ php composer.phar install - -Create database schema - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/laravel/notejam/ - $ touch app/database/notejam.db - $ php artisan migrate - - ------- -Launch ------- - -Start laravel web server: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/laravel/notejam/ - $ php artisan serve - -Go to http://localhost:8000/ in your browser. - ---------- -Run tests ---------- - -Run functional and unit tests: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/laravel/notejam/ - $ php vendor/bin/phpunit - - - -============ -Contribution -============ - -Do you have php/laravel experience? Help the app to follow php and laravel best practices. - -Please send your pull requests in the ``master`` branch. -Always prepend your commits with framework name: - -.. code-block:: bash - - Laravel: Implemented sign in functionality - -Read `contribution guide `_ for details. diff --git a/laravel/notejam/.gitattributes b/laravel/notejam/.gitattributes deleted file mode 100644 index 176a458f9..000000000 --- a/laravel/notejam/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text=auto diff --git a/laravel/notejam/.gitignore b/laravel/notejam/.gitignore deleted file mode 100644 index b5363f020..000000000 --- a/laravel/notejam/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/bootstrap/compiled.php -/vendor -composer.phar -composer.lock -.env.*.php -.env.php -.DS_Store -Thumbs.db diff --git a/laravel/notejam/app/commands/.gitkeep b/laravel/notejam/app/commands/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/laravel/notejam/app/config/app.php b/laravel/notejam/app/config/app.php deleted file mode 100644 index a63864d83..000000000 --- a/laravel/notejam/app/config/app.php +++ /dev/null @@ -1,193 +0,0 @@ - true, - - /* - |-------------------------------------------------------------------------- - | Application URL - |-------------------------------------------------------------------------- - | - | This URL is used by the console to properly generate URLs when using - | the Artisan command line tool. You should set this to the root of - | your application so that it is used when running Artisan tasks. - | - */ - - 'url' => 'http://localhost', - - /* - |-------------------------------------------------------------------------- - | Application Timezone - |-------------------------------------------------------------------------- - | - | Here you may specify the default timezone for your application, which - | will be used by the PHP date and date-time functions. We have gone - | ahead and set this to a sensible default for you out of the box. - | - */ - - 'timezone' => 'UTC', - - /* - |-------------------------------------------------------------------------- - | Application Locale Configuration - |-------------------------------------------------------------------------- - | - | The application locale determines the default locale that will be used - | by the translation service provider. You are free to set this value - | to any of the locales which will be supported by the application. - | - */ - - 'locale' => 'en', - - /* - |-------------------------------------------------------------------------- - | Application Fallback Locale - |-------------------------------------------------------------------------- - | - | The fallback locale determines the locale to use when the current one - | is not available. You may change the value to correspond to any of - | the language folders that are provided through your application. - | - */ - - 'fallback_locale' => 'en', - - /* - |-------------------------------------------------------------------------- - | Encryption Key - |-------------------------------------------------------------------------- - | - | This key is used by the Illuminate encrypter service and should be set - | to a random, 32 character string, otherwise these encrypted strings - | will not be safe. Please do this before deploying an application! - | - */ - - 'key' => 'J5263afFApteAj79OGkWSpGnBf0h76kF', - - 'crypt' => MCRYPT_RIJNDAEL_256, - - /* - |-------------------------------------------------------------------------- - | Autoloaded Service Providers - |-------------------------------------------------------------------------- - | - | The service providers listed here will be automatically loaded on the - | request to your application. Feel free to add your own services to - | this array to grant expanded functionality to your applications. - | - */ - - 'providers' => array( - - 'Illuminate\Foundation\Providers\ArtisanServiceProvider', - 'Illuminate\Auth\AuthServiceProvider', - 'Illuminate\Cache\CacheServiceProvider', - 'Illuminate\Session\CommandsServiceProvider', - 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider', - 'Illuminate\Routing\ControllerServiceProvider', - 'Illuminate\Cookie\CookieServiceProvider', - 'Illuminate\Database\DatabaseServiceProvider', - 'Illuminate\Encryption\EncryptionServiceProvider', - 'Illuminate\Filesystem\FilesystemServiceProvider', - 'Illuminate\Hashing\HashServiceProvider', - 'Illuminate\Html\HtmlServiceProvider', - 'Illuminate\Log\LogServiceProvider', - 'Illuminate\Mail\MailServiceProvider', - 'Illuminate\Database\MigrationServiceProvider', - 'Illuminate\Pagination\PaginationServiceProvider', - 'Illuminate\Queue\QueueServiceProvider', - 'Illuminate\Redis\RedisServiceProvider', - 'Illuminate\Remote\RemoteServiceProvider', - 'Illuminate\Auth\Reminders\ReminderServiceProvider', - 'Illuminate\Database\SeedServiceProvider', - 'Illuminate\Session\SessionServiceProvider', - 'Illuminate\Translation\TranslationServiceProvider', - 'Illuminate\Validation\ValidationServiceProvider', - 'Illuminate\View\ViewServiceProvider', - 'Illuminate\Workbench\WorkbenchServiceProvider', - - ), - - /* - |-------------------------------------------------------------------------- - | Service Provider Manifest - |-------------------------------------------------------------------------- - | - | The service provider manifest is used by Laravel to lazy load service - | providers which are not needed for each request, as well to keep a - | list of all of the services. Here, you may set its storage spot. - | - */ - - 'manifest' => storage_path().'/meta', - - /* - |-------------------------------------------------------------------------- - | Class Aliases - |-------------------------------------------------------------------------- - | - | This array of class aliases will be registered when this application - | is started. However, feel free to register as many as you wish as - | the aliases are "lazy" loaded so they don't hinder performance. - | - */ - - 'aliases' => array( - - 'App' => 'Illuminate\Support\Facades\App', - 'Artisan' => 'Illuminate\Support\Facades\Artisan', - 'Auth' => 'Illuminate\Support\Facades\Auth', - 'Blade' => 'Illuminate\Support\Facades\Blade', - 'Cache' => 'Illuminate\Support\Facades\Cache', - 'ClassLoader' => 'Illuminate\Support\ClassLoader', - 'Config' => 'Illuminate\Support\Facades\Config', - 'Controller' => 'Illuminate\Routing\Controller', - 'Cookie' => 'Illuminate\Support\Facades\Cookie', - 'Crypt' => 'Illuminate\Support\Facades\Crypt', - 'DB' => 'Illuminate\Support\Facades\DB', - 'Eloquent' => 'Illuminate\Database\Eloquent\Model', - 'Event' => 'Illuminate\Support\Facades\Event', - 'File' => 'Illuminate\Support\Facades\File', - 'Form' => 'Illuminate\Support\Facades\Form', - 'Hash' => 'Illuminate\Support\Facades\Hash', - 'HTML' => 'Illuminate\Support\Facades\HTML', - 'Input' => 'Illuminate\Support\Facades\Input', - 'Lang' => 'Illuminate\Support\Facades\Lang', - 'Log' => 'Illuminate\Support\Facades\Log', - 'Mail' => 'Illuminate\Support\Facades\Mail', - 'Paginator' => 'Illuminate\Support\Facades\Paginator', - 'Password' => 'Illuminate\Support\Facades\Password', - 'Queue' => 'Illuminate\Support\Facades\Queue', - 'Redirect' => 'Illuminate\Support\Facades\Redirect', - 'Redis' => 'Illuminate\Support\Facades\Redis', - 'Request' => 'Illuminate\Support\Facades\Request', - 'Response' => 'Illuminate\Support\Facades\Response', - 'Route' => 'Illuminate\Support\Facades\Route', - 'Schema' => 'Illuminate\Support\Facades\Schema', - 'Seeder' => 'Illuminate\Database\Seeder', - 'Session' => 'Illuminate\Support\Facades\Session', - 'SSH' => 'Illuminate\Support\Facades\SSH', - 'Str' => 'Illuminate\Support\Str', - 'URL' => 'Illuminate\Support\Facades\URL', - 'Validator' => 'Illuminate\Support\Facades\Validator', - 'View' => 'Illuminate\Support\Facades\View', - - ), - -); diff --git a/laravel/notejam/app/config/auth.php b/laravel/notejam/app/config/auth.php deleted file mode 100644 index eacbbfaed..000000000 --- a/laravel/notejam/app/config/auth.php +++ /dev/null @@ -1,71 +0,0 @@ - 'eloquent', - - /* - |-------------------------------------------------------------------------- - | Authentication Model - |-------------------------------------------------------------------------- - | - | When using the "Eloquent" authentication driver, we need to know which - | Eloquent model should be used to retrieve your users. Of course, it - | is often just the "User" model but you may use whatever you like. - | - */ - - 'model' => 'User', - - /* - |-------------------------------------------------------------------------- - | Authentication Table - |-------------------------------------------------------------------------- - | - | When using the "Database" authentication driver, we need to know which - | table should be used to retrieve your users. We have chosen a basic - | default value but you may easily change it to any table you like. - | - */ - - 'table' => 'users', - - /* - |-------------------------------------------------------------------------- - | Password Reminder Settings - |-------------------------------------------------------------------------- - | - | Here you may set the settings for password reminders, including a view - | that should be used as your password reminder e-mail. You will also - | be able to set the name of the table that holds the reset tokens. - | - | The "expire" time is the number of minutes that the reminder should be - | considered valid. This security feature keeps tokens short-lived so - | they have less time to be guessed. You may change this as needed. - | - */ - - 'reminder' => array( - - 'email' => 'emails.auth.reminder', - - 'table' => 'password_reminders', - - 'expire' => 60, - - ), - -); diff --git a/laravel/notejam/app/config/cache.php b/laravel/notejam/app/config/cache.php deleted file mode 100644 index ce8984239..000000000 --- a/laravel/notejam/app/config/cache.php +++ /dev/null @@ -1,89 +0,0 @@ - 'file', - - /* - |-------------------------------------------------------------------------- - | File Cache Location - |-------------------------------------------------------------------------- - | - | When using the "file" cache driver, we need a location where the cache - | files may be stored. A sensible default has been specified, but you - | are free to change it to any other place on disk that you desire. - | - */ - - 'path' => storage_path().'/cache', - - /* - |-------------------------------------------------------------------------- - | Database Cache Connection - |-------------------------------------------------------------------------- - | - | When using the "database" cache driver you may specify the connection - | that should be used to store the cached items. When this option is - | null the default database connection will be utilized for cache. - | - */ - - 'connection' => null, - - /* - |-------------------------------------------------------------------------- - | Database Cache Table - |-------------------------------------------------------------------------- - | - | When using the "database" cache driver we need to know the table that - | should be used to store the cached items. A default table name has - | been provided but you're free to change it however you deem fit. - | - */ - - 'table' => 'cache', - - /* - |-------------------------------------------------------------------------- - | Memcached Servers - |-------------------------------------------------------------------------- - | - | Now you may specify an array of your Memcached servers that should be - | used when utilizing the Memcached cache driver. All of the servers - | should contain a value for "host", "port", and "weight" options. - | - */ - - 'memcached' => array( - - array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100), - - ), - - /* - |-------------------------------------------------------------------------- - | Cache Key Prefix - |-------------------------------------------------------------------------- - | - | When utilizing a RAM based store such as APC or Memcached, there might - | be other applications utilizing the same cache. So, we'll specify a - | value to get prefixed to all our keys so we can avoid collisions. - | - */ - - 'prefix' => 'laravel', - -); diff --git a/laravel/notejam/app/config/compile.php b/laravel/notejam/app/config/compile.php deleted file mode 100644 index d5e55181b..000000000 --- a/laravel/notejam/app/config/compile.php +++ /dev/null @@ -1,18 +0,0 @@ - PDO::FETCH_CLASS, - - /* - |-------------------------------------------------------------------------- - | Default Database Connection Name - |-------------------------------------------------------------------------- - | - | Here you may specify which of the database connections below you wish - | to use as your default connection for all database work. Of course - | you may use many connections at once using the Database library. - | - */ - - 'default' => 'sqlite', - - /* - |-------------------------------------------------------------------------- - | Database Connections - |-------------------------------------------------------------------------- - | - | Here are each of the database connections setup for your application. - | Of course, examples of configuring each database platform that is - | supported by Laravel is shown below to make development simple. - | - | - | All database work in Laravel is done through the PHP PDO facilities - | so make sure you have the driver for your particular database of - | choice installed on your machine before you begin development. - | - */ - - 'connections' => array( - - 'sqlite' => array( - 'driver' => 'sqlite', - 'database' => __DIR__.'/../database/notejam.db', - 'prefix' => '', - ), - - 'mysql' => array( - 'driver' => 'mysql', - 'host' => 'localhost', - 'database' => 'database', - 'username' => 'root', - 'password' => '', - 'charset' => 'utf8', - 'collation' => 'utf8_unicode_ci', - 'prefix' => '', - ), - - 'pgsql' => array( - 'driver' => 'pgsql', - 'host' => 'localhost', - 'database' => 'database', - 'username' => 'root', - 'password' => '', - 'charset' => 'utf8', - 'prefix' => '', - 'schema' => 'public', - ), - - 'sqlsrv' => array( - 'driver' => 'sqlsrv', - 'host' => 'localhost', - 'database' => 'database', - 'username' => 'root', - 'password' => '', - 'prefix' => '', - ), - - ), - - /* - |-------------------------------------------------------------------------- - | Migration Repository Table - |-------------------------------------------------------------------------- - | - | This table keeps track of all the migrations that have already run for - | your application. Using this information, we can determine which of - | the migrations on disk haven't actually been run in the database. - | - */ - - 'migrations' => 'migrations', - - /* - |-------------------------------------------------------------------------- - | Redis Databases - |-------------------------------------------------------------------------- - | - | Redis is an open source, fast, and advanced key-value store that also - | provides a richer set of commands than a typical key-value systems - | such as APC or Memcached. Laravel makes it easy to dig right in. - | - */ - - 'redis' => array( - - 'cluster' => false, - - 'default' => array( - 'host' => '127.0.0.1', - 'port' => 6379, - 'database' => 0, - ), - - ), - - 'test' => array( - 'driver' => 'sqlite', - 'database' => 'memory:', - 'prefix' => '', - ), - -); diff --git a/laravel/notejam/app/config/local/app.php b/laravel/notejam/app/config/local/app.php deleted file mode 100644 index c56fcb9ce..000000000 --- a/laravel/notejam/app/config/local/app.php +++ /dev/null @@ -1,18 +0,0 @@ - true, - -); diff --git a/laravel/notejam/app/config/mail.php b/laravel/notejam/app/config/mail.php deleted file mode 100644 index 06be66551..000000000 --- a/laravel/notejam/app/config/mail.php +++ /dev/null @@ -1,124 +0,0 @@ - 'smtp', - - /* - |-------------------------------------------------------------------------- - | SMTP Host Address - |-------------------------------------------------------------------------- - | - | Here you may provide the host address of the SMTP server used by your - | applications. A default option is provided that is compatible with - | the Mailgun mail service which will provide reliable deliveries. - | - */ - - 'host' => 'smtp.mailgun.org', - - /* - |-------------------------------------------------------------------------- - | SMTP Host Port - |-------------------------------------------------------------------------- - | - | This is the SMTP port used by your application to delivery e-mails to - | users of your application. Like the host we have set this value to - | stay compatible with the Mailgun e-mail applications by default. - | - */ - - 'port' => 587, - - /* - |-------------------------------------------------------------------------- - | Global "From" Address - |-------------------------------------------------------------------------- - | - | You may wish for all e-mails sent by your application to be sent from - | the same address. Here, you may specify a name and address that is - | used globally for all e-mails that are sent by your application. - | - */ - - 'from' => array('address' => null, 'name' => null), - - /* - |-------------------------------------------------------------------------- - | E-Mail Encryption Protocol - |-------------------------------------------------------------------------- - | - | Here you may specify the encryption protocol that should be used when - | the application send e-mail messages. A sensible default using the - | transport layer security protocol should provide great security. - | - */ - - 'encryption' => 'tls', - - /* - |-------------------------------------------------------------------------- - | SMTP Server Username - |-------------------------------------------------------------------------- - | - | If your SMTP server requires a username for authentication, you should - | set it here. This will get used to authenticate with your server on - | connection. You may also set the "password" value below this one. - | - */ - - 'username' => null, - - /* - |-------------------------------------------------------------------------- - | SMTP Server Password - |-------------------------------------------------------------------------- - | - | Here you may set the password required by your SMTP server to send out - | messages from your application. This will be given to the server on - | connection so that the application will be able to send messages. - | - */ - - 'password' => null, - - /* - |-------------------------------------------------------------------------- - | Sendmail System Path - |-------------------------------------------------------------------------- - | - | When using the "sendmail" driver to send e-mails, we will need to know - | the path to where Sendmail lives on this server. A default path has - | been provided here, which will work well on most of your systems. - | - */ - - 'sendmail' => '/usr/sbin/sendmail -bs', - - /* - |-------------------------------------------------------------------------- - | Mail "Pretend" - |-------------------------------------------------------------------------- - | - | When this option is enabled, e-mail will not actually be sent over the - | web and will instead be written to your application's logs files so - | you may inspect the message. This is great for local development. - | - */ - - 'pretend' => true, - -); diff --git a/laravel/notejam/app/config/packages/.gitkeep b/laravel/notejam/app/config/packages/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/laravel/notejam/app/config/queue.php b/laravel/notejam/app/config/queue.php deleted file mode 100644 index 1fa4467e0..000000000 --- a/laravel/notejam/app/config/queue.php +++ /dev/null @@ -1,85 +0,0 @@ - 'sync', - - /* - |-------------------------------------------------------------------------- - | Queue Connections - |-------------------------------------------------------------------------- - | - | Here you may configure the connection information for each server that - | is used by your application. A default configuration has been added - | for each back-end shipped with Laravel. You are free to add more. - | - */ - - 'connections' => array( - - 'sync' => array( - 'driver' => 'sync', - ), - - 'beanstalkd' => array( - 'driver' => 'beanstalkd', - 'host' => 'localhost', - 'queue' => 'default', - 'ttr' => 60, - ), - - 'sqs' => array( - 'driver' => 'sqs', - 'key' => 'your-public-key', - 'secret' => 'your-secret-key', - 'queue' => 'your-queue-url', - 'region' => 'us-east-1', - ), - - 'iron' => array( - 'driver' => 'iron', - 'host' => 'mq-aws-us-east-1.iron.io', - 'token' => 'your-token', - 'project' => 'your-project-id', - 'queue' => 'your-queue-name', - 'encrypt' => false - ), - - 'redis' => array( - 'driver' => 'redis', - 'queue' => 'default', - ), - - ), - - /* - |-------------------------------------------------------------------------- - | Failed Queue Jobs - |-------------------------------------------------------------------------- - | - | These options configure the behavior of failed queue job logging so you - | can control which database and table are used to store the jobs that - | have failed. You may change them to any database / table you wish. - | - */ - - 'failed' => array( - - 'database' => 'mysql', 'table' => 'failed_jobs', - - ), - -); diff --git a/laravel/notejam/app/config/remote.php b/laravel/notejam/app/config/remote.php deleted file mode 100644 index 2169c434b..000000000 --- a/laravel/notejam/app/config/remote.php +++ /dev/null @@ -1,59 +0,0 @@ - 'production', - - /* - |-------------------------------------------------------------------------- - | Remote Server Connections - |-------------------------------------------------------------------------- - | - | These are the servers that will be accessible via the SSH task runner - | facilities of Laravel. This feature radically simplifies executing - | tasks on your servers, such as deploying out these applications. - | - */ - - 'connections' => array( - - 'production' => array( - 'host' => '', - 'username' => '', - 'password' => '', - 'key' => '', - 'keyphrase' => '', - 'root' => '/var/www', - ), - - ), - - /* - |-------------------------------------------------------------------------- - | Remote Server Groups - |-------------------------------------------------------------------------- - | - | Here you may list connections under a single group name, which allows - | you to easily access all of the servers at once using a short name - | that is extremely easy to remember, such as "web" or "database". - | - */ - - 'groups' => array( - - 'web' => array('production') - - ), - -); diff --git a/laravel/notejam/app/config/session.php b/laravel/notejam/app/config/session.php deleted file mode 100644 index ae343029e..000000000 --- a/laravel/notejam/app/config/session.php +++ /dev/null @@ -1,140 +0,0 @@ - 'file', - - /* - |-------------------------------------------------------------------------- - | Session Lifetime - |-------------------------------------------------------------------------- - | - | Here you may specify the number of minutes that you wish the session - | to be allowed to remain idle before it expires. If you want them - | to immediately expire on the browser closing, set that option. - | - */ - - 'lifetime' => 120, - - 'expire_on_close' => false, - - /* - |-------------------------------------------------------------------------- - | Session File Location - |-------------------------------------------------------------------------- - | - | When using the native session driver, we need a location where session - | files may be stored. A default has been set for you but a different - | location may be specified. This is only needed for file sessions. - | - */ - - 'files' => storage_path().'/sessions', - - /* - |-------------------------------------------------------------------------- - | Session Database Connection - |-------------------------------------------------------------------------- - | - | When using the "database" or "redis" session drivers, you may specify a - | connection that should be used to manage these sessions. This should - | correspond to a connection in your database configuration options. - | - */ - - 'connection' => null, - - /* - |-------------------------------------------------------------------------- - | Session Database Table - |-------------------------------------------------------------------------- - | - | When using the "database" session driver, you may specify the table we - | should use to manage the sessions. Of course, a sensible default is - | provided for you; however, you are free to change this as needed. - | - */ - - 'table' => 'sessions', - - /* - |-------------------------------------------------------------------------- - | Session Sweeping Lottery - |-------------------------------------------------------------------------- - | - | Some session drivers must manually sweep their storage location to get - | rid of old sessions from storage. Here are the chances that it will - | happen on a given request. By default, the odds are 2 out of 100. - | - */ - - 'lottery' => array(2, 100), - - /* - |-------------------------------------------------------------------------- - | Session Cookie Name - |-------------------------------------------------------------------------- - | - | Here you may change the name of the cookie used to identify a session - | instance by ID. The name specified here will get used every time a - | new session cookie is created by the framework for every driver. - | - */ - - 'cookie' => 'laravel_session', - - /* - |-------------------------------------------------------------------------- - | Session Cookie Path - |-------------------------------------------------------------------------- - | - | The session cookie path determines the path for which the cookie will - | be regarded as available. Typically, this will be the root path of - | your application but you are free to change this when necessary. - | - */ - - 'path' => '/', - - /* - |-------------------------------------------------------------------------- - | Session Cookie Domain - |-------------------------------------------------------------------------- - | - | Here you may change the domain of the cookie used to identify a session - | in your application. This will determine which domains the cookie is - | available to in your application. A sensible default has been set. - | - */ - - 'domain' => null, - - /* - |-------------------------------------------------------------------------- - | HTTPS Only Cookies - |-------------------------------------------------------------------------- - | - | By setting this option to true, session cookies will only be sent back - | to the server if the browser has a HTTPS connection. This will keep - | the cookie from being sent to you if it can not be done securely. - | - */ - - 'secure' => false, - -); diff --git a/laravel/notejam/app/config/testing/cache.php b/laravel/notejam/app/config/testing/cache.php deleted file mode 100644 index 66a8a39a8..000000000 --- a/laravel/notejam/app/config/testing/cache.php +++ /dev/null @@ -1,20 +0,0 @@ - 'array', - -); diff --git a/laravel/notejam/app/config/testing/database.php b/laravel/notejam/app/config/testing/database.php deleted file mode 100644 index d5e72f04a..000000000 --- a/laravel/notejam/app/config/testing/database.php +++ /dev/null @@ -1,14 +0,0 @@ - 'sqlite', - - 'connections' => array( - 'sqlite' => array( - 'driver' => 'sqlite', - 'database' => ':memory:', - 'prefix' => '' - ), - ) -); diff --git a/laravel/notejam/app/config/testing/session.php b/laravel/notejam/app/config/testing/session.php deleted file mode 100644 index 0364b63dc..000000000 --- a/laravel/notejam/app/config/testing/session.php +++ /dev/null @@ -1,21 +0,0 @@ - 'array', - -); diff --git a/laravel/notejam/app/config/view.php b/laravel/notejam/app/config/view.php deleted file mode 100644 index 34b8f3873..000000000 --- a/laravel/notejam/app/config/view.php +++ /dev/null @@ -1,31 +0,0 @@ - array(__DIR__.'/../views'), - - /* - |-------------------------------------------------------------------------- - | Pagination View - |-------------------------------------------------------------------------- - | - | This view will be used to render the pagination link output, and can - | be easily customized here to show any view you like. A clean view - | compatible with Twitter's Bootstrap is given to you by default. - | - */ - - 'pagination' => 'pagination::slider-3', - -); diff --git a/laravel/notejam/app/config/workbench.php b/laravel/notejam/app/config/workbench.php deleted file mode 100644 index 87c5e3879..000000000 --- a/laravel/notejam/app/config/workbench.php +++ /dev/null @@ -1,31 +0,0 @@ - '', - - /* - |-------------------------------------------------------------------------- - | Workbench Author E-Mail Address - |-------------------------------------------------------------------------- - | - | Like the option above, your e-mail address is used when generating new - | workbench packages. The e-mail is placed in your composer.json file - | automatically after the package is created by the workbench tool. - | - */ - - 'email' => '', - -); diff --git a/laravel/notejam/app/controllers/.gitkeep b/laravel/notejam/app/controllers/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/laravel/notejam/app/controllers/BaseController.php b/laravel/notejam/app/controllers/BaseController.php deleted file mode 100644 index cd6f5a89f..000000000 --- a/laravel/notejam/app/controllers/BaseController.php +++ /dev/null @@ -1,28 +0,0 @@ -layout)) - { - $this->layout = View::make($this->layout); - } - } - - protected function processOrderParam() - { - $order = array( - 'name' => array('name', 'ASC'), - '-name' => array('name', 'DESC'), - 'updated_at' => array('updated_at', 'ASC'), - '-updated_at' => array('updated_at', 'DESC'), - ); - return $order[Input::get('order', '-updated_at')]; - } -} diff --git a/laravel/notejam/app/controllers/NoteController.php b/laravel/notejam/app/controllers/NoteController.php deleted file mode 100644 index 7c853dcae..000000000 --- a/laravel/notejam/app/controllers/NoteController.php +++ /dev/null @@ -1,114 +0,0 @@ -processOrderParam(); - $notes = Auth::user()->notes()->orderBy( - $orderParams[0], $orderParams[1] - )->get(); - return View::make('note/index', array('notes' => $notes)); - } - - public function create() - { - return View::make('note/create'); - } - - public function store() - { - $validation = $this->validator(); - if ($validation->fails()) - { - return Redirect::route('notes.create')->withErrors($validation); - } - $note = new Note( - array( - 'name' => Input::get('name'), - 'text' => Input::get('text') - ) - ); - $padId = (int)Input::get('pad_id'); - if ($padId) { - $pad = Auth::user()->pads() - ->where('id', $padId)->firstOrFail(); - $note->pad_id = $pad->id; - } - Auth::user()->notes()->save($note); - return Redirect::route('notes.show', array('id' => $note->id)) - ->with('success', 'Note is successfully created.'); - } - - public function edit($id) - { - $note = $this->getNoteOrFail($id); - return View::make('note/edit', array('note' => $note)); - } - - public function update($id) - { - $note = $this->getNoteOrFail($id); - $validation = $this->validator(); - if ($validation->fails()) - { - return Redirect::route('notes.edit')->withErrors($validation); - } - $note->update( - array( - 'name' => Input::get('name'), - 'text' => Input::get('text') - ) - ); - $padId = (int)Input::get('pad_id'); - if ($padId) { - $pad = Auth::user()->pads() - ->where('id', $padId)->firstOrFail(); - $note->pad_id = $pad->id; - } else { - $note->pad_id = null; - } - Auth::user()->notes()->save($note); - - return Redirect::route('notes.show', array('id' => $note->id)) - ->with('success', 'Note is successfully updated.'); - } - - public function delete($id) - { - $note = $this->getNoteOrFail($id); - return View::make('note/delete', array('note' => $note)); - } - - public function destroy($id) - { - $note = $this->getNoteOrFail($id); - $note->delete(); - return Redirect::route('all_notes') - ->with('success', 'Note is deleted.'); - } - - public function show($id) - { - $note = $this->getNoteOrFail($id); - return View::make('note/view', array('note' => $note)); - } - - private function getNoteOrFail($id) - { - return Auth::user()->notes() - ->where('id', '=', $id)->firstOrFail(); - } - - private function validator() - { - return Validator::make( - Input::all(), - array( - 'name' => 'required', - 'text' => 'required', - ) - ); - } -} diff --git a/laravel/notejam/app/controllers/PadController.php b/laravel/notejam/app/controllers/PadController.php deleted file mode 100644 index 81017f24f..000000000 --- a/laravel/notejam/app/controllers/PadController.php +++ /dev/null @@ -1,87 +0,0 @@ -validator(); - if ($validation->fails()) - { - return Redirect::route('pads.create')->withErrors($validation); - } - $pad = new Pad(array('name' => Input::get('name'))); - Auth::user()->pads()->save($pad); - return Redirect::route('pads.show', array('id' => $pad->id)) - ->with('success', 'Pad is created.'); - } - - public function edit($id) - { - $pad = $this->getPadOrFail($id); - return View::make('pad/edit', array('pad' => $pad)); - } - - public function update($id) - { - $pad = $this->getPadOrFail($id); - $validation = $this->validator(); - if ($validation->fails()) - { - return Redirect::route('pads.edit', array('id' => $pad->id)) - ->withErrors($validation); - } - $pad->name = Input::get('name'); - $pad->save(); - return Redirect::route('pads.show', array('id' => $pad->id)) - ->with('success', 'Pad is updated.'); - } - - public function show($id) - { - $pad = $this->getPadOrFail($id); - $orderParams = $this->processOrderParam(); - $notes = $pad->notes()->orderBy( - $orderParams[0], $orderParams[1] - )->get(); - return View::make( - 'pad/view', - array('pad' => $pad, 'notes' => $notes) - ); - } - - public function delete($id) - { - $pad = $this->getPadOrFail($id); - return View::make('pad/delete', array('pad' => $pad)); - } - - public function destroy($id) - { - $pad = $this->getPadOrFail($id); - $pad->delete(); - return Redirect::route('all_notes') - ->with('success', 'Pad is deleted.'); - } - - private function getPadOrFail($id) - { - return Auth::user()->pads() - ->where('id', '=', $id)->firstOrFail(); - } - - private function validator() - { - return Validator::make( - Input::all(), - array( - 'name' => 'required', - ) - ); - } -} - diff --git a/laravel/notejam/app/controllers/UserController.php b/laravel/notejam/app/controllers/UserController.php deleted file mode 100644 index 0d5745c06..000000000 --- a/laravel/notejam/app/controllers/UserController.php +++ /dev/null @@ -1,150 +0,0 @@ - 'required|email|unique:users', - 'password' => 'required|min:6|confirmed', - 'password_confirmation' => 'required|min:6', - ) - ); - if ($validation->fails()) - { - return Redirect::route('signup')->withErrors($validation); - } - $user = User::create( - array( - 'email' => Input::get('email'), - 'password' => Hash::make(Input::get('password')) - ) - ); - return Redirect::route('signin') - ->with('success', 'Account is created. Now you can sign in.'); - } - - public function signin() - { - return View::make('user/signin'); - } - - public function processSignin() - { - $validation = Validator::make( - Input::all(), - array( - 'email' => 'required|email', - 'password' => 'required|min:6', - ) - ); - if ($validation->fails()) - { - return Redirect::route('signin')->withErrors($validation); - } - $authParams = array( - 'email' => Input::get('email'), - 'password' => Input::get('password') - ); - if (Auth::attempt($authParams)) - { - return Redirect::route('all_notes') - ->with('success', 'Signed in now!'); - } - return Redirect::route('signin') - ->with('error', 'Invalid email or password'); - } - - public function settings() - { - return View::make('user/settings'); - } - - public function updateSettings() - { - $user = Auth::user(); - $validation = Validator::make( - Input::all(), - array( - 'old_password' => 'required', - 'password' => 'required|min:6|confirmed', - 'password_confirmation' => 'required|min:6', - ) - ); - if ($validation->fails()) - { - return Redirect::route('settings')->withErrors($validation); - } - $authParams = array( - 'email' => $user->email, - 'password' => Input::get('old_password') - ); - if (Auth::validate($authParams)) - { - $user->password = Hash::make(Input::get('password')); - return Redirect::route('settings') - ->with('success', 'Password is successfully changed'); - } else { - return Redirect::route('settings') - ->with('error', 'Current password is incorrect'); - } - } - - public function forgotPassword() - { - if (Request::isMethod('post')) - { - $validation = Validator::make( - Input::all(), - array( - 'email' => 'required|email|exists:users', - ) - ); - if ($validation->fails()) - { - return Redirect::route('forgot_password') - ->withErrors($validation); - } - $user = User::where( - 'email', '=', Input::get('email') - )->firstOrFail(); - - $password = $this->generatePassword(); - $user->password = Hash::make($password); - $user->save(); - - $this->sendNewPassword($user, $password); - - return Redirect::route('signin') - ->with('success', 'New password sent to you mail.'); - } - return View::make('user/forgot-password'); - } - - private function generatePassword() - { - return substr(md5(time()), 0, 8); - } - - private function sendNewPassword($user, $password) - { - $data = array( - 'email' => $user->email, - 'password' => $password - ); - Mail::send(array('text' => 'emails.password') , $data, - function($message) use ($user) - { - $message->to($user->email)->subject('New password'); - } - ); - } -} - diff --git a/laravel/notejam/app/database/migrations/.gitkeep b/laravel/notejam/app/database/migrations/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/laravel/notejam/app/database/migrations/2014_05_14_215427_create_users_table.php b/laravel/notejam/app/database/migrations/2014_05_14_215427_create_users_table.php deleted file mode 100644 index 88be6b9f9..000000000 --- a/laravel/notejam/app/database/migrations/2014_05_14_215427_create_users_table.php +++ /dev/null @@ -1,34 +0,0 @@ -increments('id'); - $table->string('email'); - $table->string('password', 60); - $table->string('remember_token', 100)->nullable(); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('users'); - } -} diff --git a/laravel/notejam/app/database/migrations/2014_05_16_225623_create_pads_table.php b/laravel/notejam/app/database/migrations/2014_05_16_225623_create_pads_table.php deleted file mode 100644 index b3ac08f33..000000000 --- a/laravel/notejam/app/database/migrations/2014_05_16_225623_create_pads_table.php +++ /dev/null @@ -1,34 +0,0 @@ -increments('id'); - $table->string('name', 255); - $table->integer('user_id'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - // - } - -} diff --git a/laravel/notejam/app/database/migrations/2014_05_18_180146_create_notes_table.php b/laravel/notejam/app/database/migrations/2014_05_18_180146_create_notes_table.php deleted file mode 100644 index 9ae69da2e..000000000 --- a/laravel/notejam/app/database/migrations/2014_05_18_180146_create_notes_table.php +++ /dev/null @@ -1,36 +0,0 @@ -increments('id'); - $table->string('name', 255); - $table->text('text'); - $table->integer('user_id'); - $table->integer('pad_id')->nullable(); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - // - } - -} diff --git a/laravel/notejam/app/database/production.sqlite b/laravel/notejam/app/database/production.sqlite deleted file mode 100644 index e69de29bb..000000000 diff --git a/laravel/notejam/app/database/seeds/.gitkeep b/laravel/notejam/app/database/seeds/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/laravel/notejam/app/database/seeds/DatabaseSeeder.php b/laravel/notejam/app/database/seeds/DatabaseSeeder.php deleted file mode 100644 index 198925207..000000000 --- a/laravel/notejam/app/database/seeds/DatabaseSeeder.php +++ /dev/null @@ -1,17 +0,0 @@ -call('UserTableSeeder'); - } - -} diff --git a/laravel/notejam/app/filters.php b/laravel/notejam/app/filters.php deleted file mode 100644 index 5b81f3e36..000000000 --- a/laravel/notejam/app/filters.php +++ /dev/null @@ -1,80 +0,0 @@ - '« Previous', - - 'next' => 'Next »', - -); diff --git a/laravel/notejam/app/lang/en/reminders.php b/laravel/notejam/app/lang/en/reminders.php deleted file mode 100644 index e42148e9f..000000000 --- a/laravel/notejam/app/lang/en/reminders.php +++ /dev/null @@ -1,24 +0,0 @@ - "Passwords must be at least six characters and match the confirmation.", - - "user" => "We can't find a user with that e-mail address.", - - "token" => "This password reset token is invalid.", - - "sent" => "Password reminder sent!", - -); diff --git a/laravel/notejam/app/lang/en/validation.php b/laravel/notejam/app/lang/en/validation.php deleted file mode 100644 index b03b926c8..000000000 --- a/laravel/notejam/app/lang/en/validation.php +++ /dev/null @@ -1,104 +0,0 @@ - "The :attribute must be accepted.", - "active_url" => "The :attribute is not a valid URL.", - "after" => "The :attribute must be a date after :date.", - "alpha" => "The :attribute may only contain letters.", - "alpha_dash" => "The :attribute may only contain letters, numbers, and dashes.", - "alpha_num" => "The :attribute may only contain letters and numbers.", - "array" => "The :attribute must be an array.", - "before" => "The :attribute must be a date before :date.", - "between" => array( - "numeric" => "The :attribute must be between :min and :max.", - "file" => "The :attribute must be between :min and :max kilobytes.", - "string" => "The :attribute must be between :min and :max characters.", - "array" => "The :attribute must have between :min and :max items.", - ), - "confirmed" => "The :attribute confirmation does not match.", - "date" => "The :attribute is not a valid date.", - "date_format" => "The :attribute does not match the format :format.", - "different" => "The :attribute and :other must be different.", - "digits" => "The :attribute must be :digits digits.", - "digits_between" => "The :attribute must be between :min and :max digits.", - "email" => "The :attribute must be a valid email address.", - "exists" => "The selected :attribute is invalid.", - "image" => "The :attribute must be an image.", - "in" => "The selected :attribute is invalid.", - "integer" => "The :attribute must be an integer.", - "ip" => "The :attribute must be a valid IP address.", - "max" => array( - "numeric" => "The :attribute may not be greater than :max.", - "file" => "The :attribute may not be greater than :max kilobytes.", - "string" => "The :attribute may not be greater than :max characters.", - "array" => "The :attribute may not have more than :max items.", - ), - "mimes" => "The :attribute must be a file of type: :values.", - "min" => array( - "numeric" => "The :attribute must be at least :min.", - "file" => "The :attribute must be at least :min kilobytes.", - "string" => "The :attribute must be at least :min characters.", - "array" => "The :attribute must have at least :min items.", - ), - "not_in" => "The selected :attribute is invalid.", - "numeric" => "The :attribute must be a number.", - "regex" => "The :attribute format is invalid.", - "required" => "The :attribute field is required.", - "required_if" => "The :attribute field is required when :other is :value.", - "required_with" => "The :attribute field is required when :values is present.", - "required_with_all" => "The :attribute field is required when :values is present.", - "required_without" => "The :attribute field is required when :values is not present.", - "required_without_all" => "The :attribute field is required when none of :values are present.", - "same" => "The :attribute and :other must match.", - "size" => array( - "numeric" => "The :attribute must be :size.", - "file" => "The :attribute must be :size kilobytes.", - "string" => "The :attribute must be :size characters.", - "array" => "The :attribute must contain :size items.", - ), - "unique" => "The :attribute has already been taken.", - "url" => "The :attribute format is invalid.", - - /* - |-------------------------------------------------------------------------- - | Custom Validation Language Lines - |-------------------------------------------------------------------------- - | - | Here you may specify custom validation messages for attributes using the - | convention "attribute.rule" to name the lines. This makes it quick to - | specify a specific custom language line for a given attribute rule. - | - */ - - 'custom' => array( - 'attribute-name' => array( - 'rule-name' => 'custom-message', - ), - ), - - /* - |-------------------------------------------------------------------------- - | Custom Validation Attributes - |-------------------------------------------------------------------------- - | - | The following language lines are used to swap attribute place-holders - | with something more reader friendly such as E-Mail Address instead - | of "email". This simply helps us make messages a little cleaner. - | - */ - - 'attributes' => array(), - -); diff --git a/laravel/notejam/app/models/Note.php b/laravel/notejam/app/models/Note.php deleted file mode 100644 index 1867ff21c..000000000 --- a/laravel/notejam/app/models/Note.php +++ /dev/null @@ -1,41 +0,0 @@ -belongsTo('User'); - } - - public function pad() - { - return $this->belongsTo('Pad'); - } - - public function smartDate() - { - $day = 86400; - $date = strtotime($this->updated_at); - $diff = floor((time() - $date) / $day); - if ($diff < 1) { - return "Today at " . date("H:i", $date); - } elseif ($diff == 1) { - return "Yesterday at " . date("H:i", $date); - } elseif ($diff > 1 && $diff < 8) { - return "{$diff} days ago"; - } else { - return date("d.m.Y", $date); - } - } -} diff --git a/laravel/notejam/app/models/Pad.php b/laravel/notejam/app/models/Pad.php deleted file mode 100644 index 95c0759be..000000000 --- a/laravel/notejam/app/models/Pad.php +++ /dev/null @@ -1,26 +0,0 @@ -belongsTo('User'); - } - - public function notes() - { - return $this->hasMany('Note'); - } -} - diff --git a/laravel/notejam/app/models/User.php b/laravel/notejam/app/models/User.php deleted file mode 100644 index d780769c7..000000000 --- a/laravel/notejam/app/models/User.php +++ /dev/null @@ -1,85 +0,0 @@ -getKey(); - } - - /** - * Get the password for the user. - * - * @return string - */ - public function getAuthPassword() - { - return $this->password; - } - - /** - * Get the token value for the "remember me" session. - * - * @return string - */ - public function getRememberToken() - { - return $this->remember_token; - } - - /** - * Set the token value for the "remember me" session. - * - * @param string $value - * @return void - */ - public function setRememberToken($value) - { - $this->remember_token = $value; - } - - /** - * Get the column name for the "remember me" token. - * - * @return string - */ - public function getRememberTokenName() - { - return 'remember_token'; - } - - public function pads() - { - return $this->hasMany('Pad'); - } - - public function notes() - { - return $this->hasMany('Note'); - } - -} diff --git a/laravel/notejam/app/routes.php b/laravel/notejam/app/routes.php deleted file mode 100644 index b25c1e562..000000000 --- a/laravel/notejam/app/routes.php +++ /dev/null @@ -1,91 +0,0 @@ - 'auth'), function() -{ - Route::get('/', array( - 'as' => 'all_notes', 'uses' => 'NoteController@index' - ) - ); - - # user related routes (authed) - Route::get('settings', array( - 'as' => 'settings', 'uses' => 'UserController@settings' - ) - ); - Route::post('settings', array( - 'as' => 'settings.update', 'uses' => 'UserController@updateSettings' - ) - ); - Route::get('signout', array('as' => 'signout', function() { - Auth::logout(); - return Redirect::route('signin'); - })); - - # customized pad resource controller - Route::post('pads/{id}/update', array( - 'as' => 'pads.update', 'uses' => 'PadController@update' - ) - ); - Route::get('pads/{id}/delete', array( - 'as' => 'pads.delete', 'uses' => 'PadController@delete' - ) - ); - Route::post('pads/{id}/delete', array( - 'as' => 'pads.destroy', 'uses' => 'PadController@destroy' - ) - ); - Route::resource('pads', 'PadController', - array('except' => array('destroy', 'index', 'update'))); - - # customized note resource controller - Route::post('notes/{id}/update', array( - 'as' => 'notes.update', 'uses' => 'NoteController@update' - ) - ); - Route::get('notes/{id}/delete', array( - 'as' => 'notes.delete', 'uses' => 'NoteController@delete' - ) - ); - Route::post('notes/{id}/delete', array( - 'as' => 'notes.destroy', 'uses' => 'NoteController@destroy' - ) - ); - Route::resource('notes', 'NoteController', - array('except' => array('destroy', 'index', 'update'))); -}); - -# user related routes (anonymous) -Route::get( - 'signup', - array('as' => 'signup', 'uses' => 'UserController@signup') -); -Route::post( - 'signup', - array('as' => 'user.store', 'uses' => 'UserController@store') -); - -Route::get( - 'signin', - array('as' => 'signin', 'uses' => 'UserController@signin') -); -Route::post( - 'signin', - array('as' => 'signin.process', 'uses' => 'UserController@processSignin') -); -Route::match( - array('GET', 'POST'), - 'forgot-password', - array('as' => 'forgot_password', 'uses' => 'UserController@forgotPassword') -); - diff --git a/laravel/notejam/app/start/artisan.php b/laravel/notejam/app/start/artisan.php deleted file mode 100644 index 1df850bc9..000000000 --- a/laravel/notejam/app/start/artisan.php +++ /dev/null @@ -1,13 +0,0 @@ - 'Note', - 'text' => 'Text', - ), - $override - ); - } - - public function testCreateSuccess() - { - $data = $this->getNoteData(); - $user = $this->createUser('exists@example.com'); - $this->be($user); - $crawler = $this->client->request( - 'POST', URL::route('notes.store'), $data - ); - $this->assertRedirectedToRoute( - 'notes.show', - array('id' => $user->notes()->first()->id) - ); - $this->assertEquals(1, $user->notes()->count()); - } - - public function testCreateFailRequiredFields() - { - $this->be($this->createUser('exists@example.com')); - $crawler = $this->client->request( - 'POST', URL::route('notes.store'), array() - ); - $this->assertSessionHasErrors( - array('name', 'text') - ); - } - - public function testCreateFailAnonymousUser() - { - $data = $this->getNoteData(); - $crawler = $this->client->request( - 'POST', URL::route('notes.store'), $data - ); - $this->assertRedirectedToRoute('signin'); - } - - /** - * @expectedException Illuminate\Database\Eloquent\ModelNotFoundException - */ - public function testCreateFailAnothersUserPad() - { - $user2 = $this->createUser('exists@example.com'); - $pad = $user2->pads()->save(new Pad(array('name' => 'pad'))); - - $user = $this->createUser('exists2@example.com'); - $data = $this->getNoteData(array('pad_id' => $pad->id)); - $this->be($user); - $crawler = $this->client->request( - 'POST', URL::route('notes.store'), $data - ); - } - - public function testEditSuccess() - { - $user = $this->createUser('exists@example.com'); - $this->be($user); - $note = $user->notes()->save( - new Note($this->getNoteData()) - ); - $crawler = $this->client->request( - 'POST', - URL::route('notes.update', array('id' => $note->id)), - array('name' => 'new name', 'text' => 'new text') - ); - $this->assertRedirectedToRoute('notes.show', array('id' => $note->id)); - } - - public function testEditFailRequiredFields() - { - $user = $this->createUser('exists@example.com'); - $this->be($user); - $note = $user->notes()->save( - new Note($this->getNoteData()) - ); - $crawler = $this->client->request( - 'POST', - URL::route('notes.update', array('id' => $note->id)), - array() - ); - $this->assertSessionHasErrors( - array('name', 'text') - ); - } - - /** - * @expectedException Illuminate\Database\Eloquent\ModelNotFoundException - */ - public function testEditFailNotAnOwner() - { - $user = $this->createUser('exists@example.com'); - $note = $user->notes()->save( - new Note($this->getNoteData()) - ); - $this->be($this->createUser('exists2@example.com')); - - $crawler = $this->client->request( - 'POST', - URL::route('notes.update', array('id' => $note->id)), - array('name' => 'new name', 'text' => 'new text') - ); - } - - public function testViewSuccess() - { - $user = $this->createUser('exists@example.com'); - $note = $user->notes()->save( - new Note($this->getNoteData()) - ); - $this->be($user); - $crawler = $this->client->request( - 'GET', - URL::route('notes.show', array('id' => $note->id)) - ); - $this->assertTrue($this->client->getResponse()->isOk()); - } - - /** - * @expectedException Illuminate\Database\Eloquent\ModelNotFoundException - */ - public function testViewFailNotAnOwner() - { - $user = $this->createUser('exists@example.com'); - $note = $user->notes()->save( - new Note($this->getNoteData()) - ); - $this->be($this->createUser('exists2@example.com')); - $crawler = $this->client->request( - 'GET', - URL::route('notes.show', array('id' => $note->id)) - ); - } - - public function testDeleteSuccess() - { - $user = $this->createUser('exists@example.com'); - $note = $user->notes()->save( - new Note($this->getNoteData()) - ); - $this->be($user); - $crawler = $this->client->request( - 'POST', - URL::route('notes.destroy', array('id' => $note->id)) - ); - $this->assertRedirectedToRoute('all_notes'); - $this->assertEquals(0, $user->notes()->count()); - } - - /** - * @expectedException Illuminate\Database\Eloquent\ModelNotFoundException - */ - public function testDeleteFailNotAnOwner() - { - $user = $this->createUser('exists@example.com'); - $note = $user->notes()->save( - new Note($this->getNoteData()) - ); - $this->be($this->createUser('exists2@example.com')); - $crawler = $this->client->request( - 'POST', - URL::route('notes.destroy', array('id' => $note->id)) - ); - } -} - - - diff --git a/laravel/notejam/app/tests/PadTest.php b/laravel/notejam/app/tests/PadTest.php deleted file mode 100644 index ecae234bb..000000000 --- a/laravel/notejam/app/tests/PadTest.php +++ /dev/null @@ -1,138 +0,0 @@ - 'Pad', - ), - $override - ); - } - - public function testCreateSuccess() - { - $data = $this->getPadData(); - $user = $this->createUser('exists@example.com'); - $this->be($user); - $crawler = $this->client->request( - 'POST', URL::route('pads.store'), $data - ); - $this->assertRedirectedToRoute( - 'pads.show', - array('id' => $user->pads()->first()->id) - ); - $this->assertEquals(1, $user->pads()->count()); - } - - public function testCreateFailRequiredFields() - { - $this->be($this->createUser('exists@example.com')); - $crawler = $this->client->request( - 'POST', URL::route('pads.store'), array() - ); - $this->assertSessionHasErrors( - array('name') - ); - } - - public function testEditSuccess() - { - $user = $this->createUser('exists@example.com'); - $this->be($user); - $pad = $user->pads()->save(new Pad(array('name' => 'pad'))); - $crawler = $this->client->request( - 'POST', - URL::route('pads.update', array('id' => $pad->id)), - array('name' => 'new name') - ); - $this->assertRedirectedToRoute('pads.show', array('id' => $pad->id)); - } - - public function testEditFailRequiredFields() - { - $user = $this->createUser('exists@example.com'); - $this->be($user); - $pad = $user->pads()->save(new Pad(array('name' => 'pad'))); - $crawler = $this->client->request( - 'POST', - URL::route('pads.update', array('id' => $pad->id)), - array() - ); - $this->assertSessionHasErrors( - array('name') - ); - } - - /** - * @expectedException Illuminate\Database\Eloquent\ModelNotFoundException - */ - public function testEditFailNotAnOwner() - { - $user = $this->createUser('exists@example.com'); - $pad = $user->pads()->save(new Pad(array('name' => 'pad'))); - - $this->be($this->createUser('exists2@example.com')); - $crawler = $this->client->request( - 'POST', - URL::route('pads.update', array('id' => $pad->id)), - array('name' => 'new name') - ); - } - - public function testViewSuccess() - { - $user = $this->createUser('exists@example.com'); - $this->be($user); - $pad = $user->pads()->save(new Pad(array('name' => 'pad'))); - $crawler = $this->client->request( - 'GET', - URL::route('pads.show', array('id' => $pad->id)) - ); - $this->assertTrue($this->client->getResponse()->isOk()); - } - - /** - * @expectedException Illuminate\Database\Eloquent\ModelNotFoundException - */ - public function testViewFailNotAnOwner() - { - $user = $this->createUser('exists@example.com'); - $pad = $user->pads()->save(new Pad(array('name' => 'pad'))); - $this->be($this->createUser('exists2@example.com')); - $crawler = $this->client->request( - 'GET', - URL::route('pads.show', array('id' => $pad->id)) - ); - } - - public function testDeleteSuccess() - { - $user = $this->createUser('exists@example.com'); - $this->be($user); - $pad = $user->pads()->save(new Pad(array('name' => 'pad'))); - $crawler = $this->client->request( - 'POST', - URL::route('pads.destroy', array('id' => $pad->id)) - ); - $this->assertRedirectedToRoute('all_notes'); - $this->assertEquals(0, $user->pads()->count()); - } - - /** - * @expectedException Illuminate\Database\Eloquent\ModelNotFoundException - */ - public function testDeleteFailNotAnOwner() - { - $user = $this->createUser('exists@example.com'); - $pad = $user->pads()->save(new Pad(array('name' => 'pad'))); - $this->be($this->createUser('exists2@example.com')); - $crawler = $this->client->request( - 'POST', - URL::route('pads.destroy', array('id' => $pad->id)) - ); - } -} - - diff --git a/laravel/notejam/app/tests/TestCase.php b/laravel/notejam/app/tests/TestCase.php deleted file mode 100644 index 2c0e90102..000000000 --- a/laravel/notejam/app/tests/TestCase.php +++ /dev/null @@ -1,36 +0,0 @@ -app['router']->enableFilters(); - - Artisan::call('migrate'); - } - - protected function createUser($email, $password = 'password') { - $user = User::create( - array( - 'email' => $email, - 'password' => Hash::make($password) - ) - ); - return $user; - } - -} diff --git a/laravel/notejam/app/tests/UserTest.php b/laravel/notejam/app/tests/UserTest.php deleted file mode 100644 index f95f14d83..000000000 --- a/laravel/notejam/app/tests/UserTest.php +++ /dev/null @@ -1,97 +0,0 @@ - 'user@example.com', - 'password' => 'secure_password' - ), - $override - ); - } - - public function testSignupSuccess() - { - $data = $this->getUserData(); - $data['password_confirmation'] = $data['password']; - $crawler = $this->client->request( - 'POST', URL::route('signup'), $data - ); - $this->assertRedirectedToRoute('signin'); - $this->assertEquals(1, User::all()->count()); - } - - public function testSignupFailRequiredFields() - { - $crawler = $this->client->request( - 'POST', URL::route('signup'), array() - ); - $this->assertSessionHasErrors( - array('email', 'password', 'password_confirmation') - ); - } - - public function testSignupFailInvalidEmail() - { - $data = $this->getUserData(array('email' => 'invalid')); - $crawler = $this->client->request( - 'POST', URL::route('signup'), $data - ); - $this->assertSessionHasErrors('email'); - } - - public function testSignupFailEmailExists() - { - $email = 'exists@example.com'; - $user = $this->createUser($email); - - $data = $this->getUserData(array('email' => $email)); - $crawler = $this->client->request( - 'POST', URL::route('signup'), $data - ); - $this->assertSessionHasErrors('email'); - } - - public function testSignupFailPasswordsNotMatch() - { - $data = $this->getUserData(); - $data['password_confirmation'] = 'another_password'; - $crawler = $this->client->request( - 'POST', URL::route('signup'), $data - ); - $this->assertSessionHasErrors('password'); - } - - public function testSigninSuccess() - { - $data = $this->getUserData(); - $data['password'] = Hash::make($data['password']); - $user = User::create($data); - $crawler = $this->client->request( - 'POST', URL::route('signin'), $this->getUserData() - ); - $this->assertRedirectedToRoute('all_notes'); - } - - public function testSigninFailRequiredFields() - { - $crawler = $this->client->request( - 'POST', URL::route('signin'), array() - ); - $this->assertSessionHasErrors( - array('email', 'password') - ); - } - - public function testSigninFailInvalidCredentials() - { - $crawler = $this->client->request( - 'POST', URL::route('signin'), $this->getUserData() - ); - $this->assertRedirectedToRoute('signin'); - $this->assertSessionHas('error'); - } -} - diff --git a/laravel/notejam/app/views/emails/auth/reminder.blade.php b/laravel/notejam/app/views/emails/auth/reminder.blade.php deleted file mode 100644 index d92f2b3f5..000000000 --- a/laravel/notejam/app/views/emails/auth/reminder.blade.php +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - -

Password Reset

- -
- To reset your password, complete this form: {{ URL::to('password/reset', array($token)) }}. -
- - diff --git a/laravel/notejam/app/views/emails/password.blade.php b/laravel/notejam/app/views/emails/password.blade.php deleted file mode 100644 index d2f8e7ceb..000000000 --- a/laravel/notejam/app/views/emails/password.blade.php +++ /dev/null @@ -1,4 +0,0 @@ -Hi, {{ $email }} -========================================= -  -Your new password is {{ $password }} diff --git a/laravel/notejam/app/views/layout.blade.php b/laravel/notejam/app/views/layout.blade.php deleted file mode 100644 index aeb5c7aa9..000000000 --- a/laravel/notejam/app/views/layout.blade.php +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - @yield('page_title') - - - - - - - - {{ HTML::style('http://cdnjs.cloudflare.com/ajax/libs/skeleton/1.2/base.min.css') }} - {{ HTML::style('http://cdnjs.cloudflare.com/ajax/libs/skeleton/1.2/skeleton.min.css') }} - {{ HTML::style('http://cdnjs.cloudflare.com/ajax/libs/skeleton/1.2/layout.css') }} - {{ HTML::style('css/style.css') }} - - - - -
-
- -
-
-

- notejam: - @yield('page_title') -

-
- @yield('pads') -
- @if(Session::has('success') || Session::has('error')) -
- @if(Session::has('success')) -
{{ Session::get('success') }}
- {{ Session::forget('success') }} - @endif - @if(Session::has('error')) -
{{ Session::get('error') }}
- {{ Session::forget('error') }} - @endif -
- @endif - @yield('content') -
- - -
- Fork me on GitHub - - diff --git a/laravel/notejam/app/views/note/create.blade.php b/laravel/notejam/app/views/note/create.blade.php deleted file mode 100644 index 6b801ba8f..000000000 --- a/laravel/notejam/app/views/note/create.blade.php +++ /dev/null @@ -1,24 +0,0 @@ -@extends('user') - -@section('page_title') -New note -@stop - -@section('content') - {{ Form::open(array("route" => "notes.store", "class" => "note")) }} - - {{ Form::label('name', 'Name') . Form::text('name', Input::old('name'), array('class' => 'thirteen')) }} - @include('partials.error', array('error' => $errors->first('name'))) - - {{ Form::label('text', 'Text') . Form::textarea('text', Input::old('text'), array('class' => 'thirteen')) }} - @include('partials.error', array('error' => $errors->first('text'))) - - {{ Form::label('pad_id', 'Pad') . Form::select('pad_id', array(0 => '-----------') + Auth::user()->pads()->lists('name', 'id'), Input::old('pad_id')) }} - - {{ Form::submit('Create') }} - - {{ Form::close() }} - -@stop - - diff --git a/laravel/notejam/app/views/note/delete.blade.php b/laravel/notejam/app/views/note/delete.blade.php deleted file mode 100644 index 9b226b376..000000000 --- a/laravel/notejam/app/views/note/delete.blade.php +++ /dev/null @@ -1,16 +0,0 @@ -@extends('user') - -@section('page_title') -{{ $note->name }} -@stop - -@section('content') - {{ Form::open() }} -

Are you sure you want to delete {{ $note->name }}?

- {{ Form::submit('Yes, I want to delete this note', array('class' => 'button red')) }} - Cancel - - {{ Form::close() }} -@stop - - diff --git a/laravel/notejam/app/views/note/edit.blade.php b/laravel/notejam/app/views/note/edit.blade.php deleted file mode 100644 index d95e76c86..000000000 --- a/laravel/notejam/app/views/note/edit.blade.php +++ /dev/null @@ -1,26 +0,0 @@ -@extends('user') - -@section('page_title') -{{ $note->name }} -@stop - -@section('content') - {{ Form::open(array("route" => array("notes.update", $note->id), "class" => "note")) }} - - {{ Form::label('name', 'Name') . Form::text('name', $note->name, array('class' => 'thirteen')) }} - @include('partials.error', array('error' => $errors->first('name'))) - - {{ Form::label('text', 'Text') . Form::textarea('text', $note->text, array('class' => 'thirteen')) }} - @include('partials.error', array('error' => $errors->first('text'))) - - {{ Form::label('pad_id', 'Pad') . Form::select('pad_id', array(0 => '-----------') + Auth::user()->pads()->lists('name', 'id'), $note->pad_id) }} - - {{ Form::submit('Save') }} - - {{ Form::close() }} - -@stop - - - - diff --git a/laravel/notejam/app/views/note/index.blade.php b/laravel/notejam/app/views/note/index.blade.php deleted file mode 100644 index 367a52a6b..000000000 --- a/laravel/notejam/app/views/note/index.blade.php +++ /dev/null @@ -1,33 +0,0 @@ -@extends('user') - -@section('page_title') -All notes ({{ $notes->count() }}) -@stop - -@section('content') - @if ($notes->count()) - - - - - - - @foreach ($notes as $note) - - - - - - @endforeach -
Note PadLast modified
{{ $note->name }} - @if ($note->pad) - {{ $note->pad->name }} - @else - No pad - @endif - {{ $note->smartDate(); }}
- @else -

Create your first note.

- @endif - New note -@stop diff --git a/laravel/notejam/app/views/note/view.blade.php b/laravel/notejam/app/views/note/view.blade.php deleted file mode 100644 index 19a552c3d..000000000 --- a/laravel/notejam/app/views/note/view.blade.php +++ /dev/null @@ -1,21 +0,0 @@ -@extends('user') - -@section('page_title') -{{ $note->name }} -@stop - -@section('content') -

Last edited at {{ $note->smartDate() }}

-
-

- {{ $note->text }} -

-
- Edit - Delete it -@stop - - - - - diff --git a/laravel/notejam/app/views/pad/create.blade.php b/laravel/notejam/app/views/pad/create.blade.php deleted file mode 100644 index 8b4b4a84d..000000000 --- a/laravel/notejam/app/views/pad/create.blade.php +++ /dev/null @@ -1,18 +0,0 @@ -@extends('user') - -@section('page_title') -New pad -@stop - -@section('content') - {{ Form::open(array('route' => 'pads.store')) }} - - {{ Form::label('name', 'Name') . Form::text('name', Input::old('name')) }} - @include('partials.error', array('error' => $errors->first('name'))) - - {{ Form::submit('Save') }} - - {{ Form::close() }} - -@stop - diff --git a/laravel/notejam/app/views/pad/delete.blade.php b/laravel/notejam/app/views/pad/delete.blade.php deleted file mode 100644 index 21b38099f..000000000 --- a/laravel/notejam/app/views/pad/delete.blade.php +++ /dev/null @@ -1,15 +0,0 @@ -@extends('user') - -@section('page_title') -Delete pad {{ $pad->name }} -@stop - -@section('content') - {{ Form::open(array('route' => array('pads.destroy', $pad->id))) }} -

Are you sure you want to delete {{ $pad->name }}?

- {{ Form::submit('Yes, I want to delete this pad', array('class' => 'button red')) }} - Cancel - - {{ Form::close() }} -@stop - diff --git a/laravel/notejam/app/views/pad/edit.blade.php b/laravel/notejam/app/views/pad/edit.blade.php deleted file mode 100644 index ac46abe20..000000000 --- a/laravel/notejam/app/views/pad/edit.blade.php +++ /dev/null @@ -1,17 +0,0 @@ -@extends('user') - -@section('page_title') -{{ $pad->name }} -@stop - -@section('content') - {{ Form::open(array('route' => array('pads.update', $pad->id))) }} - - {{ Form::label('name', 'Name') . Form::text('name', $pad->name) }} - @include('partials.error', array('error' => $errors->first('name'))) - - {{ Form::submit('Save') }} - {{ Form::close() }} - Delete pad - -@stop diff --git a/laravel/notejam/app/views/pad/view.blade.php b/laravel/notejam/app/views/pad/view.blade.php deleted file mode 100644 index 6fd1935e7..000000000 --- a/laravel/notejam/app/views/pad/view.blade.php +++ /dev/null @@ -1,26 +0,0 @@ -@extends('user') - -@section('page_title') -{{ $pad->name; }} ({{ $notes->count() }}) -@stop - -@section('content') - @if ($notes->count()) - - - - - - @foreach ($notes as $note) - - - - - @endforeach -
Note Last modified
{{ $note->name }}{{ $note->smartDate(); }}
- @else -

You don't have notes in this pad yet.

- @endif - New note  - Pad settings -@stop diff --git a/laravel/notejam/app/views/partials/error.blade.php b/laravel/notejam/app/views/partials/error.blade.php deleted file mode 100644 index cf7c470da..000000000 --- a/laravel/notejam/app/views/partials/error.blade.php +++ /dev/null @@ -1,5 +0,0 @@ -@if($error) -
    -
  • {{ $error }}
  • -
-@endif diff --git a/laravel/notejam/app/views/user.blade.php b/laravel/notejam/app/views/user.blade.php deleted file mode 100644 index 6cb1edf74..000000000 --- a/laravel/notejam/app/views/user.blade.php +++ /dev/null @@ -1,24 +0,0 @@ -@extends('layout') - -@section('content_class') -thirteen -@stop - -@section('pads') -
- - -
-@stop diff --git a/laravel/notejam/app/views/user/forgot-password.blade.php b/laravel/notejam/app/views/user/forgot-password.blade.php deleted file mode 100644 index 7ddd40535..000000000 --- a/laravel/notejam/app/views/user/forgot-password.blade.php +++ /dev/null @@ -1,18 +0,0 @@ -@extends('layout') - -@section('page_title') -Forgot Password? -@stop - -@section('content') - {{ Form::open(array('class' => 'offset-by-six')) }} - - {{ Form::label('email', 'E-mail') . Form::text('email', Input::old('email')) }} - @include('partials.error', array('error' => $errors->first('email'))) - - {{ Form::submit('Send') }} - - {{ Form::close() }} -@stop - - diff --git a/laravel/notejam/app/views/user/settings.blade.php b/laravel/notejam/app/views/user/settings.blade.php deleted file mode 100644 index 64ece1836..000000000 --- a/laravel/notejam/app/views/user/settings.blade.php +++ /dev/null @@ -1,22 +0,0 @@ -@extends('layout') - -@section('page_title') -Account Settings -@stop - -@section('content') - {{ Form::open(array('class' => 'offset-by-six')) }} - - {{ Form::label('old_password', 'Current password') . Form::password('old_password') }} - @include('partials.error', array('error' => $errors->first('old_password'))) - {{ Form::label('password', 'Password') . Form::password('password') }} - @include('partials.error', array('error' => $errors->first('password'))) - {{ Form::label('password_confirmation', 'Confirm password') . Form::password('password_confirmation') }} - @include('partials.error', array('error' => $errors->first('password_confirmation'))) - - {{ Form::submit('Save') }} - - {{ Form::close() }} - -@stop - diff --git a/laravel/notejam/app/views/user/signin.blade.php b/laravel/notejam/app/views/user/signin.blade.php deleted file mode 100644 index c118efe83..000000000 --- a/laravel/notejam/app/views/user/signin.blade.php +++ /dev/null @@ -1,21 +0,0 @@ -@extends('layout') - -@section('page_title') -Sign In -@stop - -@section('content') - {{ Form::open(array('class' => 'offset-by-six')) }} - - {{ Form::label('email', 'E-mail') . Form::text('email', Input::old('email')) }} - @include('partials.error', array('error' => $errors->first('email'))) - {{ Form::label('password', 'Password') . Form::password('password') }} - @include('partials.error', array('error' => $errors->first('password'))) - - {{ Form::submit('Sign in') }} or Sign up -
-

Forgot Password?

- - {{ Form::close() }} -@stop - diff --git a/laravel/notejam/app/views/user/signup.blade.php b/laravel/notejam/app/views/user/signup.blade.php deleted file mode 100644 index 136c29755..000000000 --- a/laravel/notejam/app/views/user/signup.blade.php +++ /dev/null @@ -1,21 +0,0 @@ -@extends('layout') - -@section('page_title') -Sign Up -@stop - -@section('content') - {{ Form::open(array('class' => 'offset-by-six')) }} - - {{ Form::label('email', 'E-mail') . Form::text('email', Input::old('email')) }} - @include('partials.error', array('error' => $errors->first('email'))) - {{ Form::label('password', 'Password') . Form::password('password') }} - @include('partials.error', array('error' => $errors->first('password'))) - {{ Form::label('password_confirmation', 'Confirm password') . Form::password('password_confirmation') }} - @include('partials.error', array('error' => $errors->first('password_confirmation'))) - - {{ Form::submit('Sign Up') }} or Sign in - - {{ Form::close() }} - -@stop diff --git a/laravel/notejam/artisan b/laravel/notejam/artisan deleted file mode 100755 index 5c408ad80..000000000 --- a/laravel/notejam/artisan +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env php -setRequestForConsoleEnvironment(); - -$artisan = Illuminate\Console\Application::start($app); - -/* -|-------------------------------------------------------------------------- -| Run The Artisan Application -|-------------------------------------------------------------------------- -| -| When we run the console application, the current CLI command will be -| executed in this console and the response sent back to a terminal -| or another output device for the developers. Here goes nothing! -| -*/ - -$status = $artisan->run(); - -/* -|-------------------------------------------------------------------------- -| Shutdown The Application -|-------------------------------------------------------------------------- -| -| Once Artisan has finished running. We will fire off the shutdown events -| so that any final work may be done by the application before we shut -| down the process. This is the last thing to happen to the request. -| -*/ - -$app->shutdown(); - -exit($status); diff --git a/laravel/notejam/bootstrap/autoload.php b/laravel/notejam/bootstrap/autoload.php deleted file mode 100644 index 6b329312a..000000000 --- a/laravel/notejam/bootstrap/autoload.php +++ /dev/null @@ -1,75 +0,0 @@ - __DIR__.'/../app', - - /* - |-------------------------------------------------------------------------- - | Public Path - |-------------------------------------------------------------------------- - | - | The public path contains the assets for your web application, such as - | your JavaScript and CSS files, and also contains the primary entry - | point for web requests into these applications from the outside. - | - */ - - 'public' => __DIR__.'/../public', - - /* - |-------------------------------------------------------------------------- - | Base Path - |-------------------------------------------------------------------------- - | - | The base path is the root of the Laravel installation. Most likely you - | will not need to change this value. But, if for some wild reason it - | is necessary you will do so here, just proceed with some caution. - | - */ - - 'base' => __DIR__.'/..', - - /* - |-------------------------------------------------------------------------- - | Storage Path - |-------------------------------------------------------------------------- - | - | The storage path is used by Laravel to store cached Blade views, logs - | and other pieces of information. You may modify the path here when - | you want to change the location of this directory for your apps. - | - */ - - 'storage' => __DIR__.'/../app/storage', - -); diff --git a/laravel/notejam/bootstrap/start.php b/laravel/notejam/bootstrap/start.php deleted file mode 100644 index a55def12d..000000000 --- a/laravel/notejam/bootstrap/start.php +++ /dev/null @@ -1,73 +0,0 @@ -detectEnvironment(array( - - 'local' => array('your-machine-name'), - -)); - -/* -|-------------------------------------------------------------------------- -| Bind Paths -|-------------------------------------------------------------------------- -| -| Here we are binding the paths configured in paths.php to the app. You -| should not be changing these here. If you need to change these you -| may do so within the paths.php file and they will be bound here. -| -*/ - -$app->bindInstallPaths(require __DIR__.'/paths.php'); - -/* -|-------------------------------------------------------------------------- -| Load The Application -|-------------------------------------------------------------------------- -| -| Here we will load this Illuminate application. We will keep this in a -| separate location so we can isolate the creation of an application -| from the actual running of the application with a given request. -| -*/ - -$framework = $app['path.base']. - '/vendor/laravel/framework/src'; - -require $framework.'/Illuminate/Foundation/start.php'; - -/* -|-------------------------------------------------------------------------- -| Return The Application -|-------------------------------------------------------------------------- -| -| This script returns the application instance. The instance is given to -| the calling script so we can separate the building of the instances -| from the actual running of the application and sending responses. -| -*/ - -return $app; diff --git a/laravel/notejam/composer.json b/laravel/notejam/composer.json deleted file mode 100644 index 6ccce0385..000000000 --- a/laravel/notejam/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "laravel/laravel", - "description": "The Laravel Framework.", - "keywords": ["framework", "laravel"], - "license": "MIT", - "require": { - "laravel/framework": "4.2.*" - }, - "require-dev": { - "phpunit/phpunit": "3.7.*" - }, - "autoload": { - "classmap": [ - "app/commands", - "app/controllers", - "app/models", - "app/database/migrations", - "app/database/seeds", - "app/tests/TestCase.php" - ] - }, - "scripts": { - "post-install-cmd": [ - "php artisan clear-compiled", - "php artisan optimize" - ], - "post-update-cmd": [ - "php artisan clear-compiled", - "php artisan optimize" - ], - "post-create-project-cmd": [ - "php artisan key:generate" - ] - }, - "config": { - "preferred-install": "dist" - }, - "minimum-stability": "stable" -} diff --git a/laravel/notejam/phpunit.xml b/laravel/notejam/phpunit.xml deleted file mode 100644 index c33042056..000000000 --- a/laravel/notejam/phpunit.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - ./app/tests/ - - - diff --git a/laravel/notejam/public/.htaccess b/laravel/notejam/public/.htaccess deleted file mode 100644 index 77827ae70..000000000 --- a/laravel/notejam/public/.htaccess +++ /dev/null @@ -1,15 +0,0 @@ - - - Options -MultiViews - - - RewriteEngine On - - # Redirect Trailing Slashes... - RewriteRule ^(.*)/$ /$1 [L,R=301] - - # Handle Front Controller... - RewriteCond %{REQUEST_FILENAME} !-d - RewriteCond %{REQUEST_FILENAME} !-f - RewriteRule ^ index.php [L] - diff --git a/laravel/notejam/public/css/style.css b/laravel/notejam/public/css/style.css deleted file mode 100644 index 86cd131ff..000000000 --- a/laravel/notejam/public/css/style.css +++ /dev/null @@ -1,395 +0,0 @@ -/* -* Skeleton V1.0.3 -* Copyright 2011, Dave Gamache -* www.getskeleton.com -* Free to use under the MIT license. -* http://www.opensource.org/licenses/mit-license.php -* 7/17/2011 -*/ - - -/* Documentation Styles -================================================== */ - div.container { - padding-top: 40px; } - - /* Doc nav */ - nav { - width: 160px; } - #logo, .bold-header { - margin-bottom: 30px; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - letter-spacing: -1px; - color: #555; - font-weight: bold; } - .bold-header span { - font-weight: normal; - font-size: 23px; - } - .bold-header a.header { - text-decoration: none; - color: inherit; - } - .bold-header span.jam { - font-size: 46px; - line-height: 50px; - } - nav ul { - float: left; } - nav ul li { - display: block; - margin-bottom: 10px; } - nav ul li a, - nav ul li a:visited, - nav ul li a:active { - font-size: 14px; - color: #555; - text-decoration: none; - font-weight: bold; } - nav ul li a:hover, - nav ul li a:focus { - color: #222; } - header h1 { - font-size: 52px; - line-height: 61px; - letter-spacing: -1px; - font-weight: normal; - font-family: "Georgia", "Times New Roman", Helvetica, Arial, sans-serif; } - hr.large { - border: none; - height: 8px; - background: #ebebeb; - margin: 50px 0; } - div.doc-section { - margin: 30px 0; } - - #whatAndWhy .row { - padding: 30px 0 0; } - - #typography blockquote { - margin-top: 20px; } - - .hidden-code a { - font-size: 12px; - color: #999; } - .hidden-code>div { - display: none; } - - - /* Grid */ - #grid .column, - #grid .columns { - background: #ddd; - height: 25px; - line-height: 25px; - margin-bottom: 10px; - text-align: center; - text-transform: uppercase; - color: #555; - font-size: 12px; - font-weight: bold; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; } - #grid .column:hover, - #grid .columns:hover { - background: #bbb; - color: #333; } - #grid .example-grid { overflow: hidden; } - - .post-button-note, - .post-button-note a { - font-size: 11px; - color: #999; } - - #examples .four.columns a { - text-decoration: none; - } - #examples .four.columns a:hover { - text-decoration: underline; - } - - - .resize { - position: fixed; - bottom: 0; - right: 0; - height: 80px; - width: 80px; - background: url(images/resize.png); } - - - img { - max-width: 100%; - height: auto; } - - .gist-meta { display: none !important;} - - ul ul ul li { margin-bottom: 3px; } - - .twitter-share-button { margin-bottom: -18px; } - - /* Table stylesheets */ - table { - width: 100%; - border-collapse: collapse; - } - - table th, table td { - padding: 10px 10px 9px; - font-size: 13px; - line-height: 18px; - text-align: left; - } - - table td { - vertical-align: top; - border-top: solid 1px #ddd; - } - - table th { - padding-top: 9px; - font-weight: bold; - vertical-align: middle; - } - - table.condensed th, table.condensed td { - padding: 5px 5px 4px; - } - - table.bordered { - border-collapse: separate; - border: solid 1px #ddd; - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; - } - - table.bordered th + th, - table.bordered th + td, - table.bordered td + td { - border-left: solid 1px #ddd; - } - - .zebra-striped tbody tr:nth-child(odd) td, - .zebra-striped tbody tr:nth-child(odd) th { - background: #f5f5f5; - } - -.carbonad, -.carbonad-image, -.carbonad-text, -.carbonad-tag { - background: none !important; - border: none !important; - margin-left: 0 !important; -} -.carbonad-tag { - margin-top: 6px !important; - padding-top: 0 !important; -} -.carbonad-text { - height: auto !important; -} -.carbonad-image { - margin-top: 0 !important; -} - -.hidden-text { - font-size: 12px; - color: #999; -} - -td.date, th.date { - text-align: right; -} - -td.date { - font-style: italic; -} - -form.note input[type="text"], form.note textarea { - width: 100%; -} - -form hr { - width: 218px; - margin: 10px 0px; -} - -form.note textarea { - height: 250px; -} - -div.content-area { - min-height: 600px; -} - -hr.footer { - margin-bottom: 10px; -} - -div.footer { - margin-bottom: 10px; - text-align: center; - font-size: 12px; -} - -form.sign-in { - margin: 50px 0 0 0; -} - -.sort_arrow { - text-decoration: none; -} - -.sort_arrow:hover { - text-decoration: none; - color: red; -} - -div.sign-in-out-block { - position: absolute; - right: 14px; - top: 8px; - font-size: 12px; -} - -div.sign-in-out-block a { - /*text-decoration: none;*/ -} - -a.small-red { - color: red; - font-size: 12px; -} - -table.notes { - margin: 0 0 20px 0; -} - -table.notes th.note { - width: 72%; -} - -table.notes td.pad { - color: grey; -} - -table.notes td.pad a { - color: grey; - text-decoration: underline; - font-style: normal; -} - - -table.notes td.pad a:hover { - color: black; -} - -p.empty { - color: grey; - font-style: italic; -} - -a.delete-note { - float: right; - font-size: 12px; - color: red; -} - -.red, input.red { - color: red !important; -} - -ul.errorlist, ul.errors { - margin: -18px 0 0 0; -} - -ul.errorlist li, ul.errors li { - color: red; -} - -.alert-area { - text-align: center; -} - -.alert { - padding: 5px 8px; - margin: 0 0 12px 0; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; -} - -.alert-success { - color: #468847; - background-color: #dff0d8; - border: 1px solid #d6e9c6; -} - -.alert-error { - color: #b94a48; - background-color: #f2dede; - border: 1px solid #eed3d7; -} - - /* Mobile */ - @media only screen and (max-width: 767px) { - header h1 { font-size: 34px; line-height: 37px; } - nav { position: relative; } - nav ul, - .carbonad { - display: none; - } - #logo { text-align: left; } - #examples .four.columns { - padding-top: 30px; - } - } - - /* Mobile Landscape */ - @media only screen and (min-width: 480px) and (max-width: 767px) { - nav ul { - display: none; - } - } - - /* Non 960 */ - @media only screen and (max-width: 959px) { - #logo { - font-size: 21px; - margin-bottom: 15px; } - nav .button { - padding: 9px 20px 11px; } - } - - /* iPad Portrait/Browser */ - @media only screen and (min-width: 768px) and (max-width: 959px) { - nav { - width: 124px; } - } - - /* Mobile/Browser */ - @media only screen and (max-width: 767px) {} - - /* Mobile Landscape/Browser */ - @media only screen and (min-width: 480px) and (max-width: 767px) {} - - /* Anything smaller than standard 960 */ - @media only screen and (max-width: 959px) {} - - - /* iPad Portrait Only */ - @media only screen and (min-width: 768px) and (max-width: 959px) and (max-device-width: 1000px) {} - - /* Mobile Only */ - @media only screen and (max-width: 767px) and (max-device-width: 1000px) {} - - /* Mobile Landscape Only */ - @media only screen and (min-width: 480px) and (max-width: 767px) and (max-device-width: 1000px) {} - - /* Anything smaller than standard 960 on a device */ - @media only screen and (max-width: 959px) and (max-device-width: 1000px) { - .resize { display: none; } - } diff --git a/laravel/notejam/public/favicon.ico b/laravel/notejam/public/favicon.ico deleted file mode 100644 index e69de29bb..000000000 diff --git a/laravel/notejam/public/index.php b/laravel/notejam/public/index.php deleted file mode 100644 index f08822d95..000000000 --- a/laravel/notejam/public/index.php +++ /dev/null @@ -1,49 +0,0 @@ - - */ - -/* -|-------------------------------------------------------------------------- -| Register The Auto Loader -|-------------------------------------------------------------------------- -| -| Composer provides a convenient, automatically generated class loader -| for our application. We just need to utilize it! We'll require it -| into the script here so that we do not have to worry about the -| loading of any our classes "manually". Feels great to relax. -| -*/ - -require __DIR__.'/../bootstrap/autoload.php'; - -/* -|-------------------------------------------------------------------------- -| Turn On The Lights -|-------------------------------------------------------------------------- -| -| We need to illuminate PHP development, so let's turn on the lights. -| This bootstraps the framework and gets it ready for use, then it -| will load up this application so that we can run it and send -| the responses back to the browser and delight these users. -| -*/ - -$app = require_once __DIR__.'/../bootstrap/start.php'; - -/* -|-------------------------------------------------------------------------- -| Run The Application -|-------------------------------------------------------------------------- -| -| Once we have the application, we can simply call the run method, -| which will execute the request and send the response back to -| the client's browser allowing them to enjoy the creative -| and wonderful application we have whipped up for them. -| -*/ - -$app->run(); diff --git a/laravel/notejam/public/packages/.gitkeep b/laravel/notejam/public/packages/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/laravel/notejam/public/robots.txt b/laravel/notejam/public/robots.txt deleted file mode 100644 index eb0536286..000000000 --- a/laravel/notejam/public/robots.txt +++ /dev/null @@ -1,2 +0,0 @@ -User-agent: * -Disallow: diff --git a/laravel/notejam/server.php b/laravel/notejam/server.php deleted file mode 100644 index 5f187f344..000000000 --- a/laravel/notejam/server.php +++ /dev/null @@ -1,19 +0,0 @@ -`_. - -Nette version: 2.3 - -The application is maintained by `@fprochazka `_. - -========================== -Installation and launching -========================== - ------ -Clone ------ - -Clone the repo: - -.. code-block:: bash - - $ git clone git@github.com:komarserjio/notejam.git YOUR_PROJECT_DIR/ - -------- -Install -------- - -Install `composer `_ - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/nette/doctrine/notejam - $ curl -s https://getcomposer.org/installer | php - -Install dependencies - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/nette/doctrine/notejam - $ php composer.phar install - -Create empty ``config.local.neon`` - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/nette/doctrine/notejam - $ cp app/config/config.local.example.neon app/config/config.local.neon - -Create database schema - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/nette/doctrine/notejam - $ php www/index.php orm:schema:up --force - - ------- -Launch ------- - -Start built-in php web server: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/nette/doctrine/notejam/ - $ php -t `pwd`/www -S 127.0.0.1:8000 `pwd`/www/index.php - -Go to http://localhost:8000/ in your browser. - ---------- -Run tests ---------- - -Run tests: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/nette/doctrine/notejam/ - $ php -t `pwd`/www -S 127.0.0.1:8000 `pwd`/www/index.php - $ ./vendor/bin/codecept run - - -============ -Contribution -============ - - -Do you have php/nette experience? Help the app to follow php and Nette Framework best practices. - -Please send your pull requests in the ``master`` branch. -Always prepend your commits with framework name: - -.. code-block:: bash - - Nette: Implemented sign in functionality - -Read `contribution guide `_ for details. diff --git a/nette/doctrine/notejam/.gitignore b/nette/doctrine/notejam/.gitignore deleted file mode 100644 index 6ddedf44f..000000000 --- a/nette/doctrine/notejam/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -app/config/config.local.neon -vendor diff --git a/nette/doctrine/notejam/app/Components/ConfirmationControl.php b/nette/doctrine/notejam/app/Components/ConfirmationControl.php deleted file mode 100644 index f9fbf8fe8..000000000 --- a/nette/doctrine/notejam/app/Components/ConfirmationControl.php +++ /dev/null @@ -1,71 +0,0 @@ -formFactory = $formFactory; - } - - - - /** - * @return Form - */ - protected function createComponentForm() - { - $form = $this->formFactory->create(); - - $form->addProtection(); - $form->addSubmit('confirm', 'Confirm'); - $form->onSuccess[] = function (Form $form) { - $this->onConfirm($this); - }; - - return $form; - } - - -} - - - -/** - * @see \Notejam\Components\PadsList\IPadsListControlFactory - */ -interface IConfirmationControlFactory -{ - - /** - * @return ConfirmationControl - */ - public function create(); -} diff --git a/nette/doctrine/notejam/app/Components/ForgottenPasswordControl.php b/nette/doctrine/notejam/app/Components/ForgottenPasswordControl.php deleted file mode 100644 index 847b79516..000000000 --- a/nette/doctrine/notejam/app/Components/ForgottenPasswordControl.php +++ /dev/null @@ -1,136 +0,0 @@ -formFactory = $formFactory; - $this->em = $em; - $this->userRepository = $userRepository; - $this->mailer = $mailer; - } - - - - /** - * Factory method for subcomponent form instance. - * This factory is called internally by Nette in the component model. - * - * @return Form - */ - protected function createComponentForm() - { - $form = $this->formFactory->create(); - - $form->addText('email', 'Email') - ->setRequired('%label is required') - ->addRule($form::EMAIL, 'Invalid email'); - - $form->addSubmit('save', 'Get new password'); - $form->onSuccess[] = [$this, 'formSucceeded']; - - return $form; - } - - - - /** - * Callback method, that is called once form is successfully submitted, without validation errors. - * - * @param Form $form - * @param Nette\Utils\ArrayHash $values - */ - public function formSucceeded(Form $form, $values) - { - if (!$user = $this->userRepository->findOneBy(['email' => $values->email])) { - $form['email']->addError("User with given email doesn't exist"); - return; - } - - // this is not a very secure way of getting new password - // but it's the same way the symfony app is doing it... - $newPassword = $user->generateRandomPassword(); - $this->em->flush(); - - try { - $message = new Nette\Mail\Message(); - $message->setSubject('Notejam password'); - $message->setFrom('noreply@notejamapp.com'); - $message->addTo($user->getEmail()); - - // !!! Never send passwords through email !!! - // This is only for demonstration purposes of Notejam. - // Ideally, you can create a unique link where user can change his password - // himself for limited amount of time, and then send the link. - $message->setBody("Your new password is {$newPassword}"); - - $this->mailer->send($message); - - } catch (Nette\Mail\SendException $e) { - Debugger::log($e, 'email'); - $form->addError('Could not send email with new password'); - } - - $this->onSuccess($this); - } - -} - - - -/** - * @see \Notejam\Components\PadsList\IPadsListControlFactory - */ -interface IForgottenPasswordControlFactory -{ - - /** - * @return ForgottenPasswordControl - */ - public function create(); -} diff --git a/nette/doctrine/notejam/app/Components/NoteControl.php b/nette/doctrine/notejam/app/Components/NoteControl.php deleted file mode 100644 index f0cec1c5e..000000000 --- a/nette/doctrine/notejam/app/Components/NoteControl.php +++ /dev/null @@ -1,172 +0,0 @@ -padRepository = $padRepository; - $this->em = $em; - $this->user = $user; - $this->formFactory = $formFactory; - } - - - - /** - * This setter allows to edit notes instead of only creating them. - * - * @param Note $note - */ - public function setNote(Note $note) - { - $this->note = $note; - $this['form']->setDefaults([ - 'name' => $note->getName(), - 'text' => $note->getText(), - 'pad' => $note->getPad() ? $note->getPad()->getId() : NULL, - ]); - } - - - - /** - * Setter for the default pad, to be pre-selected in the pad select form element. - * - * @param Pad|null $pad - */ - public function setPad(Pad $pad = NULL) - { - if ($pad === NULL) { - return; // ignore - } - - $this['form']->setDefaults([ - 'pad' => $pad->getId(), - ]); - } - - - - /** - * Factory method for subcomponent form instance. - * This factory is called internally by Nette in the component model. - * - * @return Form - */ - protected function createComponentForm() - { - $form = $this->formFactory->create(); - - $form->addText('name', 'Name') - ->setRequired('%label is required'); - $form->addTextArea('text', 'Text') - ->setRequired('%label is required'); - $form->addSelect('pad', 'Pad') - ->setPrompt('----------') - ->setItems($this->padRepository->findPairs('name')); - - $form->addSubmit('save', 'Save'); - $form->onSuccess[] = [$this, 'formSucceeded']; - - return $form; - } - - - - /** - * Callback method, that is called once form is successfully submitted, without validation errors. - * - * @param Form $form - * @param Nette\Utils\ArrayHash $values - */ - public function formSucceeded(Form $form, $values) - { - if ($this->note === NULL) { - $note = new Note($this->user->getIdentity()); - $this->em->persist($note); - - } else { - $note = $this->note; - } - - $note->setName($values->name); - $note->setText($values->text); - - if ($values->pad === NULL) { - $note->setPad(NULL); - - } else { - $note->setPad($this->padRepository->find($values->pad)); - } - - $this->em->flush(); - - $this->onSuccess($this); - } - -} - - - -/** - * @see \Notejam\Components\PadsList\IPadsListControlFactory - */ -interface INoteControlFactory -{ - - /** - * @return NoteControl - */ - function create(); -} diff --git a/nette/doctrine/notejam/app/Components/PadsControl.php b/nette/doctrine/notejam/app/Components/PadsControl.php deleted file mode 100644 index e9c367498..000000000 --- a/nette/doctrine/notejam/app/Components/PadsControl.php +++ /dev/null @@ -1,129 +0,0 @@ -em = $em; - $this->user = $user; - $this->formFactory = $formFactory; - } - - - - /** - * This setter allows to edit pads instead of only creating them. - * - * @param Pad $pad - */ - public function setPad(Pad $pad) - { - $this->pad = $pad; - $this['form']->setDefaults([ - 'name' => $pad->getName(), - ]); - } - - - - /** - * Factory method for subcomponent form instance. - * This factory is called internally by Nette in the component model. - * - * @return Form - */ - protected function createComponentForm() - { - $form = $this->formFactory->create(); - - $form->addText('name', 'Name') - ->setRequired('%label is required'); - - $form->addSubmit('save', 'Save'); - $form->onSuccess[] = [$this, 'formSucceeded']; - - return $form; - } - - - - /** - * Callback method, that is called once form is successfully submitted, without validation errors. - * - * @param Form $form - * @param Nette\Utils\ArrayHash $values - */ - public function formSucceeded(Form $form, $values) - { - if ($this->pad === NULL) { - $this->em->persist($pad = new Pad($this->user->getIdentity())); - - } else { - $pad = $this->pad; - } - - $pad->setName($values->name); - $this->em->flush($pad); - - $this->onSuccess($this, $pad); - } - -} - - - -/** - * @see \Notejam\Components\PadsList\IPadsListControlFactory - */ -interface IPadsControlFactory -{ - - /** - * @return PadsControl - */ - function create(); -} diff --git a/nette/doctrine/notejam/app/Components/PadsList/PadsListControl.php b/nette/doctrine/notejam/app/Components/PadsList/PadsListControl.php deleted file mode 100644 index 7406c7cb9..000000000 --- a/nette/doctrine/notejam/app/Components/PadsList/PadsListControl.php +++ /dev/null @@ -1,60 +0,0 @@ -padRepository = $padRepository; - $this->user = $user; - } - - - - public function render() - { - $this->template->pads = $this->padRepository->findBy(['user' => $this->user->getId()]); - $this->template->render(__DIR__ . '/default.latte'); - } - -} - - - -/** - * Interface for automatically generated factory (handled by Nette/DI), - * that is used for creating new instance of the PadsListControl. - * - * This probably should be in a separated file, but this is more convenient. - */ -interface IPadsListControlFactory -{ - - /** - * @return PadsListControl - */ - public function create(); -} diff --git a/nette/doctrine/notejam/app/Components/PadsList/default.latte b/nette/doctrine/notejam/app/Components/PadsList/default.latte deleted file mode 100644 index 66ea4a20d..000000000 --- a/nette/doctrine/notejam/app/Components/PadsList/default.latte +++ /dev/null @@ -1,14 +0,0 @@ -
- - -
diff --git a/nette/doctrine/notejam/app/Components/SettingsControl.php b/nette/doctrine/notejam/app/Components/SettingsControl.php deleted file mode 100644 index 62425dd15..000000000 --- a/nette/doctrine/notejam/app/Components/SettingsControl.php +++ /dev/null @@ -1,116 +0,0 @@ -user = $user; - $this->em = $em; - $this->formFactory = $formFactory; - } - - - - /** - * Factory method for subcomponent form instance. - * This factory is called internally by Nette in the component model. - * - * @return Form - */ - protected function createComponentForm() - { - $form = $this->formFactory->create(); - - $form->addPassword('current', 'Current password') - ->setRequired('%label is required'); - $form->addPassword('password', 'New password') - ->setRequired('%label is required'); - $form->addPassword('confirm', 'Confirm') - ->setRequired('%label is required') - ->addRule(Form::EQUAL, 'New passwords must match', $form['password']); - - $form->addSubmit('save', 'Change password'); - $form->onSuccess[] = [$this, 'formSucceeded']; - - return $form; - } - - - - /** - * Callback method, that is called once form is successfully submitted, without validation errors. - * - * @param Form $form - * @param Nette\Utils\ArrayHash $values - */ - public function formSucceeded(Form $form, $values) - { - /** @var User $user */ - $user = $this->user->getIdentity(); - - try { - $user->changePassword($values->current, $values->password); - $this->em->flush(); - $this->onSuccess($this); - - } catch (InvalidPasswordException $e) { - $form['current']->addError('Invalid current password'); - } - } - -} - - - -/** - * @see \Notejam\Components\PadsList\IPadsListControlFactory - */ -interface ISettingsControlFactory -{ - - /** - * @return SettingsControl - */ - public function create(); -} diff --git a/nette/doctrine/notejam/app/Components/SignInControl.php b/nette/doctrine/notejam/app/Components/SignInControl.php deleted file mode 100644 index 11c9bbe1a..000000000 --- a/nette/doctrine/notejam/app/Components/SignInControl.php +++ /dev/null @@ -1,100 +0,0 @@ -user = $user; - $this->formFactory = $formFactory; - } - - - - /** - * Factory method for subcomponent form instance. - * This factory is called internally by Nette in the component model. - * - * @return Form - */ - protected function createComponentForm() - { - $form = $this->formFactory->create(); - - $form->addText('email', 'Email') - ->setRequired('%label is required') - ->addRule($form::EMAIL); - $form->addPassword('password', 'Password') - ->setRequired('%label is required'); - - $form->addSubmit('send'); - $form->onSuccess[] = [$this, 'formSucceeded']; - - return $form; - } - - - - /** - * Callback method, that is called once form is successfully submitted, without validation errors. - * - * @param Form $form - * @param Nette\Utils\ArrayHash $values - */ - public function formSucceeded(Form $form, $values) - { - try { - $this->user->login($values->email, $values->password); - $this->onSuccess($this); - - } catch (Nette\Security\AuthenticationException $e) { - $form->addError($e->getMessage()); - } - } - -} - - - -/** - * @see \Notejam\Components\PadsList\IPadsListControlFactory - */ -interface ISignInControlFactory -{ - - /** - * @return SignInControl - */ - public function create(); -} diff --git a/nette/doctrine/notejam/app/Components/SignUpControl.php b/nette/doctrine/notejam/app/Components/SignUpControl.php deleted file mode 100644 index 81cd73ede..000000000 --- a/nette/doctrine/notejam/app/Components/SignUpControl.php +++ /dev/null @@ -1,125 +0,0 @@ -user = $user; - $this->em = $em; - $this->userRepository = $userRepository; - $this->formFactory = $formFactory; - } - - - - /** - * Factory method for subcomponent form instance. - * This factory is called internally by Nette in the component model. - * - * @return Form - */ - protected function createComponentForm() - { - $form = $this->formFactory->create(); - - $form->addText('email', 'Email') - ->setRequired('%label is required') - ->addRule($form::EMAIL); - $form->addPassword('password', 'Password') - ->setRequired('%label is required'); - $form->addPassword('confirm', 'Confirm') - ->setRequired('%label is required') - ->addRule(Form::EQUAL, 'New passwords must match', $form['password']); - - $form->addSubmit('send'); - $form->onSuccess[] = [$this, 'formSucceeded']; - - $form->onValidate[] = function (Form $form, $values) { - if ($this->userRepository->countBy(['email' => $values->email]) > 0) { - $form->addError('Account with this email already exists'); - } - }; - - return $form; - } - - - - /** - * Callback method, that is called once form is successfully submitted, without validation errors. - * - * @param Form $form - * @param Nette\Utils\ArrayHash $values - */ - public function formSucceeded(Form $form, $values) - { - $user = new User($values->email, $values->password); - $this->em->persist($user); - $this->em->flush(); - - // directly login user on signup - // $this->user->login($user); - - $this->onSuccess($this); - } - -} - - - -/** - * @see \Notejam\Components\PadsList\IPadsListControlFactory - */ -interface ISignUpControlFactory -{ - - /** - * @return SignUpControl - */ - public function create(); -} diff --git a/nette/doctrine/notejam/app/Presenters/BasePresenter.php b/nette/doctrine/notejam/app/Presenters/BasePresenter.php deleted file mode 100644 index a4ccaa27d..000000000 --- a/nette/doctrine/notejam/app/Presenters/BasePresenter.php +++ /dev/null @@ -1,68 +0,0 @@ -padsListControlFactory->create(); - } - - - - /** - * This allows me to implement a basic access control for presenters. - * - * This method is called for every presenter run, - * once it's created before the presenter startup, - * and for every other lifecycle methods, like render, action and signals. - */ - public function checkRequirements($element) - { - $user = PresenterComponentReflection::parseAnnotation($element, 'User'); - if ($user === FALSE) { - return; // not protected - } - - if (!$this->getUser()->isLoggedIn()) { - $this->forbiddenAccess(); - } - } - - - - /** - * The default behaviour for parts of app, where the user is not allowed for some reason. - * This can be overwritten in subclasses to achieve different behaviour. - */ - protected function forbiddenAccess() - { - $this->redirect('User:signIn'); - } - -} diff --git a/nette/doctrine/notejam/app/Presenters/Error4xxPresenter.php b/nette/doctrine/notejam/app/Presenters/Error4xxPresenter.php deleted file mode 100644 index 666e5e05a..000000000 --- a/nette/doctrine/notejam/app/Presenters/Error4xxPresenter.php +++ /dev/null @@ -1,27 +0,0 @@ -getCode()}.latte"; - $this->template->setFile(is_file($file) ? $file : __DIR__ . '/templates/Error/4xx.latte'); - } - -} diff --git a/nette/doctrine/notejam/app/Presenters/ErrorPresenter.php b/nette/doctrine/notejam/app/Presenters/ErrorPresenter.php deleted file mode 100644 index 2d05af731..000000000 --- a/nette/doctrine/notejam/app/Presenters/ErrorPresenter.php +++ /dev/null @@ -1,58 +0,0 @@ -logger = $logger; - } - - - - /** - * This method is usually implemented by the more complex UI\Presenter - * But since an unhandled exception might have occurred, - * it should be processed as simply as possible to avoid any further problems or even another exception. - * - * @param Nette\Application\Request $request - * @return Responses\CallbackResponse|Responses\ForwardResponse - */ - public function run(Nette\Application\Request $request) - { - $exception = $request->getParameter('exception'); - - // if it's a simple BadRequestException, use the more powerful presenter - if ($exception instanceof Nette\Application\BadRequestException) { - return new Responses\ForwardResponse($request->setPresenterName('Error4xx')); - } - - $this->logger->log($exception, ILogger::EXCEPTION); - - // the 500 means unhandled exception, which should translate to the simplest page possible - return new Responses\CallbackResponse( - function () { - require __DIR__ . '/templates/Error/500.phtml'; - } - ); - } - -} diff --git a/nette/doctrine/notejam/app/Presenters/NotePresenter.php b/nette/doctrine/notejam/app/Presenters/NotePresenter.php deleted file mode 100644 index 39b42d8bb..000000000 --- a/nette/doctrine/notejam/app/Presenters/NotePresenter.php +++ /dev/null @@ -1,252 +0,0 @@ -getParameter('id')) { - $this->note = $this->noteRepository->findOneBy([ - 'id' => $id, - 'user' => $this->user->getId() - ]); - - if (!$this->note) { - $this->error(); - } - } - - if ($padId = $this->getParameter('pad')) { - $this->pad = $this->padRepository->findOneBy([ - 'id' => $padId, - 'user' => $this->user->getId() - ]); - - if (!$this->pad) { - $this->error(); - } - } - } - - - - /** - * This method is called before the render method. - * It is a good place to add code that would be duplicated in all render methods. - */ - protected function beforeRender() - { - parent::beforeRender(); - - // so we don't have to repeat the code in every render method - $this->template->note = $this->note; - } - - - - /** - * Prepares template variables for the default action. - * - * @param string $order - */ - public function renderDefault($order = 'name') - { - $this->template->notes = $this->noteRepository->findBy( - [ - 'user' => $this->getUser()->getId() - ], - $this->noteRepository->buildOrderBy($order) - ); - } - - - - /** - * Since the note is required for the detail, - * if it haven't been found, the presenter should end with 404 error. - */ - public function actionDetail($id) - { - if (!$this->note) { - $this->error(); - } - } - - - - /** - * Since the note is required for the edit, - * if it haven't been found, the presenter should end with 404 error. - */ - public function actionEdit($id) - { - if (!$this->note) { - $this->error(); - } - } - - - - /** - * Since the note is required for the delete, - * if it haven't been found, the presenter should end with 404 error. - */ - public function actionDelete($id) - { - if (!$this->note) { - $this->error(); - } - } - - - - /** - * Factory method for subcomponent form instance. - * This factory is called internally by Nette in the component model. - * - * This factory creates a ConfirmationControl, - * that calls the onConfirm event if user clicks on the button. - * - * @return \Notejam\Components\ConfirmationControl - */ - protected function createComponentDeleteNote() - { - if ($this->action !== 'delete') { - $this->error(); - } - - $control = $this->confirmationControlFactory->create(); - $control->onConfirm[] = function () { - $this->em->remove($this->note); - $this->em->flush(); - $this->flashMessage('The note has been deleted', 'success'); - $this->redirect('Note:'); - }; - - return $control; - } - - - - /** - * Factory method for subcomponent form instance. - * This factory is called internally by Nette in the component model. - * - * This factory creates a NoteControl that handles creation of new notes. - * - * @return \Notejam\Components\NoteControl - * @throws Nette\Application\BadRequestException - */ - protected function createComponentCreateNote() - { - if ($this->action !== 'create') { - $this->error(); - } - - $control = $this->noteControlFactory->create(); - $control->setPad($this->pad); - $control->onSuccess[] = function () { - $this->flashMessage('Note was successfully created', 'success'); - $this->redirect('Note:'); - }; - - return $control; - } - - - - /** - * Factory method for subcomponent form instance. - * This factory is called internally by Nette in the component model. - * - * This factory creates a NoteControl that handles edit of existing notes. - * - * @return \Notejam\Components\NoteControl - * @throws Nette\Application\BadRequestException - */ - protected function createComponentEditNote() - { - if ($this->action !== 'edit' || !$this->note) { - $this->error(); - } - - $control = $this->noteControlFactory->create(); - $control->setNote($this->note); - $control->onSuccess[] = function () { - $this->flashMessage('Note was successfully edited', 'success'); - $this->redirect('Note:'); - }; - - return $control; - } - -} diff --git a/nette/doctrine/notejam/app/Presenters/PadPresenter.php b/nette/doctrine/notejam/app/Presenters/PadPresenter.php deleted file mode 100644 index c65e942a4..000000000 --- a/nette/doctrine/notejam/app/Presenters/PadPresenter.php +++ /dev/null @@ -1,223 +0,0 @@ -getParameter('id')) { - $this->pad = $this->padRepository->findOneBy([ - 'id' => $id, - 'user' => $this->user->getId() - ]); - } - } - - - - /** - * This method is called before the render method. - * It is a good place to add code that would be duplicated in all render methods. - */ - protected function beforeRender() - { - parent::beforeRender(); - - // so we don't have to repeat the code in every render method - $this->template->pad = $this->pad; - } - - - - /** - * Since the pad is required for the edit, - * if it haven't been found, the presenter should end with 404 error. - * - * Prepares template variables for the detail action. - */ - public function actionDetail($id, $order = 'name') - { - if (!$this->pad) { - $this->error(); - } - - $this->template->notes = $this->noteRepository->findBy( - [ - 'user' => $this->getUser()->getId(), - 'pad' => $this->pad->getId() - ], - $this->noteRepository->buildOrderBy($order) - ); - } - - - - /** - * Since the pad is required for the edit, - * if it haven't been found, the presenter should end with 404 error. - */ - public function actionEdit($id) - { - if (!$this->pad) { - $this->error(); - } - } - - - - /** - * Since the pad is required for the delete, - * if it haven't been found, the presenter should end with 404 error. - */ - public function actionDelete($id) - { - if (!$this->pad) { - $this->error(); - } - } - - - - /** - * Factory method for subcomponent form instance. - * This factory is called internally by Nette in the component model. - * - * This factory creates a ConfirmationControl, - * that calls the onConfirm event if user clicks on the button. - * - * @return \Notejam\Components\ConfirmationControl - */ - protected function createComponentDeletePad() - { - if ($this->action !== 'delete') { - $this->error(); - } - - $control = $this->confirmationControlFactory->create(); - $control->onConfirm[] = function () { - $this->em->remove($this->pad); - $this->em->flush(); - $this->flashMessage('The pad has been deleted', 'success'); - $this->redirect('Note:'); - }; - - return $control; - } - - - - /** - * Factory method for subcomponent form instance. - * This factory is called internally by Nette in the component model. - * - * This factory creates a PadsControl that handles creation of new pads. - * - * @return \Notejam\Components\PadsControl - * @throws Nette\Application\BadRequestException - */ - protected function createComponentCreatePad() - { - if ($this->action !== 'create') { - $this->error(); - } - - $control = $this->padsControlFactory->create(); - $control->onSuccess[] = function ($control, Pad $createdPad) { - $this->flashMessage('New pad has been created', 'success'); - $this->redirect('Pad:detail', ['id' => $createdPad->getId()]); - }; - - return $control; - } - - - - /** - * Factory method for subcomponent form instance. - * This factory is called internally by Nette in the component model. - * - * This factory creates a PadsControl that handles edit of existing pads. - * - * @return \Notejam\Components\PadsControl - * @throws Nette\Application\BadRequestException - */ - protected function createComponentEditPad() - { - if ($this->action !== 'edit' || !$this->pad) { - $this->error(); - } - - $control = $this->padsControlFactory->create(); - $control->setPad($this->pad); - $control->onSuccess[] = function () { - $this->flashMessage('Pad has been edited', 'success'); - $this->redirect('Pad:detail', ['id' => $this->pad->getId()]); - }; - - return $control; - } - -} diff --git a/nette/doctrine/notejam/app/Presenters/UserPresenter.php b/nette/doctrine/notejam/app/Presenters/UserPresenter.php deleted file mode 100644 index 03cfe6e34..000000000 --- a/nette/doctrine/notejam/app/Presenters/UserPresenter.php +++ /dev/null @@ -1,145 +0,0 @@ -user->logout(TRUE); - $this->flashMessage("You've been logged out.", 'success'); - $this->redirect('User:signIn'); - } - - - - /** - * This method is here only for the user annotation, that creates a protected section of app. - * Meaning that if you try to access this action when you're not logged in, you'll be redirected to login form page. - * - * @User() - */ - public function actionSettings() - { - - } - - - - /** - * Factory method for subcomponent form instance. - * This factory is called internally by Nette in the component model. - * - * @return \Notejam\Components\SignInControl - */ - protected function createComponentSignIn() - { - $control = $this->signInFormFactory->create(); - $control->onSuccess[] = function () { - $this->redirect('Note:'); - }; - - return $control; - } - - - - /** - * Factory method for subcomponent form instance. - * This factory is called internally by Nette in the component model. - * - * @return \Notejam\Components\SignUpControl - */ - protected function createComponentSignUp() - { - $control = $this->signUpFormFactory->create(); - $control->onSuccess[] = function () { - $this->flashMessage('Thank you for registration. Now you can sign in', 'success'); - $this->redirect('User:signIn'); - }; - - return $control; - } - - - - /** - * Factory method for subcomponent form instance. - * This factory is called internally by Nette in the component model. - * - * @return \Notejam\Components\SettingsControl - * @throws Nette\Application\BadRequestException - */ - protected function createComponentSettings() - { - if ($this->action !== 'settings') { - $this->error(); - } - - $control = $this->settingsControlFactory->create(); - $control->onSuccess[] = function () { - $this->flashMessage('The password has been changed', 'success'); - $this->redirect('Note:'); - }; - - return $control; - } - - - - /** - * Factory method for subcomponent form instance. - * This factory is called internally by Nette in the component model. - * - * @return \Notejam\Components\ForgottenPasswordControl - */ - protected function createComponentForgottenPassword() - { - $control = $this->forgottenPasswordControlFactory->create(); - $control->onSuccess[] = function () { - $this->flashMessage('New password sent to your inbox', 'success'); - $this->redirect('User:signIn'); - }; - - return $control; - } - -} diff --git a/nette/doctrine/notejam/app/Presenters/templates/@layout.latte b/nette/doctrine/notejam/app/Presenters/templates/@layout.latte deleted file mode 100644 index 8dd37f71f..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/@layout.latte +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - {ifset title}{include title|striptags}{else}Notejam{/ifset} - - - - - - - {block stylesheets} - - - - - - - - {/block} - - -
-
- -
-
-

- notejam: - {block page_title} - All notes - {/block} -

-
- {block pads} - {control padsList} - {/block} -
-
-
{$flash->message}
-
- {block body}{/block} -
- - -
- Fork me on GitHub - {block javascripts} - - {/block} - - diff --git a/nette/doctrine/notejam/app/Presenters/templates/@user.latte b/nette/doctrine/notejam/app/Presenters/templates/@user.latte deleted file mode 100644 index 2b72e3db8..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/@user.latte +++ /dev/null @@ -1,5 +0,0 @@ -{extends '@layout.latte'} - -{block content_class}sixteen columns content-area{/block} - -{block pads}{/block} diff --git a/nette/doctrine/notejam/app/Presenters/templates/Error/403.latte b/nette/doctrine/notejam/app/Presenters/templates/Error/403.latte deleted file mode 100644 index 25c24ab3c..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/Error/403.latte +++ /dev/null @@ -1,7 +0,0 @@ -{block body} -

Access Denied

- -

You do not have permission to view this page. Please try contact the web -site administrator if you believe you should be able to view this page.

- -

error 403

diff --git a/nette/doctrine/notejam/app/Presenters/templates/Error/404.latte b/nette/doctrine/notejam/app/Presenters/templates/Error/404.latte deleted file mode 100644 index d0a09f2a3..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/Error/404.latte +++ /dev/null @@ -1,8 +0,0 @@ -{block body} -

Page Not Found

- -

The page you requested could not be found. It is possible that the address is -incorrect, or that the page no longer exists. Please use a search engine to find -what you are looking for.

- -

error 404

diff --git a/nette/doctrine/notejam/app/Presenters/templates/Error/405.latte b/nette/doctrine/notejam/app/Presenters/templates/Error/405.latte deleted file mode 100644 index 28192d2ff..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/Error/405.latte +++ /dev/null @@ -1,6 +0,0 @@ -{block body} -

Method Not Allowed

- -

The requested method is not allowed for the URL.

- -

error 405

diff --git a/nette/doctrine/notejam/app/Presenters/templates/Error/410.latte b/nette/doctrine/notejam/app/Presenters/templates/Error/410.latte deleted file mode 100644 index b81f19b68..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/Error/410.latte +++ /dev/null @@ -1,6 +0,0 @@ -{block body} -

Page Not Found

- -

The page you requested has been taken off the site. We apologize for the inconvenience.

- -

error 410

diff --git a/nette/doctrine/notejam/app/Presenters/templates/Error/4xx.latte b/nette/doctrine/notejam/app/Presenters/templates/Error/4xx.latte deleted file mode 100644 index d084ed723..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/Error/4xx.latte +++ /dev/null @@ -1,4 +0,0 @@ -{block body} -

Oops...

- -

Your browser sent a request that this server could not understand or process.

diff --git a/nette/doctrine/notejam/app/Presenters/templates/Error/500.phtml b/nette/doctrine/notejam/app/Presenters/templates/Error/500.phtml deleted file mode 100644 index 619611eac..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/Error/500.phtml +++ /dev/null @@ -1,20 +0,0 @@ - - - -Server Error - - - -
-

Server Error

- -

We're sorry! The server encountered an internal error and - was unable to complete your request. Please try again later.

- -

error 500

-
diff --git a/nette/doctrine/notejam/app/Presenters/templates/Note/create.latte b/nette/doctrine/notejam/app/Presenters/templates/Note/create.latte deleted file mode 100644 index c43128571..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/Note/create.latte +++ /dev/null @@ -1,8 +0,0 @@ -{block title}New note{/block} -{block page_title}New note{/block} - -{block body} -
- {control $form ownerrors} - {control $form body} -
diff --git a/nette/doctrine/notejam/app/Presenters/templates/Note/default.latte b/nette/doctrine/notejam/app/Presenters/templates/Note/default.latte deleted file mode 100644 index 5863a25e0..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/Note/default.latte +++ /dev/null @@ -1,36 +0,0 @@ -{block title}All notes ({$notes|length}){/block} -{block page_title}All notes ({$notes|length}){/block} - -{block body} - - - - - - - - - - - -
- Note - - - Pad - Last modified - - -
{$note->name} - {if $note->pad} - {$note->pad} - {else} - No pad - {/if} - {$note->updatedAt|date:'d M. Y'}
- -{if !$iterations} -

Create your first note.

-{/if} - -New note diff --git a/nette/doctrine/notejam/app/Presenters/templates/Note/delete.latte b/nette/doctrine/notejam/app/Presenters/templates/Note/delete.latte deleted file mode 100644 index 8b552f369..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/Note/delete.latte +++ /dev/null @@ -1,9 +0,0 @@ -{block title}Delete note {$note->name}{/block} -{block page_title}Delete note {$note->name}{/block} - -{block body} -
-

Are you sure you want to delete {$note->name}?

- - Cancel -
diff --git a/nette/doctrine/notejam/app/Presenters/templates/Note/detail.latte b/nette/doctrine/notejam/app/Presenters/templates/Note/detail.latte deleted file mode 100644 index 8c2409094..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/Note/detail.latte +++ /dev/null @@ -1,10 +0,0 @@ -{block title}{$note->name}{/block} -{block page_title}{$note->name}{/block} - -{block body} -

Last edited at {$note->updatedAt->format('H:i')}

-
- {$note->text|escape|nl2br|noescape} -
- Edit - Delete it diff --git a/nette/doctrine/notejam/app/Presenters/templates/Note/edit.latte b/nette/doctrine/notejam/app/Presenters/templates/Note/edit.latte deleted file mode 100644 index 906bb35df..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/Note/edit.latte +++ /dev/null @@ -1,8 +0,0 @@ -{block title}{$note->name}{/block} -{block page_title}{$note->name}{/block} - -{block body} -
- {control $form ownerrors} - {control $form body} -
diff --git a/nette/doctrine/notejam/app/Presenters/templates/Pad/create.latte b/nette/doctrine/notejam/app/Presenters/templates/Pad/create.latte deleted file mode 100644 index 1d446a09e..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/Pad/create.latte +++ /dev/null @@ -1,5 +0,0 @@ -{block title}New pad{/block} -{block page_title}New pad{/block} - -{block body} - {control createPad-form} diff --git a/nette/doctrine/notejam/app/Presenters/templates/Pad/delete.latte b/nette/doctrine/notejam/app/Presenters/templates/Pad/delete.latte deleted file mode 100644 index 9b842beb1..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/Pad/delete.latte +++ /dev/null @@ -1,9 +0,0 @@ -{block title}Delete pad {$pad->name}{/block} -{block page_title}Delete pad {$pad->name}{/block} - -{block body} -
-

Are you sure you want to delete {$pad->name}?

- - Cancel -
diff --git a/nette/doctrine/notejam/app/Presenters/templates/Pad/detail.latte b/nette/doctrine/notejam/app/Presenters/templates/Pad/detail.latte deleted file mode 100644 index b8f233d17..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/Pad/detail.latte +++ /dev/null @@ -1,37 +0,0 @@ -{block title}{$pad->name} ({$notes|length} notes){/block} -{block page_title}{$pad->name} ({$notes|length}){/block} - -{block body} - - - - - - - - - - - -
- Note - - - Pad - Last modified - - -
{$note->name} - {if $note->pad} - {$note->pad} - {else} - No pad - {/if} - {$note->updatedAt|date:'d M. Y'}
- -{if !$iterations} -

Create first note in the pad

-{/if} - -New note  -Pad settings diff --git a/nette/doctrine/notejam/app/Presenters/templates/Pad/edit.latte b/nette/doctrine/notejam/app/Presenters/templates/Pad/edit.latte deleted file mode 100644 index 6448a3c4e..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/Pad/edit.latte +++ /dev/null @@ -1,6 +0,0 @@ -{block title}{$pad->name}{/block} -{block page_title}{$pad->name}{/block} - -{block body} - {control editPad-form} - Delete pad diff --git a/nette/doctrine/notejam/app/Presenters/templates/User/forgottenPassword.latte b/nette/doctrine/notejam/app/Presenters/templates/User/forgottenPassword.latte deleted file mode 100644 index e9ab4b29b..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/User/forgottenPassword.latte +++ /dev/null @@ -1,10 +0,0 @@ -{extends '../@user.latte'} - -{block title}Forgot Password?{/block} -{block page_title}Forgot Password?{/block} - -{block body} - diff --git a/nette/doctrine/notejam/app/Presenters/templates/User/settings.latte b/nette/doctrine/notejam/app/Presenters/templates/User/settings.latte deleted file mode 100644 index a33ed1173..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/User/settings.latte +++ /dev/null @@ -1,10 +0,0 @@ -{extends '../@user.latte'} - -{block title}Account Settings{/block} -{block page_title}Account Settings{/block} - -{block body} - diff --git a/nette/doctrine/notejam/app/Presenters/templates/User/signIn.latte b/nette/doctrine/notejam/app/Presenters/templates/User/signIn.latte deleted file mode 100644 index a8f4e16e7..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/User/signIn.latte +++ /dev/null @@ -1,21 +0,0 @@ -{extends '../@user.latte'} - -{block title}Sign In{/block} -{block page_title}Sign In{/block} - -{block body} - diff --git a/nette/doctrine/notejam/app/Presenters/templates/User/signUp.latte b/nette/doctrine/notejam/app/Presenters/templates/User/signUp.latte deleted file mode 100644 index 5b91bc2b9..000000000 --- a/nette/doctrine/notejam/app/Presenters/templates/User/signUp.latte +++ /dev/null @@ -1,20 +0,0 @@ -{extends '../@user.latte'} - -{block title}Sign Up{/block} -{block page_title}Sign Up{/block} - -{block body} - diff --git a/nette/doctrine/notejam/app/bootstrap.php b/nette/doctrine/notejam/app/bootstrap.php deleted file mode 100644 index 8fd851263..000000000 --- a/nette/doctrine/notejam/app/bootstrap.php +++ /dev/null @@ -1,21 +0,0 @@ -setDebugMode('23.75.345.200'); // enable for your remote IP -$configurator->enableDebugger(__DIR__ . '/../log'); - -$configurator->setTempDirectory(__DIR__ . '/../temp'); - -$configurator->createRobotLoader() - ->addDirectory(__DIR__) - ->register(); - -$configurator->addConfig(__DIR__ . '/config/config.neon'); -$configurator->addConfig(__DIR__ . '/config/config.local.neon'); - -$container = $configurator->createContainer(); - -return $container; diff --git a/nette/doctrine/notejam/app/config/config.local.example.neon b/nette/doctrine/notejam/app/config/config.local.example.neon deleted file mode 100644 index 8ef3ce85f..000000000 --- a/nette/doctrine/notejam/app/config/config.local.example.neon +++ /dev/null @@ -1,2 +0,0 @@ -# copy me to config.local.neon -parameters: diff --git a/nette/doctrine/notejam/app/config/config.neon b/nette/doctrine/notejam/app/config/config.neon deleted file mode 100644 index 63a9977a2..000000000 --- a/nette/doctrine/notejam/app/config/config.neon +++ /dev/null @@ -1,42 +0,0 @@ -# WARNING: it is CRITICAL that this file & directory are NOT accessible directly via a web browser! -# https://nette.org/security-warning - -parameters: - srcDir: %appDir%/../src - - -php: - date.timezone: Europe/Prague - - -extensions: - console: Kdyby\Console\DI\ConsoleExtension - events: Kdyby\Events\DI\EventsExtension - annotations: Kdyby\Annotations\DI\AnnotationsExtension - doctrine: Kdyby\Doctrine\DI\OrmExtension - doctrine2identity: Majkl578\NetteAddons\Doctrine2Identity\DI\IdentityExtension - - -application: - errorPresenter: Error - mapping: - *: Notejam\*Module\Presenters\*Presenter - - -session: - expiration: 14 days - - -doctrine: - driver: pdo_sqlite - path: %appDir%/../notejam.db - metadata: - Notejam: %srcDir%/Notejam - - -events: - debugger: off - - -includes: - - services.neon diff --git a/nette/doctrine/notejam/app/config/services.neon b/nette/doctrine/notejam/app/config/services.neon deleted file mode 100644 index 4a04010a4..000000000 --- a/nette/doctrine/notejam/app/config/services.neon +++ /dev/null @@ -1,21 +0,0 @@ -services: - router: Notejam\Http\RouterFactory::createRouter - security.authenticator: Notejam\Users\Authenticator - - latte.latteFactory: - setup: - - addFilter(length, 'Notejam\Templating\RuntimeFilters::length') - - - Notejam\UI\FormFactory - - Notejam\Components\ISignInControlFactory - - Notejam\Components\ISignUpControlFactory - - Notejam\Components\INoteControlFactory - - Notejam\Components\IPadsControlFactory - - Notejam\Components\ISettingsControlFactory - - Notejam\Components\PadsList\IPadsListControlFactory - - Notejam\Components\IForgottenPasswordControlFactory - - Notejam\Components\IConfirmationControlFactory - - - Notejam\Notes\NoteRepository - - Notejam\Pads\PadRepository - - Notejam\Users\UserRepository diff --git a/nette/doctrine/notejam/codeception.yml b/nette/doctrine/notejam/codeception.yml deleted file mode 100644 index 15019d00a..000000000 --- a/nette/doctrine/notejam/codeception.yml +++ /dev/null @@ -1,23 +0,0 @@ -actor: Tester -paths: - tests: tests - log: tests/_output - data: tests/_data - support: tests/_support - envs: tests/_envs -settings: - bootstrap: _bootstrap.php - colors: true - memory_limit: 1024M -extensions: - enabled: - - Codeception\Extension\RunFailed -modules: - config: - Db: - dsn: 'sqlite:notejam.db' - user: - password: - dump: tests/_data/dump.sql - populate: true - cleanup: true diff --git a/nette/doctrine/notejam/composer.json b/nette/doctrine/notejam/composer.json deleted file mode 100644 index 6edba100b..000000000 --- a/nette/doctrine/notejam/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "nette/web-project", - "description": "Nette: Standard Web Project", - "type": "project", - "license": ["MIT", "BSD-3-Clause", "GPL-2.0", "GPL-3.0"], - "require": { - "php": ">= 5.4.0", - "nette/application": "~2.3.6", - "nette/bootstrap": "~2.3.0", - "nette/caching": "~2.3.0", - "nette/di": "~2.3.0", - "nette/finder": "~2.3.0", - "nette/forms": "~2.3.0", - "nette/http": "~2.3.0", - "nette/mail": "~2.3.0", - "nette/robot-loader": "~2.3.0", - "nette/safe-stream": "~2.3.0", - "nette/security": "~2.3.0", - "nette/utils": "~2.3.0", - "latte/latte": "~2.3.0", - "tracy/tracy": "~2.3.0", - "nextras/static-router": "^1.0", - "kdyby/doctrine": "^3.0", - "majkl578/nette-identity-doctrine": "~2.3@rc" - }, - "autoload": { - "classmap": [ - "app/", - "src/Notejam/exceptions.php" - ], - "psr-4": { - "Notejam\\": "src/Notejam" - } - }, - "require-dev": { - "nette/tester": "~1.4", - "codeception/codeception": "^2.0" - } -} diff --git a/nette/doctrine/notejam/composer.lock b/nette/doctrine/notejam/composer.lock deleted file mode 100644 index 42880c42d..000000000 --- a/nette/doctrine/notejam/composer.lock +++ /dev/null @@ -1,3754 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "hash": "99a26131a249a67fdc54e59ec1add7b2", - "content-hash": "bb5d12a2b59bf82f1fd5ad6e2252efce", - "packages": [ - { - "name": "doctrine/annotations", - "version": "v1.2.7", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535", - "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535", - "shasum": "" - }, - "require": { - "doctrine/lexer": "1.*", - "php": ">=5.3.2" - }, - "require-dev": { - "doctrine/cache": "1.*", - "phpunit/phpunit": "4.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Common\\Annotations\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "time": "2015-08-31 12:32:49" - }, - { - "name": "doctrine/cache", - "version": "v1.5.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/cache.git", - "reference": "2b9cec5a5e722010cbebc91713d4c11eaa064d5e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/2b9cec5a5e722010cbebc91713d4c11eaa064d5e", - "reference": "2b9cec5a5e722010cbebc91713d4c11eaa064d5e", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "conflict": { - "doctrine/common": ">2.2,<2.4" - }, - "require-dev": { - "phpunit/phpunit": ">=3.7", - "predis/predis": "~1.0", - "satooshi/php-coveralls": "~0.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Caching library offering an object-oriented API for many cache backends", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "cache", - "caching" - ], - "time": "2015-11-02 18:35:48" - }, - { - "name": "doctrine/collections", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/collections.git", - "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a", - "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Common\\Collections\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Collections Abstraction library", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "array", - "collections", - "iterator" - ], - "time": "2015-04-14 22:21:58" - }, - { - "name": "doctrine/common", - "version": "v2.5.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/common.git", - "reference": "0009b8f0d4a917aabc971fb089eba80e872f83f9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/0009b8f0d4a917aabc971fb089eba80e872f83f9", - "reference": "0009b8f0d4a917aabc971fb089eba80e872f83f9", - "shasum": "" - }, - "require": { - "doctrine/annotations": "1.*", - "doctrine/cache": "1.*", - "doctrine/collections": "1.*", - "doctrine/inflector": "1.*", - "doctrine/lexer": "1.*", - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~3.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Common\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Common Library for Doctrine projects", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "annotations", - "collections", - "eventmanager", - "persistence", - "spl" - ], - "time": "2015-08-31 13:00:22" - }, - { - "name": "doctrine/dbal", - "version": "v2.5.2", - "source": { - "type": "git", - "url": "https://github.com/doctrine/dbal.git", - "reference": "01dbcbc5cd0a913d751418e635434a18a2f2a75c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/01dbcbc5cd0a913d751418e635434a18a2f2a75c", - "reference": "01dbcbc5cd0a913d751418e635434a18a2f2a75c", - "shasum": "" - }, - "require": { - "doctrine/common": ">=2.4,<2.6-dev", - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "4.*", - "symfony/console": "2.*" - }, - "suggest": { - "symfony/console": "For helpful console commands such as SQL execution and import of files." - }, - "bin": [ - "bin/doctrine-dbal" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\DBAL\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - } - ], - "description": "Database Abstraction Layer", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "database", - "dbal", - "persistence", - "queryobject" - ], - "time": "2015-09-16 16:29:33" - }, - { - "name": "doctrine/inflector", - "version": "v1.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/inflector.git", - "reference": "90b2128806bfde671b6952ab8bea493942c1fdae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae", - "reference": "90b2128806bfde671b6952ab8bea493942c1fdae", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "4.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Common\\Inflector\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "inflection", - "pluralize", - "singularize", - "string" - ], - "time": "2015-11-06 14:35:42" - }, - { - "name": "doctrine/instantiator", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2015-06-14 21:17:01" - }, - { - "name": "doctrine/lexer", - "version": "v1.0.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Common\\Lexer\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "lexer", - "parser" - ], - "time": "2014-09-09 13:34:57" - }, - { - "name": "doctrine/orm", - "version": "v2.5.2", - "source": { - "type": "git", - "url": "https://github.com/doctrine/doctrine2.git", - "reference": "464b5fdbfbbeb4a65465ac173c4c5d90960f41ff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/464b5fdbfbbeb4a65465ac173c4c5d90960f41ff", - "reference": "464b5fdbfbbeb4a65465ac173c4c5d90960f41ff", - "shasum": "" - }, - "require": { - "doctrine/cache": "~1.4", - "doctrine/collections": "~1.2", - "doctrine/common": ">=2.5-dev,<2.6-dev", - "doctrine/dbal": ">=2.5-dev,<2.6-dev", - "doctrine/instantiator": "~1.0.1", - "ext-pdo": "*", - "php": ">=5.4", - "symfony/console": "~2.5|~3.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "dev-master", - "symfony/yaml": "~2.3|~3.0" - }, - "suggest": { - "symfony/yaml": "If you want to use YAML Metadata Mapping Driver" - }, - "bin": [ - "bin/doctrine", - "bin/doctrine.php" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\ORM\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - } - ], - "description": "Object-Relational-Mapper for PHP", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "database", - "orm" - ], - "time": "2015-11-23 12:44:25" - }, - { - "name": "kdyby/annotations", - "version": "v2.3.0", - "source": { - "type": "git", - "url": "https://github.com/Kdyby/Annotations.git", - "reference": "36cb90e8a28c1f9a23a5c351af2449139c21229d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Kdyby/Annotations/zipball/36cb90e8a28c1f9a23a5c351af2449139c21229d", - "reference": "36cb90e8a28c1f9a23a5c351af2449139c21229d", - "shasum": "" - }, - "require": { - "doctrine/annotations": "~1.2", - "kdyby/doctrine-cache": "~2.4@dev", - "nette/di": "~2.3@dev", - "nette/utils": "~2.3@dev" - }, - "conflict": { - "kdyby/doctrine": "0.9.*" - }, - "require-dev": { - "latte/latte": "~2.3@dev", - "nette/application": "~2.3@dev", - "nette/bootstrap": "~2.3@dev", - "nette/caching": "~2.3@dev", - "nette/component-model": "~2.2@dev", - "nette/database": "~2.3@dev", - "nette/deprecated": "~2.3@dev", - "nette/di": "~2.3@dev", - "nette/finder": "~2.3@dev", - "nette/forms": "~2.3@dev", - "nette/http": "~2.3@dev", - "nette/mail": "~2.3@dev", - "nette/neon": "~2.3@dev", - "nette/php-generator": "~2.3@dev", - "nette/reflection": "~2.3@dev", - "nette/robot-loader": "~2.3@dev", - "nette/safe-stream": "~2.3@dev", - "nette/security": "~2.3@dev", - "nette/tester": "~1.3@rc", - "nette/tokenizer": "~2.2@dev", - "nette/utils": "~2.3@dev", - "tracy/tracy": "~2.3@dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - } - }, - "autoload": { - "psr-0": { - "Kdyby\\Annotations\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "Filip Procházka", - "email": "filip@prochazka.su", - "homepage": "http://filip-prochazka.com" - }, - { - "name": "Jáchym Toušek", - "email": "enumag@gmail.com", - "homepage": "http://enumag.cz" - } - ], - "description": "Doctrine Annotations integration into Nette Framework", - "homepage": "http://kdyby.org", - "keywords": [ - "annotations", - "doctrine", - "kdyby", - "nette" - ], - "time": "2015-10-30 21:04:27" - }, - { - "name": "kdyby/console", - "version": "v2.5.0", - "source": { - "type": "git", - "url": "https://github.com/Kdyby/Console.git", - "reference": "50e9f6ce4db18628d01724d5085d8056056eb9cb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Kdyby/Console/zipball/50e9f6ce4db18628d01724d5085d8056056eb9cb", - "reference": "50e9f6ce4db18628d01724d5085d8056056eb9cb", - "shasum": "" - }, - "require": { - "nette/application": "~2.3@dev", - "nette/di": "~2.3@dev", - "nette/http": "~2.3@dev", - "symfony/console": "~2.3" - }, - "require-dev": { - "kdyby/events": "~2.4@dev", - "latte/latte": "~2.3@dev", - "nette/application": "~2.3@dev", - "nette/bootstrap": "~2.3@dev", - "nette/caching": "~2.3@dev", - "nette/component-model": "~2.2@dev", - "nette/database": "~2.3@dev", - "nette/deprecated": "~2.3@dev", - "nette/di": "~2.3@dev", - "nette/finder": "~2.3@dev", - "nette/forms": "~2.3@dev", - "nette/http": "~2.3@dev", - "nette/mail": "~2.3@dev", - "nette/neon": "~2.3@dev", - "nette/php-generator": "~2.3@dev", - "nette/reflection": "~2.3@dev", - "nette/robot-loader": "~2.3@dev", - "nette/safe-stream": "~2.3@dev", - "nette/security": "~2.3@dev", - "nette/tester": "~1.6@rc", - "nette/tokenizer": "~2.2@dev", - "nette/utils": "~2.3@dev", - "symfony/event-dispatcher": "~2.3", - "tracy/tracy": "~2.3@dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "psr-0": { - "Kdyby\\Console\\": "src/" - }, - "classmap": [ - "src/Kdyby/Console/CliPresenter.php", - "src/Kdyby/Console/exceptions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "Filip Procházka", - "email": "filip@prochazka.su", - "homepage": "http://filip-prochazka.com" - } - ], - "description": "Symfony Console integration for Kdyby components", - "homepage": "http://kdyby.org", - "keywords": [ - "console", - "kdyby", - "nette" - ], - "time": "2015-10-30 21:57:23" - }, - { - "name": "kdyby/doctrine", - "version": "v3.0.1", - "source": { - "type": "git", - "url": "https://github.com/Kdyby/Doctrine.git", - "reference": "69c63fe943d1fade98d8879a9e3aa8fc9e7b5c4b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Kdyby/Doctrine/zipball/69c63fe943d1fade98d8879a9e3aa8fc9e7b5c4b", - "reference": "69c63fe943d1fade98d8879a9e3aa8fc9e7b5c4b", - "shasum": "" - }, - "require": { - "doctrine/dbal": "~2.5", - "doctrine/orm": "~2.5", - "kdyby/annotations": "~2.3@dev", - "kdyby/console": "~2.5@dev", - "kdyby/doctrine-cache": "~2.5@dev", - "kdyby/events": "~3.0@dev", - "nette/di": "~2.3@dev", - "nette/neon": "~2.3@dev", - "nette/robot-loader": "~2.3@dev", - "nette/utils": "~2.3@dev" - }, - "require-dev": { - "dg/dibi": "~2.0", - "latte/latte": "~2.3@dev", - "nette/application": "~2.3@dev", - "nette/bootstrap": "~2.3@dev", - "nette/caching": "~2.3@dev", - "nette/component-model": "~2.2@dev", - "nette/database": "~2.3@dev", - "nette/deprecated": "~2.2@dev", - "nette/di": "~2.3@dev", - "nette/finder": "~2.3@dev", - "nette/forms": "~2.3@dev", - "nette/http": "~2.3@dev", - "nette/mail": "~2.3@dev", - "nette/neon": "~2.3@dev", - "nette/php-generator": "~2.3@dev", - "nette/reflection": "~2.3@dev", - "nette/robot-loader": "~2.3@dev", - "nette/safe-stream": "~2.3@dev", - "nette/security": "~2.3@dev", - "nette/tester": "~1.3@rc", - "nette/tokenizer": "~2.2@dev", - "nette/utils": "~2.3@dev", - "tracy/tracy": "~2.3@dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-0": { - "Kdyby\\Doctrine\\": "src/", - "Kdyby\\Persistence\\": "src/", - "Kdyby\\DibiBridge\\": "src/" - }, - "classmap": [ - "src/Kdyby/Doctrine/exceptions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "Filip Procházka", - "email": "filip@prochazka.su", - "homepage": "http://filip-prochazka.com" - } - ], - "description": "Doctrine integration into Nette Framework", - "homepage": "http://kdyby.org", - "keywords": [ - "dbal", - "doctrine", - "kdyby", - "nette", - "orm" - ], - "time": "2015-11-14 14:11:04" - }, - { - "name": "kdyby/doctrine-cache", - "version": "v2.5.0", - "source": { - "type": "git", - "url": "https://github.com/Kdyby/DoctrineCache.git", - "reference": "01a55db5ab0e0892c77a7f6fa9ea0022dabb9440" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Kdyby/DoctrineCache/zipball/01a55db5ab0e0892c77a7f6fa9ea0022dabb9440", - "reference": "01a55db5ab0e0892c77a7f6fa9ea0022dabb9440", - "shasum": "" - }, - "require": { - "doctrine/cache": "~1.5", - "nette/caching": "~2.3@dev", - "nette/di": "~2.3@dev", - "php": ">=5.4" - }, - "require-dev": { - "latte/latte": "~2.3@dev", - "nette/application": "~2.3@dev", - "nette/bootstrap": "~2.3@dev", - "nette/caching": "~2.3@dev", - "nette/component-model": "~2.2@dev", - "nette/database": "~2.3@dev", - "nette/deprecated": "~2.3@dev", - "nette/di": "~2.3@dev", - "nette/finder": "~2.3@dev", - "nette/forms": "~2.3@dev", - "nette/http": "~2.3@dev", - "nette/mail": "~2.3@dev", - "nette/neon": "~2.3@dev", - "nette/php-generator": "~2.3@dev", - "nette/reflection": "~2.3@dev", - "nette/robot-loader": "~2.3@dev", - "nette/safe-stream": "~2.3@dev", - "nette/security": "~2.3@dev", - "nette/tester": "~1.3@rc", - "nette/tokenizer": "~2.2@dev", - "nette/utils": "~2.3@dev", - "tracy/tracy": "~2.3@dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "psr-0": { - "Kdyby\\DoctrineCache\\": "src/" - }, - "classmap": [ - "src/Kdyby/DoctrineCache/exceptions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "Filip Procházka", - "email": "filip@prochazka.su", - "homepage": "http://filip-prochazka.com" - } - ], - "description": "Doctrine Cache bridge for Nette Framework", - "homepage": "http://kdyby.org", - "keywords": [ - "cache", - "doctrine", - "kdyby", - "nette" - ], - "time": "2015-10-30 20:54:56" - }, - { - "name": "kdyby/events", - "version": "v3.0.0", - "source": { - "type": "git", - "url": "https://github.com/Kdyby/Events.git", - "reference": "fc82cd11e3415bb3c30d661948ab6279c40caa04" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Kdyby/Events/zipball/fc82cd11e3415bb3c30d661948ab6279c40caa04", - "reference": "fc82cd11e3415bb3c30d661948ab6279c40caa04", - "shasum": "" - }, - "require": { - "nette/di": "~2.3@dev", - "nette/utils": "~2.3@dev" - }, - "require-dev": { - "latte/latte": "~2.3@dev", - "nette/application": "~2.3@dev", - "nette/bootstrap": "~2.3@dev", - "nette/caching": "~2.3@dev", - "nette/component-model": "~2.2@dev", - "nette/database": "~2.3@dev", - "nette/deprecated": "~2.3@dev", - "nette/di": "~2.3@dev", - "nette/finder": "~2.3@dev", - "nette/forms": "~2.3@dev", - "nette/http": "~2.3@dev", - "nette/mail": "~2.3@dev", - "nette/neon": "~2.3@dev", - "nette/php-generator": "~2.3@dev", - "nette/reflection": "~2.3@dev", - "nette/robot-loader": "~2.3@dev", - "nette/safe-stream": "~2.3@dev", - "nette/security": "~2.3@dev", - "nette/tester": "~1.4", - "nette/tokenizer": "~2.2@dev", - "nette/utils": "~2.3@dev", - "symfony/event-dispatcher": "~2.3", - "tracy/tracy": "~2.3@dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "psr-0": { - "Kdyby\\Events\\": "src/" - }, - "classmap": [ - "src/Kdyby/Events/exceptions.php" - ], - "files": [ - "src/Doctrine/compatibility.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "Filip Procházka", - "email": "filip@prochazka.su", - "homepage": "http://filip-prochazka.com" - } - ], - "description": "Events for Nette Framework", - "homepage": "http://kdyby.org", - "keywords": [ - "kdyby", - "nette" - ], - "time": "2015-10-30 18:00:28" - }, - { - "name": "latte/latte", - "version": "v2.3.7", - "source": { - "type": "git", - "url": "https://github.com/nette/latte.git", - "reference": "b6e090e461c9cd88d60ae79a7713990b17b1531c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/latte/zipball/b6e090e461c9cd88d60ae79a7713990b17b1531c", - "reference": "b6e090e461c9cd88d60ae79a7713990b17b1531c", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.1" - }, - "require-dev": { - "nette/tester": "~1.3" - }, - "suggest": { - "ext-fileinfo": "to use filter |datastream", - "ext-mbstring": "to use filters like lower, upper, capitalize, ..." - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "Latte: the amazing template engine for PHP", - "homepage": "https://latte.nette.org", - "keywords": [ - "templating", - "twig" - ], - "time": "2015-11-07 22:54:05" - }, - { - "name": "majkl578/nette-identity-doctrine", - "version": "v2.3-rc1", - "source": { - "type": "git", - "url": "https://github.com/Majkl578/nette-identity-doctrine.git", - "reference": "6d78821908dcf06e276b34eae7a3123d9fe1fb3a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Majkl578/nette-identity-doctrine/zipball/6d78821908dcf06e276b34eae7a3123d9fe1fb3a", - "reference": "6d78821908dcf06e276b34eae7a3123d9fe1fb3a", - "shasum": "" - }, - "require": { - "doctrine/orm": "~2.3", - "nette/di": "~2.2", - "nette/http": "~2.2", - "nette/security": "~2.2", - "php": ">=5.3.2" - }, - "require-dev": { - "kdyby/doctrine": "~2.0", - "nette/bootstrap": "~2.2", - "phpunit/phpunit": "~4.8", - "tracy/tracy": "~2.2" - }, - "type": "nette-addon", - "autoload": { - "psr-4": { - "Majkl578\\NetteAddons\\Doctrine2Identity\\": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Moravec" - } - ], - "description": "Integration of entities implementing IIdentity in Nette 2", - "keywords": [ - "Authentication", - "doctrine", - "identity", - "nette", - "orm", - "security" - ], - "time": "2015-11-27 13:47:40" - }, - { - "name": "nette/application", - "version": "v2.3.7", - "source": { - "type": "git", - "url": "https://github.com/nette/application.git", - "reference": "8e87ae81c2098abd7895bfd96d9fac1cd332abc3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/application/zipball/8e87ae81c2098abd7895bfd96d9fac1cd332abc3", - "reference": "8e87ae81c2098abd7895bfd96d9fac1cd332abc3", - "shasum": "" - }, - "require": { - "nette/component-model": "~2.2", - "nette/http": "~2.2", - "nette/reflection": "~2.2", - "nette/security": "~2.2", - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "latte/latte": "~2.3.0", - "nette/di": "~2.3", - "nette/forms": "~2.2", - "nette/robot-loader": "~2.2", - "nette/tester": "~1.3" - }, - "suggest": { - "latte/latte": "Allows using Latte in templates", - "nette/forms": "Allows to use Nette\\Application\\UI\\Form" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "Nette Application MVC Component", - "homepage": "https://nette.org", - "time": "2015-10-13 14:33:28" - }, - { - "name": "nette/bootstrap", - "version": "v2.3.3", - "source": { - "type": "git", - "url": "https://github.com/nette/bootstrap.git", - "reference": "8e2db45c39a1fa24f88e94c7b2a62ad09e9a306e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/bootstrap/zipball/8e2db45c39a1fa24f88e94c7b2a62ad09e9a306e", - "reference": "8e2db45c39a1fa24f88e94c7b2a62ad09e9a306e", - "shasum": "" - }, - "require": { - "nette/di": "~2.3", - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "latte/latte": "~2.2", - "nette/application": "~2.3", - "nette/caching": "~2.3", - "nette/database": "~2.3", - "nette/forms": "~2.3", - "nette/http": "~2.3", - "nette/mail": "~2.3", - "nette/robot-loader": "~2.2", - "nette/safe-stream": "~2.2", - "nette/security": "~2.3", - "nette/tester": "~1.3", - "tracy/tracy": "~2.3" - }, - "suggest": { - "nette/robot-loader": "to use Configurator::createRobotLoader()", - "tracy/tracy": "to use Configurator::enableDebugger()" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette Bootstrap", - "homepage": "http://nette.org", - "time": "2015-07-11 21:07:11" - }, - { - "name": "nette/caching", - "version": "v2.3.3", - "source": { - "type": "git", - "url": "https://github.com/nette/caching.git", - "reference": "d4be13806d70c02d53b72cc63e93de6cf813f50f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/caching/zipball/d4be13806d70c02d53b72cc63e93de6cf813f50f", - "reference": "d4be13806d70c02d53b72cc63e93de6cf813f50f", - "shasum": "" - }, - "require": { - "nette/finder": "~2.2", - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "latte/latte": "~2.3.0", - "nette/di": "~2.3", - "nette/tester": "~1.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette Caching Component", - "homepage": "http://nette.org", - "time": "2015-07-11 21:09:42" - }, - { - "name": "nette/component-model", - "version": "v2.2.4", - "source": { - "type": "git", - "url": "https://github.com/nette/component-model.git", - "reference": "07bce436051fd92d084642ce7a47f00045e0d1e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/component-model/zipball/07bce436051fd92d084642ce7a47f00045e0d1e5", - "reference": "07bce436051fd92d084642ce7a47f00045e0d1e5", - "shasum": "" - }, - "require": { - "nette/utils": "^2.3.5", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "Nette Component Model", - "homepage": "https://nette.org", - "time": "2015-10-06 17:54:05" - }, - { - "name": "nette/di", - "version": "v2.3.6", - "source": { - "type": "git", - "url": "https://github.com/nette/di.git", - "reference": "efa1d13f016b58b4a9200802c9c5b14d10d72e85" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/di/zipball/efa1d13f016b58b4a9200802c9c5b14d10d72e85", - "reference": "efa1d13f016b58b4a9200802c9c5b14d10d72e85", - "shasum": "" - }, - "require": { - "nette/neon": "^2.3.3", - "nette/php-generator": "^2.3.3", - "nette/utils": "~2.3", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette Dependency Injection Component", - "homepage": "http://nette.org", - "time": "2015-09-14 18:18:24" - }, - { - "name": "nette/finder", - "version": "v2.3.1", - "source": { - "type": "git", - "url": "https://github.com/nette/finder.git", - "reference": "38f803a03f4cddf352e28af70294c71f7026e516" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/finder/zipball/38f803a03f4cddf352e28af70294c71f7026e516", - "reference": "38f803a03f4cddf352e28af70294c71f7026e516", - "shasum": "" - }, - "require": { - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.4" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette Finder: Files Searching", - "homepage": "http://nette.org", - "time": "2015-07-11 21:13:50" - }, - { - "name": "nette/forms", - "version": "v2.3.6", - "source": { - "type": "git", - "url": "https://github.com/nette/forms.git", - "reference": "5e07a7b7180e5e88db9d44e12f1677e36b4f164b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/forms/zipball/5e07a7b7180e5e88db9d44e12f1677e36b4f164b", - "reference": "5e07a7b7180e5e88db9d44e12f1677e36b4f164b", - "shasum": "" - }, - "require": { - "nette/component-model": "~2.2", - "nette/http": "~2.2", - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "latte/latte": "~2.3.2", - "nette/di": "~2.3", - "nette/tester": "~1.3", - "tracy/tracy": "~2.2" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "Nette Forms: greatly facilitates web forms", - "homepage": "https://nette.org", - "time": "2015-10-19 01:41:55" - }, - { - "name": "nette/http", - "version": "v2.3.3", - "source": { - "type": "git", - "url": "https://github.com/nette/http.git", - "reference": "ff2e4608391bca2444df9af6eaf8666ac853eb02" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/http/zipball/ff2e4608391bca2444df9af6eaf8666ac853eb02", - "reference": "ff2e4608391bca2444df9af6eaf8666ac853eb02", - "shasum": "" - }, - "require": { - "nette/utils": "~2.2, >=2.2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/di": "~2.3", - "nette/tester": "~1.4" - }, - "suggest": { - "ext-fileinfo": "to detect type of uploaded files" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette HTTP Component", - "homepage": "http://nette.org", - "time": "2015-07-19 16:17:50" - }, - { - "name": "nette/mail", - "version": "v2.3.3", - "source": { - "type": "git", - "url": "https://github.com/nette/mail.git", - "reference": "4ea303d96c6a80ffe357baf59d387f4fe2cfd412" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/mail/zipball/4ea303d96c6a80ffe357baf59d387f4fe2cfd412", - "reference": "4ea303d96c6a80ffe357baf59d387f4fe2cfd412", - "shasum": "" - }, - "require": { - "ext-iconv": "*", - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/di": "~2.3", - "nette/tester": "~1.3" - }, - "suggest": { - "ext-fileinfo": "to detect type of attached files" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "Nette Mail: Sending E-mails", - "homepage": "https://nette.org", - "time": "2015-10-05 12:58:01" - }, - { - "name": "nette/neon", - "version": "v2.3.3", - "source": { - "type": "git", - "url": "https://github.com/nette/neon.git", - "reference": "12bbb0e85ba8521dd291f4df0fe20a1b79aae32c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/neon/zipball/12bbb0e85ba8521dd291f4df0fe20a1b79aae32c", - "reference": "12bbb0e85ba8521dd291f4df0fe20a1b79aae32c", - "shasum": "" - }, - "require": { - "ext-iconv": "*", - "php": ">=5.3.1" - }, - "require-dev": { - "nette/tester": "~1.4" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette NEON: parser & generator for Nette Object Notation", - "homepage": "http://ne-on.org", - "time": "2015-08-22 15:23:30" - }, - { - "name": "nette/php-generator", - "version": "v2.3.4", - "source": { - "type": "git", - "url": "https://github.com/nette/php-generator.git", - "reference": "846028e9d885d2d8ec60823d995e1291bbe3eb69" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/php-generator/zipball/846028e9d885d2d8ec60823d995e1291bbe3eb69", - "reference": "846028e9d885d2d8ec60823d995e1291bbe3eb69", - "shasum": "" - }, - "require": { - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.4" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "Nette PHP Generator", - "homepage": "https://nette.org", - "time": "2015-10-09 14:34:13" - }, - { - "name": "nette/reflection", - "version": "v2.3.1", - "source": { - "type": "git", - "url": "https://github.com/nette/reflection.git", - "reference": "9c2ed2a29f1f58125a0f19ffc987812d6b17d3e6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/reflection/zipball/9c2ed2a29f1f58125a0f19ffc987812d6b17d3e6", - "reference": "9c2ed2a29f1f58125a0f19ffc987812d6b17d3e6", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "nette/caching": "~2.2", - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/di": "~2.3", - "nette/tester": "~1.4" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette PHP Reflection Component", - "homepage": "http://nette.org", - "time": "2015-07-11 21:34:53" - }, - { - "name": "nette/robot-loader", - "version": "v2.3.1", - "source": { - "type": "git", - "url": "https://github.com/nette/robot-loader.git", - "reference": "69331d359bbc9e5f911c12b82187cac914d983fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/robot-loader/zipball/69331d359bbc9e5f911c12b82187cac914d983fb", - "reference": "69331d359bbc9e5f911c12b82187cac914d983fb", - "shasum": "" - }, - "require": { - "nette/caching": "~2.2", - "nette/finder": "~2.3", - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.4" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette RobotLoader: comfortable autoloading", - "homepage": "http://nette.org", - "time": "2015-07-11 21:20:57" - }, - { - "name": "nette/safe-stream", - "version": "v2.3.1", - "source": { - "type": "git", - "url": "https://github.com/nette/safe-stream.git", - "reference": "bf30db367b51a0932c44dcb9a378927644d48b2e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/safe-stream/zipball/bf30db367b51a0932c44dcb9a378927644d48b2e", - "reference": "bf30db367b51a0932c44dcb9a378927644d48b2e", - "shasum": "" - }, - "require": { - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "files": [ - "src/loader.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette SafeStream: Atomic Operations", - "homepage": "http://nette.org", - "time": "2015-07-11 20:59:15" - }, - { - "name": "nette/security", - "version": "v2.3.1", - "source": { - "type": "git", - "url": "https://github.com/nette/security.git", - "reference": "744264a42b506d63009d7e3853ed72b04c99e964" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/security/zipball/744264a42b506d63009d7e3853ed72b04c99e964", - "reference": "744264a42b506d63009d7e3853ed72b04c99e964", - "shasum": "" - }, - "require": { - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/di": "~2.3", - "nette/http": "~2.3", - "nette/tester": "~1.4" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette Security: Access Control Component", - "homepage": "http://nette.org", - "time": "2015-07-11 21:22:53" - }, - { - "name": "nette/utils", - "version": "v2.3.6", - "source": { - "type": "git", - "url": "https://github.com/nette/utils.git", - "reference": "c9dfaec788eb65d5ef10cefed0ae63bc76febaa8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/c9dfaec788eb65d5ef10cefed0ae63bc76febaa8", - "reference": "c9dfaec788eb65d5ef10cefed0ae63bc76febaa8", - "shasum": "" - }, - "require": { - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.0" - }, - "suggest": { - "ext-gd": "to use Image", - "ext-iconv": "to use Strings::webalize() and toAscii()", - "ext-intl": "for script transliteration in Strings::webalize() and toAscii()", - "ext-mbstring": "to use Strings::lower() etc..." - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "Nette Utility Classes", - "homepage": "https://nette.org", - "time": "2015-10-05 12:18:24" - }, - { - "name": "nextras/static-router", - "version": "v1.0.1", - "source": { - "type": "git", - "url": "https://github.com/nextras/static-router.git", - "reference": "cf4155820b9f2d2cb98705ce5538feb22226e8cc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nextras/static-router/zipball/cf4155820b9f2d2cb98705ce5538feb22226e8cc", - "reference": "cf4155820b9f2d2cb98705ce5538feb22226e8cc", - "shasum": "" - }, - "require": { - "nette/application": "~2.2", - "php": ">=5.3" - }, - "require-dev": { - "nette/tester": "~1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Nextras\\Routing\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nextras Community", - "homepage": "https://github.com/nextras/static-router/graphs/contributors" - } - ], - "description": "Simple static router for Nette Framework", - "homepage": "https://github.com/nextras/static-router", - "keywords": [ - "nette", - "nextras", - "router" - ], - "time": "2015-06-13 09:05:20" - }, - { - "name": "symfony/console", - "version": "v2.7.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "16bb1cb86df43c90931df65f529e7ebd79636750" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/16bb1cb86df43c90931df65f529e7ebd79636750", - "reference": "16bb1cb86df43c90931df65f529e7ebd79636750", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1", - "symfony/process": "~2.1" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2015-11-18 09:54:26" - }, - { - "name": "tracy/tracy", - "version": "v2.3.6", - "source": { - "type": "git", - "url": "https://github.com/nette/tracy.git", - "reference": "79831c75b6f48fcb897d25ccae5deec358cb2142" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/tracy/zipball/79831c75b6f48fcb897d25ccae5deec358cb2142", - "reference": "79831c75b6f48fcb897d25ccae5deec358cb2142", - "shasum": "" - }, - "require": { - "php": ">=5.3.1" - }, - "require-dev": { - "nette/di": "~2.3", - "nette/tester": "~1.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src" - ], - "files": [ - "src/shortcuts.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "Tracy: useful PHP debugger", - "homepage": "https://tracy.nette.org", - "keywords": [ - "debug", - "debugger", - "nette" - ], - "time": "2015-10-28 23:49:21" - } - ], - "packages-dev": [ - { - "name": "codeception/codeception", - "version": "2.1.4", - "source": { - "type": "git", - "url": "https://github.com/Codeception/Codeception.git", - "reference": "6a812e8a0d1b1db939a29b4dc14cb398b21b6112" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/6a812e8a0d1b1db939a29b4dc14cb398b21b6112", - "reference": "6a812e8a0d1b1db939a29b4dc14cb398b21b6112", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-mbstring": "*", - "facebook/webdriver": ">=1.0.1", - "guzzlehttp/guzzle": ">=4.1.4 <7.0", - "guzzlehttp/psr7": "~1.0", - "php": ">=5.4.0", - "phpunit/phpunit": "~4.8.0", - "symfony/browser-kit": "~2.4", - "symfony/console": "~2.4", - "symfony/css-selector": "~2.4", - "symfony/dom-crawler": "~2.4,!=2.4.5", - "symfony/event-dispatcher": "~2.4", - "symfony/finder": "~2.4", - "symfony/yaml": "~2.4" - }, - "require-dev": { - "codeception/specify": "~0.3", - "facebook/php-sdk-v4": "~4.0", - "flow/jsonpath": "~0.2", - "monolog/monolog": "~1.8", - "pda/pheanstalk": "~2.0", - "videlalvaro/php-amqplib": "~2.4" - }, - "suggest": { - "codeception/phpbuiltinserver": "Extension to start and stop PHP built-in web server for your tests", - "codeception/specify": "BDD-style code blocks", - "codeception/verify": "BDD-style assertions", - "monolog/monolog": "Log test steps", - "phpseclib/phpseclib": "Extension required to use the SFTP option in the FTP Module." - }, - "bin": [ - "codecept" - ], - "type": "library", - "extra": { - "branch-alias": [] - }, - "autoload": { - "psr-4": { - "Codeception\\": "src\\Codeception", - "Codeception\\Extension\\": "ext" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Bodnarchuk", - "email": "davert@mail.ua", - "homepage": "http://codegyre.com" - } - ], - "description": "BDD-style testing framework", - "homepage": "http://codeception.com/", - "keywords": [ - "BDD", - "TDD", - "acceptance testing", - "functional testing", - "unit testing" - ], - "time": "2015-11-12 03:57:06" - }, - { - "name": "facebook/webdriver", - "version": "1.0.4", - "source": { - "type": "git", - "url": "https://github.com/facebook/php-webdriver.git", - "reference": "a6e209a309bf7cd71acf15476f40b11a25d5a79d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/a6e209a309bf7cd71acf15476f40b11a25d5a79d", - "reference": "a6e209a309bf7cd71acf15476f40b11a25d5a79d", - "shasum": "" - }, - "require": { - "php": ">=5.3.19" - }, - "require-dev": { - "phpunit/phpunit": "4.6.*" - }, - "suggest": { - "phpdocumentor/phpdocumentor": "2.*" - }, - "type": "library", - "autoload": { - "psr-4": { - "Facebook\\WebDriver\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "description": "A PHP client for WebDriver", - "homepage": "https://github.com/facebook/php-webdriver", - "keywords": [ - "facebook", - "php", - "selenium", - "webdriver" - ], - "time": "2015-11-03 22:17:22" - }, - { - "name": "guzzlehttp/guzzle", - "version": "6.1.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "c6851d6e48f63b69357cbfa55bca116448140e0c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/c6851d6e48f63b69357cbfa55bca116448140e0c", - "reference": "c6851d6e48f63b69357cbfa55bca116448140e0c", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "~1.0", - "guzzlehttp/psr7": "~1.1", - "php": ">=5.5.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~4.0", - "psr/log": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.1-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2015-11-23 00:47:50" - }, - { - "name": "guzzlehttp/promises", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/b1e1c0d55f8083c71eda2c28c12a228d708294ea", - "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "time": "2015-10-15 22:28:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/4d0bdbe1206df7440219ce14c972aa57cc5e4982", - "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "PSR-7 message implementation", - "keywords": [ - "http", - "message", - "stream", - "uri" - ], - "time": "2015-11-03 01:34:55" - }, - { - "name": "nette/tester", - "version": "v1.6.1", - "source": { - "type": "git", - "url": "https://github.com/nette/tester.git", - "reference": "b0f312e7ab9a70bbd5c92568e2a20dd46be9a529" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/tester/zipball/b0f312e7ab9a70bbd5c92568e2a20dd46be9a529", - "reference": "b0f312e7ab9a70bbd5c92568e2a20dd46be9a529", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "bin": [ - "src/tester" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "An easy-to-use PHP unit testing framework.", - "homepage": "https://tester.nette.org", - "keywords": [ - "nette", - "testing", - "unit" - ], - "time": "2015-10-26 05:38:30" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "time": "2015-02-03 12:10:50" - }, - { - "name": "phpspec/prophecy", - "version": "v1.5.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1" - }, - "require-dev": { - "phpspec/phpspec": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2015-08-13 10:07:40" - }, - { - "name": "phpunit/php-code-coverage", - "version": "2.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2015-10-06 15:47:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2015-06-21 13:08:43" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21 13:50:34" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.7", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2015-06-21 08:01:12" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2015-09-15 10:49:45" - }, - { - "name": "phpunit/phpunit", - "version": "4.8.18", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fa33d4ad96481b91df343d83e8c8aabed6b1dfd3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fa33d4ad96481b91df343d83e8c8aabed6b1dfd3", - "reference": "fa33d4ad96481b91df343d83e8c8aabed6b1dfd3", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": ">=1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.1", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.8.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2015-11-11 11:32:49" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2015-10-02 06:51:40" - }, - { - "name": "psr/http-message", - "version": "1.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2015-05-04 20:22:00" - }, - { - "name": "sebastian/comparator", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2015-07-26 15:48:44" - }, - { - "name": "sebastian/diff", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2015-02-22 15:13:53" - }, - { - "name": "sebastian/environment", - "version": "1.3.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6324c907ce7a52478eeeaede764f48733ef5ae44", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2015-08-03 06:14:51" - }, - { - "name": "sebastian/exporter", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2015-06-21 07:55:53" - }, - { - "name": "sebastian/global-state", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2015-10-12 03:26:01" - }, - { - "name": "sebastian/recursion-context", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-06-21 08:04:50" - }, - { - "name": "sebastian/version", - "version": "1.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "shasum": "" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21 13:59:46" - }, - { - "name": "symfony/browser-kit", - "version": "v2.7.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/browser-kit.git", - "reference": "bd28847ea2193916074c7b11d4fdd78570049694" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/bd28847ea2193916074c7b11d4fdd78570049694", - "reference": "bd28847ea2193916074c7b11d4fdd78570049694", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/dom-crawler": "~2.0,>=2.0.5" - }, - "require-dev": { - "symfony/css-selector": "~2.0,>=2.0.5", - "symfony/process": "~2.3.34|~2.7,>=2.7.6" - }, - "suggest": { - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\BrowserKit\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony BrowserKit Component", - "homepage": "https://symfony.com", - "time": "2015-11-02 20:20:53" - }, - { - "name": "symfony/css-selector", - "version": "v2.7.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "abb47717fb88aebd9437da2fc8bb01a50a36679f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/abb47717fb88aebd9437da2fc8bb01a50a36679f", - "reference": "abb47717fb88aebd9437da2fc8bb01a50a36679f", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony CssSelector Component", - "homepage": "https://symfony.com", - "time": "2015-10-30 20:10:21" - }, - { - "name": "symfony/dom-crawler", - "version": "v2.7.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/dom-crawler.git", - "reference": "b33593cbfe1d81b50d48353f338aca76a08658d8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/b33593cbfe1d81b50d48353f338aca76a08658d8", - "reference": "b33593cbfe1d81b50d48353f338aca76a08658d8", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/css-selector": "~2.3" - }, - "suggest": { - "symfony/css-selector": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\DomCrawler\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony DomCrawler Component", - "homepage": "https://symfony.com", - "time": "2015-11-02 20:20:53" - }, - { - "name": "symfony/event-dispatcher", - "version": "v2.7.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "7e2f9c31645680026c2372edf66f863fc7757af5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7e2f9c31645680026c2372edf66f863fc7757af5", - "reference": "7e2f9c31645680026c2372edf66f863fc7757af5", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5", - "symfony/dependency-injection": "~2.6", - "symfony/expression-language": "~2.6", - "symfony/stopwatch": "~2.3" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2015-10-30 20:10:21" - }, - { - "name": "symfony/finder", - "version": "v2.7.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "a06a0c0ff7db3736a50d530c908cca547bf13da9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/a06a0c0ff7db3736a50d530c908cca547bf13da9", - "reference": "a06a0c0ff7db3736a50d530c908cca547bf13da9", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2015-10-30 20:10:21" - }, - { - "name": "symfony/yaml", - "version": "v2.7.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "4cfcd7a9fceba662b3c036b7d9a91f6197af046c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/4cfcd7a9fceba662b3c036b7d9a91f6197af046c", - "reference": "4cfcd7a9fceba662b3c036b7d9a91f6197af046c", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2015-11-18 13:41:01" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": { - "majkl578/nette-identity-doctrine": 5 - }, - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">= 5.4.0" - }, - "platform-dev": [] -} diff --git a/nette/doctrine/notejam/log/.gitignore b/nette/doctrine/notejam/log/.gitignore deleted file mode 100644 index d6b7ef32c..000000000 --- a/nette/doctrine/notejam/log/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/nette/doctrine/notejam/src/Notejam/Http/RouterFactory.php b/nette/doctrine/notejam/src/Notejam/Http/RouterFactory.php deleted file mode 100644 index d3a6d7584..000000000 --- a/nette/doctrine/notejam/src/Notejam/Http/RouterFactory.php +++ /dev/null @@ -1,40 +0,0 @@ - 'signup', - 'User:signIn' => 'signin', - 'User:signOut' => 'signout', - 'User:forgottenPassword' => 'forgot-password', - 'User:settings' => 'settings', - ]); - - $router[] = new Route('pads/[/]', 'Pad:detail'); - $router[] = new Route('pads[/]', 'Pad:default'); - - $router[] = new Route('notes/[/]', 'Note:detail'); - $router[] = new Route('notes[/]', 'Note:'); - $router[] = new Route('[/]', 'Note:default'); - - return $router; - } - -} diff --git a/nette/doctrine/notejam/src/Notejam/Notes/Note.php b/nette/doctrine/notejam/src/Notejam/Notes/Note.php deleted file mode 100644 index 15f73eb96..000000000 --- a/nette/doctrine/notejam/src/Notejam/Notes/Note.php +++ /dev/null @@ -1,168 +0,0 @@ -user = $user; - } - - - - /** - * @param string $name - * @return Note - */ - public function setName($name) - { - $this->name = $name; - return $this; - } - - - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - - - /** - * @param string $text - * @return Note - */ - public function setText($text) - { - $this->text = $text; - return $this; - } - - - - /** - * @return string - */ - public function getText() - { - return $this->text; - } - - - - /** - * @return User - */ - public function getUser() - { - return $this->user; - } - - - - /** - * @return Pad - */ - public function getPad() - { - return $this->pad; - } - - - - /** - * @param Pad pad - * @return Note - */ - public function setPad(Pad $pad = null) - { - $this->pad = $pad; - return $this; - } - - - - /** - * @ORM\PrePersist - * @ORM\PreUpdate - */ - public function setUpdatedAt() - { - $this->updatedAt = new \DateTime('now'); - } - - - - /** - * @return \Datetime - */ - public function getUpdatedAt() - { - return clone $this->updatedAt; - } - - - - /** - * @return string - */ - public function __toString() - { - return $this->getName(); - } -} diff --git a/nette/doctrine/notejam/src/Notejam/Notes/NoteRepository.php b/nette/doctrine/notejam/src/Notejam/Notes/NoteRepository.php deleted file mode 100644 index 913e66baf..000000000 --- a/nette/doctrine/notejam/src/Notejam/Notes/NoteRepository.php +++ /dev/null @@ -1,34 +0,0 @@ - array('name' => 'ASC'), - '-name' => array('name' => 'DESC'), - 'updated_at' => array('updatedAt' => 'ASC'), - '-updated_at' => array('updatedAt' => 'DESC') - ]; - - return isset($ordering[$orderBy]) ? $ordering[$orderBy] : $ordering['name']; - } - -} diff --git a/nette/doctrine/notejam/src/Notejam/Pads/Pad.php b/nette/doctrine/notejam/src/Notejam/Pads/Pad.php deleted file mode 100644 index cdeec9b1a..000000000 --- a/nette/doctrine/notejam/src/Notejam/Pads/Pad.php +++ /dev/null @@ -1,105 +0,0 @@ -user = $user; - $this->notes = new ArrayCollection(); - } - - - - /** - * @param string $name - * @return Pad - */ - public function setName($name) - { - $this->name = $name; - return $this; - } - - - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - - - /** - * @return User - */ - public function getUser() - { - return $this->user; - } - - - - /** - * @param User user - * @return Pad - */ - public function setUser($user) - { - $this->user = $user; - return $this; - } - - - - /** - * @return string - */ - public function __toString() - { - return $this->getName(); - } - -} diff --git a/nette/doctrine/notejam/src/Notejam/Pads/PadRepository.php b/nette/doctrine/notejam/src/Notejam/Pads/PadRepository.php deleted file mode 100644 index 12b36c3cf..000000000 --- a/nette/doctrine/notejam/src/Notejam/Pads/PadRepository.php +++ /dev/null @@ -1,16 +0,0 @@ -setRenderer(new FormRenderer()); - - return $form; - } - -} diff --git a/nette/doctrine/notejam/src/Notejam/UI/FormRenderer.php b/nette/doctrine/notejam/src/Notejam/UI/FormRenderer.php deleted file mode 100644 index 8984181a6..000000000 --- a/nette/doctrine/notejam/src/Notejam/UI/FormRenderer.php +++ /dev/null @@ -1,29 +0,0 @@ -wrappers['error']['container'] = 'ul class=errorlist'; - $this->wrappers['control']['errorcontainer'] = 'ul class=errorlist'; - $this->wrappers['control']['erroritem'] = 'li'; - - // remove rendering in table - $this->wrappers['controls']['container'] = NULL; - $this->wrappers['pair']['container'] = NULL; - $this->wrappers['control']['container'] = NULL; - $this->wrappers['label']['container'] = NULL; - } - -} diff --git a/nette/doctrine/notejam/src/Notejam/Users/Authenticator.php b/nette/doctrine/notejam/src/Notejam/Users/Authenticator.php deleted file mode 100644 index 6634fdd2a..000000000 --- a/nette/doctrine/notejam/src/Notejam/Users/Authenticator.php +++ /dev/null @@ -1,49 +0,0 @@ -userRepository = $userRepository; - } - - - - /** - * Using the given email finds the user and verifies it's password. - * If the user is not fund or if the password is wrong, it throws. - * - * @param array $credentials - * @throws AuthenticationException - * @return User|NULL - */ - public function authenticate(array $credentials) - { - list($username, $password) = $credentials; - - if (!$user = $this->userRepository->findOneBy(['email' => $username])) { - throw new AuthenticationException("User '$username' not found.", self::IDENTITY_NOT_FOUND); - - } elseif (!$user->verifyPassword($password)) { - throw new AuthenticationException('Invalid password.', self::INVALID_CREDENTIAL); - } - - return $user; - } - -} diff --git a/nette/doctrine/notejam/src/Notejam/Users/User.php b/nette/doctrine/notejam/src/Notejam/Users/User.php deleted file mode 100644 index d1348a90c..000000000 --- a/nette/doctrine/notejam/src/Notejam/Users/User.php +++ /dev/null @@ -1,162 +0,0 @@ -email = $email; - $this->password = Passwords::hash($password); - $this->active = true; - - $this->pads = new ArrayCollection(); - $this->notes = new ArrayCollection(); - } - - - - /** - * List of string roles of the user. - * - * @return array - */ - public function getRoles() - { - return array('user'); - } - - - - /** - * @return string - */ - public function getEmail() - { - return $this->email; - } - - - - /** - * @return boolean - */ - public function isActive() - { - return $this->active; - } - - - - /** - * Changes the password, only if the right original password is provided. - * - * @param string $original - * @param string $password - * @throws InvalidPasswordException - */ - public function changePassword($original, $password) - { - if (!$this->verifyPassword($original)) { - throw new InvalidPasswordException('Wrong password'); - } - - $this->password = Passwords::hash($password); - } - - - - /** - * Generates a random password that can be used when the user forgots the orignal. - * In real app, this shouldn't overwrite the current password, - * it should be in another field, or even better a whole new table. - * - * @return string - */ - public function generateRandomPassword() - { - $password = Random::generate(10); - $this->password = Passwords::hash($password); - return $password; - } - - - - /** - * Verifies if given password is the same as the original hashed password. - * - * @param string $password - * @return bool - */ - public function verifyPassword($password) - { - return Passwords::verify($password, $this->password); - } - - - - /** - * If the password was hashed with too small cost, this method can tell you that, - * so you can regenerate the hash with higher cost. - * - * @return bool - */ - public function passwordNeedsRehash() - { - return Passwords::needsRehash($this->password); - } - -} diff --git a/nette/doctrine/notejam/src/Notejam/Users/UserRepository.php b/nette/doctrine/notejam/src/Notejam/Users/UserRepository.php deleted file mode 100644 index 50ce70d6e..000000000 --- a/nette/doctrine/notejam/src/Notejam/Users/UserRepository.php +++ /dev/null @@ -1,16 +0,0 @@ -amOnPage('/signin'); - $this->see('Sign in'); - $this->fillField("Email", $email); - $this->fillField("Password", $password); - $this->click('Sign in', ['css' => 'form.sign-in']); - } - -} diff --git a/nette/doctrine/notejam/tests/_support/FunctionalTester.php b/nette/doctrine/notejam/tests/_support/FunctionalTester.php deleted file mode 100644 index 7e888f8b2..000000000 --- a/nette/doctrine/notejam/tests/_support/FunctionalTester.php +++ /dev/null @@ -1,26 +0,0 @@ -wantTo('see note can be successfully created'); -$I->testLogin(); -$I->amOnPage('/notes/create'); -$I->fillField('Name', 'Example note'); -$I->fillField('Text', 'Lorem ipsum'); -$I->selectOption('Pad', 1); -$I->click('Save'); -$I->see('Example note'); diff --git a/nette/doctrine/notejam/tests/acceptance/CreateNoteFailCept.php b/nette/doctrine/notejam/tests/acceptance/CreateNoteFailCept.php deleted file mode 100644 index 4f768ee29..000000000 --- a/nette/doctrine/notejam/tests/acceptance/CreateNoteFailCept.php +++ /dev/null @@ -1,9 +0,0 @@ -wantTo('see note can not be created without required fields'); -$I->testLogin(); -$I->amOnPage('/notes/create'); -$I->click('Save'); -$I->seeInCurrentUrl('/notes/create'); -$I->see('Name is required'); -$I->see('Text is required'); diff --git a/nette/doctrine/notejam/tests/acceptance/CreatePadCept.php b/nette/doctrine/notejam/tests/acceptance/CreatePadCept.php deleted file mode 100644 index 4926950ba..000000000 --- a/nette/doctrine/notejam/tests/acceptance/CreatePadCept.php +++ /dev/null @@ -1,8 +0,0 @@ -wantTo('see pad can be successfully created'); -$I->testLogin(); -$I->amOnPage('/pads/create'); -$I->fillField('Name', 'Example pad'); -$I->click('Save'); -$I->see('Example pad'); diff --git a/nette/doctrine/notejam/tests/acceptance/CreatePadFailCept.php b/nette/doctrine/notejam/tests/acceptance/CreatePadFailCept.php deleted file mode 100644 index b8f61bbfa..000000000 --- a/nette/doctrine/notejam/tests/acceptance/CreatePadFailCept.php +++ /dev/null @@ -1,9 +0,0 @@ -wantTo('see pad can not be created without required fields'); -$I->testLogin(); -$I->amOnPage('/pads/create'); -$I->click('Save'); -$I->dontSee('Example pad'); -$I->seeInCurrentUrl('/pads/create'); -$I->see('Name is required'); diff --git a/nette/doctrine/notejam/tests/acceptance/DeleteNoteCept.php b/nette/doctrine/notejam/tests/acceptance/DeleteNoteCept.php deleted file mode 100644 index fb718c70c..000000000 --- a/nette/doctrine/notejam/tests/acceptance/DeleteNoteCept.php +++ /dev/null @@ -1,7 +0,0 @@ -wantTo('see note can be successfully deleted'); -$I->testLogin(); -$I->amOnPage('/notes/1/delete'); -$I->click('Yes, I want to delete this note'); -$I->dontSee('Note 1'); diff --git a/nette/doctrine/notejam/tests/acceptance/DeleteOtherOwnersNoteCept.php b/nette/doctrine/notejam/tests/acceptance/DeleteOtherOwnersNoteCept.php deleted file mode 100644 index f9f262da0..000000000 --- a/nette/doctrine/notejam/tests/acceptance/DeleteOtherOwnersNoteCept.php +++ /dev/null @@ -1,6 +0,0 @@ -wantTo('see note can not be deleted by not an owner'); -$I->testLogin(); -$I->amOnPage('/notes/5/delete'); -$I->dontSee('Yes, I want to delete this note'); diff --git a/nette/doctrine/notejam/tests/acceptance/DeleteOtherOwnersPadCept.php b/nette/doctrine/notejam/tests/acceptance/DeleteOtherOwnersPadCept.php deleted file mode 100644 index 531887afe..000000000 --- a/nette/doctrine/notejam/tests/acceptance/DeleteOtherOwnersPadCept.php +++ /dev/null @@ -1,6 +0,0 @@ -wantTo('see pad can not be deleted by not an owner'); -$I->testLogin(); -$I->amOnPage('/pads/4/delete'); -$I->dontSee('Yes, I want to delete this pad'); diff --git a/nette/doctrine/notejam/tests/acceptance/DeletePadCept.php b/nette/doctrine/notejam/tests/acceptance/DeletePadCept.php deleted file mode 100644 index f86354c75..000000000 --- a/nette/doctrine/notejam/tests/acceptance/DeletePadCept.php +++ /dev/null @@ -1,7 +0,0 @@ -wantTo('see pad can be successfully deleted'); -$I->testLogin(); -$I->amOnPage('/pads/1/delete'); -$I->click('Yes, I want to delete this pad'); -$I->dontSee('Pad 1'); diff --git a/nette/doctrine/notejam/tests/acceptance/EditNoteCept.php b/nette/doctrine/notejam/tests/acceptance/EditNoteCept.php deleted file mode 100644 index 9012a2e35..000000000 --- a/nette/doctrine/notejam/tests/acceptance/EditNoteCept.php +++ /dev/null @@ -1,12 +0,0 @@ -wantTo('see note can be successfully edited'); -$I->testLogin(); -$I->amOnPage('/notes/1/edit'); -$I->fillField('Name', 'Note 1 - edited'); -$I->fillField('Text', 'Lorem ipsum - edited'); -$I->selectOption('Pad', 1); -$I->click('Save'); -$I->see('Note 1 - edited'); -$I->amOnPage('/pads/1'); -$I->see('Note 1 - edited'); diff --git a/nette/doctrine/notejam/tests/acceptance/EditNoteFailCept.php b/nette/doctrine/notejam/tests/acceptance/EditNoteFailCept.php deleted file mode 100644 index f921f1475..000000000 --- a/nette/doctrine/notejam/tests/acceptance/EditNoteFailCept.php +++ /dev/null @@ -1,11 +0,0 @@ -wantTo('see note can not be edited without required fields'); -$I->testLogin(); -$I->amOnPage('/notes/1/edit'); -$I->fillField('Name', ''); -$I->fillField('Text', ''); -$I->click('Save'); -$I->seeInCurrentUrl('/notes/1/edit'); -$I->see('Name is required'); -$I->see('Text is required'); diff --git a/nette/doctrine/notejam/tests/acceptance/EditOtherOwnersNoteCept.php b/nette/doctrine/notejam/tests/acceptance/EditOtherOwnersNoteCept.php deleted file mode 100644 index 23d00f608..000000000 --- a/nette/doctrine/notejam/tests/acceptance/EditOtherOwnersNoteCept.php +++ /dev/null @@ -1,6 +0,0 @@ -wantTo('see note can not be edited by not an owner'); -$I->testLogin(); -$I->amOnPage('/notes/5/edit'); -$I->dontSee('Save', 'input'); diff --git a/nette/doctrine/notejam/tests/acceptance/EditOtherOwnersPadCept.php b/nette/doctrine/notejam/tests/acceptance/EditOtherOwnersPadCept.php deleted file mode 100644 index 227f97916..000000000 --- a/nette/doctrine/notejam/tests/acceptance/EditOtherOwnersPadCept.php +++ /dev/null @@ -1,6 +0,0 @@ -wantTo('see pad can not be edited by not an owner'); -$I->testLogin(); -$I->amOnPage('/pads/4/edit'); -$I->dontSee('Save', 'input'); diff --git a/nette/doctrine/notejam/tests/acceptance/EditPadCept.php b/nette/doctrine/notejam/tests/acceptance/EditPadCept.php deleted file mode 100644 index 923c9cc95..000000000 --- a/nette/doctrine/notejam/tests/acceptance/EditPadCept.php +++ /dev/null @@ -1,8 +0,0 @@ -wantTo('see pad can be successfully edited'); -$I->testLogin(); -$I->amOnPage('/pads/1/edit'); -$I->fillField('Name', 'Pad 1 - edited'); -$I->click('Save'); -$I->see('Pad 1 - edited'); diff --git a/nette/doctrine/notejam/tests/acceptance/EditPadFailCept.php b/nette/doctrine/notejam/tests/acceptance/EditPadFailCept.php deleted file mode 100644 index a6614b736..000000000 --- a/nette/doctrine/notejam/tests/acceptance/EditPadFailCept.php +++ /dev/null @@ -1,9 +0,0 @@ -wantTo('see pad cannot be edited without required fields'); -$I->testLogin(); -$I->amOnPage('/pads/1/edit'); -$I->fillField('Name', ''); -$I->click('Save'); -$I->seeInCurrentUrl('/pads/1/edit'); -$I->see('Name is required'); diff --git a/nette/doctrine/notejam/tests/acceptance/ForgottenPasswordCept.php b/nette/doctrine/notejam/tests/acceptance/ForgottenPasswordCept.php deleted file mode 100644 index aaeccdc3c..000000000 --- a/nette/doctrine/notejam/tests/acceptance/ForgottenPasswordCept.php +++ /dev/null @@ -1,7 +0,0 @@ -wantTo('see user can successfully get new password'); -$I->amOnPage('/forgot-password'); -$I->fillField('Email', 'john.doe@example.com'); -$I->click('Get new password'); -$I->see('Sign in'); diff --git a/nette/doctrine/notejam/tests/acceptance/ForgottenPasswordInvalidEmailCept.php b/nette/doctrine/notejam/tests/acceptance/ForgottenPasswordInvalidEmailCept.php deleted file mode 100644 index 2be0e84ab..000000000 --- a/nette/doctrine/notejam/tests/acceptance/ForgottenPasswordInvalidEmailCept.php +++ /dev/null @@ -1,7 +0,0 @@ -wantTo('see user can not successfully get new password with invalid email'); -$I->amOnPage('/forgot-password'); -$I->fillField('Email', 'invalid'); -$I->click('Get new password'); -$I->see('Invalid email'); diff --git a/nette/doctrine/notejam/tests/acceptance/ForgottenPasswordUnregisteredEmailCept.php b/nette/doctrine/notejam/tests/acceptance/ForgottenPasswordUnregisteredEmailCept.php deleted file mode 100644 index 1ef96e58d..000000000 --- a/nette/doctrine/notejam/tests/acceptance/ForgottenPasswordUnregisteredEmailCept.php +++ /dev/null @@ -1,7 +0,0 @@ -wantTo('see user can not successfully get new password with unregistered email'); -$I->amOnPage('/forgot-password'); -$I->fillField('Email', 'invalid@example.com'); -$I->click('Get new password'); -$I->see("User with given email doesn't exist"); diff --git a/nette/doctrine/notejam/tests/acceptance/HomepageCept.php b/nette/doctrine/notejam/tests/acceptance/HomepageCept.php deleted file mode 100644 index c7c7afd42..000000000 --- a/nette/doctrine/notejam/tests/acceptance/HomepageCept.php +++ /dev/null @@ -1,8 +0,0 @@ -wantTo('see notes can be viewed successfully'); -$I->amOnPage('/'); -$I->seeInCurrentUrl('/signin'); -$I->testLogin(); -$I->seeCurrentUrlEquals('/'); -$I->see('My pads'); diff --git a/nette/doctrine/notejam/tests/acceptance/NoteDetailCept.php b/nette/doctrine/notejam/tests/acceptance/NoteDetailCept.php deleted file mode 100644 index 55c890c63..000000000 --- a/nette/doctrine/notejam/tests/acceptance/NoteDetailCept.php +++ /dev/null @@ -1,7 +0,0 @@ -wantTo('see note can be viewed successfully'); -$I->testLogin(); -$I->amOnPage('/notes/1'); -$I->see('Note 1'); -$I->see('Lorem ipsum'); diff --git a/nette/doctrine/notejam/tests/acceptance/OtherOwnersNoteDetailCept.php b/nette/doctrine/notejam/tests/acceptance/OtherOwnersNoteDetailCept.php deleted file mode 100644 index 2e65f0224..000000000 --- a/nette/doctrine/notejam/tests/acceptance/OtherOwnersNoteDetailCept.php +++ /dev/null @@ -1,7 +0,0 @@ -wantTo('see note can not be viewed by not an owner'); -$I->testLogin(); -$I->amOnPage('/notes/5'); -$I->dontSee('Other Note'); -$I->dontSee('Lorem ipsum'); diff --git a/nette/doctrine/notejam/tests/acceptance/OtherOwnersPadDetailCept.php b/nette/doctrine/notejam/tests/acceptance/OtherOwnersPadDetailCept.php deleted file mode 100644 index e169ae94f..000000000 --- a/nette/doctrine/notejam/tests/acceptance/OtherOwnersPadDetailCept.php +++ /dev/null @@ -1,6 +0,0 @@ -wantTo('see pad can not be viewed by not an owner'); -$I->testLogin(); -$I->amOnPage('/pads/4'); -$I->dontSee('Other Pad'); diff --git a/nette/doctrine/notejam/tests/acceptance/PadDetailCept.php b/nette/doctrine/notejam/tests/acceptance/PadDetailCept.php deleted file mode 100644 index cc00bcf9a..000000000 --- a/nette/doctrine/notejam/tests/acceptance/PadDetailCept.php +++ /dev/null @@ -1,7 +0,0 @@ -wantTo('see pad can be viewed'); -$I->testLogin(); -$I->amOnPage('/pads/1'); -$I->see('Pad 1'); -$I->see('Note 2'); // Note 2 belongs to Pad 1 diff --git a/nette/doctrine/notejam/tests/acceptance/SetNewPasswordCept.php b/nette/doctrine/notejam/tests/acceptance/SetNewPasswordCept.php deleted file mode 100644 index 70c1ed8ef..000000000 --- a/nette/doctrine/notejam/tests/acceptance/SetNewPasswordCept.php +++ /dev/null @@ -1,10 +0,0 @@ -wantTo('see user can successfully set new password'); -$I->testLogin(); -$I->amOnPage('/settings'); -$I->fillField('Current password', 'pass'); -$I->fillField('New password', 'qwerty'); -$I->fillField('Confirm', 'qwerty'); -$I->click('Change password'); -$I->see('Account settings'); diff --git a/nette/doctrine/notejam/tests/acceptance/SetNewPasswordFailCept.php b/nette/doctrine/notejam/tests/acceptance/SetNewPasswordFailCept.php deleted file mode 100644 index 26ee270fd..000000000 --- a/nette/doctrine/notejam/tests/acceptance/SetNewPasswordFailCept.php +++ /dev/null @@ -1,11 +0,0 @@ -wantTo('see user can not set new password without required fields'); -$I->testLogin(); -$I->amOnPage('/settings'); -$I->fillField('Current password', ''); -$I->fillField('New password', ''); -$I->fillField('Confirm', ''); -$I->click('Change password'); -$I->see('Current password is required'); -$I->see('New password is required'); diff --git a/nette/doctrine/notejam/tests/acceptance/SetNewPasswordInvalidCurrentPasswordCept.php b/nette/doctrine/notejam/tests/acceptance/SetNewPasswordInvalidCurrentPasswordCept.php deleted file mode 100644 index a7aabf0af..000000000 --- a/nette/doctrine/notejam/tests/acceptance/SetNewPasswordInvalidCurrentPasswordCept.php +++ /dev/null @@ -1,10 +0,0 @@ -wantTo('see user can not set new password with invalid current password'); -$I->testLogin(); -$I->amOnPage('/settings'); -$I->fillField('Current password', 'pls'); -$I->fillField('New password', 'pass'); -$I->fillField('Confirm', 'pass'); -$I->click('Change password'); -$I->see('Invalid current password'); diff --git a/nette/doctrine/notejam/tests/acceptance/SetNewPasswordMismatchCept.php b/nette/doctrine/notejam/tests/acceptance/SetNewPasswordMismatchCept.php deleted file mode 100644 index 1ded09583..000000000 --- a/nette/doctrine/notejam/tests/acceptance/SetNewPasswordMismatchCept.php +++ /dev/null @@ -1,10 +0,0 @@ -wantTo('see user can not set new password without confirming new password'); -$I->testLogin(); -$I->amOnPage('/settings'); -$I->fillField('Current password', 'pass'); -$I->fillField('New password', 'pls'); -$I->fillField('Confirm', 'pass'); -$I->click('Change password'); -$I->see('New passwords must match'); diff --git a/nette/doctrine/notejam/tests/acceptance/SignInCept.php b/nette/doctrine/notejam/tests/acceptance/SignInCept.php deleted file mode 100644 index bae44a2a5..000000000 --- a/nette/doctrine/notejam/tests/acceptance/SignInCept.php +++ /dev/null @@ -1,5 +0,0 @@ -wantTo('see user can successfully sign in'); -$I->testLogin(); -$I->see("My pads"); diff --git a/nette/doctrine/notejam/tests/acceptance/SignInFailCept.php b/nette/doctrine/notejam/tests/acceptance/SignInFailCept.php deleted file mode 100644 index e123b018e..000000000 --- a/nette/doctrine/notejam/tests/acceptance/SignInFailCept.php +++ /dev/null @@ -1,10 +0,0 @@ -wantTo('see user can not sign in without required fields'); -$I->amOnPage('/signin'); -$I->see('Sign in'); -$I->fillField("Email", ''); -$I->fillField("Password", ''); -$I->click('Sign in', ['css' => 'form.sign-in']); -$I->see('Email is required'); -$I->see('Password is required'); diff --git a/nette/doctrine/notejam/tests/acceptance/SignInInvalidEmailCept.php b/nette/doctrine/notejam/tests/acceptance/SignInInvalidEmailCept.php deleted file mode 100644 index 0298b64a8..000000000 --- a/nette/doctrine/notejam/tests/acceptance/SignInInvalidEmailCept.php +++ /dev/null @@ -1,5 +0,0 @@ -wantTo('see user can not sign in with invalid email'); -$I->testLogin('invalid@example.com', 'pass'); -$I->see("User 'invalid@example.com' not found."); diff --git a/nette/doctrine/notejam/tests/acceptance/SignInInvalidPasswordCept.php b/nette/doctrine/notejam/tests/acceptance/SignInInvalidPasswordCept.php deleted file mode 100644 index 2e8b58871..000000000 --- a/nette/doctrine/notejam/tests/acceptance/SignInInvalidPasswordCept.php +++ /dev/null @@ -1,5 +0,0 @@ -wantTo('see user can not sign in with invalid password'); -$I->testLogin('john.doe@example.com', 'pls'); -$I->see('Invalid password'); diff --git a/nette/doctrine/notejam/tests/acceptance/SignUpAlreadyExistsCept.php b/nette/doctrine/notejam/tests/acceptance/SignUpAlreadyExistsCept.php deleted file mode 100644 index 5e92ec0a7..000000000 --- a/nette/doctrine/notejam/tests/acceptance/SignUpAlreadyExistsCept.php +++ /dev/null @@ -1,10 +0,0 @@ -wantTo('see user can not sign up with already registered email'); -$I->amOnPage('/signup'); -$I->fillField('Email', 'john.doe@example.com'); -$I->fillField('Password', 'pass'); -$I->fillField('confirm', 'pass'); -$I->click('Sign up', ['css' => 'form']); -$I->seeInCurrentUrl('/signup'); -$I->see('Account with this email already exists'); diff --git a/nette/doctrine/notejam/tests/acceptance/SignUpCept.php b/nette/doctrine/notejam/tests/acceptance/SignUpCept.php deleted file mode 100644 index df11ed43e..000000000 --- a/nette/doctrine/notejam/tests/acceptance/SignUpCept.php +++ /dev/null @@ -1,13 +0,0 @@ -wantTo('see user can successfully sign up'); -$I->amOnPage('/signup'); -$I->fillField('Email', 'test@example.com'); -$I->fillField('Password', 'qwerty'); -$I->fillField('confirm', 'qwerty'); -$I->click('Sign up', ['css' => 'form']); -$I->seeInCurrentUrl('/signin'); -$I->see('Thank you for registration. Now you can sign in'); -$I->testLogin('test@example.com', 'qwerty'); -$I->seeCurrentUrlEquals('/'); -$I->see('My pads'); diff --git a/nette/doctrine/notejam/tests/acceptance/SignUpFailCept.php b/nette/doctrine/notejam/tests/acceptance/SignUpFailCept.php deleted file mode 100644 index 250b1cd83..000000000 --- a/nette/doctrine/notejam/tests/acceptance/SignUpFailCept.php +++ /dev/null @@ -1,11 +0,0 @@ -wantTo('see user can not sign up without required fields'); -$I->amOnPage('/signup'); -$I->fillField('Email', ''); -$I->fillField('Password', ''); -$I->fillField('confirm', ''); -$I->click('Sign up', ['css' => 'form']); -$I->seeInCurrentUrl('/signup'); -$I->see('Email is required'); -$I->see('Password is required'); diff --git a/nette/doctrine/notejam/tests/acceptance/SignUpInvalidEmailCept.php b/nette/doctrine/notejam/tests/acceptance/SignUpInvalidEmailCept.php deleted file mode 100644 index 1cc57ad1e..000000000 --- a/nette/doctrine/notejam/tests/acceptance/SignUpInvalidEmailCept.php +++ /dev/null @@ -1,10 +0,0 @@ -wantTo('see user can not sign up with invalid email'); -$I->amOnPage('/signup'); -$I->fillField('Email', 'abcd'); -$I->fillField('Password', 'pass'); -$I->fillField('confirm', 'pass'); -$I->click('Sign up', ['css' => 'form']); -$I->seeInCurrentUrl('/signup'); -$I->see('Please enter a valid email address.'); diff --git a/nette/doctrine/notejam/tests/acceptance/SignUpPasswordMismatchCept.php b/nette/doctrine/notejam/tests/acceptance/SignUpPasswordMismatchCept.php deleted file mode 100644 index e1e083f19..000000000 --- a/nette/doctrine/notejam/tests/acceptance/SignUpPasswordMismatchCept.php +++ /dev/null @@ -1,10 +0,0 @@ -wantTo('see user can not sign up without confirming password'); -$I->amOnPage('/signup'); -$I->fillField('Email', 'test@example.com'); -$I->fillField('Password', 'pass'); -$I->fillField('confirm', 'pls'); -$I->click('Sign up', ['css' => 'form']); -$I->seeInCurrentUrl('/signup'); -$I->see('Passwords must match'); diff --git a/nette/doctrine/notejam/tests/acceptance/_bootstrap.php b/nette/doctrine/notejam/tests/acceptance/_bootstrap.php deleted file mode 100644 index 8a8855580..000000000 --- a/nette/doctrine/notejam/tests/acceptance/_bootstrap.php +++ /dev/null @@ -1,2 +0,0 @@ - - Options -Indexes - - -# enable cool URL - - RewriteEngine On - # RewriteBase / - - # prevents files starting with dot to be viewed by browser - RewriteRule /\.|^\. - [F] - - # front controller - RewriteCond %{REQUEST_FILENAME} !-f - RewriteCond %{REQUEST_FILENAME} !-d - RewriteRule !\.(pdf|js|ico|gif|jpg|png|css|rar|zip|tar\.gz|map)$ index.php [L] - - -# enable gzip compression - - - AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript application/json application/xml image/svg+xml - - diff --git a/nette/doctrine/notejam/www/.maintenance.php b/nette/doctrine/notejam/www/.maintenance.php deleted file mode 100644 index 2ff638cb3..000000000 --- a/nette/doctrine/notejam/www/.maintenance.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - -Site is temporarily down for maintenance - -

We're Sorry

- -

The site is temporarily down for maintenance. Please try again in a few minutes.

- -div { - display: none; } - - - /* Grid */ - #grid .column, - #grid .columns { - background: #ddd; - height: 25px; - line-height: 25px; - margin-bottom: 10px; - text-align: center; - text-transform: uppercase; - color: #555; - font-size: 12px; - font-weight: bold; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; } - #grid .column:hover, - #grid .columns:hover { - background: #bbb; - color: #333; } - #grid .example-grid { overflow: hidden; } - - .post-button-note, - .post-button-note a { - font-size: 11px; - color: #999; } - - #examples .four.columns a { - text-decoration: none; - } - #examples .four.columns a:hover { - text-decoration: underline; - } - - - .resize { - position: fixed; - bottom: 0; - right: 0; - height: 80px; - width: 80px; - background: url(images/resize.png); } - - - img { - max-width: 100%; - height: auto; } - - .gist-meta { display: none !important;} - - ul ul ul li { margin-bottom: 3px; } - - .twitter-share-button { margin-bottom: -18px; } - - /* Table stylesheets */ - table { - width: 100%; - border-collapse: collapse; - } - - table th, table td { - padding: 10px 10px 9px; - font-size: 13px; - line-height: 18px; - text-align: left; - } - - table td { - vertical-align: top; - border-top: solid 1px #ddd; - } - - table th { - padding-top: 9px; - font-weight: bold; - vertical-align: middle; - } - - table.condensed th, table.condensed td { - padding: 5px 5px 4px; - } - - table.bordered { - border-collapse: separate; - border: solid 1px #ddd; - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; - } - - table.bordered th + th, - table.bordered th + td, - table.bordered td + td { - border-left: solid 1px #ddd; - } - - .zebra-striped tbody tr:nth-child(odd) td, - .zebra-striped tbody tr:nth-child(odd) th { - background: #f5f5f5; - } - -.carbonad, -.carbonad-image, -.carbonad-text, -.carbonad-tag { - background: none !important; - border: none !important; - margin-left: 0 !important; -} -.carbonad-tag { - margin-top: 6px !important; - padding-top: 0 !important; -} -.carbonad-text { - height: auto !important; -} -.carbonad-image { - margin-top: 0 !important; -} - -.hidden-text { - font-size: 12px; - color: #999; -} - -td.date, th.date { - text-align: right; -} - -td.date { - font-style: italic; -} - -form.note input[type="text"], form.note textarea { - width: 100%; -} - -form hr { - width: 218px; - margin: 10px 0px; -} - -form.note textarea { - height: 250px; -} - -div.content-area { - min-height: 600px; -} - -hr.footer { - margin-bottom: 10px; -} - -div.footer { - margin-bottom: 10px; - text-align: center; - font-size: 12px; -} - -form.sign-in { - margin: 50px 0 0 0; -} - -.sort_arrow { - text-decoration: none; -} - -.sort_arrow:hover { - text-decoration: none; - color: red; -} - -div.sign-in-out-block { - position: absolute; - right: 14px; - top: 8px; - font-size: 12px; -} - -div.sign-in-out-block a { - /*text-decoration: none;*/ -} - -a.small-red { - color: red; - font-size: 12px; -} - -table.notes { - margin: 0 0 20px 0; -} - -table.notes th.note { - width: 72%; -} - -table.notes td.pad { - color: grey; -} - -table.notes td.pad a { - color: grey; - text-decoration: underline; - font-style: normal; -} - - -table.notes td.pad a:hover { - color: black; -} - -p.empty { - color: grey; - font-style: italic; -} - -a.delete-note { - float: right; - font-size: 12px; - color: red; -} - -.red, input.red { - color: red !important; -} - -ul.errorlist, ul.errors { - margin: -18px 0 0 0; -} - -ul.errorlist li, ul.errors li { - color: red; -} - -.alert-area { - text-align: center; -} - -.alert { - padding: 5px 8px; - margin: 0 0 12px 0; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; -} - -.alert-success { - color: #468847; - background-color: #dff0d8; - border: 1px solid #d6e9c6; -} - -.alert-error { - color: #b94a48; - background-color: #f2dede; - border: 1px solid #eed3d7; -} - - /* Mobile */ - @media only screen and (max-width: 767px) { - header h1 { font-size: 34px; line-height: 37px; } - nav { position: relative; } - nav ul, - .carbonad { - display: none; - } - #logo { text-align: left; } - #examples .four.columns { - padding-top: 30px; - } - } - - /* Mobile Landscape */ - @media only screen and (min-width: 480px) and (max-width: 767px) { - nav ul { - display: none; - } - } - - /* Non 960 */ - @media only screen and (max-width: 959px) { - #logo { - font-size: 21px; - margin-bottom: 15px; } - nav .button { - padding: 9px 20px 11px; } - } - - /* iPad Portrait/Browser */ - @media only screen and (min-width: 768px) and (max-width: 959px) { - nav { - width: 124px; } - } - - /* Mobile/Browser */ - @media only screen and (max-width: 767px) {} - - /* Mobile Landscape/Browser */ - @media only screen and (min-width: 480px) and (max-width: 767px) {} - - /* Anything smaller than standard 960 */ - @media only screen and (max-width: 959px) {} - - - /* iPad Portrait Only */ - @media only screen and (min-width: 768px) and (max-width: 959px) and (max-device-width: 1000px) {} - - /* Mobile Only */ - @media only screen and (max-width: 767px) and (max-device-width: 1000px) {} - - /* Mobile Landscape Only */ - @media only screen and (min-width: 480px) and (max-width: 767px) and (max-device-width: 1000px) {} - - /* Anything smaller than standard 960 on a device */ - @media only screen and (max-width: 959px) and (max-device-width: 1000px) { - .resize { display: none; } - } - diff --git a/nette/doctrine/notejam/www/favicon.ico b/nette/doctrine/notejam/www/favicon.ico deleted file mode 100644 index b20cfd0f0..000000000 Binary files a/nette/doctrine/notejam/www/favicon.ico and /dev/null differ diff --git a/nette/doctrine/notejam/www/index.php b/nette/doctrine/notejam/www/index.php deleted file mode 100644 index 26a5aebd0..000000000 --- a/nette/doctrine/notejam/www/index.php +++ /dev/null @@ -1,8 +0,0 @@ -getByType('Nette\Application\Application')->run(); diff --git a/nette/doctrine/notejam/www/robots.txt b/nette/doctrine/notejam/www/robots.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/nette/native_db/notejam/.gitignore b/nette/native_db/notejam/.gitignore deleted file mode 100644 index 32b40f1f6..000000000 --- a/nette/native_db/notejam/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -log/* -temp/* -vendor/* -!.gitignore -app/config/config.local.neon - -tests/_output/* diff --git a/nette/native_db/notejam/app/bootstrap.php b/nette/native_db/notejam/app/bootstrap.php deleted file mode 100644 index 8fd851263..000000000 --- a/nette/native_db/notejam/app/bootstrap.php +++ /dev/null @@ -1,21 +0,0 @@ -setDebugMode('23.75.345.200'); // enable for your remote IP -$configurator->enableDebugger(__DIR__ . '/../log'); - -$configurator->setTempDirectory(__DIR__ . '/../temp'); - -$configurator->createRobotLoader() - ->addDirectory(__DIR__) - ->register(); - -$configurator->addConfig(__DIR__ . '/config/config.neon'); -$configurator->addConfig(__DIR__ . '/config/config.local.neon'); - -$container = $configurator->createContainer(); - -return $container; diff --git a/nette/native_db/notejam/app/components/Notes/INotesFactory.php b/nette/native_db/notejam/app/components/Notes/INotesFactory.php deleted file mode 100644 index 375c2e520..000000000 --- a/nette/native_db/notejam/app/components/Notes/INotesFactory.php +++ /dev/null @@ -1,18 +0,0 @@ - - - - Note - - - Pad - - Last modified - - - - - {$note->name} - - {if $note->pad_id} - {$note->pad->name} - {else} - No pad - {/if} - - {$note->updated_at|date:'d. M. Y'} - - diff --git a/nette/native_db/notejam/app/components/Notes/Notes.php b/nette/native_db/notejam/app/components/Notes/Notes.php deleted file mode 100644 index 5ebb20fc3..000000000 --- a/nette/native_db/notejam/app/components/Notes/Notes.php +++ /dev/null @@ -1,42 +0,0 @@ -notes = $notes; - $this->pad = $pad; - } - - - /** - * Renders the component. - */ - public function render() - { - $template = $this->createTemplate(); - $template->setFile(__DIR__ . '/Notes.latte'); - $template->notes = $this->notes; - $template->pad = $this->pad; - $template->render(); - } - -} diff --git a/nette/native_db/notejam/app/components/Pads/IPadsFactory.php b/nette/native_db/notejam/app/components/Pads/IPadsFactory.php deleted file mode 100644 index 351e360bd..000000000 --- a/nette/native_db/notejam/app/components/Pads/IPadsFactory.php +++ /dev/null @@ -1,15 +0,0 @@ - - - - diff --git a/nette/native_db/notejam/app/components/Pads/Pads.php b/nette/native_db/notejam/app/components/Pads/Pads.php deleted file mode 100644 index bd7f96bba..000000000 --- a/nette/native_db/notejam/app/components/Pads/Pads.php +++ /dev/null @@ -1,35 +0,0 @@ -pads = $pads; - } - - - /** - * Renders the component. - */ - public function render() - { - $template = $this->createTemplate(); - $template->setFile(__DIR__ . '/Pads.latte'); - $template->pads = $this->pads; - $template->render(); - } - -} diff --git a/nette/native_db/notejam/app/components/UserBar/IUserBarFactory.php b/nette/native_db/notejam/app/components/UserBar/IUserBarFactory.php deleted file mode 100644 index efa689371..000000000 --- a/nette/native_db/notejam/app/components/UserBar/IUserBarFactory.php +++ /dev/null @@ -1,14 +0,0 @@ - - - diff --git a/nette/native_db/notejam/app/components/UserBar/UserBar.php b/nette/native_db/notejam/app/components/UserBar/UserBar.php deleted file mode 100644 index adf2d82e2..000000000 --- a/nette/native_db/notejam/app/components/UserBar/UserBar.php +++ /dev/null @@ -1,35 +0,0 @@ -user = $user; - } - - /** - * Renders the component. - */ - public function render() - { - $template = $this->createTemplate(); - $template->setFile(__DIR__ . '/UserBar.latte'); - $template->render(); - } - -} diff --git a/nette/native_db/notejam/app/config/config.example.neon b/nette/native_db/notejam/app/config/config.example.neon deleted file mode 100644 index 24dfdf1f0..000000000 --- a/nette/native_db/notejam/app/config/config.example.neon +++ /dev/null @@ -1,3 +0,0 @@ -parameters: - database: - dsn: 'sqlite:%appDir%/../notejam.db' diff --git a/nette/native_db/notejam/app/config/config.neon b/nette/native_db/notejam/app/config/config.neon deleted file mode 100644 index d1a5d2533..000000000 --- a/nette/native_db/notejam/app/config/config.neon +++ /dev/null @@ -1,45 +0,0 @@ -# -# WARNING: it is CRITICAL that this file & directory are NOT accessible directly via a web browser! -# https://nette.org/security-warning -# -parameters: - - -php: - date.timezone: Europe/Prague - - -application: - errorPresenter: Error - mapping: - *: App\*Module\Presenters\*Presenter - - -session: - expiration: 14 days - - -database: - dsn: %database.dsn% - options: - lazy: yes - - -services: - - App\Model\UserManager - - App\Model\NoteManager - - App\Model\PadManager - - App\Components\Notes\INotesFactory - - App\Components\Pads\IPadsFactory - - App\Components\UserBar\IUserBarFactory - - App\Forms\Account\AccountSettingsFormFactory - - App\Forms\Note\DeleteNoteFormFactory - - App\Forms\Note\EditNoteFormFactory - - App\Forms\Note\NewNoteFormFactory - - App\Forms\Pad\DeletePadFormFactory - - App\Forms\Pad\EditPadFormFactory - - App\Forms\Pad\NewPadFormFactory - - App\Forms\Sign\ForgottenPasswordFormFactory - - App\Forms\Sign\SignInFormFactory - - App\Forms\Sign\SignUpFormFactory - router: App\RouterFactory::createRouter diff --git a/nette/native_db/notejam/app/forms/Account/AccountSettingsFormFactory.php b/nette/native_db/notejam/app/forms/Account/AccountSettingsFormFactory.php deleted file mode 100644 index 14a3e12f5..000000000 --- a/nette/native_db/notejam/app/forms/Account/AccountSettingsFormFactory.php +++ /dev/null @@ -1,69 +0,0 @@ -userManager = $userManager; - $this->user = $user; - } - - /** - * Creates Account Settings Form. - * @return Form - */ - public function create() - { - $form = new Form; - $form->addPassword('current', 'Current password') - ->setRequired('%label is required'); - - $form->addPassword('new', 'New Password') - ->setRequired('%label is required'); - - $form->addPassword('confirm', 'Confirm New Password') - ->setRequired('New password is required') - ->addRule(Form::EQUAL, 'New passwords must match', $form['new']); - - $form->addSubmit('submit', 'Change Password'); - - $form->onSuccess[] = [$this, 'formSucceeded']; - - return $form; - } - - /** - * Callback for Account Settings Form onSuccess event. - * @param Form $form - * @param ArrayHash $values - */ - public function formSucceeded(Form $form, $values) - { - if (!$this->userManager->checkPassword($this->user->getId(), $values->current)) { - $form->addError("Invalid current password"); - } - $this->userManager->setNewPassword($this->user->getId(), $values->new); - } - -} diff --git a/nette/native_db/notejam/app/forms/Note/DeleteNoteFormFactory.php b/nette/native_db/notejam/app/forms/Note/DeleteNoteFormFactory.php deleted file mode 100644 index 1adb01b4e..000000000 --- a/nette/native_db/notejam/app/forms/Note/DeleteNoteFormFactory.php +++ /dev/null @@ -1,45 +0,0 @@ -noteManager = $noteManager; - } - - /** - * Creates a DeleteNoteForm. - * @param int $id Id of the note to be deleted. - * @return Form - */ - public function create($id) - { - $form = new Form; - $form->addProtection(); // Adds CSRF protection - - $form->addSubmit('submit', 'Yes, I want to delete this note'); - - $form->onSuccess[] = function (Form $form) use ($id) { - if (!$this->noteManager->delete($id)) { - $form->addError("Failed to delete note"); - } - }; - - return $form; - } - -} diff --git a/nette/native_db/notejam/app/forms/Note/EditNoteFormFactory.php b/nette/native_db/notejam/app/forms/Note/EditNoteFormFactory.php deleted file mode 100644 index 894a43b81..000000000 --- a/nette/native_db/notejam/app/forms/Note/EditNoteFormFactory.php +++ /dev/null @@ -1,65 +0,0 @@ -padManager = $padManager; - $this->noteManager = $noteManager; - } - - /** - * Creates an EditNoteForm. - * @param int $id - * @param string $name - * @param string $text - * @param int $pad - * @return Form - */ - public function create($id, $name, $text, $pad) - { - $form = new Form; - $form->addText('name', 'Name') - ->setDefaultValue($name) - ->setRequired('%label is required'); - - $form->addTextArea('text', 'Text') - ->setDefaultValue($text) - ->setRequired('%label is required'); - - $form->addSelect('pad', 'Pad', $this->padManager->findAll()->fetchPairs('id', 'name')) - ->setPrompt('Select pad') - ->setDefaultValue($pad); - - $form->addSubmit('submit', 'Save'); - - $form->onSuccess[] = function (Form $form, $values) use ($id) { - if (!$this->noteManager->update($id, $values->name, $values->text, $values->pad)) { - $form->addError("Failed to edit pad"); - } - }; - - return $form; - } - -} diff --git a/nette/native_db/notejam/app/forms/Note/NewNoteFormFactory.php b/nette/native_db/notejam/app/forms/Note/NewNoteFormFactory.php deleted file mode 100644 index b99d46fb0..000000000 --- a/nette/native_db/notejam/app/forms/Note/NewNoteFormFactory.php +++ /dev/null @@ -1,68 +0,0 @@ -padManager = $padManager; - $this->noteManager = $noteManager; - } - - /** - * Creates a NewNoteForm. - * @param int|NULL $pad Id of the default pad. Can be NULL. - * @return Form - */ - public function create($pad) - { - $form = new Form; - $form->addText('name', 'Name') - ->setRequired('%label is required'); - - $form->addTextArea('text', 'Text') - ->setRequired('%label is required'); - - $form->addSelect('pad', 'Pad', $this->padManager->findAll()->fetchPairs('id', 'name')) - ->setPrompt('Select pad') - ->setDefaultValue($pad); - - $form->addSubmit('submit', 'Save'); - - $form->onSuccess[] = [$this, 'formSucceeded']; - return $form; - } - - /** - * Callback for NewNoteForm onSuccess event. - * @param Form $form - * @param ArrayHash $values - */ - public function formSucceeded(Form $form, $values) - { - if (!$this->noteManager->add($values->name, $values->text, $values->pad)) { - $form->addError("Failed to create pad"); - } - } - -} diff --git a/nette/native_db/notejam/app/forms/Pad/DeletePadFormFactory.php b/nette/native_db/notejam/app/forms/Pad/DeletePadFormFactory.php deleted file mode 100644 index ebacdf538..000000000 --- a/nette/native_db/notejam/app/forms/Pad/DeletePadFormFactory.php +++ /dev/null @@ -1,46 +0,0 @@ -padManager = $padManager; - } - - /** - * Creates a DeletePadForm. - * @param int $id Id of the pad to be deleted. - * @return Form - */ - public function create($id) - { - $form = new Form; - $form->addProtection(); // Adds CSRF protection - - $form->addSubmit('submit', 'Yes, I want to delete this pad'); - - $form->onSuccess[] = function (Form $form) use ($id) { - if (!$this->padManager->delete($id)) { - $form->addError("Failed to delete pad"); - } - }; - - return $form; - } - -} diff --git a/nette/native_db/notejam/app/forms/Pad/EditPadFormFactory.php b/nette/native_db/notejam/app/forms/Pad/EditPadFormFactory.php deleted file mode 100644 index 62a9510ad..000000000 --- a/nette/native_db/notejam/app/forms/Pad/EditPadFormFactory.php +++ /dev/null @@ -1,49 +0,0 @@ -padManager = $padManager; - } - - /** - * Creates an EditPadForm. - * @param int $id Id of the pad to be edited. - * @param string $name Current name of the pad. - * @return Form - */ - public function create($id, $name) - { - $form = new Form; - $form->addText('name', 'Name') - ->setDefaultValue($name) - ->setRequired('%label is required'); - - $form->addSubmit('submit', 'Save'); - - $form->onSuccess[] = function (Form $form, $values) use ($id) { - if (!$this->padManager->update($id, $values->name)) { - $form->addError("Failed to edit pad"); - } - }; - - return $form; - } - -} diff --git a/nette/native_db/notejam/app/forms/Pad/NewPadFormFactory.php b/nette/native_db/notejam/app/forms/Pad/NewPadFormFactory.php deleted file mode 100644 index b4ca697ea..000000000 --- a/nette/native_db/notejam/app/forms/Pad/NewPadFormFactory.php +++ /dev/null @@ -1,54 +0,0 @@ -padManager = $padManager; - } - - /** - * Creates a NewPadForm. - * @return Form - */ - public function create() - { - $form = new Form; - $form->addText('name', 'Name') - ->setRequired('%label is required'); - - $form->addSubmit('submit', 'Save'); - - $form->onSuccess[] = [$this, 'formSucceeded']; - return $form; - } - - /** - * Callback for NewPadForm onSuccess event. - * @param Form $form - * @param ArrayHash $values - */ - public function formSucceeded(Form $form, $values) - { - if (!$this->padManager->add($values->name)) { - $form->addError("Failed to create new pad"); - } - } - -} diff --git a/nette/native_db/notejam/app/forms/Sign/ForgottenPasswordFormFactory.php b/nette/native_db/notejam/app/forms/Sign/ForgottenPasswordFormFactory.php deleted file mode 100644 index 3fb12cabd..000000000 --- a/nette/native_db/notejam/app/forms/Sign/ForgottenPasswordFormFactory.php +++ /dev/null @@ -1,84 +0,0 @@ -userManager = $userManager; - $this->mailer = $mailer; - } - - /** - * Creates a ForgottenPasswordForm. - * @return Form - */ - public function create() - { - $form = new Form; - $form->addText('email', 'Email') - ->setRequired('%label is required') - ->addRule(Form::EMAIL, 'Invalid %label'); - - $form->addSubmit('submit', 'Get new password'); - - $form->onSuccess[] = [$this, 'formSucceeded']; - return $form; - } - - /** - * Callback for ForgottenPasswordForm onSuccess event. - * @param Form $form - * @param ArrayHash $values - */ - public function formSucceeded(Form $form, $values) - { - $user = $this->userManager->findByEmail($values->email); - if (!$user) { - $form->addError('No user with given email found'); - return; - } - $password = Nette\Utils\Random::generate(10); - $this->userManager->setNewPassword($user->id, $password); - - try { - // !!! Never send passwords through email !!! - // This is only for demonstration purposes of Notejam. - // Ideally, you can create a unique link where user can change his password - // himself for limited amount of time, and then send the link. - $mail = new Nette\Mail\Message(); - $mail->setFrom('noreply@notejamapp.com', 'Notejamapp'); - $mail->addTo($user->email); - $mail->setSubject('New notejam password'); - $mail->setBody(sprintf('Your new password: %s', $password)); - $this->mailer->send($mail); - - } catch (Nette\Mail\SendException $e) { - Debugger::log($e, Debugger::EXCEPTION); - $form->addError('Could not send email with new password'); - } - } - -} diff --git a/nette/native_db/notejam/app/forms/Sign/SignInFormFactory.php b/nette/native_db/notejam/app/forms/Sign/SignInFormFactory.php deleted file mode 100644 index 7737e36db..000000000 --- a/nette/native_db/notejam/app/forms/Sign/SignInFormFactory.php +++ /dev/null @@ -1,60 +0,0 @@ -user = $user; - } - - /** - * Creates a SignInForm. - * @return Form - */ - public function create() - { - $form = new Form; - - $form->addText('email', 'Email') - ->setRequired('%label is required'); - - $form->addPassword('password', 'Password') - ->setRequired('%label is required'); - - $form->addSubmit('submit', 'Sign In'); - - $form->onSuccess[] = [$this, 'formSucceeded']; - return $form; - } - - /** - * Callback for SignInForm onSuccess event. - * @param Form $form - * @param ArrayHash $values - */ - public function formSucceeded(Form $form, $values) - { - try { - $this->user->login($values->email, $values->password); - } catch (Nette\Security\AuthenticationException $e) { - $form->addError($e->getMessage()); - } - } - -} diff --git a/nette/native_db/notejam/app/forms/Sign/SignUpFormFactory.php b/nette/native_db/notejam/app/forms/Sign/SignUpFormFactory.php deleted file mode 100644 index 06b1d2519..000000000 --- a/nette/native_db/notejam/app/forms/Sign/SignUpFormFactory.php +++ /dev/null @@ -1,65 +0,0 @@ -userManager = $userManager; - } - - /** - * Creates a SignUpForm. - * @return Form - */ - public function create() - { - $form = new Form; - $form->addText('email', 'Email') - ->setRequired('%label is required') - ->addRule(Form::EMAIL, 'Invalid email'); - - $form->addPassword('password', 'Password') - ->setRequired('%label is required'); - - $form->addPassword('confirm', 'Confirm Password') - ->setRequired('%label is required') - ->addRule(Form::EQUAL, 'Passwords must match', $form['password']); - - $form->addSubmit('submit', 'Sign Up'); - - $form->onSuccess[] = [$this, 'formSucceeded']; - return $form; - } - - /** - * Callback for SignUpForm onSuccess event. - * @param Form $form - * @param ArrayHash $values - */ - public function formSucceeded(Form $form, $values) - { - try { - $this->userManager->add($values->email, $values->password); - } catch (DuplicateNameException $e) { - $form->addError($e->getMessage()); - } - } - -} diff --git a/nette/native_db/notejam/app/helpers/OrderHelper.php b/nette/native_db/notejam/app/helpers/OrderHelper.php deleted file mode 100644 index 72d2296ca..000000000 --- a/nette/native_db/notejam/app/helpers/OrderHelper.php +++ /dev/null @@ -1,25 +0,0 @@ - 'name ASC', - '-name' => 'name DESC', - 'updated_at' => 'updated_at ASC', - '-updated_at' => 'updated_at DESC' - ]; - return isset($ordering[$orderBy]) ? $ordering[$orderBy] : $ordering['name']; - } - -} diff --git a/nette/native_db/notejam/app/model/NoteManager.php b/nette/native_db/notejam/app/model/NoteManager.php deleted file mode 100644 index be5c9151b..000000000 --- a/nette/native_db/notejam/app/model/NoteManager.php +++ /dev/null @@ -1,121 +0,0 @@ -database = $database; - $this->user = $user; - } - - /** - * Finds note with given id. - * @param int $id - * @return bool|mixed|Nette\Database\Table\IRow - */ - public function find($id) - { - return $this->findAll()->where('id', $id)->fetch(); - } - - /** - * Finds all notes. - * @return Nette\Database\Table\Selection - */ - public function findAll() - { - return $this->getTable()->where('user_id', $this->user->getId()); - } - - /** - * Finds notes in given pad. - * @param int $padId - * @return Nette\Database\Table\Selection - */ - public function findByPad($padId) - { - return $this->findAll()->where('pad_id', $padId); - } - - /** - * Adds new note. - * @param string $name - * @param string $text - * @param int $padId - * @return bool|int|Nette\Database\Table\IRow - */ - public function add($name, $text, $padId) - { - return $this->getTable()->insert([ - 'name' => $name, - 'text' => $text, - 'pad_id' => $padId, - 'user_id' => $this->user->getId(), - 'created_at' => date('Y-m-d H:i:s'), - 'updated_at' => date('Y-m-d H:i:s'), - ]); - } - - /** - * Updates note with given id. - * @param int $id - * @param string $name - * @param string $text - * @param int $padId - * @return int - */ - public function update($id, $name, $text, $padId) - { - return $this->getTable()->where([ - 'id' => $id, - 'user_id' => $this->user->getId(), - ])->update([ - 'name' => $name, - 'text' => $text, - 'pad_id' => $padId, - 'updated_at' => date('Y-m-d H:i:s'), - ]); - } - - /** - * Deletes note with given id. - * @param int $id - * @return int - */ - public function delete($id) - { - return $this->getTable()->where([ - 'id' => $id, - 'user_id' => $this->user->getId(), - ])->delete(); - } - - /** - * @return Nette\Database\Table\Selection - */ - protected function getTable() - { - return $this->database->table('notes'); - } - -} diff --git a/nette/native_db/notejam/app/model/PadManager.php b/nette/native_db/notejam/app/model/PadManager.php deleted file mode 100644 index 306d8f95f..000000000 --- a/nette/native_db/notejam/app/model/PadManager.php +++ /dev/null @@ -1,100 +0,0 @@ -database = $database; - $this->user = $user; - } - - /** - * Finds pad with given id. - * @param int $id - * @return Nette\Database\Table\IRow|bool The pad or FALSE if not found. - */ - public function find($id) - { - return $this->findAll()->where('id', $id)->fetch(); - } - - /** - * Finds all pads. - * @return Nette\Database\Table\Selection - */ - public function findAll() - { - return $this->getTable()->where('user_id', $this->user->getId()); - } - - /** - * Adds new pad. - * @param string $name - * @return bool|int|Nette\Database\Table\IRow - */ - public function add($name) - { - return $this->getTable()->insert([ - 'name' => $name, - 'user_id' => $this->user->getId(), - ]); - } - - /** - * Updates pad with given id. - * @param int $id - * @param string $name - * @return int - */ - public function update($id, $name) - { - return $this->getTable()->where([ - 'id' => $id, - 'user_id' => $this->user->getId(), - ])->update([ - 'name' => $name, - ]); - } - - /** - * Deletes pad with given id. - * @param int $id - * @return int - */ - public function delete($id) - { - return $this->getTable()->where([ - 'id' => $id, - 'user_id' => $this->user->getId(), - ])->delete(); - } - - /** - * @return Nette\Database\Table\Selection - */ - protected function getTable() - { - return $this->database->table('pads'); - } - -} diff --git a/nette/native_db/notejam/app/model/UserManager.php b/nette/native_db/notejam/app/model/UserManager.php deleted file mode 100644 index 1365a33cb..000000000 --- a/nette/native_db/notejam/app/model/UserManager.php +++ /dev/null @@ -1,123 +0,0 @@ -database = $database; - } - - /** - * Performs an authentication. - * @param array $credentials - * @return Nette\Security\Identity - * @throws Nette\Security\AuthenticationException - */ - public function authenticate(array $credentials) - { - list($email, $password) = $credentials; - - $row = $this->findByEmail($email); - - if (!$row) { - throw new Nette\Security\AuthenticationException(sprintf('Unknown user', $email), self::IDENTITY_NOT_FOUND); - - } elseif (!Passwords::verify($password, $row['password'])) { - throw new Nette\Security\AuthenticationException('Invalid password', self::INVALID_CREDENTIAL); - - } elseif (Passwords::needsRehash($row['password'])) { - $row->update([ - 'password' => Passwords::hash($password), - ]); - } - - $arr = $row->toArray(); - unset($arr['password']); - return new Nette\Security\Identity($row['id'], null, $arr); - } - - - /** - * Adds new user. - * @param string $email - * @param string $password - * @throws DuplicateNameException - */ - public function add($email, $password) - { - if ($this->getTable()->where('email', $email)->count() > 0) { - throw new DuplicateNameException("User with given email already registered"); - } - - $this->getTable()->insert([ - 'email' => $email, - 'password' => Passwords::hash($password), - ]); - } - - /** - * @param $id - * @param $password - * @return bool - */ - public function checkPassword($id, $password) - { - $user = $this->getTable()->get($id); - return $user && Passwords::verify($password, $user->password); - } - - /** - * Changes password of the user with given id. - * @param int $id - * @param string $new - * @return int - */ - public function setNewPassword($id, $new) - { - return $this->getTable()->where('id', $id)->update([ - 'password' => Passwords::hash($new) - ]); - } - - /** - * Finds user by given email. - * @param string $email - * @return bool|mixed|Nette\Database\Table\IRow - */ - public function findByEmail($email) - { - return $this->getTable()->where('email', $email)->fetch(); - } - - /** - * @return Nette\Database\Table\Selection - */ - protected function getTable() - { - return $this->database->table('users'); - } - -} - - -class DuplicateNameException extends \Exception -{ - -} diff --git a/nette/native_db/notejam/app/presenters/AccountPresenter.php b/nette/native_db/notejam/app/presenters/AccountPresenter.php deleted file mode 100644 index 0903c195e..000000000 --- a/nette/native_db/notejam/app/presenters/AccountPresenter.php +++ /dev/null @@ -1,35 +0,0 @@ -formFactory->create(); - $form->onError[] = function ($form) { - foreach ($form->getErrors() as $error) { - $this->flashMessage($error, 'error'); - } - }; - $form->onSuccess[] = function () { - $this->flashMessage('Password is successfully changed', 'success'); - $this->redirect('Homepage:'); - }; - return $form; - } - -} diff --git a/nette/native_db/notejam/app/presenters/BasePresenter.php b/nette/native_db/notejam/app/presenters/BasePresenter.php deleted file mode 100644 index 96d1dacf8..000000000 --- a/nette/native_db/notejam/app/presenters/BasePresenter.php +++ /dev/null @@ -1,47 +0,0 @@ -userBarFactory->create(); - } - - /** - * @return \App\Components\Pads\Pads - */ - protected function createComponentPads() - { - $this->pads = $this->padManager->findAll(); - return $this->padsFactory->create($this->pads); - } - -} diff --git a/nette/native_db/notejam/app/presenters/Error4xxPresenter.php b/nette/native_db/notejam/app/presenters/Error4xxPresenter.php deleted file mode 100644 index c25c651a2..000000000 --- a/nette/native_db/notejam/app/presenters/Error4xxPresenter.php +++ /dev/null @@ -1,21 +0,0 @@ -getCode()}.latte"; - $this->template->setFile(is_file($file) ? $file : __DIR__ . '/templates/Error/4xx.latte'); - } - -} diff --git a/nette/native_db/notejam/app/presenters/ErrorPresenter.php b/nette/native_db/notejam/app/presenters/ErrorPresenter.php deleted file mode 100644 index 6067dee05..000000000 --- a/nette/native_db/notejam/app/presenters/ErrorPresenter.php +++ /dev/null @@ -1,42 +0,0 @@ -logger = $logger; - } - - /** - * @return Nette\Application\IResponse - */ - public function run(Nette\Application\Request $request) - { - $e = $request->getParameter('exception'); - - if ($e instanceof Nette\Application\BadRequestException) { - // $this->logger->log("HTTP code {$e->getCode()}: {$e->getMessage()} in {$e->getFile()}:{$e->getLine()}", 'access'); - return new Nette\Application\Responses\ForwardResponse($request->setPresenterName('Error4xx')); - } - - $this->logger->log($e, ILogger::EXCEPTION); - return new Nette\Application\Responses\CallbackResponse(function () { - require __DIR__ . '/templates/Error/500.phtml'; - }); - } - -} diff --git a/nette/native_db/notejam/app/presenters/HomepagePresenter.php b/nette/native_db/notejam/app/presenters/HomepagePresenter.php deleted file mode 100644 index eaeacb42a..000000000 --- a/nette/native_db/notejam/app/presenters/HomepagePresenter.php +++ /dev/null @@ -1,51 +0,0 @@ -notesFactory->create($this->notes); - } - - /** - * Homepage:default. - * @param string $order - */ - public function actionDefault($order) - { - $this->notes = $this->noteManager->findAll(); - if ($order) { - $this->notes->order(OrderHelper::translateParameterToColumns($order)); - } - } - - /** - * Homepage:default render. - */ - public function renderDefault() - { - $this->template->notes = $this->notes; - } - -} diff --git a/nette/native_db/notejam/app/presenters/NotePresenter.php b/nette/native_db/notejam/app/presenters/NotePresenter.php deleted file mode 100644 index ab344412b..000000000 --- a/nette/native_db/notejam/app/presenters/NotePresenter.php +++ /dev/null @@ -1,183 +0,0 @@ -editPadFormFactory->create($this->note->id, $this->note->name, $this->note->text, $this->note->pad_id); - $form->onError[] = function ($form) { - foreach ($form->getErrors() as $error) { - $this->flashMessage($error, 'error'); - } - }; - $form->onSuccess[] = function () { - $this->flashMessage('Note successfully updated', 'success'); - $this->redirect('default', ['id' => $this->id]); - }; - return $form; - } - - /** - * Creates DeleteNoteForm component. - * Called automagically by the framework. - * @return \Nette\Application\UI\Form - */ - protected function createComponentDeleteNoteForm() - { - $form = $this->deletePadFormFactory->create($this->id); - $form->onError[] = function ($form) { - foreach ($form->getErrors() as $error) { - $this->flashMessage($error, 'error'); - } - }; - $form->onSuccess[] = function () { - $this->flashMessage('Note successfully deleted', 'success'); - $this->redirect('Homepage:'); - }; - return $form; - } - - /** - * Creates NewNoteForm component. - * Called automagically by the framework. - * @return \Nette\Application\UI\Form - */ - protected function createComponentNewNoteForm() - { - $form = $this->newPadFormFactory->create($this->padId); - $form->onError[] = function ($form) { - foreach ($form->getErrors() as $error) { - $this->flashMessage($error, 'error'); - } - }; - $form->onSuccess[] = function () { - $this->flashMessage('Note successfully created', 'success'); - $this->redirect('Homepage:'); - }; - return $form; - } - - /** - * Note:default. - * @param int $id - * @throws BadRequestException - */ - public function actionDefault($id) - { - $this->loadNote($id); - $this->notes = $this->noteManager->findByPad($id); - } - - /** - * Note:default render. - */ - public function renderDefault() - { - $this->template->note = $this->note; - } - - /** - * Note:edit. - * @param int $id - * @throws BadRequestException - */ - public function actionEdit($id) - { - $this->loadNote($id); - } - - /** - * Note:edit render. - */ - public function renderEdit() - { - $this->template->note = $this->note; - } - - /** - * Note:delete. - * @param int $id - * @throws BadRequestException - */ - public function actionDelete($id) - { - $this->loadNote($id); - } - - /** - * Note:delete render. - */ - public function renderDelete() - { - $this->template->note = $this->note; - } - - /** - * Note:new. - * @param int $pad - */ - public function actionNew($pad) - { - $this->padId = $pad; - } - - /** - * Loads note with given id and if not found, throws BadRequestException. - * @param int $id - * @throws BadRequestException - */ - private function loadNote($id) - { - $this->id = $id; - $this->note = $this->noteManager->find($this->id); - if (!$this->note) { - throw new BadRequestException("Pad with given id not found"); - } - } - -} diff --git a/nette/native_db/notejam/app/presenters/PadPresenter.php b/nette/native_db/notejam/app/presenters/PadPresenter.php deleted file mode 100644 index c15961cc0..000000000 --- a/nette/native_db/notejam/app/presenters/PadPresenter.php +++ /dev/null @@ -1,189 +0,0 @@ -editPadFormFactory->create($this->id, $this->pad->name); - $form->onError[] = function ($form) { - foreach ($form->getErrors() as $error) { - $this->flashMessage($error, 'error'); - } - }; - $form->onSuccess[] = function () { - $this->flashMessage('Pad successfully updated', 'success'); - $this->redirect('Homepage:'); - }; - return $form; - } - - /** - * Creates DeletePadForm component. - * Called automagically by the framework. - * @return \Nette\Application\UI\Form - */ - protected function createComponentDeletePadForm() - { - $form = $this->deletePadFormFactory->create($this->id); - $form->onError[] = function ($form) { - foreach ($form->getErrors() as $error) { - $this->flashMessage($error, 'error'); - } - }; - $form->onSuccess[] = function () { - $this->flashMessage('Pad successfully deleted', 'success'); - $this->redirect('Homepage:'); - }; - return $form; - } - - /** - * Creates NewPadForm component. - * Called automagically by the framework. - * @return \Nette\Application\UI\Form - */ - protected function createComponentNewPadForm() - { - $form = $this->newPadFormFactory->create(); - $form->onError[] = function ($form) { - foreach ($form->getErrors() as $error) { - $this->flashMessage($error, 'error'); - } - }; - $form->onSuccess[] = function () { - $this->flashMessage('Pad successfully created', 'success'); - $this->redirect('Homepage:'); - }; - return $form; - } - - /** - * Creates Notes component. - * Called automagically by the framework. - * @return \App\Components\Notes\Notes - */ - protected function createComponentNotes() - { - return $this->notesFactory->create($this->notes, $this->pad); - } - - /** - * Pad:default. - * @param int $id - * @param string|null $order - * @throws BadRequestException - */ - public function actionDefault($id, $order) - { - $this->loadPad($id); - $this->notes = $this->noteManager->findByPad($id); - if ($order) { - $this->notes->order(OrderHelper::translateParameterToColumns($order)); - } - } - - /** - * Pad:default render. - */ - public function renderDefault() - { - $this->template->pad = $this->pad; - } - - /** - * Pad:edit. - * @param int $id - * @throws BadRequestException - */ - public function actionEdit($id) - { - $this->loadPad($id); - } - - /** - * Pad:edit render. - */ - public function renderEdit() - { - $this->template->pad = $this->pad; - } - - /** - * Pad:delete. - * @param int $id - * @throws BadRequestException - */ - public function actionDelete($id) - { - $this->loadPad($id); - } - - /** - * Pad:delete render. - */ - public function renderDelete() - { - $this->template->pad = $this->pad; - } - - /** - * Loads pad with given id and if not found, throws BadRequestException. - * @param int $id - * @throws BadRequestException - */ - private function loadPad($id) - { - $this->id = $id; - $this->pad = $this->padManager->find($this->id); - if (!$this->pad) { - throw new BadRequestException("Pad with given id not found"); - } - } - -} diff --git a/nette/native_db/notejam/app/presenters/SecuredBasePresenter.php b/nette/native_db/notejam/app/presenters/SecuredBasePresenter.php deleted file mode 100644 index d9838e6b1..000000000 --- a/nette/native_db/notejam/app/presenters/SecuredBasePresenter.php +++ /dev/null @@ -1,20 +0,0 @@ -user->isLoggedIn()) { - $this->redirect('Sign:in', ['backlink' => $this->storeRequest()]); - } - } - -} diff --git a/nette/native_db/notejam/app/presenters/SignPresenter.php b/nette/native_db/notejam/app/presenters/SignPresenter.php deleted file mode 100644 index 8a51cb89d..000000000 --- a/nette/native_db/notejam/app/presenters/SignPresenter.php +++ /dev/null @@ -1,116 +0,0 @@ -forgottenPasswordFormFactory->create(); - $form->onError[] = function ($form) { - foreach ($form->getErrors() as $error) { - $this->flashMessage($error, 'error'); - } - }; - $form->onSuccess[] = function () { - $this->flashMessage('New password sent to your inbox', 'success'); - $this->redirect('Sign:in'); - }; - return $form; - } - - /** - * Creates SignInForm component. - * Called automagically by the framework. - * @return Nette\Application\UI\Form - */ - protected function createComponentSignInForm() - { - $form = $this->signInFormFactory->create(); - $form->onError[] = function ($form) { - foreach ($form->getErrors() as $error) { - $this->flashMessage($error, 'error'); - } - }; - $form->onSuccess[] = function () { - $this->restoreRequest($this->backlink); - $this->redirect('Homepage:'); - }; - return $form; - } - - - /** - * Creates SignUpForm component. - * Called automagically by the framework. - * @return Nette\Application\UI\Form - */ - protected function createComponentSignUpForm() - { - $form = $this->signUpFormFactory->create(); - $form->onError[] = function ($form) { - foreach ($form->getErrors() as $error) { - $this->flashMessage($error, 'error'); - } - }; - $form->onSuccess[] = function () { - $this->flashMessage('User is successfully created. Now you can sign in.', 'success'); - $this->redirect('Sign:in'); - }; - return $form; - } - - /** - * Sign:in. - */ - public function actionIn() - { - if ($this->user->isLoggedIn()) { - $this->redirect('Homepage:'); - } - } - - /** - * Sign:up. - */ - public function actionUp() - { - if ($this->user->isLoggedIn()) { - $this->redirect('Homepage:'); - } - } - - /** - * Sign:out. - */ - public function actionOut() - { - $this->getUser()->logout(true); - $this->flashMessage('You have been signed out.', 'info'); - $this->redirect('in'); - } - -} diff --git a/nette/native_db/notejam/app/presenters/templates/@layout.latte b/nette/native_db/notejam/app/presenters/templates/@layout.latte deleted file mode 100644 index 57cb82c51..000000000 --- a/nette/native_db/notejam/app/presenters/templates/@layout.latte +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - Notejam{ifset title}: {include title|striptags}{/ifset} - - - - - - - - - - - - - - - -
- {if $user->isLoggedIn()} - {control userBar} - {else} -
- -
- {/if} - -
-

notejam: - {include header} -

-
- - {if $user->isLoggedIn() && !$presenter->isLinkCurrent('Account:settings')} - {control pads} - {/if} - -
-
-
{$flash->message}
-
- {include content} -
- - - -
- - Fork me on GitHub - - - diff --git a/nette/native_db/notejam/app/presenters/templates/Account/settings.latte b/nette/native_db/notejam/app/presenters/templates/Account/settings.latte deleted file mode 100644 index d5e1a7424..000000000 --- a/nette/native_db/notejam/app/presenters/templates/Account/settings.latte +++ /dev/null @@ -1,13 +0,0 @@ -{block title}Account settings{/block} -{block header}Account settings{/block} -{block content} - -{/block} diff --git a/nette/native_db/notejam/app/presenters/templates/Error/403.latte b/nette/native_db/notejam/app/presenters/templates/Error/403.latte deleted file mode 100644 index de00328e7..000000000 --- a/nette/native_db/notejam/app/presenters/templates/Error/403.latte +++ /dev/null @@ -1,7 +0,0 @@ -{block content} -

Access Denied

- -

You do not have permission to view this page. Please try contact the web -site administrator if you believe you should be able to view this page.

- -

error 403

diff --git a/nette/native_db/notejam/app/presenters/templates/Error/404.latte b/nette/native_db/notejam/app/presenters/templates/Error/404.latte deleted file mode 100644 index 022001c2a..000000000 --- a/nette/native_db/notejam/app/presenters/templates/Error/404.latte +++ /dev/null @@ -1,8 +0,0 @@ -{block content} -

Page Not Found

- -

The page you requested could not be found. It is possible that the address is -incorrect, or that the page no longer exists. Please use a search engine to find -what you are looking for.

- -

error 404

diff --git a/nette/native_db/notejam/app/presenters/templates/Error/405.latte b/nette/native_db/notejam/app/presenters/templates/Error/405.latte deleted file mode 100644 index d42489233..000000000 --- a/nette/native_db/notejam/app/presenters/templates/Error/405.latte +++ /dev/null @@ -1,6 +0,0 @@ -{block content} -

Method Not Allowed

- -

The requested method is not allowed for the URL.

- -

error 405

diff --git a/nette/native_db/notejam/app/presenters/templates/Error/410.latte b/nette/native_db/notejam/app/presenters/templates/Error/410.latte deleted file mode 100644 index 99bde92c1..000000000 --- a/nette/native_db/notejam/app/presenters/templates/Error/410.latte +++ /dev/null @@ -1,6 +0,0 @@ -{block content} -

Page Not Found

- -

The page you requested has been taken off the site. We apologize for the inconvenience.

- -

error 410

diff --git a/nette/native_db/notejam/app/presenters/templates/Error/4xx.latte b/nette/native_db/notejam/app/presenters/templates/Error/4xx.latte deleted file mode 100644 index d5ce82f19..000000000 --- a/nette/native_db/notejam/app/presenters/templates/Error/4xx.latte +++ /dev/null @@ -1,4 +0,0 @@ -{block content} -

Oops...

- -

Your browser sent a request that this server could not understand or process.

diff --git a/nette/native_db/notejam/app/presenters/templates/Error/500.phtml b/nette/native_db/notejam/app/presenters/templates/Error/500.phtml deleted file mode 100644 index 619611eac..000000000 --- a/nette/native_db/notejam/app/presenters/templates/Error/500.phtml +++ /dev/null @@ -1,20 +0,0 @@ - - - -Server Error - - - -
-

Server Error

- -

We're sorry! The server encountered an internal error and - was unable to complete your request. Please try again later.

- -

error 500

-
diff --git a/nette/native_db/notejam/app/presenters/templates/Homepage/default.latte b/nette/native_db/notejam/app/presenters/templates/Homepage/default.latte deleted file mode 100644 index 616841a40..000000000 --- a/nette/native_db/notejam/app/presenters/templates/Homepage/default.latte +++ /dev/null @@ -1,6 +0,0 @@ -{block title}All notes ({count($notes)}){/block} -{block header}All notes ({count($notes)}){/block} -{block content} - {control notes} - New note -{/block} diff --git a/nette/native_db/notejam/app/presenters/templates/Note/default.latte b/nette/native_db/notejam/app/presenters/templates/Note/default.latte deleted file mode 100644 index 3f72e1232..000000000 --- a/nette/native_db/notejam/app/presenters/templates/Note/default.latte +++ /dev/null @@ -1,9 +0,0 @@ -{block title}{$note->name}{/block} -{block header}{$note->name}{/block} -{block content} -

Last edited {$note->updated_at|date:'d. M. Y'}

-

{$note->text}

-
- Edit - Delete it -{/block} diff --git a/nette/native_db/notejam/app/presenters/templates/Note/delete.latte b/nette/native_db/notejam/app/presenters/templates/Note/delete.latte deleted file mode 100644 index 1ab2ab7f5..000000000 --- a/nette/native_db/notejam/app/presenters/templates/Note/delete.latte +++ /dev/null @@ -1,9 +0,0 @@ -{block title}{$note->name}{/block} -{block header}{$note->name}{/block} -{block content} -

Are you sure you want to delete the note?

-
-   - Cancel -
-{/block} diff --git a/nette/native_db/notejam/app/presenters/templates/Note/edit.latte b/nette/native_db/notejam/app/presenters/templates/Note/edit.latte deleted file mode 100644 index 5066cc048..000000000 --- a/nette/native_db/notejam/app/presenters/templates/Note/edit.latte +++ /dev/null @@ -1,13 +0,0 @@ -{block title}{$note->name}{/block} -{block header}{$note->name}{/block} -{block content} -
- - - - - - - -
-{/block} diff --git a/nette/native_db/notejam/app/presenters/templates/Note/new.latte b/nette/native_db/notejam/app/presenters/templates/Note/new.latte deleted file mode 100644 index 4b3f7daba..000000000 --- a/nette/native_db/notejam/app/presenters/templates/Note/new.latte +++ /dev/null @@ -1,13 +0,0 @@ -{block title}New note{/block} -{block header}New note{/block} -{block content} -
- - - - - - - -
-{/block} diff --git a/nette/native_db/notejam/app/presenters/templates/Pad/default.latte b/nette/native_db/notejam/app/presenters/templates/Pad/default.latte deleted file mode 100644 index 86e3c6904..000000000 --- a/nette/native_db/notejam/app/presenters/templates/Pad/default.latte +++ /dev/null @@ -1,8 +0,0 @@ -{block title}New pad{/block} -{block header}New pad{/block} -{block content} - {control notes} - New note -   - Pad settings -{/block} diff --git a/nette/native_db/notejam/app/presenters/templates/Pad/delete.latte b/nette/native_db/notejam/app/presenters/templates/Pad/delete.latte deleted file mode 100644 index dbc159065..000000000 --- a/nette/native_db/notejam/app/presenters/templates/Pad/delete.latte +++ /dev/null @@ -1,9 +0,0 @@ -{block title}{$pad->name}{/block} -{block header}{$pad->name}{/block} -{block content} -

Are you sure you want to delete the pad?

-
-   - Cancel -
-{/block} diff --git a/nette/native_db/notejam/app/presenters/templates/Pad/edit.latte b/nette/native_db/notejam/app/presenters/templates/Pad/edit.latte deleted file mode 100644 index 95decdce9..000000000 --- a/nette/native_db/notejam/app/presenters/templates/Pad/edit.latte +++ /dev/null @@ -1,11 +0,0 @@ -{block title}{$pad->name}{/block} -{block header}{$pad->name}{/block} -{block content} -
- - - - - -
-{/block} diff --git a/nette/native_db/notejam/app/presenters/templates/Pad/new.latte b/nette/native_db/notejam/app/presenters/templates/Pad/new.latte deleted file mode 100644 index 70acc715b..000000000 --- a/nette/native_db/notejam/app/presenters/templates/Pad/new.latte +++ /dev/null @@ -1,9 +0,0 @@ -{block title}New pad{/block} -{block header}New pad{/block} -{block content} -
- - - -
-{/block} diff --git a/nette/native_db/notejam/app/presenters/templates/Sign/forgotten.latte b/nette/native_db/notejam/app/presenters/templates/Sign/forgotten.latte deleted file mode 100644 index 7f2702b6d..000000000 --- a/nette/native_db/notejam/app/presenters/templates/Sign/forgotten.latte +++ /dev/null @@ -1,9 +0,0 @@ -{block title}Frogot password?{/block} -{block header}Forgot password?{/block} -{block content} - -{/block} diff --git a/nette/native_db/notejam/app/presenters/templates/Sign/in.latte b/nette/native_db/notejam/app/presenters/templates/Sign/in.latte deleted file mode 100644 index 0644d8aa9..000000000 --- a/nette/native_db/notejam/app/presenters/templates/Sign/in.latte +++ /dev/null @@ -1,13 +0,0 @@ -{block title}Sign In{/block} -{block header}Sign In{/block} -{block content} - -{/block} diff --git a/nette/native_db/notejam/app/presenters/templates/Sign/up.latte b/nette/native_db/notejam/app/presenters/templates/Sign/up.latte deleted file mode 100644 index b742ab8ee..000000000 --- a/nette/native_db/notejam/app/presenters/templates/Sign/up.latte +++ /dev/null @@ -1,15 +0,0 @@ -{block title}Sign Up{/block} -{block header}Sign Up{/block} -{block content} - -{/block} diff --git a/nette/native_db/notejam/app/router/RouterFactory.php b/nette/native_db/notejam/app/router/RouterFactory.php deleted file mode 100644 index c601dec2a..000000000 --- a/nette/native_db/notejam/app/router/RouterFactory.php +++ /dev/null @@ -1,40 +0,0 @@ -', 'Note:default'); - $router[] = new Route('/notes//edit', 'Note:edit'); - $router[] = new Route('/notes//delete', 'Note:delete'); - - $router[] = new Route('/pads/create', 'Pad:new'); - $router[] = new Route('/pads/', 'Pad:default'); - $router[] = new Route('/pads//edit', 'Pad:edit'); - $router[] = new Route('/pads//delete', 'Pad:delete'); - - $router[] = new Route('[/]', 'Homepage:default'); - return $router; - } - -} diff --git a/nette/native_db/notejam/bin/create-db.php b/nette/native_db/notejam/bin/create-db.php deleted file mode 100644 index 5df629192..000000000 --- a/nette/native_db/notejam/bin/create-db.php +++ /dev/null @@ -1,29 +0,0 @@ -getByType('Nette\Database\Context'); -$db->getConnection()->query(" -CREATE TABLE IF NOT EXISTS users ( - id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - email VARCHAR(75) NOT NULL, - password VARCHAR(128) NOT NULL -);"); - -$db->getConnection()->query(" -CREATE TABLE IF NOT EXISTS pads ( - id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - name VARCHAR(100) NOT NULL, - user_id INTEGER NOT NULL REFERENCES users(id) -);"); - -$db->getConnection()->query(" -CREATE TABLE notes ( - id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - pad_id INTEGER REFERENCES pads(id), - user_id INTEGER NOT NULL REFERENCES users(id), - name VARCHAR(100) NOT NULL, - text text NOT NULL, - created_at DATETIME NOT NULL, - updated_at DATETIME NOT NULL -);"); diff --git a/nette/native_db/notejam/codeception.yml b/nette/native_db/notejam/codeception.yml deleted file mode 100644 index 15019d00a..000000000 --- a/nette/native_db/notejam/codeception.yml +++ /dev/null @@ -1,23 +0,0 @@ -actor: Tester -paths: - tests: tests - log: tests/_output - data: tests/_data - support: tests/_support - envs: tests/_envs -settings: - bootstrap: _bootstrap.php - colors: true - memory_limit: 1024M -extensions: - enabled: - - Codeception\Extension\RunFailed -modules: - config: - Db: - dsn: 'sqlite:notejam.db' - user: - password: - dump: tests/_data/dump.sql - populate: true - cleanup: true diff --git a/nette/native_db/notejam/composer.json b/nette/native_db/notejam/composer.json deleted file mode 100644 index e261b7a05..000000000 --- a/nette/native_db/notejam/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "nette/sandbox", - "description": "The sandbox is a pre-packaged Nette Framework project, basic configured structure for your application.", - "homepage": "https://nette.org", - "type": "project", - "license": ["BSD-3-Clause", "GPL-2.0", "GPL-3.0"], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "require": { - "php": ">= 5.3.7", - "nette/application": "~2.3.6", - "nette/bootstrap": "~2.3.0", - "nette/caching": "~2.3.0", - "nette/database": "~2.3.0", - "nette/di": "~2.3.0", - "nette/finder": "~2.3.0", - "nette/forms": "~2.3.0", - "nette/http": "~2.3.0", - "nette/mail": "~2.3.0", - "nette/robot-loader": "~2.3.0", - "nette/safe-stream": "~2.3.0", - "nette/security": "~2.3.0", - "nette/utils": "~2.3.0", - "latte/latte": "~2.3.0", - "tracy/tracy": "~2.3.0", - "dg/adminer-custom": "~1.6" - }, - "require-dev": { - "codeception/codeception": "*" - } -} diff --git a/nette/native_db/notejam/composer.lock b/nette/native_db/notejam/composer.lock deleted file mode 100644 index ca68de2e1..000000000 --- a/nette/native_db/notejam/composer.lock +++ /dev/null @@ -1,2697 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "hash": "42813a0174e5fbe7e251f6af01ccfeba", - "content-hash": "9f640b3bb59ce0b58222c5594953b85f", - "packages": [ - { - "name": "dg/adminer-custom", - "version": "v1.6.4", - "source": { - "type": "git", - "url": "https://github.com/dg/adminer-custom.git", - "reference": "5215a1fa29ae9fc4304a867ce972f252b12921b0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dg/adminer-custom/zipball/5215a1fa29ae9fc4304a867ce972f252b12921b0", - "reference": "5215a1fa29ae9fc4304a867ce972f252b12921b0", - "shasum": "" - }, - "type": "project", - "notification-url": "https://packagist.org/downloads/", - "description": "Customization for the best database management tool written in PHP, Adminer", - "time": "2015-09-07 07:29:02" - }, - { - "name": "latte/latte", - "version": "v2.3.7", - "source": { - "type": "git", - "url": "https://github.com/nette/latte.git", - "reference": "b6e090e461c9cd88d60ae79a7713990b17b1531c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/latte/zipball/b6e090e461c9cd88d60ae79a7713990b17b1531c", - "reference": "b6e090e461c9cd88d60ae79a7713990b17b1531c", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.1" - }, - "require-dev": { - "nette/tester": "~1.3" - }, - "suggest": { - "ext-fileinfo": "to use filter |datastream", - "ext-mbstring": "to use filters like lower, upper, capitalize, ..." - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "Latte: the amazing template engine for PHP", - "homepage": "https://latte.nette.org", - "keywords": [ - "templating", - "twig" - ], - "time": "2015-11-07 22:54:05" - }, - { - "name": "nette/application", - "version": "v2.3.7", - "source": { - "type": "git", - "url": "https://github.com/nette/application.git", - "reference": "8e87ae81c2098abd7895bfd96d9fac1cd332abc3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/application/zipball/8e87ae81c2098abd7895bfd96d9fac1cd332abc3", - "reference": "8e87ae81c2098abd7895bfd96d9fac1cd332abc3", - "shasum": "" - }, - "require": { - "nette/component-model": "~2.2", - "nette/http": "~2.2", - "nette/reflection": "~2.2", - "nette/security": "~2.2", - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "latte/latte": "~2.3.0", - "nette/di": "~2.3", - "nette/forms": "~2.2", - "nette/robot-loader": "~2.2", - "nette/tester": "~1.3" - }, - "suggest": { - "latte/latte": "Allows using Latte in templates", - "nette/forms": "Allows to use Nette\\Application\\UI\\Form" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "Nette Application MVC Component", - "homepage": "https://nette.org", - "time": "2015-10-13 14:33:28" - }, - { - "name": "nette/bootstrap", - "version": "v2.3.3", - "source": { - "type": "git", - "url": "https://github.com/nette/bootstrap.git", - "reference": "8e2db45c39a1fa24f88e94c7b2a62ad09e9a306e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/bootstrap/zipball/8e2db45c39a1fa24f88e94c7b2a62ad09e9a306e", - "reference": "8e2db45c39a1fa24f88e94c7b2a62ad09e9a306e", - "shasum": "" - }, - "require": { - "nette/di": "~2.3", - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "latte/latte": "~2.2", - "nette/application": "~2.3", - "nette/caching": "~2.3", - "nette/database": "~2.3", - "nette/forms": "~2.3", - "nette/http": "~2.3", - "nette/mail": "~2.3", - "nette/robot-loader": "~2.2", - "nette/safe-stream": "~2.2", - "nette/security": "~2.3", - "nette/tester": "~1.3", - "tracy/tracy": "~2.3" - }, - "suggest": { - "nette/robot-loader": "to use Configurator::createRobotLoader()", - "tracy/tracy": "to use Configurator::enableDebugger()" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette Bootstrap", - "homepage": "http://nette.org", - "time": "2015-07-11 21:07:11" - }, - { - "name": "nette/caching", - "version": "v2.3.3", - "source": { - "type": "git", - "url": "https://github.com/nette/caching.git", - "reference": "d4be13806d70c02d53b72cc63e93de6cf813f50f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/caching/zipball/d4be13806d70c02d53b72cc63e93de6cf813f50f", - "reference": "d4be13806d70c02d53b72cc63e93de6cf813f50f", - "shasum": "" - }, - "require": { - "nette/finder": "~2.2", - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "latte/latte": "~2.3.0", - "nette/di": "~2.3", - "nette/tester": "~1.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette Caching Component", - "homepage": "http://nette.org", - "time": "2015-07-11 21:09:42" - }, - { - "name": "nette/component-model", - "version": "v2.2.4", - "source": { - "type": "git", - "url": "https://github.com/nette/component-model.git", - "reference": "07bce436051fd92d084642ce7a47f00045e0d1e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/component-model/zipball/07bce436051fd92d084642ce7a47f00045e0d1e5", - "reference": "07bce436051fd92d084642ce7a47f00045e0d1e5", - "shasum": "" - }, - "require": { - "nette/utils": "^2.3.5", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "Nette Component Model", - "homepage": "https://nette.org", - "time": "2015-10-06 17:54:05" - }, - { - "name": "nette/database", - "version": "v2.3.7", - "source": { - "type": "git", - "url": "https://github.com/nette/database.git", - "reference": "32ab8af7abb405c6415ef335d3395dea9d575859" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/database/zipball/32ab8af7abb405c6415ef335d3395dea9d575859", - "reference": "32ab8af7abb405c6415ef335d3395dea9d575859", - "shasum": "" - }, - "require": { - "ext-pdo": "*", - "nette/caching": "~2.2", - "nette/utils": "^2.3.5", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "mockery/mockery": "~0.9.1", - "nette/di": "~2.3", - "nette/tester": "~1.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "Nette Database Component", - "homepage": "https://nette.org", - "time": "2015-10-05 13:16:36" - }, - { - "name": "nette/di", - "version": "v2.3.6", - "source": { - "type": "git", - "url": "https://github.com/nette/di.git", - "reference": "efa1d13f016b58b4a9200802c9c5b14d10d72e85" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/di/zipball/efa1d13f016b58b4a9200802c9c5b14d10d72e85", - "reference": "efa1d13f016b58b4a9200802c9c5b14d10d72e85", - "shasum": "" - }, - "require": { - "nette/neon": "^2.3.3", - "nette/php-generator": "^2.3.3", - "nette/utils": "~2.3", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette Dependency Injection Component", - "homepage": "http://nette.org", - "time": "2015-09-14 18:18:24" - }, - { - "name": "nette/finder", - "version": "v2.3.1", - "source": { - "type": "git", - "url": "https://github.com/nette/finder.git", - "reference": "38f803a03f4cddf352e28af70294c71f7026e516" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/finder/zipball/38f803a03f4cddf352e28af70294c71f7026e516", - "reference": "38f803a03f4cddf352e28af70294c71f7026e516", - "shasum": "" - }, - "require": { - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.4" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette Finder: Files Searching", - "homepage": "http://nette.org", - "time": "2015-07-11 21:13:50" - }, - { - "name": "nette/forms", - "version": "v2.3.6", - "source": { - "type": "git", - "url": "https://github.com/nette/forms.git", - "reference": "5e07a7b7180e5e88db9d44e12f1677e36b4f164b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/forms/zipball/5e07a7b7180e5e88db9d44e12f1677e36b4f164b", - "reference": "5e07a7b7180e5e88db9d44e12f1677e36b4f164b", - "shasum": "" - }, - "require": { - "nette/component-model": "~2.2", - "nette/http": "~2.2", - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "latte/latte": "~2.3.2", - "nette/di": "~2.3", - "nette/tester": "~1.3", - "tracy/tracy": "~2.2" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "Nette Forms: greatly facilitates web forms", - "homepage": "https://nette.org", - "time": "2015-10-19 01:41:55" - }, - { - "name": "nette/http", - "version": "v2.3.3", - "source": { - "type": "git", - "url": "https://github.com/nette/http.git", - "reference": "ff2e4608391bca2444df9af6eaf8666ac853eb02" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/http/zipball/ff2e4608391bca2444df9af6eaf8666ac853eb02", - "reference": "ff2e4608391bca2444df9af6eaf8666ac853eb02", - "shasum": "" - }, - "require": { - "nette/utils": "~2.2, >=2.2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/di": "~2.3", - "nette/tester": "~1.4" - }, - "suggest": { - "ext-fileinfo": "to detect type of uploaded files" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette HTTP Component", - "homepage": "http://nette.org", - "time": "2015-07-19 16:17:50" - }, - { - "name": "nette/mail", - "version": "v2.3.3", - "source": { - "type": "git", - "url": "https://github.com/nette/mail.git", - "reference": "4ea303d96c6a80ffe357baf59d387f4fe2cfd412" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/mail/zipball/4ea303d96c6a80ffe357baf59d387f4fe2cfd412", - "reference": "4ea303d96c6a80ffe357baf59d387f4fe2cfd412", - "shasum": "" - }, - "require": { - "ext-iconv": "*", - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/di": "~2.3", - "nette/tester": "~1.3" - }, - "suggest": { - "ext-fileinfo": "to detect type of attached files" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "Nette Mail: Sending E-mails", - "homepage": "https://nette.org", - "time": "2015-10-05 12:58:01" - }, - { - "name": "nette/neon", - "version": "v2.3.3", - "source": { - "type": "git", - "url": "https://github.com/nette/neon.git", - "reference": "12bbb0e85ba8521dd291f4df0fe20a1b79aae32c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/neon/zipball/12bbb0e85ba8521dd291f4df0fe20a1b79aae32c", - "reference": "12bbb0e85ba8521dd291f4df0fe20a1b79aae32c", - "shasum": "" - }, - "require": { - "ext-iconv": "*", - "php": ">=5.3.1" - }, - "require-dev": { - "nette/tester": "~1.4" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette NEON: parser & generator for Nette Object Notation", - "homepage": "http://ne-on.org", - "time": "2015-08-22 15:23:30" - }, - { - "name": "nette/php-generator", - "version": "v2.3.4", - "source": { - "type": "git", - "url": "https://github.com/nette/php-generator.git", - "reference": "846028e9d885d2d8ec60823d995e1291bbe3eb69" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/php-generator/zipball/846028e9d885d2d8ec60823d995e1291bbe3eb69", - "reference": "846028e9d885d2d8ec60823d995e1291bbe3eb69", - "shasum": "" - }, - "require": { - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.4" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "Nette PHP Generator", - "homepage": "https://nette.org", - "time": "2015-10-09 14:34:13" - }, - { - "name": "nette/reflection", - "version": "v2.3.1", - "source": { - "type": "git", - "url": "https://github.com/nette/reflection.git", - "reference": "9c2ed2a29f1f58125a0f19ffc987812d6b17d3e6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/reflection/zipball/9c2ed2a29f1f58125a0f19ffc987812d6b17d3e6", - "reference": "9c2ed2a29f1f58125a0f19ffc987812d6b17d3e6", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "nette/caching": "~2.2", - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/di": "~2.3", - "nette/tester": "~1.4" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette PHP Reflection Component", - "homepage": "http://nette.org", - "time": "2015-07-11 21:34:53" - }, - { - "name": "nette/robot-loader", - "version": "v2.3.1", - "source": { - "type": "git", - "url": "https://github.com/nette/robot-loader.git", - "reference": "69331d359bbc9e5f911c12b82187cac914d983fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/robot-loader/zipball/69331d359bbc9e5f911c12b82187cac914d983fb", - "reference": "69331d359bbc9e5f911c12b82187cac914d983fb", - "shasum": "" - }, - "require": { - "nette/caching": "~2.2", - "nette/finder": "~2.3", - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.4" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette RobotLoader: comfortable autoloading", - "homepage": "http://nette.org", - "time": "2015-07-11 21:20:57" - }, - { - "name": "nette/safe-stream", - "version": "v2.3.1", - "source": { - "type": "git", - "url": "https://github.com/nette/safe-stream.git", - "reference": "bf30db367b51a0932c44dcb9a378927644d48b2e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/safe-stream/zipball/bf30db367b51a0932c44dcb9a378927644d48b2e", - "reference": "bf30db367b51a0932c44dcb9a378927644d48b2e", - "shasum": "" - }, - "require": { - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "files": [ - "src/loader.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette SafeStream: Atomic Operations", - "homepage": "http://nette.org", - "time": "2015-07-11 20:59:15" - }, - { - "name": "nette/security", - "version": "v2.3.1", - "source": { - "type": "git", - "url": "https://github.com/nette/security.git", - "reference": "744264a42b506d63009d7e3853ed72b04c99e964" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/security/zipball/744264a42b506d63009d7e3853ed72b04c99e964", - "reference": "744264a42b506d63009d7e3853ed72b04c99e964", - "shasum": "" - }, - "require": { - "nette/utils": "~2.2", - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/di": "~2.3", - "nette/http": "~2.3", - "nette/tester": "~1.4" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "http://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "http://nette.org/contributors" - } - ], - "description": "Nette Security: Access Control Component", - "homepage": "http://nette.org", - "time": "2015-07-11 21:22:53" - }, - { - "name": "nette/utils", - "version": "v2.3.6", - "source": { - "type": "git", - "url": "https://github.com/nette/utils.git", - "reference": "c9dfaec788eb65d5ef10cefed0ae63bc76febaa8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/c9dfaec788eb65d5ef10cefed0ae63bc76febaa8", - "reference": "c9dfaec788eb65d5ef10cefed0ae63bc76febaa8", - "shasum": "" - }, - "require": { - "php": ">=5.3.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~1.0" - }, - "suggest": { - "ext-gd": "to use Image", - "ext-iconv": "to use Strings::webalize() and toAscii()", - "ext-intl": "for script transliteration in Strings::webalize() and toAscii()", - "ext-mbstring": "to use Strings::lower() etc..." - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "Nette Utility Classes", - "homepage": "https://nette.org", - "time": "2015-10-05 12:18:24" - }, - { - "name": "tracy/tracy", - "version": "v2.3.6", - "source": { - "type": "git", - "url": "https://github.com/nette/tracy.git", - "reference": "79831c75b6f48fcb897d25ccae5deec358cb2142" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/tracy/zipball/79831c75b6f48fcb897d25ccae5deec358cb2142", - "reference": "79831c75b6f48fcb897d25ccae5deec358cb2142", - "shasum": "" - }, - "require": { - "php": ">=5.3.1" - }, - "require-dev": { - "nette/di": "~2.3", - "nette/tester": "~1.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src" - ], - "files": [ - "src/shortcuts.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "Tracy: useful PHP debugger", - "homepage": "https://tracy.nette.org", - "keywords": [ - "debug", - "debugger", - "nette" - ], - "time": "2015-10-28 23:49:21" - } - ], - "packages-dev": [ - { - "name": "codeception/codeception", - "version": "2.1.4", - "source": { - "type": "git", - "url": "https://github.com/Codeception/Codeception.git", - "reference": "6a812e8a0d1b1db939a29b4dc14cb398b21b6112" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/6a812e8a0d1b1db939a29b4dc14cb398b21b6112", - "reference": "6a812e8a0d1b1db939a29b4dc14cb398b21b6112", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-mbstring": "*", - "facebook/webdriver": ">=1.0.1", - "guzzlehttp/guzzle": ">=4.1.4 <7.0", - "guzzlehttp/psr7": "~1.0", - "php": ">=5.4.0", - "phpunit/phpunit": "~4.8.0", - "symfony/browser-kit": "~2.4", - "symfony/console": "~2.4", - "symfony/css-selector": "~2.4", - "symfony/dom-crawler": "~2.4,!=2.4.5", - "symfony/event-dispatcher": "~2.4", - "symfony/finder": "~2.4", - "symfony/yaml": "~2.4" - }, - "require-dev": { - "codeception/specify": "~0.3", - "facebook/php-sdk-v4": "~4.0", - "flow/jsonpath": "~0.2", - "monolog/monolog": "~1.8", - "pda/pheanstalk": "~2.0", - "videlalvaro/php-amqplib": "~2.4" - }, - "suggest": { - "codeception/phpbuiltinserver": "Extension to start and stop PHP built-in web server for your tests", - "codeception/specify": "BDD-style code blocks", - "codeception/verify": "BDD-style assertions", - "monolog/monolog": "Log test steps", - "phpseclib/phpseclib": "Extension required to use the SFTP option in the FTP Module." - }, - "bin": [ - "codecept" - ], - "type": "library", - "extra": { - "branch-alias": [] - }, - "autoload": { - "psr-4": { - "Codeception\\": "src\\Codeception", - "Codeception\\Extension\\": "ext" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Bodnarchuk", - "email": "davert@mail.ua", - "homepage": "http://codegyre.com" - } - ], - "description": "BDD-style testing framework", - "homepage": "http://codeception.com/", - "keywords": [ - "BDD", - "TDD", - "acceptance testing", - "functional testing", - "unit testing" - ], - "time": "2015-11-12 03:57:06" - }, - { - "name": "doctrine/instantiator", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2015-06-14 21:17:01" - }, - { - "name": "facebook/webdriver", - "version": "1.0.4", - "source": { - "type": "git", - "url": "https://github.com/facebook/php-webdriver.git", - "reference": "a6e209a309bf7cd71acf15476f40b11a25d5a79d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/a6e209a309bf7cd71acf15476f40b11a25d5a79d", - "reference": "a6e209a309bf7cd71acf15476f40b11a25d5a79d", - "shasum": "" - }, - "require": { - "php": ">=5.3.19" - }, - "require-dev": { - "phpunit/phpunit": "4.6.*" - }, - "suggest": { - "phpdocumentor/phpdocumentor": "2.*" - }, - "type": "library", - "autoload": { - "psr-4": { - "Facebook\\WebDriver\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "description": "A PHP client for WebDriver", - "homepage": "https://github.com/facebook/php-webdriver", - "keywords": [ - "facebook", - "php", - "selenium", - "webdriver" - ], - "time": "2015-11-03 22:17:22" - }, - { - "name": "guzzlehttp/guzzle", - "version": "6.1.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "c6851d6e48f63b69357cbfa55bca116448140e0c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/c6851d6e48f63b69357cbfa55bca116448140e0c", - "reference": "c6851d6e48f63b69357cbfa55bca116448140e0c", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "~1.0", - "guzzlehttp/psr7": "~1.1", - "php": ">=5.5.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~4.0", - "psr/log": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.1-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2015-11-23 00:47:50" - }, - { - "name": "guzzlehttp/promises", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/b1e1c0d55f8083c71eda2c28c12a228d708294ea", - "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "time": "2015-10-15 22:28:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/4d0bdbe1206df7440219ce14c972aa57cc5e4982", - "reference": "4d0bdbe1206df7440219ce14c972aa57cc5e4982", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "PSR-7 message implementation", - "keywords": [ - "http", - "message", - "stream", - "uri" - ], - "time": "2015-11-03 01:34:55" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "time": "2015-02-03 12:10:50" - }, - { - "name": "phpspec/prophecy", - "version": "v1.5.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1" - }, - "require-dev": { - "phpspec/phpspec": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2015-08-13 10:07:40" - }, - { - "name": "phpunit/php-code-coverage", - "version": "2.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2015-10-06 15:47:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2015-06-21 13:08:43" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21 13:50:34" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.7", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2015-06-21 08:01:12" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2015-09-15 10:49:45" - }, - { - "name": "phpunit/phpunit", - "version": "4.8.18", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fa33d4ad96481b91df343d83e8c8aabed6b1dfd3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fa33d4ad96481b91df343d83e8c8aabed6b1dfd3", - "reference": "fa33d4ad96481b91df343d83e8c8aabed6b1dfd3", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": ">=1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.1", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.8.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2015-11-11 11:32:49" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2015-10-02 06:51:40" - }, - { - "name": "psr/http-message", - "version": "1.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2015-05-04 20:22:00" - }, - { - "name": "sebastian/comparator", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2015-07-26 15:48:44" - }, - { - "name": "sebastian/diff", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2015-02-22 15:13:53" - }, - { - "name": "sebastian/environment", - "version": "1.3.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6324c907ce7a52478eeeaede764f48733ef5ae44", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2015-08-03 06:14:51" - }, - { - "name": "sebastian/exporter", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2015-06-21 07:55:53" - }, - { - "name": "sebastian/global-state", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2015-10-12 03:26:01" - }, - { - "name": "sebastian/recursion-context", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-06-21 08:04:50" - }, - { - "name": "sebastian/version", - "version": "1.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "shasum": "" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21 13:59:46" - }, - { - "name": "symfony/browser-kit", - "version": "v2.7.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/browser-kit.git", - "reference": "bd28847ea2193916074c7b11d4fdd78570049694" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/bd28847ea2193916074c7b11d4fdd78570049694", - "reference": "bd28847ea2193916074c7b11d4fdd78570049694", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/dom-crawler": "~2.0,>=2.0.5" - }, - "require-dev": { - "symfony/css-selector": "~2.0,>=2.0.5", - "symfony/process": "~2.3.34|~2.7,>=2.7.6" - }, - "suggest": { - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\BrowserKit\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony BrowserKit Component", - "homepage": "https://symfony.com", - "time": "2015-11-02 20:20:53" - }, - { - "name": "symfony/console", - "version": "v2.7.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "16bb1cb86df43c90931df65f529e7ebd79636750" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/16bb1cb86df43c90931df65f529e7ebd79636750", - "reference": "16bb1cb86df43c90931df65f529e7ebd79636750", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1", - "symfony/process": "~2.1" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2015-11-18 09:54:26" - }, - { - "name": "symfony/css-selector", - "version": "v2.7.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "abb47717fb88aebd9437da2fc8bb01a50a36679f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/abb47717fb88aebd9437da2fc8bb01a50a36679f", - "reference": "abb47717fb88aebd9437da2fc8bb01a50a36679f", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony CssSelector Component", - "homepage": "https://symfony.com", - "time": "2015-10-30 20:10:21" - }, - { - "name": "symfony/dom-crawler", - "version": "v2.7.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/dom-crawler.git", - "reference": "b33593cbfe1d81b50d48353f338aca76a08658d8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/b33593cbfe1d81b50d48353f338aca76a08658d8", - "reference": "b33593cbfe1d81b50d48353f338aca76a08658d8", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/css-selector": "~2.3" - }, - "suggest": { - "symfony/css-selector": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\DomCrawler\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony DomCrawler Component", - "homepage": "https://symfony.com", - "time": "2015-11-02 20:20:53" - }, - { - "name": "symfony/event-dispatcher", - "version": "v2.7.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "7e2f9c31645680026c2372edf66f863fc7757af5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7e2f9c31645680026c2372edf66f863fc7757af5", - "reference": "7e2f9c31645680026c2372edf66f863fc7757af5", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5", - "symfony/dependency-injection": "~2.6", - "symfony/expression-language": "~2.6", - "symfony/stopwatch": "~2.3" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2015-10-30 20:10:21" - }, - { - "name": "symfony/finder", - "version": "v2.7.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "a06a0c0ff7db3736a50d530c908cca547bf13da9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/a06a0c0ff7db3736a50d530c908cca547bf13da9", - "reference": "a06a0c0ff7db3736a50d530c908cca547bf13da9", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2015-10-30 20:10:21" - }, - { - "name": "symfony/yaml", - "version": "v2.7.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "4cfcd7a9fceba662b3c036b7d9a91f6197af046c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/4cfcd7a9fceba662b3c036b7d9a91f6197af046c", - "reference": "4cfcd7a9fceba662b3c036b7d9a91f6197af046c", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2015-11-18 13:41:01" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">= 5.3.7" - }, - "platform-dev": [] -} diff --git a/nette/native_db/notejam/tests/_bootstrap.php b/nette/native_db/notejam/tests/_bootstrap.php deleted file mode 100644 index 243f9c85b..000000000 --- a/nette/native_db/notejam/tests/_bootstrap.php +++ /dev/null @@ -1,2 +0,0 @@ -amOnPage('/signin'); - $this->see('Sign in'); - $this->fillField("Email", $email); - $this->fillField("Password", $password); - $this->click('Sign In'); - } - -} diff --git a/nette/native_db/notejam/tests/_support/FunctionalTester.php b/nette/native_db/notejam/tests/_support/FunctionalTester.php deleted file mode 100644 index 7e888f8b2..000000000 --- a/nette/native_db/notejam/tests/_support/FunctionalTester.php +++ /dev/null @@ -1,26 +0,0 @@ -wantTo('see note can be successfully created'); -$I->testLogin(); -$I->amOnPage('/notes/create'); -$I->fillField('Name', 'Example note'); -$I->fillField('Text', 'Lorem ipsum'); -$I->selectOption('Pad', 1); -$I->click('Save'); -$I->see('Example note'); diff --git a/nette/native_db/notejam/tests/acceptance/CreateNoteFailCept.php b/nette/native_db/notejam/tests/acceptance/CreateNoteFailCept.php deleted file mode 100644 index 4f768ee29..000000000 --- a/nette/native_db/notejam/tests/acceptance/CreateNoteFailCept.php +++ /dev/null @@ -1,9 +0,0 @@ -wantTo('see note can not be created without required fields'); -$I->testLogin(); -$I->amOnPage('/notes/create'); -$I->click('Save'); -$I->seeInCurrentUrl('/notes/create'); -$I->see('Name is required'); -$I->see('Text is required'); diff --git a/nette/native_db/notejam/tests/acceptance/CreatePadCept.php b/nette/native_db/notejam/tests/acceptance/CreatePadCept.php deleted file mode 100644 index 4926950ba..000000000 --- a/nette/native_db/notejam/tests/acceptance/CreatePadCept.php +++ /dev/null @@ -1,8 +0,0 @@ -wantTo('see pad can be successfully created'); -$I->testLogin(); -$I->amOnPage('/pads/create'); -$I->fillField('Name', 'Example pad'); -$I->click('Save'); -$I->see('Example pad'); diff --git a/nette/native_db/notejam/tests/acceptance/CreatePadFailCept.php b/nette/native_db/notejam/tests/acceptance/CreatePadFailCept.php deleted file mode 100644 index b8f61bbfa..000000000 --- a/nette/native_db/notejam/tests/acceptance/CreatePadFailCept.php +++ /dev/null @@ -1,9 +0,0 @@ -wantTo('see pad can not be created without required fields'); -$I->testLogin(); -$I->amOnPage('/pads/create'); -$I->click('Save'); -$I->dontSee('Example pad'); -$I->seeInCurrentUrl('/pads/create'); -$I->see('Name is required'); diff --git a/nette/native_db/notejam/tests/acceptance/DeleteNoteCept.php b/nette/native_db/notejam/tests/acceptance/DeleteNoteCept.php deleted file mode 100644 index fb718c70c..000000000 --- a/nette/native_db/notejam/tests/acceptance/DeleteNoteCept.php +++ /dev/null @@ -1,7 +0,0 @@ -wantTo('see note can be successfully deleted'); -$I->testLogin(); -$I->amOnPage('/notes/1/delete'); -$I->click('Yes, I want to delete this note'); -$I->dontSee('Note 1'); diff --git a/nette/native_db/notejam/tests/acceptance/DeleteOtherOwnersNoteCept.php b/nette/native_db/notejam/tests/acceptance/DeleteOtherOwnersNoteCept.php deleted file mode 100644 index f9f262da0..000000000 --- a/nette/native_db/notejam/tests/acceptance/DeleteOtherOwnersNoteCept.php +++ /dev/null @@ -1,6 +0,0 @@ -wantTo('see note can not be deleted by not an owner'); -$I->testLogin(); -$I->amOnPage('/notes/5/delete'); -$I->dontSee('Yes, I want to delete this note'); diff --git a/nette/native_db/notejam/tests/acceptance/DeleteOtherOwnersPadCept.php b/nette/native_db/notejam/tests/acceptance/DeleteOtherOwnersPadCept.php deleted file mode 100644 index 531887afe..000000000 --- a/nette/native_db/notejam/tests/acceptance/DeleteOtherOwnersPadCept.php +++ /dev/null @@ -1,6 +0,0 @@ -wantTo('see pad can not be deleted by not an owner'); -$I->testLogin(); -$I->amOnPage('/pads/4/delete'); -$I->dontSee('Yes, I want to delete this pad'); diff --git a/nette/native_db/notejam/tests/acceptance/DeletePadCept.php b/nette/native_db/notejam/tests/acceptance/DeletePadCept.php deleted file mode 100644 index f86354c75..000000000 --- a/nette/native_db/notejam/tests/acceptance/DeletePadCept.php +++ /dev/null @@ -1,7 +0,0 @@ -wantTo('see pad can be successfully deleted'); -$I->testLogin(); -$I->amOnPage('/pads/1/delete'); -$I->click('Yes, I want to delete this pad'); -$I->dontSee('Pad 1'); diff --git a/nette/native_db/notejam/tests/acceptance/EditNoteCept.php b/nette/native_db/notejam/tests/acceptance/EditNoteCept.php deleted file mode 100644 index 9012a2e35..000000000 --- a/nette/native_db/notejam/tests/acceptance/EditNoteCept.php +++ /dev/null @@ -1,12 +0,0 @@ -wantTo('see note can be successfully edited'); -$I->testLogin(); -$I->amOnPage('/notes/1/edit'); -$I->fillField('Name', 'Note 1 - edited'); -$I->fillField('Text', 'Lorem ipsum - edited'); -$I->selectOption('Pad', 1); -$I->click('Save'); -$I->see('Note 1 - edited'); -$I->amOnPage('/pads/1'); -$I->see('Note 1 - edited'); diff --git a/nette/native_db/notejam/tests/acceptance/EditNoteFailCept.php b/nette/native_db/notejam/tests/acceptance/EditNoteFailCept.php deleted file mode 100644 index f921f1475..000000000 --- a/nette/native_db/notejam/tests/acceptance/EditNoteFailCept.php +++ /dev/null @@ -1,11 +0,0 @@ -wantTo('see note can not be edited without required fields'); -$I->testLogin(); -$I->amOnPage('/notes/1/edit'); -$I->fillField('Name', ''); -$I->fillField('Text', ''); -$I->click('Save'); -$I->seeInCurrentUrl('/notes/1/edit'); -$I->see('Name is required'); -$I->see('Text is required'); diff --git a/nette/native_db/notejam/tests/acceptance/EditOtherOwnersNoteCept.php b/nette/native_db/notejam/tests/acceptance/EditOtherOwnersNoteCept.php deleted file mode 100644 index 23d00f608..000000000 --- a/nette/native_db/notejam/tests/acceptance/EditOtherOwnersNoteCept.php +++ /dev/null @@ -1,6 +0,0 @@ -wantTo('see note can not be edited by not an owner'); -$I->testLogin(); -$I->amOnPage('/notes/5/edit'); -$I->dontSee('Save', 'input'); diff --git a/nette/native_db/notejam/tests/acceptance/EditOtherOwnersPadCept.php b/nette/native_db/notejam/tests/acceptance/EditOtherOwnersPadCept.php deleted file mode 100644 index 227f97916..000000000 --- a/nette/native_db/notejam/tests/acceptance/EditOtherOwnersPadCept.php +++ /dev/null @@ -1,6 +0,0 @@ -wantTo('see pad can not be edited by not an owner'); -$I->testLogin(); -$I->amOnPage('/pads/4/edit'); -$I->dontSee('Save', 'input'); diff --git a/nette/native_db/notejam/tests/acceptance/EditPadCept.php b/nette/native_db/notejam/tests/acceptance/EditPadCept.php deleted file mode 100644 index 923c9cc95..000000000 --- a/nette/native_db/notejam/tests/acceptance/EditPadCept.php +++ /dev/null @@ -1,8 +0,0 @@ -wantTo('see pad can be successfully edited'); -$I->testLogin(); -$I->amOnPage('/pads/1/edit'); -$I->fillField('Name', 'Pad 1 - edited'); -$I->click('Save'); -$I->see('Pad 1 - edited'); diff --git a/nette/native_db/notejam/tests/acceptance/EditPadFailCept.php b/nette/native_db/notejam/tests/acceptance/EditPadFailCept.php deleted file mode 100644 index a6614b736..000000000 --- a/nette/native_db/notejam/tests/acceptance/EditPadFailCept.php +++ /dev/null @@ -1,9 +0,0 @@ -wantTo('see pad cannot be edited without required fields'); -$I->testLogin(); -$I->amOnPage('/pads/1/edit'); -$I->fillField('Name', ''); -$I->click('Save'); -$I->seeInCurrentUrl('/pads/1/edit'); -$I->see('Name is required'); diff --git a/nette/native_db/notejam/tests/acceptance/ForgottenPasswordCept.php b/nette/native_db/notejam/tests/acceptance/ForgottenPasswordCept.php deleted file mode 100644 index aaeccdc3c..000000000 --- a/nette/native_db/notejam/tests/acceptance/ForgottenPasswordCept.php +++ /dev/null @@ -1,7 +0,0 @@ -wantTo('see user can successfully get new password'); -$I->amOnPage('/forgot-password'); -$I->fillField('Email', 'john.doe@example.com'); -$I->click('Get new password'); -$I->see('Sign in'); diff --git a/nette/native_db/notejam/tests/acceptance/ForgottenPasswordInvalidEmailCept.php b/nette/native_db/notejam/tests/acceptance/ForgottenPasswordInvalidEmailCept.php deleted file mode 100644 index 2be0e84ab..000000000 --- a/nette/native_db/notejam/tests/acceptance/ForgottenPasswordInvalidEmailCept.php +++ /dev/null @@ -1,7 +0,0 @@ -wantTo('see user can not successfully get new password with invalid email'); -$I->amOnPage('/forgot-password'); -$I->fillField('Email', 'invalid'); -$I->click('Get new password'); -$I->see('Invalid email'); diff --git a/nette/native_db/notejam/tests/acceptance/ForgottenPasswordUnregisteredEmailCept.php b/nette/native_db/notejam/tests/acceptance/ForgottenPasswordUnregisteredEmailCept.php deleted file mode 100644 index 83702e1d2..000000000 --- a/nette/native_db/notejam/tests/acceptance/ForgottenPasswordUnregisteredEmailCept.php +++ /dev/null @@ -1,7 +0,0 @@ -wantTo('see user can not successfully get new password with unregistered email'); -$I->amOnPage('/forgot-password'); -$I->fillField('Email', 'invalid@example.com'); -$I->click('Get new password'); -$I->see('No user with given email found'); diff --git a/nette/native_db/notejam/tests/acceptance/HomepageCept.php b/nette/native_db/notejam/tests/acceptance/HomepageCept.php deleted file mode 100644 index c7c7afd42..000000000 --- a/nette/native_db/notejam/tests/acceptance/HomepageCept.php +++ /dev/null @@ -1,8 +0,0 @@ -wantTo('see notes can be viewed successfully'); -$I->amOnPage('/'); -$I->seeInCurrentUrl('/signin'); -$I->testLogin(); -$I->seeCurrentUrlEquals('/'); -$I->see('My pads'); diff --git a/nette/native_db/notejam/tests/acceptance/NoteDetailCept.php b/nette/native_db/notejam/tests/acceptance/NoteDetailCept.php deleted file mode 100644 index 55c890c63..000000000 --- a/nette/native_db/notejam/tests/acceptance/NoteDetailCept.php +++ /dev/null @@ -1,7 +0,0 @@ -wantTo('see note can be viewed successfully'); -$I->testLogin(); -$I->amOnPage('/notes/1'); -$I->see('Note 1'); -$I->see('Lorem ipsum'); diff --git a/nette/native_db/notejam/tests/acceptance/OtherOwnersNoteDetailCept.php b/nette/native_db/notejam/tests/acceptance/OtherOwnersNoteDetailCept.php deleted file mode 100644 index 2e65f0224..000000000 --- a/nette/native_db/notejam/tests/acceptance/OtherOwnersNoteDetailCept.php +++ /dev/null @@ -1,7 +0,0 @@ -wantTo('see note can not be viewed by not an owner'); -$I->testLogin(); -$I->amOnPage('/notes/5'); -$I->dontSee('Other Note'); -$I->dontSee('Lorem ipsum'); diff --git a/nette/native_db/notejam/tests/acceptance/OtherOwnersPadDetailCept.php b/nette/native_db/notejam/tests/acceptance/OtherOwnersPadDetailCept.php deleted file mode 100644 index e169ae94f..000000000 --- a/nette/native_db/notejam/tests/acceptance/OtherOwnersPadDetailCept.php +++ /dev/null @@ -1,6 +0,0 @@ -wantTo('see pad can not be viewed by not an owner'); -$I->testLogin(); -$I->amOnPage('/pads/4'); -$I->dontSee('Other Pad'); diff --git a/nette/native_db/notejam/tests/acceptance/PadDetailCept.php b/nette/native_db/notejam/tests/acceptance/PadDetailCept.php deleted file mode 100644 index cc00bcf9a..000000000 --- a/nette/native_db/notejam/tests/acceptance/PadDetailCept.php +++ /dev/null @@ -1,7 +0,0 @@ -wantTo('see pad can be viewed'); -$I->testLogin(); -$I->amOnPage('/pads/1'); -$I->see('Pad 1'); -$I->see('Note 2'); // Note 2 belongs to Pad 1 diff --git a/nette/native_db/notejam/tests/acceptance/SetNewPasswordCept.php b/nette/native_db/notejam/tests/acceptance/SetNewPasswordCept.php deleted file mode 100644 index 5b4a95f91..000000000 --- a/nette/native_db/notejam/tests/acceptance/SetNewPasswordCept.php +++ /dev/null @@ -1,10 +0,0 @@ -wantTo('see user can successfully set new password'); -$I->testLogin(); -$I->amOnPage('/settings'); -$I->fillField('Current password', 'pass'); -$I->fillField('New Password', 'qwerty'); -$I->fillField('Confirm New Password', 'qwerty'); -$I->click('Change Password'); -$I->see('Account settings'); diff --git a/nette/native_db/notejam/tests/acceptance/SetNewPasswordFailCept.php b/nette/native_db/notejam/tests/acceptance/SetNewPasswordFailCept.php deleted file mode 100644 index 76160c170..000000000 --- a/nette/native_db/notejam/tests/acceptance/SetNewPasswordFailCept.php +++ /dev/null @@ -1,11 +0,0 @@ -wantTo('see user can not set new password without required fields'); -$I->testLogin(); -$I->amOnPage('/settings'); -$I->fillField('Current password', ''); -$I->fillField('New Password', ''); -$I->fillField('Confirm New Password', ''); -$I->click('Change Password'); -$I->see('Current password is required'); -$I->see('New password is required'); diff --git a/nette/native_db/notejam/tests/acceptance/SetNewPasswordInvalidCurrentPasswordCept.php b/nette/native_db/notejam/tests/acceptance/SetNewPasswordInvalidCurrentPasswordCept.php deleted file mode 100644 index 44decd705..000000000 --- a/nette/native_db/notejam/tests/acceptance/SetNewPasswordInvalidCurrentPasswordCept.php +++ /dev/null @@ -1,10 +0,0 @@ -wantTo('see user can not set new password with invalid current password'); -$I->testLogin(); -$I->amOnPage('/settings'); -$I->fillField('Current password', 'pls'); -$I->fillField('New Password', 'pass'); -$I->fillField('Confirm New Password', 'pass'); -$I->click('Change Password'); -$I->see('Invalid current password'); diff --git a/nette/native_db/notejam/tests/acceptance/SetNewPasswordMismatchCept.php b/nette/native_db/notejam/tests/acceptance/SetNewPasswordMismatchCept.php deleted file mode 100644 index a229a0ecd..000000000 --- a/nette/native_db/notejam/tests/acceptance/SetNewPasswordMismatchCept.php +++ /dev/null @@ -1,10 +0,0 @@ -wantTo('see user can not set new password without confirming new password'); -$I->testLogin(); -$I->amOnPage('/settings'); -$I->fillField('Current password', 'pass'); -$I->fillField('New Password', 'pls'); -$I->fillField('Confirm New Password', 'pass'); -$I->click('Change Password'); -$I->see('New passwords must match'); diff --git a/nette/native_db/notejam/tests/acceptance/SignInCept.php b/nette/native_db/notejam/tests/acceptance/SignInCept.php deleted file mode 100644 index bae44a2a5..000000000 --- a/nette/native_db/notejam/tests/acceptance/SignInCept.php +++ /dev/null @@ -1,5 +0,0 @@ -wantTo('see user can successfully sign in'); -$I->testLogin(); -$I->see("My pads"); diff --git a/nette/native_db/notejam/tests/acceptance/SignInFailCept.php b/nette/native_db/notejam/tests/acceptance/SignInFailCept.php deleted file mode 100644 index 99645b64f..000000000 --- a/nette/native_db/notejam/tests/acceptance/SignInFailCept.php +++ /dev/null @@ -1,10 +0,0 @@ -wantTo('see user can not sign in without required fields'); -$I->amOnPage('/signin'); -$I->see('Sign in'); -$I->fillField("Email", ''); -$I->fillField("Password", ''); -$I->click('Sign In'); -$I->see('Email is required'); -$I->see('Password is required'); diff --git a/nette/native_db/notejam/tests/acceptance/SignInInvalidEmailCept.php b/nette/native_db/notejam/tests/acceptance/SignInInvalidEmailCept.php deleted file mode 100644 index 606afc3c2..000000000 --- a/nette/native_db/notejam/tests/acceptance/SignInInvalidEmailCept.php +++ /dev/null @@ -1,5 +0,0 @@ -wantTo('see user can not sign in with invalid email'); -$I->testLogin('invalid@example.com', 'pass'); -$I->see("Unknown user"); diff --git a/nette/native_db/notejam/tests/acceptance/SignInInvalidPasswordCept.php b/nette/native_db/notejam/tests/acceptance/SignInInvalidPasswordCept.php deleted file mode 100644 index 2e8b58871..000000000 --- a/nette/native_db/notejam/tests/acceptance/SignInInvalidPasswordCept.php +++ /dev/null @@ -1,5 +0,0 @@ -wantTo('see user can not sign in with invalid password'); -$I->testLogin('john.doe@example.com', 'pls'); -$I->see('Invalid password'); diff --git a/nette/native_db/notejam/tests/acceptance/SignUpAlreadyExistsCept.php b/nette/native_db/notejam/tests/acceptance/SignUpAlreadyExistsCept.php deleted file mode 100644 index f8e100b0f..000000000 --- a/nette/native_db/notejam/tests/acceptance/SignUpAlreadyExistsCept.php +++ /dev/null @@ -1,10 +0,0 @@ -wantTo('see user can not sign up with already registered email'); -$I->amOnPage('/signup'); -$I->fillField('Email', 'john.doe@example.com'); -$I->fillField('Password', 'pass'); -$I->fillField('confirm', 'pass'); -$I->click('Sign Up'); -$I->seeInCurrentUrl('/signup'); -$I->see('User with given email already registered'); diff --git a/nette/native_db/notejam/tests/acceptance/SignUpCept.php b/nette/native_db/notejam/tests/acceptance/SignUpCept.php deleted file mode 100644 index 4c6f190ac..000000000 --- a/nette/native_db/notejam/tests/acceptance/SignUpCept.php +++ /dev/null @@ -1,13 +0,0 @@ -wantTo('see user can successfully sign up'); -$I->amOnPage('/signup'); -$I->fillField('Email', 'test@example.com'); -$I->fillField('Password', 'qwerty'); -$I->fillField('confirm', 'qwerty'); -$I->click('Sign Up'); -$I->seeInCurrentUrl('/signin'); -$I->see('User is successfully created. Now you can sign in.'); -$I->testLogin('test@example.com', 'qwerty'); -$I->seeCurrentUrlEquals('/'); -$I->see('My pads'); diff --git a/nette/native_db/notejam/tests/acceptance/SignUpFailCept.php b/nette/native_db/notejam/tests/acceptance/SignUpFailCept.php deleted file mode 100644 index 2581fb91e..000000000 --- a/nette/native_db/notejam/tests/acceptance/SignUpFailCept.php +++ /dev/null @@ -1,11 +0,0 @@ -wantTo('see user can not sign up without required fields'); -$I->amOnPage('/signup'); -$I->fillField('Email', ''); -$I->fillField('Password', ''); -$I->fillField('confirm', ''); -$I->click('Sign Up'); -$I->seeInCurrentUrl('/signup'); -$I->see('Email is required'); -$I->see('Password is required'); diff --git a/nette/native_db/notejam/tests/acceptance/SignUpInvalidEmailCept.php b/nette/native_db/notejam/tests/acceptance/SignUpInvalidEmailCept.php deleted file mode 100644 index 97b4bfef8..000000000 --- a/nette/native_db/notejam/tests/acceptance/SignUpInvalidEmailCept.php +++ /dev/null @@ -1,10 +0,0 @@ -wantTo('see user can not sign up with invalid email'); -$I->amOnPage('/signup'); -$I->fillField('Email', 'abcd'); -$I->fillField('Password', 'pass'); -$I->fillField('confirm', 'pass'); -$I->click('Sign Up'); -$I->seeInCurrentUrl('/signup'); -$I->see('Invalid email'); diff --git a/nette/native_db/notejam/tests/acceptance/SignUpPasswordMismatchCept.php b/nette/native_db/notejam/tests/acceptance/SignUpPasswordMismatchCept.php deleted file mode 100644 index 1e6a470fb..000000000 --- a/nette/native_db/notejam/tests/acceptance/SignUpPasswordMismatchCept.php +++ /dev/null @@ -1,10 +0,0 @@ -wantTo('see user can not sign up without confirming password'); -$I->amOnPage('/signup'); -$I->fillField('Email', 'test@example.com'); -$I->fillField('Password', 'pass'); -$I->fillField('confirm', 'pls'); -$I->click('Sign Up'); -$I->seeInCurrentUrl('/signup'); -$I->see('Passwords must match'); diff --git a/nette/native_db/notejam/tests/acceptance/_bootstrap.php b/nette/native_db/notejam/tests/acceptance/_bootstrap.php deleted file mode 100644 index 8a8855580..000000000 --- a/nette/native_db/notejam/tests/acceptance/_bootstrap.php +++ /dev/null @@ -1,2 +0,0 @@ - - - - - - - - -Site is temporarily down for maintenance - -

We're Sorry

- -

The site is temporarily down for maintenance. Please try again in a few minutes.

- -div { - display: none; } - - -/* Grid */ -#grid .column, -#grid .columns { - background: #ddd; - height: 25px; - line-height: 25px; - margin-bottom: 10px; - text-align: center; - text-transform: uppercase; - color: #555; - font-size: 12px; - font-weight: bold; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; } -#grid .column:hover, -#grid .columns:hover { - background: #bbb; - color: #333; } -#grid .example-grid { overflow: hidden; } - -.post-button-note, -.post-button-note a { - font-size: 11px; - color: #999; } - -#examples .four.columns a { - text-decoration: none; -} -#examples .four.columns a:hover { - text-decoration: underline; -} - - -.resize { - position: fixed; - bottom: 0; - right: 0; - height: 80px; - width: 80px; - background: url(images/resize.png); } - - -img { - max-width: 100%; - height: auto; } - -.gist-meta { display: none !important;} - -ul ul ul li { margin-bottom: 3px; } - -.twitter-share-button { margin-bottom: -18px; } - -/* Table stylesheets */ -table { - width: 100%; - border-collapse: collapse; -} - -table th, table td { - padding: 10px 10px 9px; - font-size: 13px; - line-height: 18px; - text-align: left; -} - -table td { - vertical-align: top; - border-top: solid 1px #ddd; -} - -table th { - padding-top: 9px; - font-weight: bold; - vertical-align: middle; -} - -table.condensed th, table.condensed td { - padding: 5px 5px 4px; -} - -table.bordered { - border-collapse: separate; - border: solid 1px #ddd; - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; -} - -table.bordered th + th, -table.bordered th + td, -table.bordered td + td { - border-left: solid 1px #ddd; -} - -.zebra-striped tbody tr:nth-child(odd) td, -.zebra-striped tbody tr:nth-child(odd) th { - background: #f5f5f5; -} - -.carbonad, -.carbonad-image, -.carbonad-text, -.carbonad-tag { - background: none !important; - border: none !important; - margin-left: 0 !important; -} -.carbonad-tag { - margin-top: 6px !important; - padding-top: 0 !important; -} -.carbonad-text { - height: auto !important; -} -.carbonad-image { - margin-top: 0 !important; -} - -.hidden-text { - font-size: 12px; - color: #999; -} - -td.date, th.date { - text-align: right; -} - -td.date { - font-style: italic; -} - -form.note input[type="text"], form.note textarea { - width: 100%; -} - -form hr { - width: 218px; - margin: 10px 0px; -} - -form.note textarea { - height: 250px; -} - -div.content-area { - min-height: 600px; -} - -hr.footer { - margin-bottom: 10px; -} - -div.footer { - margin-bottom: 10px; - text-align: center; - font-size: 12px; -} - -form.sign-in { - margin: 50px 0 0 0; -} - -.sort_arrow { - text-decoration: none; -} - -.sort_arrow:hover { - text-decoration: none; - color: red; -} - -div.sign-in-out-block { - position: absolute; - right: 14px; - top: 8px; - font-size: 12px; -} - -div.sign-in-out-block a { - /*text-decoration: none;*/ -} - -a.small-red { - color: red; - font-size: 12px; -} - -table.notes { - margin: 0 0 20px 0; -} - -table.notes th.note { - width: 72%; -} - -table.notes td.pad { - color: grey; -} - -table.notes td.pad a { - color: grey; - text-decoration: underline; - font-style: normal; -} - - -table.notes td.pad a:hover { - color: black; -} - -p.empty { - color: grey; - font-style: italic; -} - -a.delete-note { - float: right; - font-size: 12px; - color: red; -} - -.red, input.red { - color: red !important; -} - -ul.errorlist, ul.errors { - margin: -18px 0 0 0; -} - -ul.errorlist li, ul.errors li { - color: red; -} - -.alert-area { - text-align: center; -} - -.alert { - padding: 5px 8px; - margin: 0 0 12px 0; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; -} - -.alert-success { - color: #468847; - background-color: #dff0d8; - border: 1px solid #d6e9c6; -} - -.alert-error { - color: #b94a48; - background-color: #f2dede; - border: 1px solid #eed3d7; -} - -/* Mobile */ -@media only screen and (max-width: 767px) { - header h1 { font-size: 34px; line-height: 37px; } - nav { position: relative; } - nav ul, - .carbonad { - display: none; - } - #logo { text-align: left; } - #examples .four.columns { - padding-top: 30px; - } -} - -/* Mobile Landscape */ -@media only screen and (min-width: 480px) and (max-width: 767px) { - nav ul { - display: none; - } -} - -/* Non 960 */ -@media only screen and (max-width: 959px) { - #logo { - font-size: 21px; - margin-bottom: 15px; } - nav .button { - padding: 9px 20px 11px; } -} - -/* iPad Portrait/Browser */ -@media only screen and (min-width: 768px) and (max-width: 959px) { - nav { - width: 124px; } -} - -/* Mobile/Browser */ -@media only screen and (max-width: 767px) {} - -/* Mobile Landscape/Browser */ -@media only screen and (min-width: 480px) and (max-width: 767px) {} - -/* Anything smaller than standard 960 */ -@media only screen and (max-width: 959px) {} - - -/* iPad Portrait Only */ -@media only screen and (min-width: 768px) and (max-width: 959px) and (max-device-width: 1000px) {} - -/* Mobile Only */ -@media only screen and (max-width: 767px) and (max-device-width: 1000px) {} - -/* Mobile Landscape Only */ -@media only screen and (min-width: 480px) and (max-width: 767px) and (max-device-width: 1000px) {} - -/* Anything smaller than standard 960 on a device */ -@media only screen and (max-width: 959px) and (max-device-width: 1000px) { - .resize { display: none; } -} diff --git a/nette/native_db/notejam/www/favicon.ico b/nette/native_db/notejam/www/favicon.ico deleted file mode 100644 index b20cfd0f0..000000000 Binary files a/nette/native_db/notejam/www/favicon.ico and /dev/null differ diff --git a/nette/native_db/notejam/www/images/spinner.gif b/nette/native_db/notejam/www/images/spinner.gif deleted file mode 100644 index 185a077d3..000000000 Binary files a/nette/native_db/notejam/www/images/spinner.gif and /dev/null differ diff --git a/nette/native_db/notejam/www/index.php b/nette/native_db/notejam/www/index.php deleted file mode 100644 index 13b8a6a6d..000000000 --- a/nette/native_db/notejam/www/index.php +++ /dev/null @@ -1,13 +0,0 @@ -getByType('Nette\Application\Application')->run(); diff --git a/nette/native_db/notejam/www/js/main.js b/nette/native_db/notejam/www/js/main.js deleted file mode 100644 index f5aaa4205..000000000 --- a/nette/native_db/notejam/www/js/main.js +++ /dev/null @@ -1,2 +0,0 @@ -$(function () { -}); diff --git a/nette/native_db/notejam/www/robots.txt b/nette/native_db/notejam/www/robots.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/nette/native_db/readme.rst b/nette/native_db/readme.rst deleted file mode 100644 index b68fe3fe8..000000000 --- a/nette/native_db/readme.rst +++ /dev/null @@ -1,99 +0,0 @@ -************** -Notejam: Nette -************** - -Notejam application implemented using `Nette framework `_. - -Nette version: 2.3 - -The application is maintained by `@klimesf `_. - -========================== -Installation and launching -========================== - ------ -Clone ------ - -Clone the repo: - -.. code-block:: bash - - $ git clone git@github.com:komarserjio/notejam.git YOUR_PROJECT_DIR/ - -------- -Install -------- - -Install `composer `_ - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/nette/native_db/notejam - $ curl -s https://getcomposer.org/installer | php - -Install dependencies - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/nette/native_db/notejam - $ php composer.phar install - -Create your copy of ``config.local.neon`` - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/nette/native_db/notejam - $ cp app/config/config.example.neon app/config/config.local.neon - -Create database schema - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/nette/native_db/notejam - $ php ./bin/create-db.php - - ------- -Launch ------- - -Start built-in php web server: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/nette/native_db/notejam/www/ - $ php -t `pwd` -S 127.0.0.1:8000 `pwd`/index.php - -Go to http://localhost:8000/ in your browser. - ---------- -Run tests ---------- - -Run tests: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/nette/native_db/notejam/www/ - $ php -t `pwd` -S 127.0.0.1:8000 `pwd`/index.php - $ cd ../ - $ ./vendor/bin/codecept run - - -============ -Contribution -============ - - -Do you have php/nette experience? Help the app to follow php and Nette Framework best practices. - -Please send your pull requests in the ``master`` branch. -Always prepend your commits with framework name: - -.. code-block:: bash - - Nette: Implemented sign in functionality - -Read `contribution guide `_ for details. diff --git a/padrino/README.rst b/padrino/README.rst deleted file mode 100644 index 37221a864..000000000 --- a/padrino/README.rst +++ /dev/null @@ -1,73 +0,0 @@ -**************** -Notejam: Padrino -**************** - -Notejam application implemented using `Padrino `_ framework. - -========================== -Installation and launching -========================== - ------ -Clone ------ - -Clone the repo: - -.. code-block:: bash - - $ git clone git@github.com:komarserjio/notejam.git YOUR_PROJECT_DIR/ - -------- -Install -------- - -Use `RVM `_ or `rbenv `_ -for environment management. - -Install dependencies: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/padrino/notejam/ - $ bundle install - ------- -Launch ------- - -Start built-in web server: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/padrino/notejam/ - $ padrino start - -Go to http://127.0.0.1:3000/ in your browser. - - ---------- -Run tests ---------- - -Start functional and unit tests: - -.. code-block:: bash - - $ cd YOUR_PROJECT_DIR/padrino/notejam/ - $ padrino rake spec - - -============ -Contribution -============ -Do you have ruby/padrino experience? Help the app to follow ruby and padrino best practices. - -Please send your pull requests in the ``master`` branch. -Always prepend your commits with framework name: - -.. code-block:: bash - - Padrino: Implemented sign in functionality - -Read `contribution guide `_ for details. diff --git a/padrino/notejam/.components b/padrino/notejam/.components deleted file mode 100644 index 9e717cd7c..000000000 --- a/padrino/notejam/.components +++ /dev/null @@ -1,10 +0,0 @@ ---- -:orm: datamapper -:test: rspec -:mock: none -:script: none -:renderer: erb -:stylesheet: none -:namespace: Notejam -:migration_format: number -:admin_renderer: erb diff --git a/padrino/notejam/.gitignore b/padrino/notejam/.gitignore deleted file mode 100644 index 9fa1cf0a7..000000000 --- a/padrino/notejam/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -.DS_Store -log/**/* -tmp/**/* -bin/* -vendor/gems/* -!vendor/gems/cache/ -.sass-cache/* -db/*.db -.*.sw* diff --git a/padrino/notejam/Gemfile b/padrino/notejam/Gemfile deleted file mode 100644 index 0745cf8d3..000000000 --- a/padrino/notejam/Gemfile +++ /dev/null @@ -1,43 +0,0 @@ -source 'https://rubygems.org' - -# Distribute your app as a gem -# gemspec - -# Server requirements -# gem 'thin' # or mongrel -# gem 'trinidad', :platform => 'jruby' - -# Optional JSON codec (faster performance) -# gem 'oj' - -# Project requirements -gem 'rake' - -# Component requirements -gem 'bcrypt' -gem 'erubis', '~> 2.7.0' -gem 'dm-sqlite-adapter' -gem 'dm-validations' -gem 'dm-timestamps' -gem 'dm-migrations' -gem 'dm-constraints' -gem 'dm-aggregates' -gem 'dm-types' -gem 'dm-core' - -# Test requirements -gem 'rspec', :group => 'test' -gem 'rack-test', :require => 'rack/test', :group => 'test' - -gem 'database_cleaner' - -# Padrino Stable Gem -gem 'padrino', '0.12.2' - -# Or Padrino Edge -# gem 'padrino', :github => 'padrino/padrino-framework' - -# Or Individual Gems -# %w(core support gen helpers cache mailer admin).each do |g| -# gem 'padrino-' + g, '0.12.2' -# end diff --git a/padrino/notejam/Gemfile.lock b/padrino/notejam/Gemfile.lock deleted file mode 100644 index ced4f9db8..000000000 --- a/padrino/notejam/Gemfile.lock +++ /dev/null @@ -1,144 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - activesupport (4.1.1) - i18n (~> 0.6, >= 0.6.9) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.1) - tzinfo (~> 1.1) - addressable (2.3.6) - bcrypt (3.1.7) - bcrypt-ruby (3.1.5) - bcrypt (>= 3.1.3) - data_objects (0.10.14) - addressable (~> 2.1) - database_cleaner (0.9.1) - diff-lcs (1.2.5) - dm-aggregates (1.2.0) - dm-core (~> 1.2.0) - dm-constraints (1.2.0) - dm-core (~> 1.2.0) - dm-core (1.2.1) - addressable (~> 2.3) - dm-do-adapter (1.2.0) - data_objects (~> 0.10.6) - dm-core (~> 1.2.0) - dm-migrations (1.2.0) - dm-core (~> 1.2.0) - dm-sqlite-adapter (1.2.0) - dm-do-adapter (~> 1.2.0) - do_sqlite3 (~> 0.10.6) - dm-timestamps (1.2.0) - dm-core (~> 1.2.0) - dm-types (1.2.2) - bcrypt-ruby (~> 3.0) - dm-core (~> 1.2.0) - fastercsv (~> 1.5) - json (~> 1.6) - multi_json (~> 1.0) - stringex (~> 1.4) - uuidtools (~> 2.1) - dm-validations (1.2.0) - dm-core (~> 1.2.0) - do_sqlite3 (0.10.14) - data_objects (= 0.10.14) - erubis (2.7.0) - fastercsv (1.5.5) - http_router (0.11.1) - rack (>= 1.0.0) - url_mount (~> 0.2.1) - i18n (0.6.9) - json (1.8.1) - mail (2.5.4) - mime-types (~> 1.16) - treetop (~> 1.4.8) - mime-types (1.25.1) - minitest (5.3.4) - moneta (0.7.20) - multi_json (1.10.1) - padrino (0.12.2) - padrino-admin (= 0.12.2) - padrino-cache (= 0.12.2) - padrino-core (= 0.12.2) - padrino-gen (= 0.12.2) - padrino-helpers (= 0.12.2) - padrino-mailer (= 0.12.2) - padrino-support (= 0.12.2) - padrino-admin (0.12.2) - padrino-core (= 0.12.2) - padrino-helpers (= 0.12.2) - padrino-cache (0.12.2) - moneta (~> 0.7.0) - padrino-core (= 0.12.2) - padrino-helpers (= 0.12.2) - padrino-core (0.12.2) - activesupport (>= 3.1) - http_router (~> 0.11.0) - padrino-support (= 0.12.2) - rack-protection (>= 1.5.0) - sinatra (~> 1.4.2) - thor (~> 0.18.0) - padrino-gen (0.12.2) - bundler (~> 1.0) - padrino-core (= 0.12.2) - padrino-helpers (0.12.2) - i18n (~> 0.6, >= 0.6.7) - padrino-support (= 0.12.2) - tilt (~> 1.4.1) - padrino-mailer (0.12.2) - mail (~> 2.5.3) - padrino-core (= 0.12.2) - padrino-support (0.12.2) - activesupport (>= 3.1) - polyglot (0.3.4) - rack (1.5.2) - rack-protection (1.5.3) - rack - rack-test (0.6.2) - rack (>= 1.0) - rake (10.3.2) - rspec (2.14.1) - rspec-core (~> 2.14.0) - rspec-expectations (~> 2.14.0) - rspec-mocks (~> 2.14.0) - rspec-core (2.14.8) - rspec-expectations (2.14.5) - diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.14.6) - sinatra (1.4.5) - rack (~> 1.4) - rack-protection (~> 1.4) - tilt (~> 1.3, >= 1.3.4) - stringex (1.5.1) - thor (0.18.1) - thread_safe (0.3.3) - tilt (1.4.1) - treetop (1.4.15) - polyglot - polyglot (>= 0.3.1) - tzinfo (1.1.0) - thread_safe (~> 0.1) - url_mount (0.2.1) - rack - uuidtools (2.1.4) - -PLATFORMS - ruby - -DEPENDENCIES - bcrypt - database_cleaner - dm-aggregates - dm-constraints - dm-core - dm-migrations - dm-sqlite-adapter - dm-timestamps - dm-types - dm-validations - erubis (~> 2.7.0) - padrino (= 0.12.2) - rack-test - rake - rspec diff --git a/padrino/notejam/Rakefile b/padrino/notejam/Rakefile deleted file mode 100644 index 98c59df4b..000000000 --- a/padrino/notejam/Rakefile +++ /dev/null @@ -1,6 +0,0 @@ -require 'bundler/setup' -require 'padrino-core/cli/rake' - -PadrinoTasks.use(:database) -PadrinoTasks.use(:datamapper) -PadrinoTasks.init diff --git a/padrino/notejam/admin/app.rb b/padrino/notejam/admin/app.rb deleted file mode 100644 index 1e960c1ea..000000000 --- a/padrino/notejam/admin/app.rb +++ /dev/null @@ -1,43 +0,0 @@ -module Notejam - class Admin < Padrino::Application - register Padrino::Mailer - register Padrino::Helpers - register Padrino::Admin::AccessControl - - ## - # Application configuration options - # - # set :raise_errors, true # Raise exceptions (will stop application) (default for test) - # set :dump_errors, true # Exception backtraces are written to STDERR (default for production/development) - # set :show_exceptions, true # Shows a stack trace in browser (default for development) - # set :logging, true # Logging in STDOUT for development and file for production (default only for development) - # set :public_folder, "foo/bar" # Location for static assets (default root/public) - # set :reload, false # Reload application files (default in development) - # set :default_builder, "foo" # Set a custom form builder (default 'StandardFormBuilder') - # set :locale_path, "bar" # Set path for I18n translations (default your_app/locales) - # disable :sessions # Disabled sessions by default (enable if needed) - # disable :flash # Disables sinatra-flash (enabled by default if Sinatra::Flash is defined) - # layout :my_layout # Layout can be in views/layouts/foo.ext or views/foo.ext (default :application) - # - - set :admin_model, 'Account' - set :login_page, '/sessions/new' - - enable :sessions - disable :store_location - - access_control.roles_for :any do |role| - role.protect '/' - role.allow '/sessions' - end - - access_control.roles_for :admin do |role| - role.project_module :accounts, '/accounts' - end - - # Custom error management - error(403) { @title = "Error 403"; render('errors/403', :layout => :error) } - error(404) { @title = "Error 404"; render('errors/404', :layout => :error) } - error(500) { @title = "Error 500"; render('errors/500', :layout => :error) } - end -end diff --git a/padrino/notejam/admin/controllers/accounts.rb b/padrino/notejam/admin/controllers/accounts.rb deleted file mode 100644 index c5230d05f..000000000 --- a/padrino/notejam/admin/controllers/accounts.rb +++ /dev/null @@ -1,90 +0,0 @@ -Notejam::Admin.controllers :accounts do - get :index do - @title = "Accounts" - @accounts = Account.all - render 'accounts/index' - end - - get :new do - @title = pat(:new_title, :model => 'account') - @account = Account.new - render 'accounts/new' - end - - post :create do - @account = Account.new(params[:account]) - if @account.save - @title = pat(:create_title, :model => "account #{@account.id}") - flash[:success] = pat(:create_success, :model => 'Account') - params[:save_and_continue] ? redirect(url(:accounts, :index)) : redirect(url(:accounts, :edit, :id => @account.id)) - else - @title = pat(:create_title, :model => 'account') - flash.now[:error] = pat(:create_error, :model => 'account') - render 'accounts/new' - end - end - - get :edit, :with => :id do - @title = pat(:edit_title, :model => "account #{params[:id]}") - @account = Account.get(params[:id]) - if @account - render 'accounts/edit' - else - flash[:warning] = pat(:create_error, :model => 'account', :id => "#{params[:id]}") - halt 404 - end - end - - put :update, :with => :id do - @title = pat(:update_title, :model => "account #{params[:id]}") - @account = Account.get(params[:id]) - if @account - if @account.update(params[:account]) - flash[:success] = pat(:update_success, :model => 'Account', :id => "#{params[:id]}") - params[:save_and_continue] ? - redirect(url(:accounts, :index)) : - redirect(url(:accounts, :edit, :id => @account.id)) - else - flash.now[:error] = pat(:update_error, :model => 'account') - render 'accounts/edit' - end - else - flash[:warning] = pat(:update_warning, :model => 'account', :id => "#{params[:id]}") - halt 404 - end - end - - delete :destroy, :with => :id do - @title = "Accounts" - account = Account.get(params[:id]) - if account - if account != current_account && account.destroy - flash[:success] = pat(:delete_success, :model => 'Account', :id => "#{params[:id]}") - else - flash[:error] = pat(:delete_error, :model => 'account') - end - redirect url(:accounts, :index) - else - flash[:warning] = pat(:delete_warning, :model => 'account', :id => "#{params[:id]}") - halt 404 - end - end - - delete :destroy_many do - @title = "Accounts" - unless params[:account_ids] - flash[:error] = pat(:destroy_many_error, :model => 'account') - redirect(url(:accounts, :index)) - end - ids = params[:account_ids].split(',').map(&:strip) - accounts = Account.all(:id => ids) - - if accounts.include? current_account - flash[:error] = pat(:delete_error, :model => 'account') - elsif accounts.destroy - - flash[:success] = pat(:destroy_many_success, :model => 'Accounts', :ids => "#{ids.to_sentence}") - end - redirect url(:accounts, :index) - end -end diff --git a/padrino/notejam/admin/controllers/base.rb b/padrino/notejam/admin/controllers/base.rb deleted file mode 100644 index 22e502e59..000000000 --- a/padrino/notejam/admin/controllers/base.rb +++ /dev/null @@ -1,5 +0,0 @@ -Notejam::Admin.controllers :base do - get :index, :map => "/" do - render "base/index" - end -end diff --git a/padrino/notejam/admin/controllers/sessions.rb b/padrino/notejam/admin/controllers/sessions.rb deleted file mode 100644 index 7bc4491f4..000000000 --- a/padrino/notejam/admin/controllers/sessions.rb +++ /dev/null @@ -1,25 +0,0 @@ -Notejam::Admin.controllers :sessions do - get :new do - render "/sessions/new", nil, :layout => false - end - - post :create do - if account = Account.authenticate(params[:email], params[:password]) - set_current_account(account) - redirect url(:base, :index) - elsif Padrino.env == :development && params[:bypass] - account = Account.first - set_current_account(account) - redirect url(:base, :index) - else - params[:email] = h(params[:email]) - flash.now[:error] = pat('login.error') - render "/sessions/new", nil, :layout => false - end - end - - delete :destroy do - set_current_account(nil) - redirect url(:sessions, :new) - end -end diff --git a/padrino/notejam/admin/views/accounts/_form.erb b/padrino/notejam/admin/views/accounts/_form.erb deleted file mode 100644 index 8f5c1fedd..000000000 --- a/padrino/notejam/admin/views/accounts/_form.erb +++ /dev/null @@ -1,57 +0,0 @@ -<% error = @account.errors.key?(:name) && @account.errors[:name].count > 0 %> -
'> - <%= f.label :name, :class => 'control-label' %> -
- <%= f.text_field :name, :class => 'form-control input-xlarge input-with-feedback', :autofocus => true %> - <%= error ? f.error_message_on(:name) : "Ex: a simple text" %> -
-
-<% error = @account.errors.key?(:surname) && @account.errors[:surname].count > 0 %> -
'> - <%= f.label :surname, :class => 'control-label' %> -
- <%= f.text_field :surname, :class => 'form-control input-xlarge input-with-feedback' %> - <%= error ? f.error_message_on(:surname) : "Ex: a simple text" %> -
-
-<% error = @account.errors.key?(:email) && @account.errors[:email].count > 0 %> -
'> - <%= f.label :email, :class => 'control-label' %> -
- <%= f.text_field :email, :class => 'form-control input-xlarge input-with-feedback' %> - <%= error ? f.error_message_on(:email) : "Ex: a simple text" %> -
-
-<% error = @account.errors.key?(:password) && @account.errors[:password].count > 0 %> -
'> - <%= f.label :password, :class => 'control-label' %> -
- <%= f.password_field :password, :class => 'form-control input-xlarge input-with-feedback' %> - <%= error ? f.error_message_on(:password) : "Ex: a simple text" %> -
-
-<% error = @account.errors.key?(:password_confirmation) && @account.errors[:password_confirmation].count > 0 %> -
'> - <%= f.label :password_confirmation, :class => 'control-label' %> -
- <%= f.password_field :password_confirmation, :class => 'form-control input-xlarge input-with-feedback' %> - <%= error ? f.error_message_on(:password_confirmation) : "Ex: a simple text" %> -
-
-<% error = @account.errors.key?(:role) && @account.errors[:role].count > 0 %> -
'> - <%= f.label :role, :class => 'control-label' %> -
- <%= f.text_field :role, :class => 'form-control input-xlarge input-with-feedback' %> - <%= error ? f.error_message_on(:role) : "Ex: a simple text" %> -
-
- - -
- <%= f.submit pat(:save), :class => 'btn btn-primary' %> -   - <%= f.submit pat(:save_and_continue), :class => 'btn btn-info', :name => 'save_and_continue' %> -   - <%= link_to pat(:cancel), url(:accounts, :index), :class => 'btn btn-default' %> -
\ No newline at end of file diff --git a/padrino/notejam/admin/views/accounts/edit.erb b/padrino/notejam/admin/views/accounts/edit.erb deleted file mode 100644 index 9adf99f14..000000000 --- a/padrino/notejam/admin/views/accounts/edit.erb +++ /dev/null @@ -1,10 +0,0 @@ - -
- <% form_for :account, url(:accounts, :update, :id => @account.id), :method => :put, :class => 'form-horizontal' do |f| %> - <%= partial 'accounts/form', :locals => { :f => f } %> - <% end %> -
diff --git a/padrino/notejam/admin/views/accounts/index.erb b/padrino/notejam/admin/views/accounts/index.erb deleted file mode 100644 index c12efdc4c..000000000 --- a/padrino/notejam/admin/views/accounts/index.erb +++ /dev/null @@ -1,74 +0,0 @@ - -
- - - - - - - - - - - - - <% @accounts.each do |account| %> - - - - - - - - <% end %> - -
- - <%= mat(:account, :id) %> <%= mat(:account, :name) %> <%= mat(:account, :surname) %> <%= mat(:account, :email) %>
- <%= check_box_tag 'account_ids[]', :value => account.id, :class => 'list-selectable-checkbox' %> - <%= account.id %> <%= account.name %> <%= account.surname %> <%= account.email %> -
- <%= link_to tag_icon(:edit), :href => url(:accounts, :edit, :id => account.id), :rel => :tooltip, :title => "#{pat(:edit)} account", :class => 'list-row-action-wrapper-link' %> - <%= link_to tag_icon(:trash), :rel => :tooltip, :title => "#{pat(:delete)} account", :class => 'list-row-action-delete-one list-row-action-wrapper-link' %> -
-
-

<%= pat(:delete, :model => "account") %>

-
- <%- form_tag url(:accounts, :destroy, :id => account.id), :method => :delete do %> - <%= submit_tag pat(:delete), :class =>'list-row-action-popover-delete-one-btn btn btn-danger btn-small' %> -
<%= pat(:cancel) %>
- <% end %> -
-
-
-
\ No newline at end of file diff --git a/padrino/notejam/admin/views/accounts/new.erb b/padrino/notejam/admin/views/accounts/new.erb deleted file mode 100644 index d0222f1dd..000000000 --- a/padrino/notejam/admin/views/accounts/new.erb +++ /dev/null @@ -1,9 +0,0 @@ - -
- <% form_for :account, url(:accounts, :create), :class => 'form-horizontal' do |f| %> - <%= partial 'accounts/form', :locals => { :f => f } %> - <% end %> -
diff --git a/padrino/notejam/admin/views/base/index.erb b/padrino/notejam/admin/views/base/index.erb deleted file mode 100644 index fcfdbb224..000000000 --- a/padrino/notejam/admin/views/base/index.erb +++ /dev/null @@ -1,15 +0,0 @@ -
-

Padrino is a ruby framework built upon the Sinatra web library.

-

It was created to make it fun and easy to code more advanced web applications while still adhering to the spirit that makes Sinatra great!

-

Padrino comes shipped with a slick and beautiful Admin Interface, with the following features:

-
- -
-
-
<%= tag_icon("cogs icon-2x", "Orm Agnostic") %>
-
<%= tag_icon("group icon-2x", "Authentication") %>
-
<%= tag_icon("tasks icon-2x", "Template Agnostic") %>
-
<%= tag_icon("flag icon-2x", "Multi Language") %>
-
<%= tag_icon("magic icon-2x", "Scaffold") %>
-
-
diff --git a/padrino/notejam/admin/views/errors/403.erb b/padrino/notejam/admin/views/errors/403.erb deleted file mode 100644 index 4ceaca627..000000000 --- a/padrino/notejam/admin/views/errors/403.erb +++ /dev/null @@ -1,3 +0,0 @@ -

<%= tag_icon 'minus-sign icon-3x' %>

-

<%= pat('custom_errors.403.title') %>

-

<%= pat('custom_errors.403.description') %>

diff --git a/padrino/notejam/admin/views/errors/404.erb b/padrino/notejam/admin/views/errors/404.erb deleted file mode 100644 index 630469e15..000000000 --- a/padrino/notejam/admin/views/errors/404.erb +++ /dev/null @@ -1,3 +0,0 @@ -

<%= tag_icon 'warning-sign icon-3x' %>

-

<%= pat('custom_errors.404.title') %>

-

<%= pat('custom_errors.404.description') %>

diff --git a/padrino/notejam/admin/views/errors/500.erb b/padrino/notejam/admin/views/errors/500.erb deleted file mode 100644 index 8c44b9a27..000000000 --- a/padrino/notejam/admin/views/errors/500.erb +++ /dev/null @@ -1,3 +0,0 @@ -

<%= tag_icon 'beaker icon-3x' %>

-

<%= pat('custom_errors.500.title') %>

-

<%= pat('custom_errors.500.description') %>

diff --git a/padrino/notejam/admin/views/layouts/application.erb b/padrino/notejam/admin/views/layouts/application.erb deleted file mode 100644 index 49c251e25..000000000 --- a/padrino/notejam/admin/views/layouts/application.erb +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - <%= @title.present? ? "#{@title} | Padrino Admin" : "Padrino Admin" %> - <%= favicon_tag "favicon.ico" %> - - <%= stylesheet_link_tag 'bootstrap', 'application' %> - - - - -
-
- <%= {:error => 'danger', :warning => 'warning', :success => 'success', :notice => 'info'}.map { |type, class_name| flash_tag(type, :class => "alert alert-#{class_name} fade in", :bootstrap => true) }.join.html_safe %> -
<%= yield %>
-
-
-
- -
- -
- - <%= javascript_include_tag 'jquery-1.9.0.min', (Padrino.env == :production ? 'bootstrap/bootstrap.min' : %w[bootstrap/affix bootstrap/alert bootstrap/button bootstrap/carousel bootstrap/collapse bootstrap/dropdown bootstrap/tooltip bootstrap/transition bootstrap/modal bootstrap/popover bootstrap/scrollspy bootstrap/tab]), :application %> - - diff --git a/padrino/notejam/admin/views/layouts/error.erb b/padrino/notejam/admin/views/layouts/error.erb deleted file mode 100644 index d2cce35f2..000000000 --- a/padrino/notejam/admin/views/layouts/error.erb +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - <%= @title.present? ? "#{@title} | Padrino Admin" : "#{pat(:custom_errors.title)} | Padrino Admin" %> - <%= favicon_tag "favicon.ico" %> - - <%= stylesheet_link_tag 'bootstrap', 'application' %> - - -
-
<%= yield %>
- -
- - \ No newline at end of file diff --git a/padrino/notejam/admin/views/sessions/new.erb b/padrino/notejam/admin/views/sessions/new.erb deleted file mode 100644 index 45cf67e31..000000000 --- a/padrino/notejam/admin/views/sessions/new.erb +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - <%= @title.present? ? "#{@title} | Padrino Admin" : "#{pat('login.title')} | Padrino Admin" %> - <%= favicon_tag "favicon.ico" %> - <%= stylesheet_link_tag "bootstrap", "application" %> - - - <% form_tag url(:sessions, :create), :class=>"login form-horizontal" do %> - - - - <% end %> - <%= javascript_include_tag 'jquery-1.9.0.min', (Padrino.env == :production ? 'bootstrap/bootstrap.min' : %w[bootstrap/affix bootstrap/alert bootstrap/button bootstrap/carousel bootstrap/collapse bootstrap/dropdown bootstrap/tooltip bootstrap/transition bootstrap/modal bootstrap/popover bootstrap/scrollspy bootstrap/tab]), :application %> - - diff --git a/padrino/notejam/app/app.rb b/padrino/notejam/app/app.rb deleted file mode 100644 index fd6bceeb7..000000000 --- a/padrino/notejam/app/app.rb +++ /dev/null @@ -1,84 +0,0 @@ -module Notejam - class App < Padrino::Application - register Padrino::Admin::AccessControl - register Padrino::Mailer - register Padrino::Helpers - - enable :sessions - - enable :authentication - enable :store_location - set :login_page, "/signin" - - access_control.roles_for :any do |role| - role.protect '/' - role.allow '/signin' - role.allow '/signup' - role.allow '/forgot-password' - role.allow '/set-session-variable' - end - - set :delivery_method, :test - - ## - # Caching support. - # - # register Padrino::Cache - # enable :caching - # - # You can customize caching store engines: - # - # set :cache, Padrino::Cache.new(:LRUHash) # Keeps cached values in memory - # set :cache, Padrino::Cache.new(:Memcached) # Uses default server at localhost - # set :cache, Padrino::Cache.new(:Memcached, '127.0.0.1:11211', :exception_retry_limit => 1) - # set :cache, Padrino::Cache.new(:Memcached, :backend => memcached_or_dalli_instance) - # set :cache, Padrino::Cache.new(:Redis) # Uses default server at localhost - # set :cache, Padrino::Cache.new(:Redis, :host => '127.0.0.1', :port => 6379, :db => 0) - # set :cache, Padrino::Cache.new(:Redis, :backend => redis_instance) - # set :cache, Padrino::Cache.new(:Mongo) # Uses default server at localhost - # set :cache, Padrino::Cache.new(:Mongo, :backend => mongo_client_instance) - # set :cache, Padrino::Cache.new(:File, :dir => Padrino.root('tmp', app_name.to_s, 'cache')) # default choice - # - - ## - # Application configuration options. - # - # set :raise_errors, true # Raise exceptions (will stop application) (default for test) - # set :dump_errors, true # Exception backtraces are written to STDERR (default for production/development) - # set :show_exceptions, true # Shows a stack trace in browser (default for development) - # set :logging, true # Logging in STDOUT for development and file for production (default only for development) - # set :public_folder, 'foo/bar' # Location for static assets (default root/public) - # set :reload, false # Reload application files (default in development) - # set :default_builder, 'foo' # Set a custom form builder (default 'StandardFormBuilder') - # set :locale_path, 'bar' # Set path for I18n translations (default your_apps_root_path/locale) - # disable :sessions # Disabled sessions by default (enable if needed) - # disable :flash # Disables sinatra-flash (enabled by default if Sinatra::Flash is defined) - # layout :my_layout # Layout can be in views/layouts/foo.ext or views/foo.ext (default :application) - # - - ## - # You can configure for a specified environment like: - # - # configure :development do - # set :foo, :bar - # disable :asset_stamp # no asset timestamping for dev - # end - # - configure :test do - set :protect_from_csrf, false - end - - ## - # You can manage errors like: - # - # error 404 do - # render 'errors/404' - # end - # - # error 505 do - # render 'errors/505' - # end - # - DataMapper.auto_upgrade! - end -end diff --git a/padrino/notejam/app/controllers/note.rb b/padrino/notejam/app/controllers/note.rb deleted file mode 100644 index dae4210bf..000000000 --- a/padrino/notejam/app/controllers/note.rb +++ /dev/null @@ -1,72 +0,0 @@ -Notejam::App.controllers :note do - - layout :layout - - get :all_notes, :map => '/' do - @notes = Note.all( - :user_id => current_account.id, :order => order_param(params) - ) - render "note/list" - end - - get :create, :map => '/notes/create' do - render "note/create" - end - - post :create, :map => '/notes/create' do - # @TODO datamapper validation issue? - if params[:note][:pad_id] == "0" - params[:note].delete("pad_id") - else - @pad = get_or_404(current_account.pads, params[:note][:pad_id]) - end - - @note = Note.new(params[:note]) - current_account.notes << @note - if @note.save - flash[:success] = 'Note is successfully created.' - redirect url(:note, :view, :id => @note.id) - end - render "note/create" - end - - get :edit, :map => '/notes/:id/edit' do - @note = get_or_404(current_account.notes, params[:id]) - render "note/edit" - end - - post :edit, :map => '/notes/:id/edit' do - @note = get_or_404(current_account.notes, params[:id]) - - # @TODO datamapper validation issue? - if params[:note][:pad_id] == "0" - params[:note].delete("pad_id") - end - - @note.update(params[:note]) - if @note.save - flash[:success] = 'Note is successfully updated.' - redirect url(:note, :view, :id => @note.id) - end - render "note/edit" - end - - get :view, :map => '/notes/:id' do - @note = get_or_404(current_account.notes, params[:id]) - render "note/view" - end - - get :delete, :map => '/notes/:id/delete' do - @note = get_or_404(current_account.notes, params[:id]) - render "note/delete" - end - - post :delete, :map => '/notes/:id/delete' do - @note = get_or_404(current_account.notes, params[:id]) - @note.destroy - flash[:success] = 'Note is successfully deleted.' - redirect url(:note, :all_notes) - end - -end - diff --git a/padrino/notejam/app/controllers/pad.rb b/padrino/notejam/app/controllers/pad.rb deleted file mode 100644 index a0fec2b44..000000000 --- a/padrino/notejam/app/controllers/pad.rb +++ /dev/null @@ -1,56 +0,0 @@ -Notejam::App.controllers :pad do - - layout :layout - - get :create, :map => '/pads/create' do - render "pad/create" - end - - post :create, :map => '/pads/create' do - @pad = Pad.new(params[:pad]) - current_account.pads << @pad - if @pad.save - flash[:success] = 'Pad is created!' - redirect url(:pad, :view, :id => @pad.id) - end - @pad.destroy - render "pad/create" - end - - get :edit, :map => '/pads/:id/edit' do - @pad = get_or_404(current_account.pads, params[:id]) - render "pad/edit" - end - - post :edit, :map => '/pads/:id/edit' do - @pad = get_or_404(current_account.pads, params[:id]) - @pad.update(params[:pad]) - if @pad.save - flash[:success] = 'Pad is updated!' - redirect url(:pad, :view, :id => @pad.id) - end - render "pad/edit" - end - - get :delete, :map => '/pads/:id/delete' do - @pad = get_or_404(current_account.pads, params[:id]) - render "pad/delete" - end - - post :delete, :map => '/pads/:id/delete' do - @pad = get_or_404(current_account.pads, params[:id]) - @pad.destroy - flash[:success] = 'Pad is deleted!' - redirect url(:note, :all_notes) - end - - get :view, :map => '/pads/:id' do - @pad = get_or_404(current_account.pads, params[:id]) - @notes = Note.all( - :pad_id => @pad.id, :order => order_param(params) - ) - render "pad/view" - end -end - - diff --git a/padrino/notejam/app/controllers/user.rb b/padrino/notejam/app/controllers/user.rb deleted file mode 100644 index 4f8b78b2e..000000000 --- a/padrino/notejam/app/controllers/user.rb +++ /dev/null @@ -1,79 +0,0 @@ -Notejam::App.controllers :user do - - layout :user - - get :signup, :map => '/signup' do - render "user/signup" - end - - post :signup, :map => '/signup' do - @user = User.new(params[:user]) - if @user.save - flash[:success] = 'Account is created. Now you can sign in.' - redirect url(:user, :signin) - end - render "user/signup" - end - - get :signin, :map => '/signin' do - render "user/signin" - end - - post :signin, :map => '/signin' do - if user = User.authenticate(params[:email], params[:password]) - set_current_account(user) - redirect url(:note, :all_notes) - else - params[:email] = h(params[:email]) - flash.now[:error] = "Wrong email or password." - render "user/signin" - end - end - - get :signout, :map => '/signout' do - set_current_account nil - redirect url(:pad, :create) - end - - get :settings, :map => '/settings' do - @user = current_account - render "user/settings" - end - - post :settings, :map => '/settings' do - @user = current_account - if @user.has_password? params[:current_password] - params[:user][:crypted_password] = nil - @user.update(params[:user]) - if @user.save - flash[:success] = 'Password was successfully changed.' - redirect url(:note, :all_notes) - end - else - flash[:error] = 'Entered current password is incorrect.' - redirect url(:user, :settings) - end - - render "user/settings" - end - - get :forgot_password, :map => '/forgot-password' do - render "user/forgot-password" - end - - post :forgot_password, :map => '/forgot-password' do - @user = User.first(:email => params[:email]) - if @user - new_password = generate_password - @user.password = new_password - @user.save - - deliver(:mailer, :new_password_email, @user.email, new_password) - - flash[:success] = 'New password sent to your email.' - redirect url(:user, :signin) - end - flash[:error] = 'No users found' - redirect url(:user, :forgot_password) - end -end diff --git a/padrino/notejam/app/helpers.rb b/padrino/notejam/app/helpers.rb deleted file mode 100644 index 30145873f..000000000 --- a/padrino/notejam/app/helpers.rb +++ /dev/null @@ -1,47 +0,0 @@ -# Helper methods defined here can be accessed in any controller or view in the application - -module Notejam - class App - def get_or_404(model, id) - model.get(id) or halt 404, "Page not found" - end - - def smart_date(datetime) - diff = Date.today - datetime.to_date - days = diff.to_i - if days == 0 - 'Today at ' + datetime.strftime("%H:%M") - elsif days == 1 - 'Yesterday' - elsif days > 1 && days <= 7 - days.to_s + " days ago" - else - datetime.strftime("%d %b %Y") - end - end - - def field_errors(field, model) - if model && model.errors[field].any? - errors = "
    " - model.errors[field].each do |message| - errors << "
  • #{message}
  • " - end - errors << "
" - errors.html_safe - end - end - - def order_param(params) - order = params[:order] || "-updated_at" - {"name" => :name.asc, - "-name" => :name.desc, - "updated_at" => :updated_at.asc, - "-updated_at" => :updated_at.desc}[order] - end - - def generate_password - # weak password generation - (0...8).map { ('a'..'z').to_a[rand(26)] }.join - end - end -end diff --git a/padrino/notejam/app/helpers/user_helper.rb b/padrino/notejam/app/helpers/user_helper.rb deleted file mode 100644 index 6ae8670de..000000000 --- a/padrino/notejam/app/helpers/user_helper.rb +++ /dev/null @@ -1,10 +0,0 @@ -# Helper methods defined here can be accessed in any controller or view in the application - -module Notejam - class App - module UserHelper - end - - helpers UserHelper - end -end diff --git a/padrino/notejam/app/mailers.rb b/padrino/notejam/app/mailers.rb deleted file mode 100644 index 08739db6f..000000000 --- a/padrino/notejam/app/mailers.rb +++ /dev/null @@ -1,44 +0,0 @@ -## -# Mailer methods can be defined using the simple format: -# -# email :registration_email do |name, user| -# from 'admin@site.com' -# to user.email -# subject 'Welcome to the site!' -# locals :name => name -# content_type 'text/html' # optional, defaults to plain/text -# via :sendmail # optional, to smtp if defined, otherwise sendmail -# render 'registration_email' -# end -# -# You can set the default delivery settings from your app through: -# -# set :delivery_method, :smtp => { -# :address => 'smtp.yourserver.com', -# :port => '25', -# :user_name => 'user', -# :password => 'pass', -# :authentication => :plain, # :plain, :login, :cram_md5, no auth by default -# :domain => "localhost.localdomain" # the HELO domain provided by the client to the server -# } -# -# or sendmail (default): -# -# set :delivery_method, :sendmail -# -# or for tests: -# -# set :delivery_method, :test -# -# or storing emails locally: -# -# set :delivery_method, :file => { -# :location => "#{Padrino.root}/tmp/emails", -# } -# -# and then all delivered mail will use these settings unless otherwise specified. -# - -Notejam::App.mailer :notifier do - # Message definitions here ... -end diff --git a/padrino/notejam/app/mailers/mailer.rb b/padrino/notejam/app/mailers/mailer.rb deleted file mode 100644 index 51101ee5f..000000000 --- a/padrino/notejam/app/mailers/mailer.rb +++ /dev/null @@ -1,11 +0,0 @@ -Notejam::App.mailer :mailer do - - email :new_password_email do |email, password| - from 'noreply@notejamapp.com' - to email - subject 'New notejam password' - locals :password => password, :email => email - render 'mailer/new_password_email' - end - -end diff --git a/padrino/notejam/app/views/layouts/layout.html.erb b/padrino/notejam/app/views/layouts/layout.html.erb deleted file mode 100644 index 15e0edb51..000000000 --- a/padrino/notejam/app/views/layouts/layout.html.erb +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - <%= yield_content(:page_title) %> - - - - - - - - <%= stylesheet_link_tag "http://cdnjs.cloudflare.com/ajax/libs/skeleton/1.2/base.min.css", media: "all" %> - <%= stylesheet_link_tag "http://cdnjs.cloudflare.com/ajax/libs/skeleton/1.2/skeleton.min.css", media: "all" %> - <%= stylesheet_link_tag "http://cdnjs.cloudflare.com/ajax/libs/skeleton/1.2/layout.css", media: "all" %> - <%= stylesheet_link_tag "style", media: "all" %> - - - <%= csrf_meta_tags %> - - - - -
-
- -
-
-

- notejam: - <%= yield_content(:page_title) %> -

-
- <% if content_for?(:pad_menu) %> - <%= yield_content(:pad_menu) %> - <% else %> -
- - -
- <% end %> -
-
- <% flash.each do |name, msg| -%> -
<%= msg %>
- <% end -%> -
- <%= content_for?(:content) ? yield_content(:content) : yield %> -
- - -
- Fork me on GitHub - - diff --git a/padrino/notejam/app/views/layouts/user.html.erb b/padrino/notejam/app/views/layouts/user.html.erb deleted file mode 100644 index 34579b994..000000000 --- a/padrino/notejam/app/views/layouts/user.html.erb +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - <%= yield_content(:page_title) %> - - - - - - - - <%= stylesheet_link_tag "http://cdnjs.cloudflare.com/ajax/libs/skeleton/1.2/base.min.css", media: "all" %> - <%= stylesheet_link_tag "http://cdnjs.cloudflare.com/ajax/libs/skeleton/1.2/skeleton.min.css", media: "all" %> - <%= stylesheet_link_tag "http://cdnjs.cloudflare.com/ajax/libs/skeleton/1.2/layout.css", media: "all" %> - <%= stylesheet_link_tag "style", media: "all" %> - - - <%= csrf_meta_tags %> - - - - -
-
- -
-
-

- notejam: - <%= yield_content(:page_title) %> -

-
-
-
- <% flash.each do |name, msg| -%> -
<%= msg %>
- <% end -%> -
- <%= content_for?(:content) ? yield_content(:content) : yield %> -
- - -
- Fork me on GitHub - - diff --git a/padrino/notejam/app/views/mailers/mailer/new_password_email.erb b/padrino/notejam/app/views/mailers/mailer/new_password_email.erb deleted file mode 100644 index 3d48fc0b9..000000000 --- a/padrino/notejam/app/views/mailers/mailer/new_password_email.erb +++ /dev/null @@ -1,5 +0,0 @@ -Hi, <%= @email %> -========================================= -  -Your new password is <%= @password %> - diff --git a/padrino/notejam/app/views/note/create.html.erb b/padrino/notejam/app/views/note/create.html.erb deleted file mode 100644 index 8aa32eeea..000000000 --- a/padrino/notejam/app/views/note/create.html.erb +++ /dev/null @@ -1,18 +0,0 @@ -<% content_for :page_title do %>New note<% end %> - -<% form_for :note, url(:note, :create), {:class => "note"} do |f| %> - <%= f.label :name %> - <%= f.text_field :name %> - <%= field_errors :name, @note %> - - <%= f.label :text %> - <%= f.text_area :text %> - <%= field_errors :text, @note %> - - <%= f.label :pad %> - <%= f.select :pad_id, :collection => current_account.pads, :fields => ['name', 'id'], :include_blank => ['-------', 0], :selected => params[:pad] %> - - <%= f.submit "Create" %> -<% end %> - - diff --git a/padrino/notejam/app/views/note/delete.html.erb b/padrino/notejam/app/views/note/delete.html.erb deleted file mode 100644 index fff921148..000000000 --- a/padrino/notejam/app/views/note/delete.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<% content_for :page_title do %><%= @note.name %><% end %> - -

Are you sure you want to delete <%= @note.name %>?

-<% form_for :note, url(:note, :delete, :id => @note.id) do |f| %> - <%= f.submit "Yes, I want to delete this note", :class => "red" %> - <%= link_to "Cancel", url(:note, :view, {:id => @note.id}) %> -<% end %> - - diff --git a/padrino/notejam/app/views/note/edit.html.erb b/padrino/notejam/app/views/note/edit.html.erb deleted file mode 100644 index a734442fa..000000000 --- a/padrino/notejam/app/views/note/edit.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<% content_for :page_title do %><%= @note.name %><% end %> - -<% form_for :note, url(:note, :edit, {:id => @note.id}), {:class => "note"} do |f| %> - <%= f.label :name %> - <%= f.text_field :name %> - <%= field_errors :name, @note %> - - <%= f.label :text %> - <%= f.text_area :text %> - <%= field_errors :text, @note %> - - <%= f.label :pad %> - <%= f.select :pad_id, :collection => current_account.pads, :fields => ['name', 'id'], :include_blank => ['-------', 0], :selected => params[:pad] %> - - <%= f.submit "Save" %> -<% end %> - - - diff --git a/padrino/notejam/app/views/note/list.html.erb b/padrino/notejam/app/views/note/list.html.erb deleted file mode 100644 index 9d435d93e..000000000 --- a/padrino/notejam/app/views/note/list.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -<% content_for :page_title do %>All notes (<%= @notes.count %>)<% end %> -<% if @notes.count.nonzero? %> - - - - - - - <% @notes.each do |note| -%> - - - - - - <% end -%> -
Note " class="sort_arrow">↑" class="sort_arrow">↓PadLast modified " class="sort_arrow">↑" class="sort_arrow">↓
<%= link_to note.name, url(:note, :view, :id => note.id) %> - <% if note.pad %> - <%= link_to note.pad.name, url(:pad, :view, :id => note.pad.id) %> - <% else %> - No pad - <% end %> - <%= smart_date note.updated_at %>
-<% else %> -

Create your first note.

-<% end %> -<%= link_to "New note", url(:note, :create), :class => "button" %> - diff --git a/padrino/notejam/app/views/note/view.html.erb b/padrino/notejam/app/views/note/view.html.erb deleted file mode 100644 index 8675c97cd..000000000 --- a/padrino/notejam/app/views/note/view.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -<% content_for :page_title do %><%= @note.name %><% end %> - -

Last edited: <%= smart_date @note.updated_at %>

-
-

- <%= @note.text %> -

-
-<%= link_to "Edit", url(:note, :edit, :id => @note.id), {:class => "button"} %> -<%= link_to "Delete", url(:note, :delete, :id => @note.id), {:class => "delete-note"} %> - diff --git a/padrino/notejam/app/views/pad/create.html.erb b/padrino/notejam/app/views/pad/create.html.erb deleted file mode 100644 index 34de38d99..000000000 --- a/padrino/notejam/app/views/pad/create.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -<% content_for :page_title do %>New pad<% end %> - -<% form_for :pad, url(:pad, :create) do |f| %> - <%= f.label :name %> - <%= f.text_field :name %> - <%= field_errors :name, @pad %> - - <%= f.submit "Create" %> -<% end %> - diff --git a/padrino/notejam/app/views/pad/delete.html.erb b/padrino/notejam/app/views/pad/delete.html.erb deleted file mode 100644 index 5388b1086..000000000 --- a/padrino/notejam/app/views/pad/delete.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<% content_for :page_title do %>Delete pad: <%= @pad.name %><% end %> - -

Are you sure you want to delete <%= @pad.name %>?

-<% form_for :pad, url(:pad, :delete, :id => @pad.id) do |f| %> - <%= f.submit "Yes, I want to delete this pad", :class => "red" %> - <%= link_to "Cancel", url(:pad, :edit, :id => @pad.id) %> -<% end %> - diff --git a/padrino/notejam/app/views/pad/edit.html.erb b/padrino/notejam/app/views/pad/edit.html.erb deleted file mode 100644 index 16100c5f4..000000000 --- a/padrino/notejam/app/views/pad/edit.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<% content_for :page_title do %><%= @pad.name %><% end %> - -<% form_for :pad, url(:pad, :edit, :id => @pad.id) do |f| %> - <%= f.label :name %> - <%= f.text_field :name %> - <%= field_errors :name, @pad %> - - <%= f.submit "Save" %> - <%= link_to "Delete pad", url(:pad, :delete, {:id => @pad.id}), :class => "red" %> -<% end %> - - diff --git a/padrino/notejam/app/views/pad/view.html.erb b/padrino/notejam/app/views/pad/view.html.erb deleted file mode 100644 index de5345b2d..000000000 --- a/padrino/notejam/app/views/pad/view.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<% content_for :page_title do %><%= @pad.name %> (<%= @notes.count %>)<% end %> -<% if @notes.count.nonzero? %> - - - - - - <% @notes.each do |note| -%> - - - - - <% end -%> -
Note " class="sort_arrow">↑" class="sort_arrow">↓Last modified " class="sort_arrow">↑" class="sort_arrow">↓
<%= link_to note.name, url(:note, :view, :id => note.id) %><%= smart_date note.updated_at %>
-<% else %> -

Create first note in the pad.

-<% end %> -<%= link_to "Create a note", url(:note, :create, {:pad => @pad.id}), :class => "button" %> -<%= link_to "Pad settings", url(:pad, :edit, {:id => @pad.id}) %> diff --git a/padrino/notejam/app/views/user/forgot-password.html.erb b/padrino/notejam/app/views/user/forgot-password.html.erb deleted file mode 100644 index 63c58028a..000000000 --- a/padrino/notejam/app/views/user/forgot-password.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -<% content_for :page_title do %>Forgot password?<% end %> - -<% form_tag({}, {:class => "offset-by-six sign-in"}) do %> - <%= label_tag :email %> - <%= text_field_tag :email, :required => true %> - - <%= submit_tag "Generate password" %> -<% end %> - - diff --git a/padrino/notejam/app/views/user/settings.html.erb b/padrino/notejam/app/views/user/settings.html.erb deleted file mode 100644 index 3379ffdbb..000000000 --- a/padrino/notejam/app/views/user/settings.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -<% content_for :page_title do %>Account Settings<% end %> - -<% form_for :user, url(:user, :settings), :class => "offset-by-six sign-in" do |f| %> - <%= label_tag :current_password %> - <%= password_field_tag :current_password %> - - <%= f.label "New password" %> - <%= f.password_field :password %> - <%= field_errors :password, @user %> - - <%= f.label :password_confirmation %> - <%= f.password_field :password_confirmation %> - <%= field_errors :password_confirmation, @user %> - - <%= f.submit "Change Password" %> -<% end %> - diff --git a/padrino/notejam/app/views/user/signin.html.erb b/padrino/notejam/app/views/user/signin.html.erb deleted file mode 100644 index fd292056a..000000000 --- a/padrino/notejam/app/views/user/signin.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -<% content_for :page_title do %>Sign In<% end %> - -<% form_tag({}, {:class => "offset-by-six sign-in"}) do %> - <%= label_tag :email %> - <%= text_field_tag :email, :required => true %> - - <%= label_tag :password %> - <%= password_field_tag :password %> - - <%= submit_tag "Sign In" %> or Sign Up -
- Forgot password? -<% end %> - diff --git a/padrino/notejam/app/views/user/signup.html.erb b/padrino/notejam/app/views/user/signup.html.erb deleted file mode 100644 index 510f35e0f..000000000 --- a/padrino/notejam/app/views/user/signup.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -<% content_for :page_title do %>Sign Up<% end %> - -<% form_for :user, '/signup', {:class => "offset-by-six sign-in"} do |f| %> - <%= f.label :email %> - <%= f.text_field :email %> - <%= field_errors :email, @user %> - - <%= f.label :password %> - <%= f.password_field :password %> - <%= field_errors :password, @user %> - - <%= f.label :password_confirmation %> - <%= f.password_field :password_confirmation %> - <%= field_errors :password_confirmation, @user %> - - <%= f.submit "Sign Up" %> or Sign In -<% end %> diff --git a/padrino/notejam/config.ru b/padrino/notejam/config.ru deleted file mode 100644 index 63045a023..000000000 --- a/padrino/notejam/config.ru +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env rackup -# encoding: utf-8 - -# This file can be used to start Padrino, -# just execute it from the command line. - -require File.expand_path("../config/boot.rb", __FILE__) - -run Padrino.application diff --git a/padrino/notejam/config/apps.rb b/padrino/notejam/config/apps.rb deleted file mode 100644 index 665a82fc8..000000000 --- a/padrino/notejam/config/apps.rb +++ /dev/null @@ -1,39 +0,0 @@ -## -# This file mounts each app in the Padrino project to a specified sub-uri. -# You can mount additional applications using any of these commands below: -# -# Padrino.mount('blog').to('/blog') -# Padrino.mount('blog', :app_class => 'BlogApp').to('/blog') -# Padrino.mount('blog', :app_file => 'path/to/blog/app.rb').to('/blog') -# -# You can also map apps to a specified host: -# -# Padrino.mount('Admin').host('admin.example.org') -# Padrino.mount('WebSite').host(/.*\.?example.org/) -# Padrino.mount('Foo').to('/foo').host('bar.example.org') -# -# Note 1: Mounted apps (by default) should be placed into the project root at '/app_name'. -# Note 2: If you use the host matching remember to respect the order of the rules. -# -# By default, this file mounts the primary app which was generated with this project. -# However, the mounted app can be modified as needed: -# -# Padrino.mount('AppName', :app_file => 'path/to/file', :app_class => 'BlogApp').to('/') -# - -## -# Setup global project settings for your apps. These settings are inherited by every subapp. You can -# override these settings in the subapps as needed. -# -Padrino.configure_apps do - # enable :sessions - set :session_secret, '8c96fce57ed6f0b8e5d2eeb3dc635f959a9b092df8e3485080a2c944f25118bc' - set :protection, :except => :path_traversal - set :protect_from_csrf, true - set :admin_model, 'User' -end - -# Mounts the core application for this project - -Padrino.mount("Notejam::Admin", :app_file => Padrino.root('admin/app.rb')).to("/admin") -Padrino.mount('Notejam::App', :app_file => Padrino.root('app/app.rb')).to('/') diff --git a/padrino/notejam/config/boot.rb b/padrino/notejam/config/boot.rb deleted file mode 100644 index 4d17cacae..000000000 --- a/padrino/notejam/config/boot.rb +++ /dev/null @@ -1,47 +0,0 @@ -# Defines our constants -RACK_ENV = ENV['RACK_ENV'] ||= 'development' unless defined?(RACK_ENV) -PADRINO_ROOT = File.expand_path('../..', __FILE__) unless defined?(PADRINO_ROOT) - -# Load our dependencies -require 'rubygems' unless defined?(Gem) -require 'bundler/setup' -Bundler.require(:default, RACK_ENV) - -## -# ## Enable devel logging -# -# Padrino::Logger::Config[:development][:log_level] = :devel -# Padrino::Logger::Config[:development][:log_static] = true -# -# ## Configure your I18n -# -# I18n.default_locale = :en -# I18n.enforce_available_locales = false -# -# ## Configure your HTML5 data helpers -# -# Padrino::Helpers::TagHelpers::DATA_ATTRIBUTES.push(:dialog) -# text_field :foo, :dialog => true -# Generates: -# -# ## Add helpers to mailer -# -# Mail::Message.class_eval do -# include Padrino::Helpers::NumberHelpers -# include Padrino::Helpers::TranslationHelpers -# end - -## -# Add your before (RE)load hooks here -# -Padrino.before_load do -end - -## -# Add your after (RE)load hooks here -# -Padrino.after_load do - DataMapper.finalize -end - -Padrino.load! diff --git a/padrino/notejam/config/database.rb b/padrino/notejam/config/database.rb deleted file mode 100644 index 4ac6dca24..000000000 --- a/padrino/notejam/config/database.rb +++ /dev/null @@ -1,40 +0,0 @@ -## -# A MySQL connection: -# DataMapper.setup(:default, 'mysql://user:password@localhost/the_database_name') -# -# # A Postgres connection: -# DataMapper.setup(:default, 'postgres://user:password@localhost/the_database_name') -# -# # A Sqlite3 connection -# DataMapper.setup(:default, "sqlite3://" + Padrino.root('db', "development.db")) -# -# # Setup DataMapper using config/database.yml -# DataMapper.setup(:default, YAML.load_file(Padrino.root('config/database.yml'))[RACK_ENV]) -# -# config/database.yml file: -# -# --- -# development: &defaults -# adapter: mysql -# database: example_development -# username: user -# password: Pa55w0rd -# host: 127.0.0.1 -# -# test: -# <<: *defaults -# database: example_test -# -# production: -# <<: *defaults -# database: example_production -# - -DataMapper.logger = logger -DataMapper::Property::String.length(255) - -case Padrino.env - when :development then DataMapper.setup(:default, "sqlite3://" + Padrino.root('db', "notejam.db")) - when :production then DataMapper.setup(:default, "sqlite3://" + Padrino.root('db', "notejam_production.db")) - when :test then DataMapper.setup(:default, "sqlite::memory:") -end diff --git a/padrino/notejam/db/migrate/001_create_users.rb b/padrino/notejam/db/migrate/001_create_users.rb deleted file mode 100644 index 3688f23d9..000000000 --- a/padrino/notejam/db/migrate/001_create_users.rb +++ /dev/null @@ -1,14 +0,0 @@ -migration 1, :create_users do - up do - create_table :users do - column :id, Integer, :serial => true - column :email, DataMapper::Property::String, :length => 255 - column :crypted_password, DataMapper::Property::String, :length => 255 - column :role, DataMapper::Property::String, :length => 255 - end - end - - down do - drop_table :users - end -end diff --git a/padrino/notejam/db/seeds.rb b/padrino/notejam/db/seeds.rb deleted file mode 100644 index b230f549c..000000000 --- a/padrino/notejam/db/seeds.rb +++ /dev/null @@ -1,28 +0,0 @@ -# Seed add you the ability to populate your db. -# We provide you a basic shell for interaction with the end user. -# So try some code like below: -# -# name = shell.ask("What's your name?") -# shell.say name -# -email = shell.ask "Which email do you want use for logging into admin?" -password = shell.ask "Tell me the password to use:" - -shell.say "" - -account = Account.create(:email => email, :name => "Foo", :surname => "Bar", :password => password, :password_confirmation => password, :role => "admin") - -if account.valid? - shell.say "=================================================================" - shell.say "Account has been successfully created, now you can login with:" - shell.say "=================================================================" - shell.say " email: #{email}" - shell.say " password: #{password}" - shell.say "=================================================================" -else - shell.say "Sorry but some thing went wrong!" - shell.say "" - account.errors.full_messages.each { |m| shell.say " - #{m}" } -end - -shell.say "" diff --git a/padrino/notejam/models/note.rb b/padrino/notejam/models/note.rb deleted file mode 100644 index 13edfc386..000000000 --- a/padrino/notejam/models/note.rb +++ /dev/null @@ -1,21 +0,0 @@ -class Note - include DataMapper::Resource - include DataMapper::Validate - - # Properties - property :id, Serial - property :name, String - property :text, Text - - belongs_to :user - belongs_to :pad, :required => false - - property :created_at, DateTime - property :updated_at, DateTime - - # Validations - validates_presence_of :name - validates_presence_of :text -end - - diff --git a/padrino/notejam/models/pad.rb b/padrino/notejam/models/pad.rb deleted file mode 100644 index c4d6c3de1..000000000 --- a/padrino/notejam/models/pad.rb +++ /dev/null @@ -1,16 +0,0 @@ -class Pad - include DataMapper::Resource - include DataMapper::Validate - - # Properties - property :id, Serial - property :name, String - - belongs_to :user - - has n, :notes - - # Validations - validates_presence_of :name -end - diff --git a/padrino/notejam/models/user.rb b/padrino/notejam/models/user.rb deleted file mode 100644 index 11e5a73c1..000000000 --- a/padrino/notejam/models/user.rb +++ /dev/null @@ -1,56 +0,0 @@ -class User - include DataMapper::Resource - include DataMapper::Validate - attr_accessor :password, :password_confirmation - - # Properties - property :id, Serial - property :email, String - property :crypted_password, String, :length => 70 - property :role, String - - has n, :pads - has n, :notes - - # Validations - validates_presence_of :email - validates_format_of :email, :with => :email_address - validates_uniqueness_of :email - validates_presence_of :password, :if => :password_required - validates_presence_of :password_confirmation, :if => :password_required - validates_length_of :password, :min => 6, :max => 32, :if => :password_required - validates_confirmation_of :password, :if => :password_required - - - # Callbacks - before :save, :encrypt_password - - ## - # This method is for authentication purpose. - # - def self.authenticate(email, password) - account = first(:conditions => ["lower(email) = lower(?)", email]) if email.present? - account && account.has_password?(password) ? account : nil - end - - ## - # This method is used by AuthenticationHelper - # - def self.find_by_id(id) - get(id) rescue nil - end - - def has_password?(password) - ::BCrypt::Password.new(crypted_password) == password - end - - private - - def password_required - crypted_password.blank? || password.present? - end - - def encrypt_password - self.crypted_password = ::BCrypt::Password.create(password) if password.present? - end -end diff --git a/padrino/notejam/public/admin/images/favicon.ico b/padrino/notejam/public/admin/images/favicon.ico deleted file mode 100644 index 4e26b1989..000000000 Binary files a/padrino/notejam/public/admin/images/favicon.ico and /dev/null differ diff --git a/padrino/notejam/public/admin/images/font/FontAwesome.otf b/padrino/notejam/public/admin/images/font/FontAwesome.otf deleted file mode 100644 index 70125459f..000000000 Binary files a/padrino/notejam/public/admin/images/font/FontAwesome.otf and /dev/null differ diff --git a/padrino/notejam/public/admin/images/font/fontawesome-webfont.eot b/padrino/notejam/public/admin/images/font/fontawesome-webfont.eot deleted file mode 100644 index 0662cb96b..000000000 Binary files a/padrino/notejam/public/admin/images/font/fontawesome-webfont.eot and /dev/null differ diff --git a/padrino/notejam/public/admin/images/font/fontawesome-webfont.svg b/padrino/notejam/public/admin/images/font/fontawesome-webfont.svg deleted file mode 100644 index 2edb4ec34..000000000 --- a/padrino/notejam/public/admin/images/font/fontawesome-webfont.svg +++ /dev/null @@ -1,399 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/padrino/notejam/public/admin/images/font/fontawesome-webfont.ttf b/padrino/notejam/public/admin/images/font/fontawesome-webfont.ttf deleted file mode 100644 index d36592469..000000000 Binary files a/padrino/notejam/public/admin/images/font/fontawesome-webfont.ttf and /dev/null differ diff --git a/padrino/notejam/public/admin/images/font/fontawesome-webfont.woff b/padrino/notejam/public/admin/images/font/fontawesome-webfont.woff deleted file mode 100644 index b9bd17e15..000000000 Binary files a/padrino/notejam/public/admin/images/font/fontawesome-webfont.woff and /dev/null differ diff --git a/padrino/notejam/public/admin/images/logo.png b/padrino/notejam/public/admin/images/logo.png deleted file mode 100644 index 984fe449d..000000000 Binary files a/padrino/notejam/public/admin/images/logo.png and /dev/null differ diff --git a/padrino/notejam/public/admin/javascripts/application.js b/padrino/notejam/public/admin/javascripts/application.js deleted file mode 100644 index 07a04c4d2..000000000 --- a/padrino/notejam/public/admin/javascripts/application.js +++ /dev/null @@ -1,118 +0,0 @@ -!function($) { - 'use strict'; - - $(function() { - function toggleAction(selector, disabled) { - var method = disabled ? 'addClass' : 'removeClass'; - $(selector)[method]('list-menu-link-disabled').parent()[method]('list-menu-wrapper-disabled'); - } - // Check/uncheck all functionality - function checkAll(base, checked) { - // Toggle all checkboxes on the table's body that exist on the first column. - base.find(listCheckboxesSelector).prop('checked', checked); - base.find('.list-row')[checked ? 'addClass' : 'removeClass']('list-row-selected'); - toggleAction('#delete-selected', !checked); - } - function generalToggle() { - var checked = listCheckboxes.filter(':checked').length; - toggleAction('#delete-selected', checked === 0); - toggleAction('#deselect-all', checked === 0); - toggleAction('#select-all', checked === listCheckboxesLength); - } - - var listCheckboxesSelector = '.list-selectable-checkbox', list = $('#list'), alertTimeout = 4000, listCheckboxes, listCheckboxesLength; - - // Automatically close alerts if there was any present. - if ($('.alert').length > 0) { - setTimeout(function() { $('.alert').alert('close'); }, alertTimeout); - } - - // Only process list-related JavaScript if there's a list! - if (list.length > 0) { - listCheckboxes = list.find(listCheckboxesSelector); - listCheckboxesLength = listCheckboxes.length; - - // Confirm before deleting one item - $('.list-row-action-delete-one').on('click', function(ev) { - ev.preventDefault(); - $(this).addClass('list-row-action-wrapper-link-active') - .siblings('.list-row-action-popover-delete-one').first().show() - .find('.cancel').on('click', function() { - - $(this).parents('.list-row-action-popover-delete-one').hide() - .siblings('.list-row-action-delete-one').removeClass('list-row-action-wrapper-link-active'); - }); - }); - - // Select/deselect record on row's click - list.find('.list-row').on('click', function(ev) { - var checkbox, willBeChecked; - ev.stopPropagation(); - - if (ev.currentTarget.tagName == 'TR') { - checkbox = $(this).find('.list-selectable-checkbox'); - willBeChecked = !checkbox.prop('checked'); - checkbox.prop('checked', willBeChecked); - $(this)[willBeChecked ? 'addClass' : 'removeClass']('list-row-selected'); - generalToggle(); - } - }); - // Select all action - $('#select-all').on('click', function(ev) { - ev.preventDefault(); - ev.stopPropagation(); - if ($(this).is('.list-menu-link-disabled')) return; - - // We assume we want to stay on the dropdown to delete all perhaps - ev.stopPropagation(); - checkAll(list, true); - toggleAction('#select-all', true); - toggleAction('#deselect-all', false); - }); - // Deselect all action - $('#deselect-all').on('click', function(ev) { - ev.preventDefault(); - if ($(this).is('.list-menu-link-disabled')) return; - - checkAll(list, false); - toggleAction('#deselect-all', true); - toggleAction('#select-all', false); - }); - // Delete selected - $('#delete-selected').on('click', function(ev) { - ev.preventDefault(); - ev.stopPropagation(); - if ($(this).is('.list-menu-link-disabled')) return; - - // Open the popup to confirm deletion - $(this).parent().addClass('active').parent('.dropdown').addClass('open'); - $(this).addClass('active') - .siblings('.list-menu-popover-delete-selected').first().show() - .find('.cancel').on('click', function() { - - // Hide the popover on cancel - $(this).parents('.list-menu-popover-delete-selected').hide() - .siblings('#delete-selected').removeClass('active').parent().removeClass('active'); - // and close the dropdown - $(this).parents('.dropdown').removeClass('open'); - }); - - $(this).siblings('.list-menu-popover-delete-selected').find(':hidden[data-delete-many-ids=true]'). - val(listCheckboxes.filter(':checked').map(function() { return $(this).val(); }).toArray().join(',')); - }); - - // Catch checkboxes check/uncheck and enable/disable the delete selected functionality - listCheckboxes.on('click', function(ev) { - ev.stopPropagation(); - - $(this).parent('.list-row')[$(this).is(':checked') ? 'addClass' : 'removeClass']('list-row-selected'); - - generalToggle(); - }); - } - - // Autofocus first field with an error. (usability) - var error_input; - if (error_input = $('.has-error :input').first()) { error_input.focus(); } - }); -}(window.jQuery); diff --git a/padrino/notejam/public/admin/javascripts/bootstrap/affix.js b/padrino/notejam/public/admin/javascripts/bootstrap/affix.js deleted file mode 100644 index c7be96e1d..000000000 --- a/padrino/notejam/public/admin/javascripts/bootstrap/affix.js +++ /dev/null @@ -1,126 +0,0 @@ -/* ======================================================================== - * Bootstrap: affix.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#affix - * ======================================================================== - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ======================================================================== */ - - -+function ($) { "use strict"; - - // AFFIX CLASS DEFINITION - // ====================== - - var Affix = function (element, options) { - this.options = $.extend({}, Affix.DEFAULTS, options) - this.$window = $(window) - .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) - .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) - - this.$element = $(element) - this.affixed = - this.unpin = null - - this.checkPosition() - } - - Affix.RESET = 'affix affix-top affix-bottom' - - Affix.DEFAULTS = { - offset: 0 - } - - Affix.prototype.checkPositionWithEventLoop = function () { - setTimeout($.proxy(this.checkPosition, this), 1) - } - - Affix.prototype.checkPosition = function () { - if (!this.$element.is(':visible')) return - - var scrollHeight = $(document).height() - var scrollTop = this.$window.scrollTop() - var position = this.$element.offset() - var offset = this.options.offset - var offsetTop = offset.top - var offsetBottom = offset.bottom - - if (typeof offset != 'object') offsetBottom = offsetTop = offset - if (typeof offsetTop == 'function') offsetTop = offset.top() - if (typeof offsetBottom == 'function') offsetBottom = offset.bottom() - - var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false : - offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' : - offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false - - if (this.affixed === affix) return - if (this.unpin) this.$element.css('top', '') - - this.affixed = affix - this.unpin = affix == 'bottom' ? position.top - scrollTop : null - - this.$element.removeClass(Affix.RESET).addClass('affix' + (affix ? '-' + affix : '')) - - if (affix == 'bottom') { - this.$element.offset({ top: document.body.offsetHeight - offsetBottom - this.$element.height() }) - } - } - - - // AFFIX PLUGIN DEFINITION - // ======================= - - var old = $.fn.affix - - $.fn.affix = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.affix') - var options = typeof option == 'object' && option - - if (!data) $this.data('bs.affix', (data = new Affix(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.affix.Constructor = Affix - - - // AFFIX NO CONFLICT - // ================= - - $.fn.affix.noConflict = function () { - $.fn.affix = old - return this - } - - - // AFFIX DATA-API - // ============== - - $(window).on('load', function () { - $('[data-spy="affix"]').each(function () { - var $spy = $(this) - var data = $spy.data() - - data.offset = data.offset || {} - - if (data.offsetBottom) data.offset.bottom = data.offsetBottom - if (data.offsetTop) data.offset.top = data.offsetTop - - $spy.affix(data) - }) - }) - -}(window.jQuery); diff --git a/padrino/notejam/public/admin/javascripts/bootstrap/alert.js b/padrino/notejam/public/admin/javascripts/bootstrap/alert.js deleted file mode 100644 index 663029ed8..000000000 --- a/padrino/notejam/public/admin/javascripts/bootstrap/alert.js +++ /dev/null @@ -1,98 +0,0 @@ -/* ======================================================================== - * Bootstrap: alert.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#alerts - * ======================================================================== - * Copyright 2013 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ======================================================================== */ - - -+function ($) { "use strict"; - - // ALERT CLASS DEFINITION - // ====================== - - var dismiss = '[data-dismiss="alert"]' - var Alert = function (el) { - $(el).on('click', dismiss, this.close) - } - - Alert.prototype.close = function (e) { - var $this = $(this) - var selector = $this.attr('data-target') - - if (!selector) { - selector = $this.attr('href') - selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 - } - - var $parent = $(selector) - - if (e) e.preventDefault() - - if (!$parent.length) { - $parent = $this.hasClass('alert') ? $this : $this.parent() - } - - $parent.trigger(e = $.Event('close.bs.alert')) - - if (e.isDefaultPrevented()) return - - $parent.removeClass('in') - - function removeElement() { - $parent.trigger('closed.bs.alert').remove() - } - - $.support.transition && $parent.hasClass('fade') ? - $parent - .one($.support.transition.end, removeElement) - .emulateTransitionEnd(150) : - removeElement() - } - - - // ALERT PLUGIN DEFINITION - // ======================= - - var old = $.fn.alert - - $.fn.alert = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.alert') - - if (!data) $this.data('bs.alert', (data = new Alert(this))) - if (typeof option == 'string') data[option].call($this) - }) - } - - $.fn.alert.Constructor = Alert - - - // ALERT NO CONFLICT - // ================= - - $.fn.alert.noConflict = function () { - $.fn.alert = old - return this - } - - - // ALERT DATA-API - // ============== - - $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) - -}(window.jQuery); diff --git a/padrino/notejam/public/admin/javascripts/bootstrap/bootstrap.min.js b/padrino/notejam/public/admin/javascripts/bootstrap/bootstrap.min.js deleted file mode 100644 index 1765631f4..000000000 --- a/padrino/notejam/public/admin/javascripts/bootstrap/bootstrap.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/** -* bootstrap.js v3.0.0 by @fat and @mdo -* Copyright 2013 Twitter Inc. -* http://www.apache.org/licenses/LICENSE-2.0 -*/ -if(!jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(window.jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]');if(a.length){var b=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");"radio"===b.prop("type")&&a.find(".active").removeClass("active")}this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(window.jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?(this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350),void 0):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(window.jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(window.jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top()),"function"==typeof h&&(h=f.bottom());var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()}))}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(window.jQuery); \ No newline at end of file diff --git a/padrino/notejam/public/admin/javascripts/bootstrap/button.js b/padrino/notejam/public/admin/javascripts/bootstrap/button.js deleted file mode 100644 index fc73b555f..000000000 --- a/padrino/notejam/public/admin/javascripts/bootstrap/button.js +++ /dev/null @@ -1,109 +0,0 @@ -/* ======================================================================== - * Bootstrap: button.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#buttons - * ======================================================================== - * Copyright 2013 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ======================================================================== */ - - -+function ($) { "use strict"; - - // BUTTON PUBLIC CLASS DEFINITION - // ============================== - - var Button = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, Button.DEFAULTS, options) - } - - Button.DEFAULTS = { - loadingText: 'loading...' - } - - Button.prototype.setState = function (state) { - var d = 'disabled' - var $el = this.$element - var val = $el.is('input') ? 'val' : 'html' - var data = $el.data() - - state = state + 'Text' - - if (!data.resetText) $el.data('resetText', $el[val]()) - - $el[val](data[state] || this.options[state]) - - // push to event loop to allow forms to submit - setTimeout(function () { - state == 'loadingText' ? - $el.addClass(d).attr(d, d) : - $el.removeClass(d).removeAttr(d); - }, 0) - } - - Button.prototype.toggle = function () { - var $parent = this.$element.closest('[data-toggle="buttons"]') - - if ($parent.length) { - var $input = this.$element.find('input') - .prop('checked', !this.$element.hasClass('active')) - .trigger('change') - if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active') - } - - this.$element.toggleClass('active') - } - - - // BUTTON PLUGIN DEFINITION - // ======================== - - var old = $.fn.button - - $.fn.button = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.button') - var options = typeof option == 'object' && option - - if (!data) $this.data('bs.button', (data = new Button(this, options))) - - if (option == 'toggle') data.toggle() - else if (option) data.setState(option) - }) - } - - $.fn.button.Constructor = Button - - - // BUTTON NO CONFLICT - // ================== - - $.fn.button.noConflict = function () { - $.fn.button = old - return this - } - - - // BUTTON DATA-API - // =============== - - $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { - var $btn = $(e.target) - if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') - $btn.button('toggle') - e.preventDefault() - }) - -}(window.jQuery); diff --git a/padrino/notejam/public/admin/javascripts/bootstrap/carousel.js b/padrino/notejam/public/admin/javascripts/bootstrap/carousel.js deleted file mode 100644 index d8c4c243c..000000000 --- a/padrino/notejam/public/admin/javascripts/bootstrap/carousel.js +++ /dev/null @@ -1,217 +0,0 @@ -/* ======================================================================== - * Bootstrap: carousel.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#carousel - * ======================================================================== - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ======================================================================== */ - - -+function ($) { "use strict"; - - // CAROUSEL CLASS DEFINITION - // ========================= - - var Carousel = function (element, options) { - this.$element = $(element) - this.$indicators = this.$element.find('.carousel-indicators') - this.options = options - this.paused = - this.sliding = - this.interval = - this.$active = - this.$items = null - - this.options.pause == 'hover' && this.$element - .on('mouseenter', $.proxy(this.pause, this)) - .on('mouseleave', $.proxy(this.cycle, this)) - } - - Carousel.DEFAULTS = { - interval: 5000 - , pause: 'hover' - , wrap: true - } - - Carousel.prototype.cycle = function (e) { - e || (this.paused = false) - - this.interval && clearInterval(this.interval) - - this.options.interval - && !this.paused - && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) - - return this - } - - Carousel.prototype.getActiveIndex = function () { - this.$active = this.$element.find('.item.active') - this.$items = this.$active.parent().children() - - return this.$items.index(this.$active) - } - - Carousel.prototype.to = function (pos) { - var that = this - var activeIndex = this.getActiveIndex() - - if (pos > (this.$items.length - 1) || pos < 0) return - - if (this.sliding) return this.$element.one('slid', function () { that.to(pos) }) - if (activeIndex == pos) return this.pause().cycle() - - return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) - } - - Carousel.prototype.pause = function (e) { - e || (this.paused = true) - - if (this.$element.find('.next, .prev').length && $.support.transition.end) { - this.$element.trigger($.support.transition.end) - this.cycle(true) - } - - this.interval = clearInterval(this.interval) - - return this - } - - Carousel.prototype.next = function () { - if (this.sliding) return - return this.slide('next') - } - - Carousel.prototype.prev = function () { - if (this.sliding) return - return this.slide('prev') - } - - Carousel.prototype.slide = function (type, next) { - var $active = this.$element.find('.item.active') - var $next = next || $active[type]() - var isCycling = this.interval - var direction = type == 'next' ? 'left' : 'right' - var fallback = type == 'next' ? 'first' : 'last' - var that = this - - if (!$next.length) { - if (!this.options.wrap) return - $next = this.$element.find('.item')[fallback]() - } - - this.sliding = true - - isCycling && this.pause() - - var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) - - if ($next.hasClass('active')) return - - if (this.$indicators.length) { - this.$indicators.find('.active').removeClass('active') - this.$element.one('slid', function () { - var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) - $nextIndicator && $nextIndicator.addClass('active') - }) - } - - if ($.support.transition && this.$element.hasClass('slide')) { - this.$element.trigger(e) - if (e.isDefaultPrevented()) return - $next.addClass(type) - $next[0].offsetWidth // force reflow - $active.addClass(direction) - $next.addClass(direction) - $active - .one($.support.transition.end, function () { - $next.removeClass([type, direction].join(' ')).addClass('active') - $active.removeClass(['active', direction].join(' ')) - that.sliding = false - setTimeout(function () { that.$element.trigger('slid') }, 0) - }) - .emulateTransitionEnd(600) - } else { - this.$element.trigger(e) - if (e.isDefaultPrevented()) return - $active.removeClass('active') - $next.addClass('active') - this.sliding = false - this.$element.trigger('slid') - } - - isCycling && this.cycle() - - return this - } - - - // CAROUSEL PLUGIN DEFINITION - // ========================== - - var old = $.fn.carousel - - $.fn.carousel = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.carousel') - var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) - var action = typeof option == 'string' ? option : options.slide - - if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) - if (typeof option == 'number') data.to(option) - else if (action) data[action]() - else if (options.interval) data.pause().cycle() - }) - } - - $.fn.carousel.Constructor = Carousel - - - // CAROUSEL NO CONFLICT - // ==================== - - $.fn.carousel.noConflict = function () { - $.fn.carousel = old - return this - } - - - // CAROUSEL DATA-API - // ================= - - $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { - var $this = $(this), href - var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 - var options = $.extend({}, $target.data(), $this.data()) - var slideIndex = $this.attr('data-slide-to') - if (slideIndex) options.interval = false - - $target.carousel(options) - - if (slideIndex = $this.attr('data-slide-to')) { - $target.data('bs.carousel').to(slideIndex) - } - - e.preventDefault() - }) - - $(window).on('load', function () { - $('[data-ride="carousel"]').each(function () { - var $carousel = $(this) - $carousel.carousel($carousel.data()) - }) - }) - -}(window.jQuery); diff --git a/padrino/notejam/public/admin/javascripts/bootstrap/collapse.js b/padrino/notejam/public/admin/javascripts/bootstrap/collapse.js deleted file mode 100644 index 92cc0bc76..000000000 --- a/padrino/notejam/public/admin/javascripts/bootstrap/collapse.js +++ /dev/null @@ -1,179 +0,0 @@ -/* ======================================================================== - * Bootstrap: collapse.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#collapse - * ======================================================================== - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ======================================================================== */ - - -+function ($) { "use strict"; - - // COLLAPSE PUBLIC CLASS DEFINITION - // ================================ - - var Collapse = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, Collapse.DEFAULTS, options) - this.transitioning = null - - if (this.options.parent) this.$parent = $(this.options.parent) - if (this.options.toggle) this.toggle() - } - - Collapse.DEFAULTS = { - toggle: true - } - - Collapse.prototype.dimension = function () { - var hasWidth = this.$element.hasClass('width') - return hasWidth ? 'width' : 'height' - } - - Collapse.prototype.show = function () { - if (this.transitioning || this.$element.hasClass('in')) return - - var startEvent = $.Event('show.bs.collapse') - this.$element.trigger(startEvent) - if (startEvent.isDefaultPrevented()) return - - var actives = this.$parent && this.$parent.find('> .panel > .in') - - if (actives && actives.length) { - var hasData = actives.data('bs.collapse') - if (hasData && hasData.transitioning) return - actives.collapse('hide') - hasData || actives.data('bs.collapse', null) - } - - var dimension = this.dimension() - - this.$element - .removeClass('collapse') - .addClass('collapsing') - [dimension](0) - - this.transitioning = 1 - - var complete = function () { - this.$element - .removeClass('collapsing') - .addClass('in') - [dimension]('auto') - this.transitioning = 0 - this.$element.trigger('shown.bs.collapse') - } - - if (!$.support.transition) return complete.call(this) - - var scrollSize = $.camelCase(['scroll', dimension].join('-')) - - this.$element - .one($.support.transition.end, $.proxy(complete, this)) - .emulateTransitionEnd(350) - [dimension](this.$element[0][scrollSize]) - } - - Collapse.prototype.hide = function () { - if (this.transitioning || !this.$element.hasClass('in')) return - - var startEvent = $.Event('hide.bs.collapse') - this.$element.trigger(startEvent) - if (startEvent.isDefaultPrevented()) return - - var dimension = this.dimension() - - this.$element - [dimension](this.$element[dimension]()) - [0].offsetHeight - - this.$element - .addClass('collapsing') - .removeClass('collapse') - .removeClass('in') - - this.transitioning = 1 - - var complete = function () { - this.transitioning = 0 - this.$element - .trigger('hidden.bs.collapse') - .removeClass('collapsing') - .addClass('collapse') - } - - if (!$.support.transition) return complete.call(this) - - this.$element - [dimension](0) - .one($.support.transition.end, $.proxy(complete, this)) - .emulateTransitionEnd(350) - } - - Collapse.prototype.toggle = function () { - this[this.$element.hasClass('in') ? 'hide' : 'show']() - } - - - // COLLAPSE PLUGIN DEFINITION - // ========================== - - var old = $.fn.collapse - - $.fn.collapse = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.collapse') - var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) - - if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.collapse.Constructor = Collapse - - - // COLLAPSE NO CONFLICT - // ==================== - - $.fn.collapse.noConflict = function () { - $.fn.collapse = old - return this - } - - - // COLLAPSE DATA-API - // ================= - - $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) { - var $this = $(this), href - var target = $this.attr('data-target') - || e.preventDefault() - || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 - var $target = $(target) - var data = $target.data('bs.collapse') - var option = data ? 'toggle' : $this.data() - var parent = $this.attr('data-parent') - var $parent = parent && $(parent) - - if (!data || !data.transitioning) { - if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') - $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') - } - - $target.collapse(option) - }) - -}(window.jQuery); diff --git a/padrino/notejam/public/admin/javascripts/bootstrap/dropdown.js b/padrino/notejam/public/admin/javascripts/bootstrap/dropdown.js deleted file mode 100644 index 6093f11a8..000000000 --- a/padrino/notejam/public/admin/javascripts/bootstrap/dropdown.js +++ /dev/null @@ -1,154 +0,0 @@ -/* ======================================================================== - * Bootstrap: dropdown.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#dropdowns - * ======================================================================== - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ======================================================================== */ - - -+function ($) { "use strict"; - - // DROPDOWN CLASS DEFINITION - // ========================= - - var backdrop = '.dropdown-backdrop' - var toggle = '[data-toggle=dropdown]' - var Dropdown = function (element) { - var $el = $(element).on('click.bs.dropdown', this.toggle) - } - - Dropdown.prototype.toggle = function (e) { - var $this = $(this) - - if ($this.is('.disabled, :disabled')) return - - var $parent = getParent($this) - var isActive = $parent.hasClass('open') - - clearMenus() - - if (!isActive) { - if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { - // if mobile we we use a backdrop because click events don't delegate - $('