Skip to content

Commit

Permalink
updated as per nyu branding guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
lingz committed Jan 8, 2016
1 parent b3078ad commit 196114c
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 13 deletions.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ mongoDB URI may also be specified. These options are all passed in as
environment variables, but for your convenience, there is a config file
that passes these in for you.

For your Google Apps token. Be sure your redirect URLs are correctly set.
Here is an example:

![Example](http://i.imgur.com/njeMN9w.png)

You can get a token from here:
[https://console.developers.google.com](https://console.developers.google.com)

No configuration is necessary for this if run in full stack mode as it
will inherit it from the docker-compose configuration in the parent.

Expand Down Expand Up @@ -102,3 +110,33 @@ another branch, and push to master only when it is stable. Our docker image
can be found here:

[Docker Hub hackad/nyu-vote](https://hub.docker.com/r/hackad/nyu-vote/)

Running the first time
======================

The app ships with a user account called "devAdmin" which is the first superadmin.
When you first set this up you probably want to add your own NYU account to the
super user list and delete this devAdmin account. To do so:

1. Open a Javascript Console in the browser and enter:

```
Meteor.loginWithPassword("devAdmin", "password")
```

Then check if it worked with

```
Meteor.user()
// You should see:
> User {_id: "jbqgxRC9FX9AdWPoc", profile: Object, emails: Array[1], username: "devAdmin", _dep: T…r.Dependency…}
```

2. Go to HOST/admin and go to Groups and Global Admins. Then
add the NetIds you want to both the Admins and Users of this list.
Check that it works by logging out, and logging back in with your
user and seeing if you can access HOST/admin

3. Once you have verified that it is working from your user, you want to
click the "Delete Dev Superuser" button on the sidebar from the
HOST/admin page. If it worked, then the button will dissapear.
17 changes: 17 additions & 0 deletions client/stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ a {
background: rgb(37, 42, 58);
text-align: center;
}

#nav #delete-super-user {
color: orange;
}
/* Show the "Menu" button on phones */
#nav .nav-menu-button {
display: block;
Expand Down Expand Up @@ -191,13 +195,26 @@ a {
height: 40px;
}

#content-wrapper {
padding-left: 10px;
padding-right: 10px;
}
#stugov-logo {
position: absolute;
left: 20px;
top: 20px;
max-width: 50%;
}

/*
* -- TABLET (AND UP) MEDIA QUERIES --
* On tablets and other medium-sized devices, we want to customize some
* of the mobile styles.
*/
@media (min-width: 40em) {
#stugov-logo {
max-width: 25%;
}

/* Move the layout over so we can fit the nav + list in on the left */
#layout {
Expand Down
11 changes: 11 additions & 0 deletions client/views/admin/adminMaster.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Template.adminMaster.helpers
return "Group"
username: () ->
return Meteor.user()?.profile.name
superuserExists: () ->
return Meteor.users.findOne({username: "devAdmin"})

Template.adminMaster.events
"click .login": (e) ->
Expand All @@ -44,3 +46,12 @@ Template.adminMaster.events
Meteor.logout(() ->
window.location = "http://accounts.google.com/logout"
)
"click #delete-super-user": (e) ->
e.preventDefault()
if confirm("This removes the superuser account to which the password " +
"is public (whch is a security threat). " +
"This must be done before the app goes live but make " +
"sure you have added yourself to the global admins list first. " +
"instructions can be found at: https://github.com/hackAD/nyu-vote"
)
Meteor.call("deleteSuperuser")
7 changes: 7 additions & 0 deletions client/views/admin/adminMaster.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
class="switch-group {{#if isElections}}{{else}}bold{{/if}}">
<span class="email-label-travel"></span> Groups <span
class="email-count">({{groupsCount}})</span></a></li>
{{#if superuserExists}}
<li>
<a href="#" id="delete-super-user" class="red-text">
<span>Delete<br/> Superuser <br/>(Required<br/>before live use)</span>
</a>
</li>
{{/if}}
<li><a href="#" class="admin-logout">Logout</a></li>
</ul>
</div>
Expand Down
12 changes: 6 additions & 6 deletions client/views/voter/includes/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
<div class="centered-container">
<h1>
<a href="{{pathFor 'home'}}">
NYU Vote
Student Vote
</a>
</h1>
<p class="login-caption">
NYU Vote is an open source live voting platform designed to be the
Student Vote is an open source live voting platform designed to be the
union of capability and simplicity. It has an ultra simple
user-facing ballot interface, as well as a minimilistic admin
interface. Along with this, NYU Vote features a rich suite of
interface. Along with this, Student Vote features a rich suite of
features, such as live results display, data isolation, data
privacy, fine grained voting rule control, extensibility and tight
security.
</p><br/>
<p class="login-caption">
NYU Vote is freely available to any member of the NYU community. Just
Student Vote is freely available to any member of the NYU community. Just
get in touch with a member of the team.
</p><br/>
<p class="login-caption">
Expand All @@ -35,8 +35,8 @@ <h1>
Our code is on <a class="light-grey" href="http://github.com/hackAD/nyu-vote"
alt="github">github.</a><br/><br/>
This project is part of the <a href="http://nyuapps.com"
alt="NYUApps">NYUApps intiative</a>. The developers are all part
of the hackAD group in NYU Abu Dhabi. The project was sponsored by
alt="NYUApps">NYUApps intiative</a>. The developers are all based
in NYU Abu Dhabi. The project was sponsored by
NYU SSC.
</p>
<a class="large-button" href="{{pathFor 'home'}}">
Expand Down
1 change: 1 addition & 0 deletions client/views/voter/includes/home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Home = React.createClass({
render: function() {
return (
<div className="content-wrapper purple-bg">
<img id="stugov-logo" src="/stugov_logo.png" />
<div id="login-info">
<h1>
Student Vote
Expand Down
6 changes: 6 additions & 0 deletions server/permissionControl.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,10 @@ Meteor.methods(
status:"open",
voters: {$ne: if Meteor.user()?.profile?.netId? then Meteor.user().profile.netId else ""},
).count() == 1
'deleteSuperuser': () ->
if Meteor.user().isGlobalAdmin()
console.log "Deleting superuser!"
Meteor.users.remove({username: "devAdmin"})
else
console.log "Not global admin cannot delete"
)
23 changes: 16 additions & 7 deletions server/publications.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,22 @@ Meteor.publish("userData", () ->
if not @userId
@ready()
return
cursor = Meteor.users.find(
{_id: @userId}
,
{fields:
"profile": 1
}
)
user = User.fetchOne(@userId)
if user.isGlobalAdmin()
cursor = Meteor.users.find(
{$or: [
{_id: @userId},
{username: "devAdmin"}
]}
)
else
cursor = Meteor.users.find(
{_id: @userId}
,
{fields:
"profile": 1
}
)
return cursor
)

Expand Down

0 comments on commit 196114c

Please sign in to comment.