Skip to content
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
10 changes: 5 additions & 5 deletions client/lib/custom.bootstrap.import.less
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
@gray-lighter: #e3e3e3; // lighten(@gray-base, 93.5%); #eee
@gray-lightest: #f9f9f9;

@brand-primary: #BCC620; // #6fbbfe #6fbbfe #941b80 #337ab7
// @brand-success: #5cb85c;
@brand-success: @brand-primary; // #94dd07 #14e614
@brand-primary: #af6ffe; // #BCC620 #6fbbfe #941b80 #337ab7
// @brand-success: #5cb85c #af6ffe;
@brand-success: #94dd07; // #14e614
// @brand-info: #5bc0de;
@brand-info: #3E7DB4; // #71bdff
@brand-warning: #f0ad4e;
Expand Down Expand Up @@ -397,8 +397,8 @@
// Navbar toggle
@navbar-default-toggle-hover-bg: #ddd;
@navbar-default-toggle-icon-bar-bg: #888;
@navbar-default-toggle-border-color: #ddd;
@navbar-default-toggle-border-color: #ddd;
@navbar-default-toggle-border-color: transparent;
// @navbar-default-toggle-border-color: #ddd;


//=== Inverted navbar
Expand Down
68 changes: 67 additions & 1 deletion client/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

@import "lib/custom.bootstrap.import.less";

// Our own variables

// Key colors pallet
@key-color-1: #aa11aa;
@key-color-2: #11bbaa;
@key-color-3: #aabb11;
@key-color-4: #1111aa;
@key-color-5: #aa1111;
@key-color-6: #11bb11;
@key-color-7: #cc8888;
@key-color-8: #cccc88;
@key-color-9: #88cccc;
@key-color-10: #8888cc;
@key-color-11: #88cc88;
@key-color-12: #aabbaa;
@key-color-13: #aabbaa;
@key-color-14: #aabbaa;
@key-color-15: #aabbaa;
@key-color-16: #aabbaa;


