Skip to content

Commit

Permalink
Even master with 0.19.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalp committed Aug 19, 2018
1 parent de9c1e1 commit f43696c
Show file tree
Hide file tree
Showing 394 changed files with 16,424 additions and 9,636 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This dockerfile is only meant for local development of Misago
# If you are looking for a proper docker setup for running Misago in production,
# please use misago-docker instead
FROM python:3
FROM python:3.5

ENV PYTHONUNBUFFERED 1
ENV PATH "$PATH:/srv/misago"
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ include LICENSE.rst
include MANIFEST.in
include README.rst
include requirements.txt
graft docs
prune docs/build
prune devproject
prune docs
prune extras
prune testproject
graft misago
Expand Down
22 changes: 6 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ Misago
:target: https://coveralls.io/github/rafalp/Misago?branch=master
:alt: Test Coverage

.. image:: https://badges.gitter.im/Misago/Misago.svg
:target: https://gitter.im/Misago/Misago?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
:alt: Development Chat

.. image:: https://img.shields.io/badge/python-2.7%2C%203.4%2C%203.5%2C%203.6-blue.svg
:target: https://travis-ci.org/rafalp/Misago
:alt: Works on Python 2.7, 3.5, 3,6

.. image:: https://img.shields.io/badge/chat-on_discord-7289da.svg
:target: https://discord.gg/fwvrZgB
:alt: Community Chat


**Development Status:** Big changes happening on master branch, use `latest release <https://github.com/rafalp/Misago/releases>`_ for working code.
**Development Status:** 🍌 `Bananas <https://en.wikipedia.org/wiki/Perpetual_beta>`_ 🍌

Misago aims to be complete, featured and modern forum solution that has no fear to say 'NO' to common and outdated opinions about how forum software should be made and what it should do.

Expand Down Expand Up @@ -79,8 +79,6 @@ Even more features will follow in future releases:
* Ranking system for forum search results based on post links, likes, author and thread importance.
* Post reactions in place of likes.

...and more!

If you are looking into using Misago to run live forum, you are absolutely invited to, but please keep in mind that Misago is relatively immature software that may contain serious bugs or issues as well as quirks and lackings thay may take time to resolve, despite best efforts.


Expand Down Expand Up @@ -116,14 +114,6 @@ If you'll ever want to destroy Docker setup because you no longer need it, run t
Frontend
--------

.. image:: https://img.shields.io/badge/github-Misago--Frontend-blue.svg
:target: https://github.com/rafalp/Misago-Frontend
:alt: Tests Result

.. image:: https://travis-ci.org/rafalp/Misago-Frontend.svg?branch=master
:target: https://travis-ci.org/rafalp/Misago-Frontend
:alt: Tests Result

With exception of Admin Panel, Misago frontend relies heavily on React.js components backed by Django API. This application relies on custom Gulp.js-based toolkit for development. As of current, Misago's ``gulpfile.js`` defines following tasks:

* **build** does production build of Misago's assets, concating and minifying javascripts, css and images, as well as moving them to misago/static directory
Expand Down Expand Up @@ -170,7 +160,7 @@ English sentences used within ``misago.faker.phrases`` were extracted from `Nati
Copyright and license
=====================

**Misago** - Copyright © 2018 `Rafał Pitoń <http://github.com/ralfp>`_
**Misago** - Copyright © 2016 `Rafał Pitoń <http://github.com/ralfp>`_
This program comes with ABSOLUTELY NO WARRANTY.

This is free software and you are welcome to modify and redistribute it under the conditions described in the license.
Expand Down
88 changes: 75 additions & 13 deletions frontend/src/components/RegisterLegalFootnote.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,84 @@
/* jshint ignore:start */
import React from 'react';
import misago from 'misago';
import escapeHtml from 'misago/utils/escape-html';

