Skip to content

Commit

Permalink
Merge pull request #51 from diggyk/master
Browse files Browse the repository at this point in the history
Added create events modal
  • Loading branch information
jathanism committed Sep 23, 2015
2 parents 12f797d + 8bf41e6 commit 5c95988
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 7 deletions.
2 changes: 1 addition & 1 deletion hermes/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.2"
__version__ = "0.4.3"
27 changes: 26 additions & 1 deletion hermes/webapp/src/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,23 @@ button:hover {
box-shadow: 2px 2px 3px #25282b;
}

.big-button {
.big-wide-button {
font-size: 1.5em;
font-weight: bold;
width: 100%;
}

.big-button {
font-size: 1.5em;
font-weight: bold;
padding: 2px 10px;
border-width: 2px;
}

.big-button:not(:first-child) {
margin-left: 10px;
}

.be-positive {
background: #ddf0e2 !important;
border-color: #48ac68 !important;
Expand Down Expand Up @@ -375,6 +386,15 @@ button:hover {
box-shadow: 0 0 20px #000000;
}

.modal-dialog .dialog-text {
padding: 20px;
font-weight: bold;
}

.modal-dialog .dialog-buttons {
text-align: center;
}

#fatesModal {
width: 900px;
height: 540px;
Expand All @@ -387,6 +407,11 @@ button:hover {
font-size: 1.2em;
}

#confirmModal {
border: 5px solid #d0d4d9;
text-align: left;
}

/* LABOR LIST */
.labor-left-panel {
background: #fff5cc;
Expand Down
4 changes: 3 additions & 1 deletion hermes/webapp/src/js/controllers/laborStatusCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
vm.totalQuests = 10;
vm.createErrorMessage = null;
vm.createSuccessMessage = null;
vm.createEventsModal = false;

vm.colors = ['#0071ce', '#72b6ec', '#cce6fa', '#f4faff'];

Expand Down Expand Up @@ -246,7 +247,7 @@
for (var idx = parseInt(vm.offset);
idx < (parseInt(vm.offset) + parseInt(vm.limit));
idx++) {
if (vm.selected.indexOf(vm.laborData[idx].id == -1)) {
if (vm.selected.indexOf(vm.laborData[idx].id) == -1) {
vm.selected.push(vm.laborData[idx].id);
}
}
Expand All @@ -271,6 +272,7 @@
*/
function createEvents() {
if (vm.createInProgress) return;
vm.createEventsModal = false;
vm.createInProgress = true;
vm.createErrorMessage = null;
vm.createSuccessMessage = null;
Expand Down
16 changes: 14 additions & 2 deletions hermes/webapp/src/templates/laborList.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@
<div class="labor-list-wrapper">
<div class="labor-actions"
ng-class="lsc.selected.length == 0 ? 'disabled' : ''">
Throw <select ng-model="lsc.throwableEventTypesSelection"
Throw <select ng-disabled="lsc.selected.length == 0"
ng-model="lsc.throwableEventTypesSelection"
ng-model-options="lsc.selectOptions"
ng-options="optValue.category + ' ' + optValue.state for optValue in lsc.throwableTypes">
</select> for {{lsc.selected.length}} selected hosts.
<button class="be-positive" ng-click="lsc.createEvents()">
<button class="be-positive" ng-click="lsc.createEventsModal = true" ng-disabled="lsc.selected.length == 0">
<img ng-if="lsc.createInProgress" src="/img/loading_15.gif" style="margin: 5px; float: left" />
Create Events
</button>
Expand Down Expand Up @@ -138,4 +139,15 @@
</div>
</div>
</div>
<div ng-cloak class="modal-wrapper fade" ng-if="lsc.createEventsModal">
<div id="confirmModal" class="modal-dialog" role="dialog">
<div class="dialog-text">
Are you sure you want to create a <code>{{lsc.selectedEventType.category}} {{lsc.selectedEventType.state}}</code> event for {{lsc.selected.length}} servers?
</div>
<div class="dialog-buttons">
<button style="float: none" class="big-button" ng-click="lsc.createEvents()">Yes</button>
<button style="float: none" class="big-button" ng-click="lsc.createEventsModal = false">No</button>
</div>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion hermes/webapp/src/templates/questCreation.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<div class="col-md-6 create-panel">
<div class="error-message" ng-if="qc.errorMessages" ng-repeat="msg in qc.errorMessages">{{msg}}</div>
<div>
<button class="big-button be-positive" ng-click="qc.createQuest()">
<button class="big-wide-button be-positive" ng-click="qc.createQuest()">
<img ng-if="qc.createInProgress" src="/img/loading_15.gif" style="margin: 5px; float: left" />
Create Quest
</button>
Expand Down
2 changes: 1 addition & 1 deletion hermes/webapp/src/templates/questStatus.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="col-md-3 quest-list">
<div class="quest-list-filter">
<div>
<button class="big-button be-positive" style="margin-bottom: 10px;" ng-click="qc.goToCreatePage()">Create Quest</button>
<button class="big-wide-button be-positive" style="margin-bottom: 10px;" ng-click="qc.goToCreatePage()">Create Quest</button>
</div>
<div>
<label for="creatorFilter">Filter by Creator</label>
Expand Down

0 comments on commit 5c95988

Please sign in to comment.