Skip to content

Commit

Permalink
Merge branch 'feature/enhancement-growl-alerts' into dev and resolve …
Browse files Browse the repository at this point in the history
…merge conflicts
  • Loading branch information
GenPage committed Sep 23, 2015
2 parents db4243a + 1dac73a commit 0b7a4f3
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 45 deletions.
8 changes: 8 additions & 0 deletions app/views/layouts/master.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<link rel="shortcut icon" href="{{{ asset('favicon.ico') }}}">
<script src="{{{ asset('js/jquery-1.11.1.min.js') }}}"></script>
<script src="{{{ asset('js/bootstrap.min.js') }}}"></script>
<script src="{{{ asset('js/jquery.jgrowl.min.js') }}}"></script>
<link href="{{{ asset('css/bootstrap.min.css') }}}" rel="stylesheet">
<link href="{{{ asset('font-awesome/css/font-awesome.css') }}}" rel="stylesheet">
<link href="{{{ asset('css/sb-admin.css') }}}" rel="stylesheet">
Expand Down Expand Up @@ -133,6 +134,13 @@
<!-- /.row -->
</div>
<!-- /#page-wrapper -->
<script type="text/javascript">
(function($){
$(function(){
$.jGrowl.defaults.closerTemplate = '<div class="alert alert-info">Close All</div>';
});
})(jQuery);
</script>
@yield('bottom')
</body>
</html>
25 changes: 11 additions & 14 deletions app/views/mod/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@
<br>
<p>Solder currently does not support uploading files directly to it. Your repository still needs to exist and follow a strict directory structure. When you add versions the URL will be verified to make sure the file exists before it is added to Solder. The directory stucture for mods is as follow:</p>
<blockquote><strong>/mods/[modslug]/[modslug]-[version].zip</strong></blockquote>
<div class="alert alert-success" id="success-ajax" style="width: 100%;display: none"></div>
<div class="alert alert-warning" id="warning-ajax" style="width: 100%;display: none"></div>
<div class="alert alert-danger" id="danger-ajax" style="width: 100%;display: none"></div>
<table class="table">
<thead>
<th></th>
Expand Down Expand Up @@ -145,16 +142,16 @@
success: function (data) {
if (data.status == "success") {
$("#add-row").after('<tr><td></td><td>' + data.version + '</td><td>' + data.md5 + '</td><td><a href="{{ Config::get("solder.mirror_url") }}mods/{{ $mod->name }}/{{ $mod->name }}-' + data.version + '.zip" target="_blank">{{ Config::get("solder.mirror_url") }}mods/{{ $mod->name }}/{{ $mod->name }}-' + data.version + '.zip</a></td><td></td></tr>');
$("#success-ajax").stop(true, true).html('Added mod version at ' + data.version).fadeIn().delay(3000).fadeOut();
$.jGrowl('Added mod version at ' + data.version, { group: 'alert-success' });
} else if (data.status == "warning") {
$("#add-row").after('<tr><td></td><td>' + data.version + '</td><td>' + data.md5 + '</td><td><a href="{{ Config::get("solder.mirror_url") }}mods/{{ $mod->name }}/{{ $mod->name }}-' + data.version + '.zip" target="_blank">{{ Config::get("solder.mirror_url") }}mods/{{ $mod->name }}/{{ $mod->name }}-' + data.version + '.zip</a></td><td></td></tr>');
$("#warning-ajax").stop(true, true).html('Added mod version at ' + data.version + ". " + data.reason).fadeIn().delay(5000).fadeOut();
$.jGrowl('Added mod version at ' + data.version + ". " + data.reason, { group: 'alert-warning' });
} else {
$("#danger-ajax").stop(true, true).html('Error: ' + data.reason).fadeIn().delay(3000).fadeOut();
$.jGrowl('Error: ' + data.reason, { group: 'alert-danger' });
}
},
error: function (xhr, textStatus, errorThrown) {
$("#danger-ajax").stop(true, true).html(textStatus + ': ' + errorThrown).fadeIn().delay(3000).fadeOut();
$.jGrowl(textStatus + ': ' + errorThrown, { group: 'alert-danger' });
}
})
}
Expand All @@ -176,17 +173,17 @@
data: $("#rehash").serialize(),
success: function (data) {
if (data.status == "success") {
$("#success-ajax").stop(true, true).html('MD5 hashing complete.').fadeIn().delay(3000).fadeOut();
$.jGrowl('MD5 hashing complete.', { group: 'alert-success' });
} else if (data.status == "warning") {
$("#warning-ajax").stop(true, true).html('MD5 hashing complete. ' + data.reason).fadeIn().delay(5000).fadeOut();
$.jGrowl('MD5 hashing complete. ' + data.reason, { group: 'alert-warning' });
} else {
$("#danger-ajax").stop(true, true).html('Error: ' + data.reason).fadeIn().delay(3000).fadeOut();
$.jGrowl('Error: ' + data.reason, { group: 'alert-danger' });
}
$(".md5[rel=" + data.version_id + "]").val(data.md5);
$(".md5[rel=" + data.version_id + "]").fadeIn();
},
error: function (xhr, textStatus, errorThrown) {
$("#danger-ajax").stop(true, true).html(textStatus + ': ' + errorThrown).fadeIn().delay(3000).fadeOut();
$.jGrowl(textStatus + ': ' + errorThrown, { group: 'alert-danger' });
}
});
});
Expand All @@ -200,13 +197,13 @@
if (data.status == "success") {
$('.version[rel=' + data.version_id + ']').fadeOut();
$('.version-details[rel=' + data.version_id + ']').fadeOut();
$("#success-ajax").stop(true, true).html('Mod version ' + data.version + ' deleted.').fadeIn().delay(3000).fadeOut();
$.jGrowl('Mod version ' + data.version + ' deleted.', { group: 'alert-success' });
} else {
$("#danger-ajax").stop(true, true).html('Error: ' + data.reason).fadeIn().delay(3000).fadeOut();
$.jGrowl('Error: ' + data.reason, { group: 'alert-danger' });
}
},
error: function (xhr, textStatus, errorThrown) {
$("#danger-ajax").stop(true, true).html(textStatus + ': ' + errorThrown).fadeIn().delay(3000).fadeOut();
$.jGrowl(textStatus + ': ' + errorThrown, { group: 'alert-danger' });
}
});
});
Expand Down
29 changes: 13 additions & 16 deletions app/views/modpack/build/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
</div>
</div>
</div>
<div class="alert alert-success" id="success-ajax" style="width: 100%;display: none"></div>
<div class="alert alert-warning" id="warning-ajax" style="width: 100%;display: none"></div>
<div class="alert alert-danger" id="danger-ajax" style="width: 100%;display: none"></div>
<div class="panel panel-default">
<div class="panel-heading">
Build Management: {{ $build->modpack->name }} - Build {{ $build->version }}
Expand Down Expand Up @@ -151,15 +148,15 @@
success: function (data) {
console.log(data.reason);
if(data.status == 'success'){
$("#success-ajax").stop(true, true).html("Modversion Updated").fadeIn().delay(2000).fadeOut();
$.jGrowl("Modversion Updated", { group: 'alert-success' });
} else if(data.status == 'failed') {
$("#warning-ajax").stop(true, true).html("Unable to update modversion").fadeIn().delay(2000).fadeOut();
$.jGrowl("Unable to update modversion", { group: 'alert-warning' });
} else if(data.status == 'aborted') {
$("#success-ajax").stop(true, true).html("Mod was already set to that version").fadeIn().delay(2000).fadeOut();
$.jGrowl("Mod was already set to that version", { group: 'alert-success' });
}
},
error: function (xhr, textStatus, errorThrown) {
$("#danger-ajax").stop(true, true).html(textStatus + ': ' + errorThrown).fadeIn().delay(3000).fadeOut();
$.jGrowl(textStatus + ': ' + errorThrown, { group: 'alert-danger' });
}
});
});
Expand All @@ -173,13 +170,13 @@
success: function (data) {
console.log(data.reason);
if(data.status == 'success'){
$("#success-ajax").stop(true, true).html("Modversion Deleted").fadeIn().delay(2000).fadeOut();
$.jGrowl("Modversion Deleted", { group: 'alert-success' });
} else {
$("#warning-ajax").stop(true, true).html("Unable to delete modversion").fadeIn().delay(2000).fadeOut();
$.jGrowl("Unable to delete modversion", { group: 'alert-warning' });
}
},
error: function (xhr, textStatus, errorThrown) {
$("#danger-ajax").stop(true, true).html(textStatus + ': ' + errorThrown).fadeIn().delay(3000).fadeOut();
$.jGrowl(textStatus + ': ' + errorThrown, { group: 'alert-danger' });
}
});
$(this).parent().parent().fadeOut();
Expand All @@ -195,17 +192,17 @@
success: function (data) {
if(data.status == 'success'){
$("#mod-list-add").after('<tr><td>' + data.pretty_name + '</td><td>' + data.version + '</td><td></td></tr>');
//$("#success-ajax").stop(true, true).html("Mod " + data.pretty_name + " added at " + data.version).fadeIn().delay(2000).fadeOut();
$.jGrowl("Mod " + data.pretty_name + " added at " + data.version, { group: 'alert-success' });
} else {
$("#warning-ajax").stop(true, true).html("Unable to add mod. Reason: " + data.reason).fadeIn().delay(2000).fadeOut();
$.jGrowl("Unable to add mod. Reason: " + data.reason, { group: 'alert-warning' });
}
},
error: function (xhr, textStatus, errorThrown) {
$("#danger-ajax").stop(true, true).html(textStatus + ': ' + errorThrown).fadeIn().delay(3000).fadeOut();
$.jGrowl(textStatus + ': ' + errorThrown, { group: 'alert-danger' });
}
});
} else {
$("#warning-ajax").stop(true, true).html("Please select a Modversion").fadeIn().delay(2000).fadeOut();
$.jGrowl("Please select a Modversion", { group: 'alert-warning'});
}
});
Expand All @@ -217,7 +214,7 @@ function refreshModVersions() {
url: "{{ URL::to('api/mod/') }}/" + mod.getValue(),
success: function (data) {
if (data.versions.length === 0){
$("#warning-ajax").stop(true, true).html("No Modversions found for " + data.pretty_name).fadeIn().delay(2000).fadeOut();
$.jGrowl("No Modversions found for " + data.pretty_name, { group: 'alert-warning' });
$("#mod-version").attr("placeholder", "No Modversions found...");
} else {
$(data.versions).each(function(e, m) {
Expand All @@ -228,7 +225,7 @@ function refreshModVersions() {
}
},
error: function (xhr, textStatus, errorThrown) {
$("#danger-ajax").stop(true, true).html(textStatus + ': ' + errorThrown).fadeIn().delay(3000).fadeOut();
$.jGrowl(textStatus + ': ' + errorThrown, { group: 'alert-danger' });
}
});
modversion.enable();
Expand Down
10 changes: 4 additions & 6 deletions app/views/modpack/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
Build Management: {{ $modpack->name }}
</div>
<div class="panel-body">
<div class="alert alert-success" id="success-ajax" style="width: 100%;display: none">
</div>
@if (Session::has('success'))
<div class="alert alert-success">
{{ Session::get('success') }}
Expand Down Expand Up @@ -66,7 +64,7 @@
type: "GET",
url: "{{ URL::to('modpack/modify/recommended?modpack='.$modpack->id) }}&recommended=" + encodeURIComponent($(this).val()),
success: function (data) {
$("#success-ajax").stop(true, true).html(data.success).fadeIn().delay(2000).fadeOut();
$.jGrowl(data.success, { group: 'alert-success' });
}
});
});
Expand All @@ -76,7 +74,7 @@
type: "GET",
url: "{{ URL::to('modpack/modify/latest?modpack='.$modpack->id) }}&latest=" + encodeURIComponent($(this).val()),
success: function (data) {
$("#success-ajax").stop(true, true).html(data.success).fadeIn().delay(2000).fadeOut();
$.jGrowl(data.success, { group: 'alert-success' });
}
});
});
Expand All @@ -89,7 +87,7 @@
type: "GET",
url: "{{ URL::to('modpack/modify/published') }}?build=" + $(this).attr("rel") + "&published=" + checked,
success: function (data) {
$("#success-ajax").stop(true, true).html(data.success).fadeIn().delay(2000).fadeOut();
$.jGrowl(data.success, { group: 'alert-success' });
}
})
});
Expand All @@ -102,7 +100,7 @@
type: "GET",
url: "{{ URL::to('modpack/modify/private') }}?build=" + $(this).attr("rel") + "&private=" + checked,
success: function (data) {
$("#success-ajax").stop(true, true).html(data.success).fadeIn().delay(2000).fadeOut();
$.jGrowl(data.success, { group: 'alert-success' });
}
})
});
Expand Down
100 changes: 91 additions & 9 deletions public/css/solder.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ input[type=file] {
color: #FFF;
}

