Code Monkey home page Code Monkey logo

forem's People

Contributors

alexcwatt avatar browning avatar caffo avatar dapz avatar filiptepper avatar fracek avatar frankel avatar gabrielbaez avatar glebm avatar idearise avatar jgadbois avatar johanb avatar juozasg avatar kunalchaudhari avatar mauriciopasquier avatar nashby avatar nebiros avatar nruth avatar parndt avatar phiggins avatar phlipper avatar radar avatar raid5 avatar strd6 avatar tanraya avatar tigercat avatar tomg65 avatar ugisozols avatar victormartins avatar yan-hoose 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  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  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  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  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  avatar  avatar  avatar  avatar

forem's Issues

Partial naming collision

Hello,

Not a bug, just something to be aware of. I just ran into an error due to having a partial named _head.haml.html in my application.html.haml. It was then load app/views/forem/forums/_head.html.erb.

Maybe something like _forum_head.html.erb?

Thanks,

Albert

Getting ActiView Template Error

Hey,

I followed your instructions and installed forem, but when I try to view the forum I get the following error message.

ActionView::Template::Error (undefined local variable or method `blogs_path' for #<#Class:0x7f4f21002090:0x7f4f20ffda40>):

I created the initializer per the instruction and configured the application controller

App controller code http://pastie.org/private/nuf4t0cz11dscgirz4kpq

This is what I currently have on my gem file

source 'http://rubygems.org'

gem 'rails', '3.1.0'

# Bundle edge Rails instead:
# gem 'rails',     :git => 'git://github.com/rails/rails.git'

gem 'pg'

gem 'devise', '1.4.5'

gem "cancan"
gem 'json'

gem 'ckeditor', :git => 'git://github.com/galetahub/rails-ckeditor.git', :branch => 'rails3'

gem 'forem', :git => "git://github.com/radar/forem.git"
gem 'forem-theme-base', :git => "git://github.com/radar/forem-theme-base.git"

gem 'kaminari'

gem 'gravatar_image_tag'

gem 'activeadmin'
gem 'sass-rails', "  ~> 3.1.0"
gem "meta_search",    '>= 1.1.0.pre'
gem 'therubyracer'

gem 'paperclip'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  #gem 'sass-rails', "  ~> 3.1.0"
  gem 'coffee-rails', "~> 3.1.0"
  gem 'uglifier'
end

gem 'jquery-rails'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug'

Sug: Email notifications / Latest posts link / thread status icons + more!

A few quick suggestions as requested by Ryan.

Grouped 1 to 3 where 1 is what I'd consider essential

Group 1

Email notifications - email sent when a thread someone has posted in has received a reply (with options)

Latest posts link - to show the latest posts made on the forum, most of my regular users (who hang around the forum) use the forum this way.

Thread status icons - to show if a thread contains new posts/whether you have replied in the thread or not/whether it's a 'hot' thread etc

Who's viewing forum - when on the forum homepage, shows how many people are visiting each particular forum. It's surprising how lifeless forum systems feel without this.

Whos online - list of people active

Group 2

Who visited today - list of people who visited in last 24hrs

I'll add more as and when I think of em/get time

Bundle install fails - forem specified twice

Hi there,

I am still quite new to rails and especially bundler. I cloned the repository and added the entries you specified in the readme. When I try execute bundle install I get the following error:

You cannot specify the same gem twice coming from different sources. You specified that forem (>= 0) should come from git://github.com/radar/forem.git (at master) and source at /projectPath/

From other examples I have found people mention duplication within the gemspec file which I do not see. Any ideas?

Thanks.

Steve

Redirect to return_path after signing in

It would be nice, if, when not signed in user tries to create topic is redirected to the sign in page, that then he would be redirected back to create form of a topic. For now, as far as I see, after signing in it redirects to the root_url.

Basic integration won't work?

ActionView::Template::Error (undefined local variable or method `current_user' for #Forem::ForumsController:0xb6e48d18):
27: <% end %>
28:
29:
30:
31: <% if forem_admin? %>
32: <%= link_to "Admin Area", admin_root_path %>
33: <% end %>

Is what I get back. I did everything given in "Installation", except I modified the Gemfile a bit. It didn't work with the gems given; I specified the rails gem to use the 3-1-stable branch and the rack gem to use the rack-1.3 branch. Then it worked to do "bundle install", but well, the said error is what I get back when I open up localhost:3000/forums. Where to define this method, "current_user"?

It could be that it's just me being stupid, and I'm sorry if it is. If it isn't, I think this is fixable easily?
Cheers!
Simon

Textile / pluggable post formatting

We'd like to use textile rather than markdown for post formatting (for consistency with our cms).

Does anyone have suggestions for how this could be architected / an appropriate pattern for having plain text, or markdown, as default, but the possibility to change to something else?

Uninitialized constant Forum

Hello,

I just install the this library and I am able to create forum and categories. However, when I click on a forum, I got this error message:

NameError in Forem::ForumsController#show

uninitialized constant Forum

Rails.root: C:/projects/EcoSearch
Application Trace | Framework Trace | Full Trace

Request

Parameters:

{"id"=>"1"}

Could you please let me know what I am missing?

Thank you,

Forum Access Control Lists

Feature/suggestion, be able to setup groups and setup ACLs (Access Control Lists) per forum/category based on groups/roles

no Base theme included

On master there is no public directory with base theme styles. Should there be? I ask because, In Forem::ApplicationHelper there is a helper method that references a none existent theme

def forem_theme_tag
stylesheet_link_tag("forem/#{Forem.theme}/style.css")
end

Also when I visit the demo site at http://forem.heroku.com/

I see a stylesheet include of

"/assets/forem/base/style-f6c5227a7309b163c14209ff02ad8f57.css"

Where does this base theme come from? Or should we be rolling our own entirely?

Postgres error using Topic.visible.by_most_recent_post

PGError: ERROR:  column "forem_topics.id" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: SELECT  "forem_topics".* FROM "forem_topics" INNER JOIN "for...
            ^
: SELECT  "forem_topics".* FROM "forem_topics" INNER JOIN "forem_posts" ON "forem_posts"."topic_id" = "forem_topics"."id"     WHERE "forem_topics"."hidden" = 'f' GROUP BY topic_id ORDER BY forem_posts.created_at DESC, forem_topics.id LIMIT 5

::Forem::Topic.visible.select("DISTINCT topic_id, forem_topics.*").limit(5).includes(:posts) works for me in postgres.

Devise in dummy application

Rather than hack around the "problem" of having authentication within the dummy application, I've gone ahead and added Devise to it within the devise branch. So far this is working, it just needs a bit of cleanup. This issue is to remind us that this needs doing.

Use Gravatar for Avatars

If the User model has an email method, we should use it to display gravatars of those people on the posts.

undefined local variable or method `per'

When I acces "http://localhost/forem/forums/1", it throws the error message of " undefined local variable or method `per' ".

It occurs at app/controllers/forem/forums_controller.rb:11:in `show' :

@forum.topics.visible.by_pinned_or_most_recent_post.page(params[:page]).per(20)

I don't know what this per method is. Do I miss any gem?

Update dummy app javascripts

The dummy app calls a couple javascript files that aren't there. Either we need to manually add rails-jquery and rails-ujs javascripts, or update the dummy app to use the asset pipeline.

Routes for other controllers not accessable

In my layout I have some user-management stuff (login/logout/etc.) Oddly, that breaks with forem. It can not find the routes to my controller.

ActionView::Template::Error (No route matches {:action=>"change_persona", :method=>:post, :controller=>"user_sessions"}):
    13:     <%= current_user.email %> 
    14:     <% if current_persona %> 
    15:       as 
    16:       <%= form_tag :controller => '/user_sessions', :method => :post, :action => :change_persona do |f| %>
    17:         <%= collection_select(
    18:         :id, 
    19:         :persona, 
  app/views/layouts/application.html.erb:16:in `_app_views_layouts_application_html_erb___733005464_88044600'

Any thoughts here?

rake routes & getting hold of the helpers in tests

I've been having some problems with the developer-accessibility of engine routes and route helpers, and would appreciate comments.

If we can drop some stuff in the readme, or think of patches to forem or rails, I'd consider this a success.

  1. I want to be able to list the forem routes, so I know which route helpers are available to me. That is to say, I want to be able to do rake:routes:forem or something like that.
  2. I also want to be able to do visit forem.forums_path or similar in my capybara tests. Perhaps this can be done through Forem::Engine.route_helpers (I think I've got the wrong chain there) but it didn't seem to work when I did it.

I tried looking into the rails engines code and rake routes stuff, but got lost/frustrated quite quickly. I'd spend longer on it now but I am swamped with non-rails stuff at the moment, so thought I'd see if anyone had ideas.

Rake 0.9.3 under 1.9.3-p0 fails. Use rake exec instead.

You have already activated rake 0.9.3.beta.1, but your Gemfile requires rake 0.9.2.2. Using bundle exec may solve this.

Raverting to 1.9.2-p290 resolves:

rvm use 1.9.2-p290 --default
bundle install
rake forem:install:migrations

Creates migrations as expected.

WYSIWYG editing

Would it take a lot of work to include WYSIWYG posting in Forem? I'm thinking about using it with Refinery CMS, which has WYSIWYG tools and HTML formatted content - it would make a ton of sense to have it work the same with Forem too? Would it be a lot of work or just a matter of disabling markdown marshaling code so it works directly with HTML and adding some javascript or partials to include the editor controls?

Include i18n?

Just started working on Polish translations for forem, would you be interested in merging them into main master repository?

forums/index is not translated

The header for this page is written in english and doesn't use I18n.t to get a translation, additionally the last post stuff is English too.

Bugs in rails g forem:install

Hi,

I notice the following issues with the installer:

  1. For the question "What is your user class called? [User]", user might press Enter right away if the their model is User already. This generates a method missing error since the installer doesn't set the value of @user_class to User.
  2. The migration ids for add_category_id_to_forums and add_forem_admin are the same -> migration error.

Abstract out ActiveRecord

Currently forem relies on activerecord it should factor this out and use templates similar to padrino-admin(?) or a glue between different ORMs (I don't think this is possible). A bullet list of what needs to be converted for this to work would be appreciated.

Issue running tests

I cloned this repo a little bit ago, but I had some trouble running the tests. Steps to reproduce:

  1. New gemset
  2. git clone
  3. bundle
  4. rake -> failures because no db tables exist
  5. rake db:create -> Don't know how to build task 'app:db:create'
  6. rake -T -> db:setup and db:create both exist
  7. rake db:create -> failure
  8. rake db:setup -> failure
  9. head scratching
  10. grep -r database .
  11. spec/dummy/config/database.yml -> aha!
  12. cd spec/dummy; rake db:create db:migrate; cd ../..; rake -> only a few failures!
  13. cd spec/dummy; rake forem:install:migrations db:migrate; cd ../..; rake -> no failures!
  14. post github issue so others can work though this more easily
  15. await suggestions as to what I can do to help

Translations of ActiveRecord models and attributes

Models names and attributesm such as Topic and Post, are not translated - for example in a new topic form, i have "Subject" and "Text" instead of translated into in my case Polish.

But even when I add such as translation to my config/locale/pl.yml:

pl:
  activerecord:
    attributes:
      topic:
        subject: Temat
        text: Tekst

I still have Subject and Text as labels in new topic form. Why?

permissions: undefined method `can_read_forem_forums?'

Running webrick for development I keep getting this nasty error:

Showing /home/kulpae/.rvm/gems/ruby-1.9.2-p180/bundler/gems/forem-76d997679209/app/views/forem/categories/_category.html.erb where line #1 raised:

undefined method `can_read_forem_forums?' for #<User:0x000000050f3020>

I've an initializer config/initializers/forem.rb with

Forem.user_class = User

Observations:

  • After the server is started, the first request works, the following requests don't.
  • Overriding the can_* methods in the User model fixes the error, but I don't think it's how it supposed to be...

Won't work with Refinery CMS, also other set-up errors

"Refinery CMS Integration
Requires Refinery CMS rails-3-1 branch"

There is no such branch there. Probably, it has been removed. And now, I can't get it wo work with Refinery. Using the latest thing of everything brings up loads of dependency errors (marginal note: I had to use the rack-1.3 branch of the git rack to get bundler to finish at all).
It's also possible that the reason is that my single steps were wrong or in wrong order. But yet, the "Refinery CMS Integration" entry doesn't tell much what to do.
I am now trying to set it up like the installation entry tells me to and posting everything that happens...

To get a refinery cms app:

refinerycms blah
(does loads of stuff, works.)
Now to add forem, I put this in the Gemfile, as given:

gem 'rails', :git => "git://github.com/rails/rails.git"
gem 'arel', :git => "git://github.com/rails/arel.git"
gem 'rack', :git => "git://github.com/rack/rack.git", :branch => "rack-1.3"
gem 'sprockets', :git => "git://github.com/sstephenson/sprockets"
gem 'forem', :git => "git://github.com/radar/forem.git"

And change
gem 'refinerycms', '~> 1.0.3'
to
gem 'refinerycms', :git => "git://github.com/resolve/refinerycms.git"

and do:

cd blah
bundle install

It tells me:
Could not find gem 'rack (~> 1.3.2)', required by 'rails', in any of the sources

So I change the rack Gemfile entry, adding the :branch option:
gem 'rack', :git => "git://github.com/rack/rack.git", :branch => "rack-1.3"

and run

bundle install
again.

Output is:
Could not find gem 'refinerycms-generators (~> 1.1), required by 'refinerycms', in any of the sources

=> do this:
gem 'refinerycms-generators', :git => "git://github.com/resolve/refinerycms-generators.git"

And get this:
Bundler could not find compatible versions for gem "refinerycms-generators":
In Gemfile:
refinerycms depends on
refinerycms-generators (~> 1.0.1)

refinerycms-generators (1.1.0)

So apparently, refinerycms will screw up its dependencies when it comes to using edge versions of rails etc.

And yes, I post this as a forem issue, because it apparently doesn't work what's given there in the instructions. ;)

Please fix! Great work though, I haven't seen any other forum that even tries to easily integrate with RefineryCMS, still, you outclass the other rails 3 forums in this case, guys.

Cheers!
Simon

Can not create new topic

When i want to create a new topic (e.g. http://localhost:3000/forem/forums/1/topics/new ), with user logged in, it redirects to the home page. The console displays this message:

  Started GET "/forem/forums/1/topics/new" for 127.0.0.1 at 2011-09-11 17:34:00 +0800
  Creating scope :page. Overwriting existing method Forem::Topic.page.
  Processing by Forem::TopicsController#new as HTML
  Parameters: {"forum_id"=>"1"}
  Refinery::Page Load (0.3ms)  SELECT .......

I googled and found it is caused by kaminari, see this issue: https://github.com/amatsuda/kaminari/issues/57 While i use the kaminari's master branch in my rails project, the error still exists. I wonder if this belongs to kaminari's bug.

My gem file is the same as this one: #38 (comment)

Thanks.

Install generator needs better tests

We just ran into an issue where the fix for #88 caused the install generator to break for new applications. It was requiring the user_class configuration option to set and was giving a non-trivial error message to users.

I think that we should have a test for the install generator which is more of an "integration" test than the current "unit" test that lives in spec/generators. This integration test should use the wonderful Aruba to create a brand new Rails application and walk through the install steps for Forem, running checks on the output of the content of the installer.

Without this, there's a chance that any change to Forem could again break the install generator, and when that happens anybody who's trying out Forem for the first time will see this and think bad things about Forem. The install generator (and the installation process) should amaze people at what it did for them and how easy it was.

Let's not break this again, ever.

Massive thanks to Aston J for pointing this out.

Email Subscriptions Proposed Feature List

Current feature plans (italics is @radar reply to my initial email)

Subscription Management

  • Subscribe/Unsubscribe link on topic view if logged in

    I think this is fine. It should indicate clearly if a person is subscribed or not.

  • Either a check box or automatic subscription when adding a post to a topic

    Determining if a user should be automatically subscribed could be done with a forem_auto_subscribe field on the "users" table that defaults to true. This could then be toggled on a profile page somewhere for the user, perhaps? We don't have somewhere like that in Forem at the moment.

  • Initially, an unsubscribe link in the email footer (vs a management page for subscriptions?)

    That would be fine, I think.

Subscription Emails

  • Emails get sent out every reply to everyone but the person who added the new reply

    That's correct. My concern with this is that it won't work at scale, but that's something to just think about for the future. There should of course be only one email per person.

  • Text of post is in email?

Not sure how you'd go about preserving the formatting here. I think just a notification of "Blah has posted in your topic called 'blah'" is fine, for now. If you want to go ahead and put the post text in the email then be my guest. I'd actually prefer it that way.

not using flash.now

Hey,
I recently started "working" on my own version of forem, because I had to modify the views, and also the controllers. Well, what catched my eye was that, when e.g. a forum creation failed in the admin area, the flash showed up again on the next page I opened. I heard about this issue before, it's fixable really damn easy. Just replace

flash[:blah] = "..."
with
flash.now[:blah] = "..."

in every case where this occurs. I think it has something to do with flash itself waiting for a redirection, but "receiving" none, and therefore showing up again on the next page, where it thinks a redirection has happened.

(vendor/forem/app/controllers/forem/admin/forums_controller.rb is my example controller here, it has this issue.)

Thanks for your awesome but simple engine!
Simon

undefined local variable or method `forem_user'

After running rails g forem:install and starting my app, I goto /forums and I'm getting the following error message

undefined local variable or method `forem_user' for #<Forem::ForumsController:0x5a28248> Extracted source (around line #7):

4: 
5:<br>
6:<footer id='admin_link'>
7:<% if forem_admin? %>
8:<%= link_to t("area", :scope => "forem.admin"), admin_root_path %>
9:<% end %>
10:</footer> ```

Forum Categories

It would be nice if the forum had category support like phpbb3 does.

Private messaging?

Just thought that it would be really useful if Forem had private messaging.

Installer should insert a forum

The installer, once complete, should create a test forum with a topic created by a dummy user. Otherwise the forum looks empty.

Incorrect gem dependency listed in installation instructions

Hello,
Had a bit of a problem installing forem. In the instructions it says use:

gem 'forem', :git => "git://github.com/radar/forem.git"

But doing this for me, pulled version 0.0.1, mostly likely because that's the last Git tag you guys have? maybe. Anyways, the only way I could get the latest master was manually download it. Then I added it to a vendor/gems directory, then referenced it like:

gem 'forem', :path => "#{File.expand_path(FILE)}/../vendor/gems/forem-0.1"

Is version 0.1 the latest? Is there a newer/better way of doing this?

Feature: edit posts

Currently users (and admins) can't edit posts within a topic. This is pretty standard forum behaviour.
It should be quite simple to do this the easy way: allowing users and admins to perform ordinary model updates.

I imagine there are concerns about post versioning, e.g. letting people see how the post looked before it was edited?

Authorization system

Last week, I spoke with somebody was interested to know if Forem had any kind of authorization system. I told him it didn't, because I didn't know how to build one for it as applications can have their own authorization system.

So I spent some time thinking about this on the plane ride back from Chicago. Here are my thoughts in no particular order. It would be great if I could get some feedback on this issue:

Permission system for forem

In many other forum systems out there, there are permission systems built into them. Forem is unique in that it's an engine and supposed to be pluggable into other applications, rather than being something standalone such as (my understanding) how phpBB and vBulletin work.

Of course, Forem can be "standalone" by just mounting it inside an empty Rails application. I don't think there will ever be a case where we have a true standalone version.

Anyway...

This complicates things. By creating our own permission system we would limit those people who may have their own permissions systems within their applications. This is definitely not ideal. Forem is already able to adapt to different authentication systems, so why not authorization also?

I propose that we build a flexible authorization system into Forem so that people can set up permissions on their forem installs in the easiest way possible using their own authorization if that's what they have, or suggesting to use CanCan instead.

How it works

I think that we should have methods on the User class which define the permissions that people have. For example, there would be a can_read_forum? method which would take one argument and do something like this:

def can_read_forum?(forum)
  permissions.where(:object => forum, :permission_type => "read")
end

The code inside the can_read_forum? method will be application-specific, but the API for the permissions is something that we should provide.

There could even be a possibility that we provide a Forem::Permissions::Default module which, when included into a User-like class, would then provide defaults for these permission methods, which then can be overridden in the model as the application designers wish. I think it would be best to have a blacklist-by-default, but I am open to ideas on this one on why it's a bad idea if anybody thinks so.

Alternative API

Alternatively we get them to include a module called Forem::Permissions which then provides the following API:

can_read_forum do
permissions.where(:object => forum, :permission_type => "read")
end

This then will store the given block which will be executed (using instance_eval) on the current_user object.

Caveats

With this kind of permission system I cannot think of a clean way that you could allow anonymous access to forums (for example). How could we fix that?

Thanks lads!

Does it work with MongoDB ?

I'm thinking about using forem in application which is based on MongoDB. Will it work without additional changes?

Followed instructions - Forem files not created

I am very new to Rails and coding in general, so this may be a stupid question. I followed the instructions to for the installation. I created the user, current_user, admin, all that good stuff.

The files were never created in my app directory. For example, my app/views only has layouts, sessions, and users -- no forem files.

What am I doing wrong? How do I fix this? Do I have to create all those pages and files manually?

Thanks for your help

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.