Code Monkey home page Code Monkey logo

bem-forum's Introduction

Russian version of readme is available here.

bem-forum

David David

BEM forum project is built according to BEM methodology and uses github issues as it's main data storage.

Forum could be used in two capacities:

  • as a separate application;
  • as a plugin to an application built on express with the use of BEMTREE and BEMHTML templates.

Installation

  • Clone a repository git clone [email protected]:bem/bem-forum.git
  • Go to downloaded project cd bem-forum
  • Install dependencies npm run build
  • Generate access token (choose scope – public_repo) and add it to config configs/common/node.json
  • Launch the project npm start

In the browser go to http://localhost:3000.

Configuration

The description of how to configure the project could be found within the following files:

  • configs/common/node.json - common configuration for any type of environment;
  • configs/development/node.json - development regime configuration;
  • configs/production/node.json - production regime configuration.

Common configuration

{
    "forum": {
        "auth": {
            "tokens": [
                /* To get data from github for unauthorized users
                 * use generated tokens that enlarge limits of calls to API
                 * from 60 per hour to 5000. In case of high activity on the forum
                 * you will need to add additional tokens.
                 */
                "7fdffdd7a38fd8a205fdf5fc910f35d3bfd05341" // This is a demonstration only token
            ]
        },
        /* To add labels you will need to add a token that has rights to git push
         * in to a repository the post will be added to
         */
        "owner_token": "98af04fdb993cee3fdc83e338f3dfd74dff5fdeb", // This is a demonstration only token
        /* An option to show or hide labels within the opening/editing form of the issue */
        "setLabels": true,
        /* A repository to store posts */
        "storage": {
            "user": "tavriaforever",
            "repo": "bem-forum-tests"
        },
        /* An option to upload forum's archive from a file system */
        "archive": "archive-example.json",
        /* Exact way to build bundle with templates and scripts notation */
        "template": {
            "level": "desktop",
            "bundle": "index"
        },
        // Enables a regime to fix bugs in server-side and client-side code
        // To see bugs within a broswer console you will need to add to the url
        // a parameter ?debug=true
        "forumDebug": true
    }
}

Environment configuration

configs/{environment}/node.json allow to specify parameters for Oauth-authorization via Github:

"forum": {
    "oauth": {
        "localhost": {
            "clientId": "your client id",
            "secret": "your secret key",
            "redirectUrl": "http://localhost:3000"
        }
    }
}

Here we foresee an option of several subdomains support for sites with, for instance, several locales:

"forum": {
    "oauth": {
        "localhost": {
            ...
        },
        "en.localhost": {
            ...
        },
        "ru.localhost": {
            ...
        }
    }
}

Important about labels

Standard behaviour so to say "battaries included" is the following: it is not allowed to set a label while opening or editing the post.

To add an option of labeling the posts you need:

  1. To open a common config config/common/node.json

  2. To register within your own profile on github a token with rights to push into a repository where issues are hosted and paste this token into owner_token field

  3. To enable labels within opening/editing posts forms set setLabels field as true

bem-forum's People

Contributors

belozer avatar belyanskii avatar mikeshukshin avatar mishanga avatar mursya avatar skad0 avatar tadatuta avatar tavriaforever avatar tormozz48 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bem-forum's Issues

Показывать заголовок темы в title

Искать по Форуму можно просто Яндексом. http://yandex.ru/yandsearch?text=%D0%BC%D0%BE%D0%B4%D0%B8%D1%84%D0%B8%D0%BA%D0%B0%D1%82%D0%BE%D1%80&lr=10493&safety=1&site=http%3A%2F%2Fru.bem.info%2Fforum&rnd=24321&csg=0%2C0%2C0%2C0%2C0%2C0%2C0

Но результаты поиска плохочитаемые, тк везде одинаковый title. Сделайте, пожалуйста, чтобы в title был заголовок темы.

Кстати, хотела зарепортить это нажатием на жучка, но он, кажется, не работает.

Two 'Add post' button

I have wrote a post but click wrong 'ADD' button and i've lost the post. So silly.

Maybe should hide top 'ADD' button while opening editor?

2015-11-03 12-41-55 banners and alerts

Когда hovered блока влияет на состояние hovered внутренного блока. События в js

Записал видео что бы было понятно.
https://yadi.sk/i/OWFoBa18cP3j4

Как сделать правильно, что бы было ожидаемое поведение? Не хочу через стили.

Написал такой код:

modules.define('more', ['i-bem__dom', 'control'], function(provide, BEMDOM, Control) {

provide(BEMDOM.decl({ block : this.name, modName : 'type', modVal: 'link', baseBlock : Control }, {
    onSetMod : {
        'js' : {
            'inited' : function() {
                this._button = this.findBlockInside('button');
            }
        },
        'hovered' : {
            'true' : function() {
                this.__base.apply(this, arguments);
                this._button.setMod('hovered');
            },
            '' : function() {
                this.__base.apply(this, arguments);
                this._button.delMod('hovered');
            }
        }
    }
}));

});

Share buttons

Есть предложение использовать https://github.com/voischev/bem-social

Могу что-то допилить, или сделать что-то совместно.
сейчас в планах, по этой либе — добавить иконки, потом буду думать как сделать счетчики

Нельзя с первого раза попасть по прямой ссылке в пост

При переходе по прямой ссылке на пост (например, http://ru.bem.info/forum/469/) перекидывает на http://ru.bem.info/forum/. Часто из твиттера переходишь и обламываешься, нужно второй раз переходить. Выяснил, что это происходит только если нет куки prevLang. И она постоянно пропадает.

Ошибка «не удалось переоткрыть пост»

https://ru.bem.info/forum/issues/252/ — пост какбы закрыт. Но я торжественно решил добавить свой коммент, на что получил алерт «не удалось переоткрыть пост». Однако комментарий добавился.

Я примерно понимаю, что произошло под капотом, но как-то всё это антиюзабилительно.

Provide possibility to watch forum

Provide possibility to watch forum: all conversations, some threads. I know about "watch" github button, but I want something just in the UI.

README.md npm run deps >> npm run build

В README указано
-Install dependencies npm run deps
Однако в package.json в секции "scripts": нет никакого deps
Возможно имеется ввиду npm run build ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.