reworked and fix minimized drawer (#137)

* added icons imgs for minimized drawer

* added 1 css class for imgs in minimized drawer

* rework minimized drawer a bit

* remove some console.log i forgot about

* modified sources of icons for when the drawer is minimized and so removed the function to get them

* added the icons path to the json representing the gather instance

i dont even know what im doing

* setup icons path

* linked icons from gather_pool.js to the front end ..?

i'm kinda lost here
This commit is contained in:
AngelRionCervi 2019-03-25 08:42:15 +01:00 committed by Absurdon
parent 99a40bfc40
commit a7c9072048
9 changed files with 1191 additions and 1121 deletions

File diff suppressed because it is too large Load diff

View file

@ -419,8 +419,12 @@ const GatherPage = React.createClass({
} }
let appClass = ["skin-blue", "sidebar-mini", "fixed"]; let appClass = ["skin-blue", "sidebar-mini", "fixed"];
if (this.state.showMessageBox) appClass.push("control-sidebar-open"); if (this.state.showMessageBox){
if (this.state.collapseMenu) appClass.push("sidebar-collapse"); appClass.push("control-sidebar-open");
}
if (this.state.collapseMenu){
appClass.push("sidebar-collapse");
}
let connectionStatus; let connectionStatus;
const connectionState = this.state.connectionState; const connectionState = this.state.connectionState;
@ -475,6 +479,7 @@ const GatherPage = React.createClass({
</div> </div>
</div> </div>
<GatherMenu <GatherMenu
drawerState={this.state.collapseMenu}
gatherPool={this.state.gatherPool} gatherPool={this.state.gatherPool}
currentGather={this.state.currentGather} currentGather={this.state.currentGather}
gatherSelectedCallback={this.onGatherSelected} /> gatherSelectedCallback={this.onGatherSelected} />

View file

@ -230,6 +230,26 @@ html, body {
padding: 5px; padding: 5px;
} }
.drawerItems {
text-align:center;
font-size: 110%;
margin-bottom: -4px;
}
.drawerItemsIcon{
text-align:center;
font-size: 150%;
margin-top: 4px;
margin-bottom: 2px;
}
.aOpened{
padding-left:0px !important;
padding-right:0px !important;
padding-top:8px !important;
padding-bottom:0px !important;
}
/* Events */ /* Events */
.events-panel { .events-panel {
@ -247,6 +267,17 @@ html, body {
color: #fff; color: #fff;
} }
.mapvotes{
border-top-width: 1px !important;
border-width: 1px 1px !important;
border-bottom-right-radius: 0px !important;
border-bottom-left-radius: 0px !important;
}
.unset1stborder{
border-top: unset;
}
.gather-voting { .gather-voting {
color: #fff !important; color: #fff !important;
} }
@ -298,3 +329,10 @@ html, body {
.borderless td, .borderless th { .borderless td, .borderless th {
border: none !important; border: none !important;
} }
/* minimized drawer gather icons */
.gatherTypeIcons{
width: 35px;
}

View file

@ -41,6 +41,8 @@ function Gather (options) {
this.type = options.type || "classic"; this.type = options.type || "classic";
this.icon = options.icon || "gather icon";
this.name = options.name || "Classic Gather"; this.name = options.name || "Classic Gather";
this.description = options.description || "No player requirements"; this.description = options.description || "No player requirements";
@ -358,6 +360,7 @@ Gather.prototype.electionStartTime = function () {
Gather.prototype.toJson = function () { Gather.prototype.toJson = function () {
return { return {
name: this.name, name: this.name,
icon: this.icon,
description: this.description, description: this.description,
type: this.type, type: this.type,
gatherers: this.gatherers, gatherers: this.gatherers,

View file

@ -19,6 +19,7 @@ const GatherPool = new Map();
const GATHER_CONFIGS = [ const GATHER_CONFIGS = [
{ {
type: "classic", type: "classic",
icon: '/normalGather.png',
name: "Classic Gather", name: "Classic Gather",
description: "No Requirements", description: "No Requirements",
serverMembershipTest: function (server) { serverMembershipTest: function (server) {
@ -27,6 +28,7 @@ const GATHER_CONFIGS = [
}, },
{ {
type: "progmod", type: "progmod",
icon: '/progmodGather.png',
name: "Progressive Mod Gather", name: "Progressive Mod Gather",
description: "No Requirements", description: "No Requirements",
serverMembershipTest: function (server) { serverMembershipTest: function (server) {
@ -35,6 +37,7 @@ const GATHER_CONFIGS = [
}, },
{ {
type: "invitational", type: "invitational",
icon: '/inviteGather.png',
name: "Invitational Gather", name: "Invitational Gather",
description: "Join on ensl.org/teams/949", description: "Join on ensl.org/teams/949",
// Grant invite if on list // Grant invite if on list
@ -56,6 +59,7 @@ const GATHER_CONFIGS = [
GATHER_CONFIGS.forEach(config => { GATHER_CONFIGS.forEach(config => {
const gatherManager = { const gatherManager = {
type: config.type, type: config.type,
icon: config.icon,
name: config.name, name: config.name,
registerCallback: function (type, method) { registerCallback: function (type, method) {
if (this.gatherCallbacks[type]) { if (this.gatherCallbacks[type]) {

BIN
public/inviteGather.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
public/normalGather.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
public/progmodGather.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

View file

@ -282,6 +282,7 @@ describe("Gather Model:", function () {
it ("returns a json representation of the gather instance", function () { it ("returns a json representation of the gather instance", function () {
var output = gather.toJson(); var output = gather.toJson();
assert.isString(output.name); assert.isString(output.name);
assert.isString(output.icon);
assert.isString(output.description); assert.isString(output.description);
assert.isArray(output.gatherers); assert.isArray(output.gatherers);
assert.isString(output.state); assert.isString(output.state);