Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
colintucker committed Jul 30, 2018
0 parents commit 187b486
Show file tree
Hide file tree
Showing 31 changed files with 7,233 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# For more information about the properties used in this file,
# please see the EditorConfig documentation:
# http://editorconfig.org/

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.php]
indent_size = 4
indent_style = space
19 changes: 19 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Docs and tests folders
/docs export-ignore
/tests export-ignore

# Continuous integration files
/.travis.yml export-ignore
/.scrutinizer.yml export-ignore

# Git files
/.gitattributes export-ignore
/.gitignore export-ignore

# Editor files
/.editorconfig export-ignore

# Markdown files
/CONTRIBUTING.md export-ignore
/LICENSE.md export-ignore
/README.md export-ignore
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
### Thumbnails ###
._*
Thumbs.db

### Folder Config ###
.directory
.DS_Store
Desktop.ini

### Log Files ###
*.log

### SQL Files ###
*.sql

### Node.js Packages ###
/**/node_modules

### Sass Cache ###
.sass-cache

### Source Maps ###
/**/*.js.map
/**/*.css.map
104 changes: 104 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Contributing

When contributing to this repository, please first discuss the change you wish to
make via issue, email, or any other method with the owners of this repository before
making a change.

In order to contribute code to this project, please follow the
[pull request workflow](#pull-request-workflow).

Please note we have a [code of conduct](#code-of-conduct), please follow it in all
your interactions with the project.

## Pull Request Workflow

1. Create a [fork][forking] of the repository.
2. Add the original repository as an [upstream remote][upstream] to keep your fork
up-to-date.
3. Create a [new branch][branching] for your changes.
4. [Commit][committing] one or more well-commented and clean changes to your fork.
5. [Sync][syncing] your fork with the upstream remote to merge any changes.
6. [Push][pushing] your changes to GitHub.
7. Create a [pull request][pullreq] using the GitHub web interface.

## Code of Conduct

### Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

### Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

### Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

### Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

### Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at <github@praxis.net.au>. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

### Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[forking]: https://help.github.com/articles/fork-a-repo
[upstream]: https://help.github.com/articles/configuring-a-remote-for-a-fork
[branching]: https://help.github.com/articles/creating-and-deleting-branches-within-your-repository
[committing]: https://help.github.com/articles/adding-a-file-to-a-repository-using-the-command-line
[syncing]: https://help.github.com/articles/syncing-a-fork
[pushing]: https://help.github.com/articles/pushing-to-a-remote
[pullreq]: https://help.github.com/articles/creating-a-pull-request
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
22 changes: 22 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2018, Praxis Interactive.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
106 changes: 106 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# SilverWare Flickr Module

[![Latest Stable Version](https://poser.pugx.org/silverware/flickr/v/stable)](https://packagist.org/packages/silverware/flickr)
[![Latest Unstable Version](https://poser.pugx.org/silverware/flickr/v/unstable)](https://packagist.org/packages/silverware/flickr)
[![License](https://poser.pugx.org/silverware/flickr/license)](https://packagist.org/packages/silverware/flickr)

Provides a component to show a series of tagged photos from a Flickr account in [SilverWare][silverware] apps.

## Contents

- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Issues](#issues)
- [Contribution](#contribution)
- [Maintainers](#maintainers)
- [License](#license)

## Requirements

- [SilverWare][silverware]
- [SilverWare Lightbox Module][silverware-lightbox]

## Installation

Installation is via [Composer][composer]:

```
$ composer require silverware/flickr
```

## Configuration

As with all SilverStripe modules, configuration is via YAML. You may modify the default endpoint and timeout
for the API via YAML:

```yml
SilverWare\Flickr\API\FlickrAPI:
default_endpoint: https://api.flickr.com/services/rest
default_timeout: 10
```
Before this module can be used, you will need to create a Flickr API key.
Once you have created your API key, you can define it for your app in one of two ways:
- via site configuration (Settings tab)
- via YAML configuration file
This module will add a Flickr tab to the Services tab under SilverWare
in your site settings. You can paste your API key into the 'Flickr API Key' field.
Alternatively, you can add your API key to YAML config for your app:
```yml
SilverWare\Flickr\API\FlickrAPI:
api_key: <paste the key here>
```
The key defined in site configuration will take precedence over the YAML key.
## Usage
This module provides a `FlickrPhotosComponent` for use within your SilverWare templates and layouts.

After creating the component, you may enter the Flickr User ID (also known as the NSID) for the component
using the CMS. The Flickr User ID is typically in the format `12345678@N01`. In addition, you can define a
series of comma-separated tags in order to show only photos with those tags.

On the Options tab of the component, you may change any of the default options, which include:

* Number of photos
* Thumbnail size (in pixels)
* Tag mode: all or any (determines whether to show photos with all tags, or any tag)
* Title mode: none, title or footer (for lightbox popups)
* Logo width (in pixels)
* Link title
* Cache duration (in seconds)

Resulting photos are cached between requests to avoid unnecessary API calls. Any time you change either
the User ID, photo tags, or tag mode, the component will automatically clear the cache. Flushing the site will also
clear the photo cache.

## Issues

Please use the [issue tracker][issues] for bug reports and feature requests.

## Contribution

Your contributions are gladly welcomed to help make this project better.
Please see [contributing](CONTRIBUTING.md) for more information.

## Maintainers

[![Colin Tucker](https://avatars3.githubusercontent.com/u/1853705?s=144)](https://github.com/colintucker) | [![Praxis Interactive](https://avatars2.githubusercontent.com/u/1782612?s=144)](https://www.praxis.net.au)
---|---
[Colin Tucker](https://github.com/colintucker) | [Praxis Interactive](https://www.praxis.net.au)

## License

[BSD-3-Clause](LICENSE.md) &copy; Praxis Interactive

[silverware]: https://github.com/praxisnetau/silverware
[silverware-lightbox]: https://github.com/praxisnetau/silverware-lightbox
[composer]: https://getcomposer.org
[issues]: https://github.com/praxisnetau/silverware-flickr/issues
16 changes: 16 additions & 0 deletions _config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

/**
* SilverWare Flickr configuration file.
*
* PHP version >=5.6.0
*
* For full copyright and license information, please view the
* LICENSE.md file that was distributed with this source code.
*
* @package SilverWare\Flickr
* @author Colin Tucker <colin@praxis.net.au>
* @copyright 2018 Praxis Interactive
* @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
* @link https://github.com/praxisnetau/silverware-flickr
*/
11 changes: 11 additions & 0 deletions _config/cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
Name: silverware-flickr-cache
---

# Configure Cache:

SilverStripe\Core\Injector\Injector:
Psr\SimpleCache\CacheInterface.FlickrPhotosComponentCache:
factory: SilverStripe\Core\Cache\CacheFactory
constructor:
namespace: 'FlickrPhotosComponentCache'
17 changes: 17 additions & 0 deletions _config/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
Name: silverware-flickr
---

# Configure Site Configuration:

SilverStripe\SiteConfig\SiteConfig:
extensions:
- SilverWare\Flickr\Extensions\FlickrConfig

# Configure Content Controller:

SilverStripe\CMS\Controllers\ContentController:
required_js:
- "silverware/flickr: client/dist/js/bundle.js"
required_css:
- "silverware/flickr: client/dist/styles/bundle.css"
9 changes: 9 additions & 0 deletions _config/model.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
Name: silverware-flickr-model
---

# Configure Model:

SilverStripe\Core\Injector\Injector:
FlickrAPI:
class: SilverWare\Flickr\API\FlickrAPI
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions admin/client/dist/js/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions admin/client/src/bundles/bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* SilverWare Flickr Admin Bundle
===================================================================================================================== */

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/dist/js/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/dist/styles/bundle.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions client/dist/svg/flickr-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions client/src/bundles/bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* SilverWare Flickr Bundle
===================================================================================================================== */

// Load Styles:

require('styles/bundle.scss');
Loading

0 comments on commit 187b486

Please sign in to comment.