const RegisterLegalFootnote = () => {
if (!misago.get('TERMS_OF_SERVICE_URL')) return null;
const AGREEMENT_URL = '<a href="%(url)s" target="_blank">%(agreement)s</a>'

const RegisterLegalFootnote = (props) => {
const {
errors,
privacyPolicy,
termsOfService,
onPrivacyPolicyChange,
onTermsOfServiceChange
} = props;

const termsOfServiceId = misago.get('TERMS_OF_SERVICE_ID');
const termsOfServiceUrl = misago.get('TERMS_OF_SERVICE_URL');

const privacyPolicyId = misago.get('PRIVACY_POLICY_ID');
const privacyPolicyUrl = misago.get('PRIVACY_POLICY_URL');

if (!termsOfServiceId && !privacyPolicyId) return null;

return (
<div>
<LegalAgreement
agreement={gettext("the terms of service")}
checked={termsOfService !== null}
errors={errors.termsOfService}
url={termsOfServiceUrl}
value={termsOfServiceId}
onChange={onTermsOfServiceChange}
/>
<LegalAgreement
agreement={gettext("the privacy policy")}
checked={privacyPolicy !== null}
errors={errors.privacyPolicy}
url={privacyPolicyUrl}
value={privacyPolicyId}
onChange={onPrivacyPolicyChange}
/>
</div>
);
}

const LegalAgreement = (props) => {
const { agreement, checked, errors, url, value, onChange } = props;

if (!url) return;

const agreementHtml = interpolate(
AGREEMENT_URL,
{ agreement: escapeHtml(agreement), url: escapeHtml(url) },
true
)
const label = interpolate(
gettext("I have read and accept %(agreement)s."),
{ agreement: agreementHtml },
true
);

return (
<p className="legal-footnote">
<span className="material-icon">
info_outline
</span>
<a
href={misago.get('TERMS_OF_SERVICE_URL')}
target="_blank"
>
{gettext("By registering you agree to site's terms and conditions.")}
</a>
</p>
<div className="checkbox legal-footnote">
<label>
<input
checked={checked}
type="checkbox"
value={value}
onChange={onChange}
/>
<span
dangerouslySetInnerHTML={{ __html: label}}
/>
</label>
{errors && errors.map((error, i) => (
<div className="help-block errors" key={i}>
{error}
</div>
))}
</div>
);
}

Expand Down
57 changes: 57 additions & 0 deletions frontend/src/components/accept-agreement.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/* jshint ignore:start */
import React from 'react';
import ajax from 'misago/services/ajax'

export default class AcceptAgreement extends React.Component {
constructor(props) {
super(props);

this.state = { submiting: false };
}

handleDecline = () => {
if (this.state.submiting) return;

const confirmation = confirm(gettext("Declining will result in immediate deactivation and deletion of your account. This action is not reversible."));
if (!confirmation) return;

this.setState({ submiting: true });

ajax.post(this.props.api, { accept: false }).then(() => {
location.reload(true)
})
}

handleAccept = () => {
if (this.state.submiting) return;

this.setState({ submiting: true });

ajax.post(this.props.api, { accept: true }).then(() => {
location.reload(true)
})
}

render() {
return (
<div>
<button
className="btn btn-default"
disabled={this.state.submiting}
type="buton"
onClick={this.handleDecline}
>
{gettext("Decline")}
</button>
<button
className="btn btn-primary"
disabled={this.state.submiting}
type="buton"
onClick={this.handleAccept}
>
{gettext("Accept and continue")}
</button>
</div>
);
}
}
2 changes: 1 addition & 1 deletion frontend/src/components/avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function(props) {
}

export function getSrc(user, size) {
if (!!user && user.id) {
if (user && user.id) {
// just avatar hash, size and user id
return resolveAvatarForSize(user.avatars, size).url;
} else {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/options/delete-account.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* jshint ignore:start */
import React from 'react';
import Button from 'misago/components/button'; // jshint ignore:line
import Button from 'misago/components/button';
import ajax from 'misago/services/ajax';
import title from 'misago/services/page-title';
import snackbar from 'misago/services/snackbar';
Expand Down
Loading

0 comments on commit f43696c

Please sign in to comment.