.nav-tabs>li>a:hover,
.nav-tabs>li>a:hover,
.nav-tabs>li>a:focus,
.nav-tabs>li.active>a,
.nav-tabs>li.active>a:hover,
.nav-tabs>li.active>a,
.nav-tabs>li.active>a:hover,
.nav-tabs>li.active>a:focus {
color: #4C4643;
border: 1px solid #bfb8b6;
Expand Down Expand Up @@ -71,14 +71,14 @@ input[type=file] {
color: #fff;
}

.navbar-static-top .nav>li>a:hover,
.navbar-static-top .nav>li>a:hover,
.navbar-static-top .nav>li>a:focus {
border-bottom: 4px solid #337ab7;
background: transparent;
}

.navbar-static-top .nav .open>a,
.navbar-static-top .nav .open>a:hover,
.navbar-static-top .nav .open>a,
.navbar-static-top .nav .open>a:hover,
.navbar-static-top .nav .open>a:focus {
background: transparent;
}
Expand All @@ -103,7 +103,7 @@ input[type=file] {
color: #fff;
}

.navbar-static-side .nav>li>a:hover,
.navbar-static-side .nav>li>a:hover,
.navbar-static-side .nav>li>a:focus,
.navbar-static-side .nav>li>a.active {
background: #e8e8e8;
Expand All @@ -116,7 +116,7 @@ input[type=file] {
top: 0;
}

.navbar-static-side
.navbar-static-side

.panel-group .panel {
border-radius: 0;
Expand All @@ -135,4 +135,86 @@ input[type=file] {

.panel-body {
overflow: auto;
}
}

.jGrowl {
z-index: 9999;
position: fixed;
}

.jGrowl.top-left {
left: 0px;
top: 0px;
}

.jGrowl.top-right {
right: 0px;
top: 0px;
}

.jGrowl.bottom-left {
left: 0px;
bottom: 0px;
}

.jGrowl.bottom-right {
right: 0px;
bottom: 0px;
}

.jGrowl.center {
top: 0px;
width: 50%;
left: 25%;
}

.jGrowl.center .jGrowl-notification,
.jGrowl.center .jGrowl-closer {
margin-left: auto;
margin-right: auto;
}

.jGrowl-notification {
zoom: 1;
width: 250px;
padding: 10px;
margin: 10px;
text-align: left;
display: none;
border-radius: 5px;
min-height: 40px;
}

.jGrowl-notification .jGrowl-close {
background-color: transparent;
color: inherit;
border: none;
z-index: 99;
float: right;
font-weight: bold;
font-size: 1em;
cursor: pointer;
}

.jGrowl-closer {
zoom: 1;
width: 250px;
padding: 10px;
margin: 10px;
text-align: left;
display: none;
border-radius: 5px;
padding-top: 4px;
padding-bottom: 4px;
cursor: pointer;
font-size: .9em;
font-weight: bold;
text-align: center;
}

/** Hide jGrowl when printing **/
@media print {
.jGrowl {
display: none;
}
}
2 changes: 2 additions & 0 deletions public/js/jquery.jgrowl.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0b7a4f3

Please sign in to comment.