Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very simple deck scaffolding. #106

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/adapters/deck.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import ApplicationAdapter from './application';
import ENV from 'netrunnerdb/config/environment';

export default class DeckAdapter extends ApplicationAdapter {
host = ENV.API_URL;
namespace = 'v3/private';
}
19 changes: 19 additions & 0 deletions app/models/deck.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Model, { attr } from '@ember-data/model';

export default class DeckModel extends Model {
@attr name;
@attr description;
@attr isMini;
@attr sideId;
@attr followsBasicDeckbuildingRules;
@attr identityCardId;
@attr influenceSpent;
@attr notes;
@attr numCards;
@attr createdAt;
@attr updatedAt;
@attr tags;
@attr userId;

// There are no relationships defined yet because of limitations on the API server at the moment.
}
8 changes: 4 additions & 4 deletions app/routes/private/decks.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import RSVP from 'rsvp';

export default class DecksRoute extends Route {
@service session;

// beforeModel(transition) {
// this.session.requireAuthentication(transition, "home.login");
// }
@service store;

model() {
return RSVP.hash({
userinfo: this.session.data.authenticated.userinfo,
decks: this.store.findAll('deck', {
reload: true,
}),
});
}
}
14 changes: 12 additions & 2 deletions app/templates/private/decks.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
<div id="content-sets">
<h2 class="nr-primary mb-4">Private Decks Placeholder Page</h2>
<h2 class="nr-primary mb-4">My Decks</h2>
<div class="tab-body">
<p>Private Deck Functionality Coming Soon!</p>
<p>My Decks - In Progress</p>

<div>
<ul>
{{#each @model.decks as |deck|}}
<li>
{{deck.name}} - {{ deck.sideId }} - {{ deck.identityCardId }} - {{ deck.numCards }} cards
</li>
{{/each}}
</ul>
</div>
</div>
</div>