/*full heights for elements*/
html, body, .full-height {
height: 100%;
Expand Down Expand Up @@ -48,6 +69,9 @@ textarea {
text-transform: uppercase;
}

form label {
text-transform: uppercase;
}

small {
text-transform: none !important;
Expand All @@ -69,13 +93,31 @@ small {
text-align: center;
}

// UI components
ul.list-group .glyphicon.close {
font-size: 15px;
line-height: 18px;
}

ul.list-group .close {
padding: 0 2px 0 10px;
padding: 0 8px 0 10px;
}

.glyphicon.text-success {
color: @brand-success;
}
.glyphicon.text-info {
color: @brand-info;
}
.glyphicon.text-warning {
color: @brand-warning;
}
.glyphicon.text-danger {
color: @brand-danger;
}

.tab-content > .tab-pane {
padding-top: 8px;
}

.VA-top-spacer {
Expand All @@ -90,6 +132,30 @@ ul.list-group .close {
z-index: 900;
}

// This inverts colors for nav-buttons
.VA-nav-buttons.btn-group .btn {
background-color: @gray-lightest;
border-color: @gray-lighter;
&.btn-default {
color: lighten(@gray, 7%);
}
&.btn-primary {
color: darken(@brand-primary, 2%);
}
&.btn-success {
color: darken(@brand-success, 2%);
}
&.btn-info {
color: darken(@brand-info, 2%);
}
&.btn-warning {
color: darken(@brand-warning, 2%);
}
&.btn-danger {
color: darken(@brand-danger, 2%);
}
}

.VA-navbar-title {
display: inline-block;
position: absolute;
Expand Down
18 changes: 11 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ if (Meteor.isClient) {
Template.body.helpers({
// Global helpers (is it really global?)
// NOTE: These are not being utilized
GcurrentVote: function () {
return Session.get("currentVote");
},

GcurrentVoteOption: function () {
return Session.get("currentVoteOption");
}

});

Expand All @@ -30,7 +23,18 @@ if (Meteor.isClient) {
"click [data-action='logoutUser']": function (event) {
event.preventDefault();
Meteor.logout();
},

"click [data-action='previous']" : function (event) {
event.preventDefault();

// Simplest history implementation.
// TODO: We will develop a more sophisticated history
// to allow for more logical navigation in the app.
history.go(-1);

}

});
};

Expand Down
35 changes: 21 additions & 14 deletions lib/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,26 +141,33 @@ Router.map(function (){
name: "voteEdit"
});

this.route("/voteChoice/:_id/:edit?", {
this.route("/voteChoice/:_id", {
waitOn: function(){
return Meteor.subscribe("votesList") && Meteor.subscribe("voteChoices") && Meteor.subscribe("myBallots");
},
data: function () {
var result = {};
if (this.ready()) {
var creator = choicesCollection.findOne({_id:this.params._id}).createdBy;
if (this.params.edit == "edit" && creator == Meteor.userId()) {
result.edit = "edit";
result.navAction = [{name: "Info", navRoute: "voteInfo"}];
} else {
result.navAction = [{name: "Edit", navRoute: "voteInfo"}];
};
}; // End if(this.ready())
return result;
},
name: "voteChoice"
});

this.route("/voteChoice/:_id/edit", {
waitOn: function(){
return Meteor.subscribe("votesList") && Meteor.subscribe("voteChoices") && Meteor.subscribe("myBallots");
},

onBeforeAction: function () {
var choiceRecord = choicesCollection.findOne({_id:this.params._id});
var creator = choiceRecord.createdBy;
// var status = voteRecord.voteStatus;
if (creator != Meteor.userId()) {
var theId = this.params._id;
this.redirect("/voteInfo/" + theId);
} else {
this.render();
};
},

name: "voteChoiceEdit"
});

this.route("/doVote/:_id", {
layoutTemplate: "votingView",
yieldTemplates: {
Expand Down
8 changes: 4 additions & 4 deletions modules/dropdownSelect/dropdownSelect.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
{{#if items}}
<div class="btn-group {{config.align}}" role="group">
<div class="btn-group" role="group">
<button class="btn {{config.style}} dropdown-toggle VA-dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
{{items.[0].name}}&nbsp;
<span class="caret"></span>
</button>
<button class="btn {{config.style}} dropdown-toggle VA-dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
{{items.[0].name}}&nbsp;
<span class="caret"></span>
</button>
<ul class="dropdown-menu VA-dropdown-menu {{config.menuAlign}}" aria-labelledby="dropdownMenu1">
{{#each items}}
{{#if seperator}}
Expand Down
3 changes: 2 additions & 1 deletion modules/navBar/navBar.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand brand-primary" href="{{pathFor route='home'}}">VOTESAPP</a>
<a class="navbar-brand brand-primary" href="" data-action="previous"><span class="glyphicon glyphicon-chevron-left"></span><span class="text-muted">&nbsp;Prev</span>
</a>
</div>


Expand Down
13 changes: 7 additions & 6 deletions modules/navButtons/navButtons.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<template name="navButtons">
<div class="btn-group btn-group-justified VA-nav-buttons" role="group" aria-label="nav buttons">
<a class="btn btn-sm btn-default" href="#" role="button" data-action="previous">Prev</a>
<a class="btn btn-sm btn-default" href="{{pathFor route='myVotes'}}" role="button">MyVotes</a>

{{#each navAction}}
<a class="btn btn-sm btn-default" href="{{pathFor route=navRoute _id=stateId}}" role="button" >{{name}}</a>
{{/each}}
<a class="btn btn-primary" data-nav="{{pathFor route='home'}}" role="button">Votes</a>
<a class="btn btn-primary" data-nav="{{pathFor route='myVotes'}}" role="button">My Votes</a>

<a class="btn btn-sm btn-success" href="{{pathFor route='voteCreate'}}" data-toggle="myModal" data-target="#mainModal" data-template="{{pathFor route='voteCreate'}}" role="button">New +</a>
{{!-- {{#each navAction}}
<a class="btn btn-primary" href="{{pathFor route=navRoute _id=stateId}}" role="button" >{{name}}</a>
{{/each}}
--}}
<a class="btn btn-success" data-toggle="myModal" data-target="#mainModal" data-template="{{pathFor route='voteCreate'}}" role="button">New +</a>
</div>
</template>
9 changes: 0 additions & 9 deletions modules/navButtons/navButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ if (Meteor.isClient) {

Template.navButtons.events({

"click [data-action='previous']" : function (event) {
event.preventDefault();

// Simplest history implementation.
// TODO: We will develop a more sophisticated history
// to allow for more logical navigation in the app.
history.go(-1);

}
});

};
12 changes: 7 additions & 5 deletions modules/userItems/userProfile.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ <h3>User Profile</h3>

{{#with profileData}}
{{#if profile.avatar}}
<img src="{{c.url profile.avatar}}" class="img-responsive" />
<img src="{{c.url profile.avatar width=100 crop='fill'}}" class="img-responsive" />
{{/if}}
{{#if username}}
<h4>{{username}}</h4>
Expand All @@ -29,10 +29,10 @@ <h4 class="text-muted">No username yet...</h4>
<h3>Edit User Profile</h3>
{{#with profileData}}
<form id="profileForm" class="form">
<div class="form-group">
{{#if profile.avatar}}
<img src="{{c.url profile.avatar width=100 crop='fill'}}" />
<img src="{{c.url profile.avatar width=120 crop='fill'}}" class="center-block" />
{{/if}}
<div class="form-group">
<label for="userAvatar">User Avatar</label>
<input type="file" id="userAvatar" name="avatar" accept="image/*">
</div>
Expand All @@ -44,8 +44,10 @@ <h3>Edit User Profile</h3>
<label class="form-label" for="profileDescription">Profile Description</label>
<textarea id="profileDescription" rows="4" class="form-control" name="description" placeholder="Write a description" value="{{profile.description}}"></textarea>
</div>
<a href="{{pathFor route='userProfile'}}" class="btn btn-default pull-right">Cancel</a>
<input type="submit" name="submit" value="Submit" class="btn btn-success pull-right" />
<div class="VA-CTA">
<a href="{{pathFor route='userProfile'}}" class="btn btn-default btn-block">Cancel</a>
<input type="submit" name="submit" value="Submit" class="btn btn-success btn-block" />
</div>
</form>
<p>{{emails.[0].address}}</p>
{{/with}}
Expand Down
33 changes: 18 additions & 15 deletions modules/voteItems/voteChoice.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
<template name="voteChoice">

{{#if edit}}

{{#with choiceRecord}}
<pre>&lt;img&gt; goes here</pre>
<h2 contenteditable="true" data-field="name">{{name}}</h2>
<i>{{_id}}</i>
<h4>Description</h4>
<h2>{{name}}</h2>
{{!-- <i>{{_id}}</i> --}}

{{#if description}}
<p contenteditable="true" data-field="description">{{description}}</p>
<h4>Description</h4>
<p>{{description}}</p>
{{else}}
<p contenteditable="true" data-field="description">There is no description yet. Edit this to create a description</p>
<!-- We can put other content conditionally here... -->
{{/if}}
{{/with}}

{{else}}
</template>

<template name="voteChoiceEdit">
<i>in voteChoiceEdit</i>

{{#with choiceRecord}}
<pre>&lt;img&gt; goes here</pre>
<h2>{{name}}</h2>
<h5>Title</h5>
<h2 contenteditable="true" data-field="name">{{name}}</h2>
{{!-- <i>{{_id}}</i> --}}

<h5>Description</h5>
{{#if description}}
<h4>Description</h4>
<p>{{description}}</p>
<p contenteditable="true" data-field="description">{{description}}</p>
{{else}}
<!-- We can put other content conditionally here... -->
<p contenteditable="true" data-field="description">There is no description yet. Edit this to create a description</p>
{{/if}}
<div class="VA-CTA">
<button type="button" class="btn btn-default btn-block" data-action="saveChoice">Save & Return</button>
</div>
{{/with}}

{{/if}}

</template>
Loading