Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions admin/dist/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Makeradmin - Stockholm Makerspace</title>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Makeradmin v1.0 - Odense Makerspace</title>

<link
rel="shortcut icon"
Expand Down
8 changes: 4 additions & 4 deletions admin/dist/member.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Medlemssidor v0.1 - Stockholm Makerspace</title>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Memberpage v0.1 - Odense Makerspace</title>

<link
rel="shortcut icon"
Expand Down
21 changes: 7 additions & 14 deletions admin/src/Components/CategoryPeriodsInput.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import DatePeriod from "../Models/DatePeriod";
import { utcToday } from "../utils";
import DatePeriodInput from "./DatePeriodInput";
import DatePeriod from "../Models/DatePeriod";

export default class CategoryPeriodsInput extends React.Component {
constructor(props) {
Expand Down Expand Up @@ -50,19 +50,12 @@ export default class CategoryPeriodsInput extends React.Component {
</div>
);
})}
<button
type="button"
style={{ marginTop: "2px" }}
className="uk-button uk-button-small uk-button-success"
onClick={() => {
const period = new DatePeriod();
period.start = utcToday();
period.end = utcToday();
this.props.categoryPeriods.add(period);
}}
>
Lägg till period
</button>
<button type="button" style={{marginTop: "2px"}} className="uk-button uk-button-small uk-button-success" onClick={() => {
const period = new DatePeriod();
period.start = utcToday();
period.end = utcToday();
this.props.categoryPeriods.add(period);
}}>Add to period</button>
</div>
);
}
Expand Down
18 changes: 6 additions & 12 deletions admin/src/Components/CollectionTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,12 @@ export default class CollectionTable extends React.Component {
</thead>
<tbody>{rows}</tbody>
</table>
{loading ? (
<div className="loadingOverlay">
<div className="loadingWrapper">
<span>
<i className="uk-icon-refresh uk-icon-spin" />{" "}
Hämtar data...
</span>
</div>
</div>
) : (
""
)}
{loading ?
<div className="loadingOverlay">
<div className="loadingWrapper">
<span><i className="uk-icon-refresh uk-icon-spin"/> Retrieving data...</span>
</div>
</div> : ''}
</div>
{pagination}
</div>
Expand Down
2 changes: 1 addition & 1 deletion admin/src/Components/Currency.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";

const Currency = (props) => {
const formatter = new Intl.NumberFormat("sv-SE", {
const formatter = new Intl.NumberFormat('da-DK', {
// style: 'currency',
// currency: 'SEK',
minimumFractionDigits: 2,
Expand Down
43 changes: 13 additions & 30 deletions admin/src/Components/FileInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,36 +105,19 @@ module.exports = class FileInput extends React.Component {
this.state.model.set(this.props.name, event.target.value);
}
*/
render() {
return (
<div>
<div id="upload-drop" className="uk-placeholder">
<p>
<i className="uk-icon-cloud-upload uk-icon-medium uk-text-muted uk-margin-small-right"></i>
{this.state.filename ? (
<span>
{this.state.filename} (
<a onClick={this.clearUpload.bind(this)}>
Ta bort
</a>
)
</span>
) : (
<span>
Ladda upp genom att dra och släppa en fil här
eller klicka på{" "}
<a className="uk-form-file">
ladda upp
<input
id="upload-select"
className="uk-hidden"
type="file"
/>
</a>
.
</span>
)}
</p>
render()
{
return (
<div>
<div id="upload-drop" className="uk-placeholder">
<p>
<i className="uk-icon-cloud-upload uk-icon-medium uk-text-muted uk-margin-small-right"></i>
{this.state.filename ?
<span>{this.state.filename} (<a onClick={this.clearUpload.bind(this)}>Delete</a>)</span>
:
<span>Upload by dragging and dropping a file here or click <a className="uk-form-file">upload<input id="upload-select" className="uk-hidden" type="file" /></a>.</span>
}
</p>

{this.state.progressbarVisible ? (
<div>
Expand Down
22 changes: 3 additions & 19 deletions admin/src/Components/GroupForm.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import TextInput from "./TextInput";
import { withRouter } from "react-router";
import TextInput from "./TextInput";
import Textarea from "./Textarea";

class GroupForm extends React.Component {
Expand Down Expand Up @@ -51,24 +51,8 @@ class GroupForm extends React.Component {

<div className="uk-form-row uk-margin-top">
<div className="uk-form-controls">
{group.id ? (
<a
className="uk-button uk-button-danger uk-float-left"
onClick={onDelete}
>
<i className="uk-icon-trash" /> Ta bort
grupp
</a>
) : (
""
)}
<button
className="uk-button uk-button-success uk-float-right"
disabled={saveDisabled}
>
<i className="uk-icon-save" />{" "}
{group.id ? "Spara" : "Skapa"}
</button>
{group.id ? <a className="uk-button uk-button-danger uk-float-left" onClick={onDelete}><i className="uk-icon-trash"/> Remove group</a> : ""}
<button className="uk-button uk-button-success uk-float-right" disabled={saveDisabled}><i className="uk-icon-save"/> {group.id ? 'Save' : 'Create'}</button>
</div>
</div>
</form>
Expand Down
71 changes: 19 additions & 52 deletions admin/src/Components/KeyHandoutForm.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import React from "react";
import { Prompt } from "react-router";
import TextInput from "./TextInput";
import { withRouter } from "react-router";
import Span, { filterCategory } from "../Models/Span";
import { renderToString } from "react-dom/server";
import { Prompt, withRouter } from "react-router";
import Collection from "../Models/Collection";
import { ADD_LABACCESS_DAYS } from "../Models/ProductAction";
import { dateTimeToStr, parseUtcDate, utcToday } from "../utils";
import Span, { filterCategory } from "../Models/Span";
import { get, post } from "../gateway";
import { notifySuccess } from "../message";
import { renderToString } from "react-dom/server";
import { dateTimeToStr, parseUtcDate, utcToday } from "../utils";
import TextInput from "./TextInput";

function last_span_enddate(spans, category) {
const last_span = filterCategory(spans, category).splice(-1)[0];
Expand All @@ -27,35 +26,14 @@ function DateView(props) {
let status, text;

if (!props.date) {
status = (
<div className="uk-panel-badge uk-badge uk-badge-warning">
Saknas
</div>
);
text = (
<p style={{ color: "gray", fontStyle: "italic" }}>
{props.placeholder}
</p>
);
status = <div className="uk-panel-badge uk-badge uk-badge-warning">Missing</div>;
text = <p style={{"color": "gray", "fontStyle": "italic"}}>{props.placeholder}</p>;
} else if (!is_valid) {
status = (
<div className="uk-panel-badge uk-badge uk-badge-danger">
Utgånget
</div>
);
text = (
<p>
Giltigt till:{" "}
<span style={{ color: "red", fontStyle: "italic" }}>
{props.date}
</span>
</p>
);
status = <div className="uk-panel-badge uk-badge uk-badge-danger">Expired</div>;
text = <p>Valid untill: <span style={{"color": "red", "fontStyle": "italic"}}>{props.date}</span></p>;
} else {
status = (
<div className="uk-panel-badge uk-badge uk-badge-success">OK</div>
);
text = <p>Giltigt till: {props.date}</p>;
status = <div className="uk-panel-badge uk-badge uk-badge-success">OK</div>;
text = <p>Valid untill: {props.date}</p>;
}

// Override if there are pending days to be synchronized
Expand All @@ -65,23 +43,12 @@ function DateView(props) {
);
}

return (
<div className="uk-panel uk-panel-box">
<p style={{ fontSize: "1.2em" }}>
<b>{props.title}</b>
</p>
{status}
{text}
{props.pending ? (
<p>
<span>
(<b>{props.pending}</b> dagar kommer läggas till vid en
nyckelsynkronisering)
</span>
</p>
) : null}
</div>
);
return <div className="uk-panel uk-panel-box">
<p style={{"fontSize": "1.2em"}}><b>{props.title}</b></p>
{status}
{text}
{ props.pending ? <p><span>(<b>{props.pending}</b> days will be added after key sync)</span></p> : null }
</div>;
}

class KeyHandoutForm extends React.Component {
Expand Down Expand Up @@ -223,7 +190,7 @@ class KeyHandoutForm extends React.Component {
if (this.state.accessy_in_org) {
notifySuccess("Medlem redan i Makerspace Accessy org");
} else {
notifySuccess("Accessy invite skickad");
notifySuccess("Accessy invite succeeded");
}
});
return false;
Expand Down Expand Up @@ -277,7 +244,7 @@ class KeyHandoutForm extends React.Component {
} else {
invite_part = (
<span className="uk-badge uk-badge-success">
Invite skickad
Invite succeeded
</span>
);
}
Expand Down
34 changes: 9 additions & 25 deletions admin/src/Components/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ export default class Login extends React.Component {
const username = this.username.value;
const password = this.password.value;

if (!username || !password) {
showError("Du måste fylla i email/medlemsnummer och lösenord");
if (!username || !password)
{
showError("You must enter a username and password");
return;
}

Expand All @@ -29,20 +30,13 @@ export default class Login extends React.Component {
onSubmit={this.login.bind(this)}
>
<div className="uk-form-row">
<h2>Logga in</h2>
<h2>Log in</h2>
</div>

<div className="uk-form-row">
<div className="uk-form-icon">
<i className="uk-icon-user" />
<input
ref={(c) => {
this.username = c;
}}
className="uk-form-large uk-form-width-large"
type="text"
placeholder="Email/Medlemsnummer"
/>
<i className="uk-icon-user"/>
<input ref={c => { this.username = c; }} className="uk-form-large uk-form-width-large" type="text" placeholder="Email / User ID" />
</div>
</div>

Expand All @@ -55,27 +49,17 @@ export default class Login extends React.Component {
}}
className="uk-form-large uk-form-width-large"
type="password"
placeholder="Lösenord"
placeholder="Password"
/>
</div>
</div>

<div className="uk-form-row">
<button
type="submit"
className="uk-width-1-1 uk-button uk-button-primary uk-button-large"
>
Logga in
</button>
<button type="submit" className="uk-width-1-1 uk-button uk-button-primary uk-button-large">Log in</button>
</div>

<div className="uk-form-row uk-text-small">
<Link
className="uk-float-right uk-link uk-link-muted"
to="/request-password-reset"
>
Glömt ditt lösenord?
</Link>
<Link className="uk-float-right uk-link uk-link-muted" to="/request-password-reset">Forgot your password?</Link>
</div>
</form>
</div>
Expand Down
Loading