Coder Social home page Coder Social logo

flarum-categories's Introduction

Flarum Categories

License Latest Stable Version

A Flarum extension. Ever wanted a traditional categories page for Flarum? Well, now you have it!

On Desktop

On Mobile

Take a look at a site running it at: https://forum.youthneuro.org

Installation

Use Bazaar or install manually with composer:

composer require askvortsov/flarum-categories

Updating

composer update askvortsov/flarum-categories

Feedback and Suggestions

I am very open to feedback and feature suggestions! Please comment on discuss or open a github issue, and I'll consider all feedback.

Links

flarum-categories's People

Contributors

askvortsov1 avatar davwheat avatar dependabot[bot] avatar flarum-bot avatar jslirola avatar yippy avatar

Stargazers

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

Watchers

 avatar  avatar

flarum-categories's Issues

Text color

Hello,
Really great extension!
But when admin set a light-bright color for Tag/Category - small grey text on such a Category block becomes almost invisible!
Please, make small text also white.
PS Will be nice if Flarum will have an automatic function to inverse text color if category color is too light-bright.

Link to fontawesome is broken

The current link https://fontawesome.com/icons?m=free is borked and redirects by default to the main search page.
It should probable be replaced by https://fontawesome.com/search?o=r&m=free instead.

Silently complete fontawesome icon name

Why ask the user to always append fas fa- to the start of an icon name ? Requiring them to do so addsunnecessary typing and frustration if they somehow mess up the prefix.
The user should not have to worry about it and only append the icon's name, while fas fa- is automatically and silently added to it.

Icon color of sub-category is the same as background circle's color, rendering the icon invisible

image

As reported here, this did not happen before v1.7.0. It seems to be happening because of this CSS:

style.color = this.tag.color();

As you can see, the color property matches the background circle's color property:

<i className="fa fa-circle fa-stack-2x icon-background" style={{ color: this.tag.color() }}></i>

this.tag.color() should be the opposite of the background color.

Question about translation descriptions

The 3rd option Don't display discussions for top-level tags on the categories page of the setting actually hides the description of tags. So.... has nothing to do with discussion ?

Link Categories

It might be a great feature to allow adding categories that do not originate from tags.
Custom categories within this addon is what i am referring to, with a way to link to a direct link (a direct post or external link) Might be useful for an external blog, or a external rules / tos page.

Accessing profile from discussion list breaks SPA

When clicking on a user avatar picture from a discussion list, the SPA will fully break and not display either the profile header (hero), nor any content. The profile menu will appear though. This does not happen when accessing a users profile from a discussion, or via direct link.

Flarum beta16, Categories v2.1.0

It throws following stacktrace:

TypeError: r.groups().find is not a function
    y index.js:20
    exports index.js:62
    e extend.js:27
    a render.js:30
    l render.js:155
    l render.js:160
    l render.js:66
    u render.js:50
    l render.js:134
    l render.js:63
    l render.js:162
    l render.js:66
    u render.js:50
    h render.js:374
    f render.js:444
    f render.js:415
    f render.js:488
    f render.js:419
    h render.js:302
    exports render.js:964
    a mount-redraw.js:14
    c mount-redraw.js:25
    c mount-redraw.js:23
    v router.js:111
    promise callback*t router.js:126
    S router.js:95
    f setImmediate.js:40
    f setImmediate.js:69
    a setImmediate.js:109
    core setImmediate.js:114
    core setImmediate.js:186
    core forum-f37283d9.js:25

Problems with markdown editor @ new version.

Looks like

"askvortsov/flarum-categories": "^2.1",

breaks

"flarum/markdown": "^0.1.0",

im dancing around with this all day:

error in chrome console:
image

way to reproduce

  1. install clean project: composer create-project flarum/flarum . --stability=beta
  2. composer require askvortsov/flarum-categories --ignore-platform-reqs -W

then get to editor and try to write down smth and try adding some bold or other stuff and its broken

using php 7.3 and mariadb in docker.

[deleted] users will cause Categories to fail to load

###【Reproduce】

  1. A user named Test creates a discussion under a label
  2. The administrator deletes this user, and the user is now displayed as "[deleted]"
  3. Click Categories. At this time, the label display is incomplete, and the console reports an error as shown in the figure.

【Screenshot】

png

Most icons from fontawesome are not displayed

I've tried adding several icons from fontawesome in my categories but i've found a pattern with most of them not working.

If the name is simple such as book or question it works as intended, no question asked.
However if it is an "unusual" icon such as a company logo like facebook or bong it only partially works and fetches something... that looks like an unrecognized character:
image
But if it's an icon with a composed name like person-digging it will act as if it worked, but will show a blank space instead:
image
Now, i did find some composed icon names that would work, like chess-queen for example.

To me this seems like fontawesome is based on special characters and the way it is implemented is currently broken as some will work (they are essentially supported emojis) and some others won't.

Maybe this has to do with my old computer which i know have some problems with emojis, not recognizing the most recent for example.
It runs on 32bit Windows 8, which should give you a hint at its age.

Performance is poor

Hi Sasha,

Great job on this extension. I was test driving this on the Bokt staging (running in sync with their current phpBB forum) flarum installation. I wasn't completely aware about the reason for poor performance on that site, assuming this related to some DNS resolution issues I had. However I patched fof/clockwork for use and excluded DNS as an issue by triangulating my requests.

Anyway, the issue is this:

        if ($event->isSerializer(TagSerializer::class)) {
            $event->attributes['discussionCount'] = $event->model->discussions()->whereVisibleTo($event->actor)->count();
            $event->attributes['postCount'] = $event->model->discussions()->whereVisibleTo($event->actor)->sum('comment_count');
        }

Bokt has many tags and this code will load all discussions twice, do a count and sum separately. Maybe this is a solution:

        if ($event->isSerializer(TagSerializer::class)) {
            $result = $event->model->discussions()
                ->select(['sum(comment_count) as postCount', 'count(id) as discussionCount'])
                ->whereVisibleTo($event->actor)
                ->get();
            
            $event->attributes['discussionCount'] = $result['discussionCount'];
            $event->attributes['postCount'] = $result['postCount'];
        }

Untested 🙈

This would half the number of sql queries. It's still not great with many tags, I think Flarum reads them all on page load 🙈

PS this is the performance capture from clockwork:

image

Api /tags postCount parameter type is not clear

open siteurl/api/tags

data > tag > attributes > postCount

If postCount is 0, then it is an int, otherwise it is a String number. When I developed a client using a strongly typed language, I encountered a type conversion problem. I can use type inference to temporarily solve the problem, but I hope its type can be fixed .

Discussion+Post Counter Fix

Hi, when I delete a post from a tag it doesn't reflect the correct post+discussion count on the category section, how can i get this sorted?

Tags sidebar glitches after accessing category view

When opening the category view and either selecting a category, or just going back whenever you select a main tag you will see a weird mix of different tags and subtags all appearing in the sidebar. Tested on multiple browsers, with full size desktop mode on and off.

Install warning

Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.

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.