Skip to content

Commit

Permalink
Has one page: quickfiles for user
Browse files Browse the repository at this point in the history
  • Loading branch information
hmoco authored and jamescdavis committed Sep 20, 2017
1 parent 0af10ec commit d401501
Show file tree
Hide file tree
Showing 15 changed files with 121 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .ember-cli
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@

Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false
"disableAnalytics": false,
"usePods": true
}
Empty file removed app/controllers/.gitkeep
Empty file.
3 changes: 3 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
<title>EmberQuickfiles</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,300,700' rel='stylesheet' type='text/css'>

{{content-for "head"}}

<link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link rel="stylesheet" href="{{rootURL}}assets/ember-quickfiles.css">

{{content-for "head-footer"}}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">

</head>
<body>
{{content-for "body"}}
Expand Down
4 changes: 4 additions & 0 deletions app/quickfiles/controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Ember from 'ember';

export default Ember.Controller.extend({
});
7 changes: 7 additions & 0 deletions app/quickfiles/route.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Ember from 'ember';

export default Ember.Route.extend({
model(params) {
return this.store.findRecord('user', params.user_id);
}
});
1 change: 1 addition & 0 deletions app/quickfiles/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{file-browser userId=model.id}}
1 change: 1 addition & 0 deletions app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const Router = Ember.Router.extend({
});

Router.map(function() {
this.route('quickfiles', {path: '/:user_id/quickfiles'});
});

export default Router;
Empty file removed app/routes/.gitkeep
Empty file.
23 changes: 19 additions & 4 deletions app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
{{!-- The following component displays Ember's default welcome message. --}}
{{welcome-page}}
{{!-- Feel free to remove this! --}}
<div>
{{new-osf-navbar}}

{{outlet}}
{{maintenance-banner}}
</div>
<br />
<br />
<br />

<div id="main" class="container">
<div class="row">
<div class="col-md-12" role="main">
{{outlet}}
</div>
</div>
</div>

{{osf-footer}}
{{osf-copyright class='text-center'}}
{{osf-mode-footer}}
3 changes: 3 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"name": "ember-quickfiles",
"dependencies": {
"osf-style": "https://github.com/CenterforOpenScience/osf-style.git#1.3.0",
"dropzone": "~4.3.0",
"jquery": "^2.2.4"
}
}
30 changes: 30 additions & 0 deletions config/local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
######## ember-osf settings ########
## This file is solely for developer convenience. Any of these settings may alternately be passed in as
# environment variables in your deployment environment

### Login settings
# Default is ability to read and write all data associated with a user's account. Some apps may not need full account
# privileges. If your app only reads data, best practice is to limit permission requests to only what you need.
OAUTH_SCOPES: osf.full_write
# Where to send the user on the site after they authenticated. Usually this is a page enabled to handle the oauth flow.
REDIRECT_URI: http://localhost:4200/login
# The developer app client ID (not client secret!). This is needed for your app to let users log in via the OSF.
CLIENT_ID: null
# Credentials for only a single user. This setting will be ignored except for local development; NEVER commit to github
PERSONAL_ACCESS_TOKEN: null

### In general, you can leave the items below commented out; ember-osf already knows how to talk to many common OSF
## backends. Only use the below if running against a new or custom OSF instance where you need to control the URLs.
## These values WILL be ignored unless you explicitly specify `BACKEND=env`.
#OSF_URL: 'http://localhost:5000/'
#OSF_API_URL: 'http://localhost:8000'
#OSF_RENDER_URL: 'http://localhost:7778/render'
#OSF_FILE_URL: 'http://localhost:7777/'
#OSF_HELP_URL: 'http://localhost:4200/help'


## Where to direct the user for cookie based authentication
#OSF_COOKIE_LOGIN_URL: 'http://localhost:8080/login'

## Where to direct the user for oauth-based authentication
#OSF_OAUTH_URL: 'http://localhost:8080/oauth2/profile'
39 changes: 23 additions & 16 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
/*jshint node:true*/
/* global require, module */
const path = require('path');

var EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function(defaults) {
var app = new EmberApp(defaults, {
// Add options here
});
var app = new EmberApp(defaults, {
'ember-bootstrap': {
'bootstrapVersion': 3,
'importBootstrapFont': true,
'importBootstrapCSS': true
}
});

// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
// environments, specify an object as the first parameter. That
// object's keys should be the environment name and the values
// should be the asset to use in that environment.
//
// If the library that you are including contains AMD or ES6
// modules that you would like to import into your application
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.
// osf-style
app.import(path.join(app.bowerDirectory, 'osf-style/vendor/prism/prism.css'));
app.import(path.join(app.bowerDirectory, 'osf-style/page.css'));
app.import(path.join(app.bowerDirectory, 'osf-style/css/base.css'));
app.import(path.join(app.bowerDirectory, 'loaders.css/loaders.min.css'));
app.import(path.join(app.bowerDirectory, 'osf-style/img/cos-white2.png'), {
destDir: 'img'
});
app.import(path.join(app.bowerDirectory, 'dropzone/dist/basic.css'));
app.import(path.join(app.bowerDirectory, 'dropzone/dist/dropzone.css'));
app.import(path.join(app.bowerDirectory, 'dropzone/dist/dropzone.js'));

app.import('vendor/assets/ember-osf.css');

return app.toTree();
return app.toTree();
};
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@
"test": "ember test"
},
"devDependencies": {
"@centerforopenscience/ember-osf": "file:///Users/henriqueharman/Desktop/ember-osf",
"bootstrap": "^3.3.7",
"broccoli-asset-rev": "^2.4.5",
"ember-ajax": "^2.4.1",
"ember-bootstrap": "1.0.0-rc.1",
"ember-cli": "2.11.1",
"ember-cli-app-version": "^2.0.0",
"ember-cli-babel": "^5.1.7",
"ember-cli-clipboard": "0.8.0",
"ember-cli-dependency-checker": "^1.3.0",
"ember-cli-htmlbars": "^1.1.1",
"ember-cli-htmlbars-inline-precompile": "^0.3.6",
Expand All @@ -33,6 +37,7 @@
"ember-cli-uglify": "^1.2.0",
"ember-data": "^2.11.0",
"ember-export-application-global": "^1.0.5",
"ember-font-awesome": "3.0.5",
"ember-load-initializers": "^0.6.0",
"ember-resolver": "^2.0.3",
"ember-source": "~2.11.0",
Expand Down
12 changes: 12 additions & 0 deletions tests/unit/quickfiles/controller-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { moduleFor, test } from 'ember-qunit';

moduleFor('controller:quickfiles', 'Unit | Controller | quickfiles', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});

// Replace this with your real tests.
test('it exists', function(assert) {
let controller = this.subject();
assert.ok(controller);
});
11 changes: 11 additions & 0 deletions tests/unit/quickfiles/route-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { moduleFor, test } from 'ember-qunit';

moduleFor('route:quickfiles', 'Unit | Route | quickfiles', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});

test('it exists', function(assert) {
let route = this.subject();
assert.ok(route);
});

0 comments on commit d401501

Please sign in to comment.