Skip to content

Commit

Permalink
Merge pull request heroku#9 from iamjem/admin-skin
Browse files Browse the repository at this point in the history
Updates to admin skin
  • Loading branch information
scottpersinger committed Oct 2, 2014
2 parents 38a7152 + 25e0d89 commit d054830
Show file tree
Hide file tree
Showing 10 changed files with 6,575 additions and 93 deletions.
150 changes: 81 additions & 69 deletions admin/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,85 +3,97 @@
<head>
<meta charset="utf-8">
<title>QuizLive Admin</title>

<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->

<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="lib/ionic/js/angular/angular-resource.js"></script>

<!-- your app's js -->
<script src="/socket.io/socket.io.js"></script>
<script src="js/admin_app.js"></script>
<script src="js/services.js"></script>
<style>
input {
width:400px;
display:block;
}
textarea {
width:400px;
height:60px;
display:block;
}
label {
display:block;
}
</style>
<link rel="stylesheet" href="css/bootstrap.css">
</head>
<body ng-controller="AdminCtrl">
<div style="float:left;width:500px">
<h1>Quiz Live Admin</h1>
{{name}}
<div class="container">

<button ng-click="next_question()" style="padding:20px;font-size:2em">Next Question!</button>
<div class="page-header">
<h1>Quiz Live Admin</h1>
</div>

<h3>Current question: {{current_question.question}}</h3>
<h3>Answers</h3>
<ul>
<li ng-repeat="answer in answers">{{answer.user.name}} {{answer.correct ? ': right' : ':wrong'}}</li>
</ul>
<div class="row">
<div class="col-md-8">
<h3>
Add Question
</h3>
<form>
<div class="form-group">
<label for="form-question">Question</label>
<p class="alert alert-danger" ng-show="!questionErrors.question">
<strong>Error!</strong> Please supply a question.
</p>
<input type="text" class="form-control" id="form-question" ng-model="question.question" placeholder="Enter question...">
</div>

<h2>Questions</h2>
<form>
<div style="width:400px;float:left">
<label>Question</label>
<textarea ng-model="question.question" ></textarea>
<label>Answers</label>
<textarea ng-model="question.answers"></textarea>
<label>Answers</label>
<p>Select the radio next to the correct answer.</p>
<p class="alert alert-danger" ng-show="!questionErrors.answers">
<strong>Error!</strong> Please supply at least one correct answer.
</p>

<div class="form-group" ng-repeat="item in questionAnswers">
<div class="input-group">
<span class="input-group-addon">
<input type="radio" ng-model="question.answer_index" ng-value="$index">
</span>
<input type="text" class="form-control" ng-model="questionAnswers[$index].text" placeholder="Enter answer...">
</div>
</div>

<button class="btn btn-default" ng-click="addAnswer()">Add Answer</button>
<button class="btn btn-primary" ng-click="saveQuestion()">Save</button>
</form>
</div>
<div style="margin-left:20px;width:400px;float:left">
<label>Correct answer</label>
<input type="text" placeholder="index of answer" ng-model="question.answer_index" />
<button ng-click="saveQuestion()">Save</button>

<div class="col-md-4">
<h4>
Current Question <small ng-show="currentQuestion.question">{{currentQuestion.question_index + 1}} of {{currentQuestion.question_total}}</small>
</h4>
<p><strong>{{currentQuestion.question}}</strong></p>
<div ng-show="answers && answers.length">
<h5>Answers:</h5>
<ul class="list-group">
<li ng-repeat="answer in answers" ng-class='{"list-group-item list-group-item-success": answer.correct, "list-group-item list-group-item-danger": !answer.correct}'>{{answer.user.name}}</li>
</ul>
</div>
<p><button class="btn btn-primary" ng-click="nextQuestion()">Next Question</button></p>

<hr>

<h4>
Leaderboard
</h4>

<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="user in leaders">
<th>{{user.name}}</th>
<td>{{user.points}}</td>
</tr>
</tbody>
</table>

<p><button class="btn btn-danger" ng-click="clearLeaders()">Clear</button></p>
</div>
<div style="clear:both;margin-bottom:40px"></div>
</form>

<table border="1">
<tr ng-repeat="question in questions">
<td>{{question.id}}</td>
<td>{{question.question}}</td>
<td>{{question.answers}}</td>
<td>{{question.answer_index}}</td>
<td>activate <input type="checkbox" ng-data-id="{{question.id}}" class="cb" style="display:inline;width:20px" ng-click="activate(question.id)"/></td>
</tr>
</table>
</div>
</div>

<div style="float:left;width:420px">
<h1>Leaderboard</h1>
<button ng-click="clearLeaders()">Clear Leaderboard</button>
<br />
<table border="1">
<tr ng-repeat="user in leaders">
<td>{{user.points}}</td>
<td>{{user.name}}</td>
</tr>
</table>
</div>
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="lib/ionic/js/angular/angular-resource.js"></script>

<!-- your app's js -->
<script src="/socket.io/socket.io.js"></script>
<script src="js/admin_app.js"></script>
<script src="js/services.js"></script>

</body>
</html>
Empty file added admin/css/admin.css
Empty file.
Loading

0 comments on commit d054830

Please sign in to comment.