Quantcast
Channel: Discourse Meta - Latest topics
Viewing all 60739 articles
Browse latest View live

Discourse plugin for static site generators like Jekyll or Octopress

$
0
0

Sjors wrote:

It would be nice to have a plugin for static site generators like Jekyll or Octopress, since the performance and security benefits of those platforms are significant if you would take the time to learn it.

What do you guys think?

Posts: 101

Participants: 13

Read full topic


Allow authentication via multiple services on one account

$
0
0

davidcelis wrote:

If you have all six authentication services enabled as well as username/password and you're a fairly forgetful person (like me), it's possible you'll repeatedly forget what service you used to authenticate with a Discourse installation. It would be nice if, after my initial signup, I could go into my preferences and create more *userinfo associations with my account so that I can choose any old service to login to my existing account.

Posts: 35

Participants: 7

Read full topic

When is trust level 3 and 4 going to be added?

How to add new features to admin panel?

$
0
0

Abhishek Gupta wrote:

To add new fields for the settings in admin, i tried looking into app/views but not found much. where the information is stored from there? basically i want to make URL shortner plugin (as per google url shortner api ) , but it requires API key etc.. , so i want to create a field in settings, so that user can enter the api key and all and enable/disable the plug-in at will.

Posts: 1

Participants: 1

Read full topic

Notification on Stale Posts

$
0
0

Jp Gordon wrote:

Continuing the discussion from Email notifications:

We have the need to be notified when a post is older than X hours. Any plans for this?

Posts: 3

Participants: 2

Read full topic

Create topic in the future

$
0
0

Stuart Langridge wrote:

I'd like to be able to, via the API, create a Discourse topic but not have it show up until a defined time in the future. This is really handy for things like announcement posts, so I can create a new topic to announce a thing at some point before the release of the thing, and have the forum discussion become available automatically at release time without me having to do anything. Has this sort of feature been discussed? (I did take a glance at the code, but I'm not really a Ruby guy, and I fear walking through the code and changing every single request for a topic to include "and publish_time <= now"...)

Posts: 7

Participants: 6

Read full topic

RSS feed unique identifier

$
0
0

To The Tick Llc wrote:

We want the title of the thread in our DC RSS feed to display the number of posts to that thread, so that the title becomes a unique identifier for a particular post or worst case just that thread

For example

<title>Does the US Need a Third Political Party?</title>

Becomes

<title>Does the US Need a Third Political Party? 1</title>

Posts: 2

Participants: 1

Read full topic

Category badge differs from onebox to title

$
0
0

Kane York wrote:

On the top, we have a yellow background and black text. In the onebox, we have a yellow background and white text.

I think the oneboxing logic isn't respecting the text color setting for the category.

Posts: 1

Participants: 1

Read full topic


Show "you were logged out!" Instead of half-transitioning account

$
0
0

Erlend Sogge Heggen wrote:

I was just testing the invite-friend functionality, so I sent out an invitation, accepted it and logged in as a new user in a new window. Coming back to my original window, I saw this:

Which was very confusing, because apparently what has happened here is that Discourse has logged me out and back in again as a new user, but not only has it not told me that this just happened, but my avatar hasn't changed (and I had to hover over those buttons to make the icon show properly instead of just a square box as well).

I think it would be better to do something like a "It seems you were logged out. Please refresh this page" prompt or something of the sort.

Posts: 2

Participants: 2

Read full topic

How to add advertisements to your Discourse forum?

$
0
0

Régis Hanol wrote:

I recently added a way to add arbitraty HTML at the top/bottom of every page in the forum.

Go to the content tab of the admin section of your forum. You should see two new site contents: Top of the pages and Bottom of the pages.

Here you can add all the HTML code you want, but for the sake of the demo, let's add some cats.

Select the Top of the pages tab and add the following code:

<div style="text-align: center; margin-bottom: 20px">
  <img src='/uploads/meta_discourse/2213/f62d5de34cc8199e'>
</div>

Hit the button and reload your homepage. You should see something like:

This is pretty basic for now but it'll hopefully help you to easily add any kind of advertising you want.

What you think of it?

Posts: 3

Participants: 2

Read full topic

Invitation expiry workflow is wonky

$
0
0

Sam Saffron wrote:

Out of the box invitations are good for 14 days, when this period expires the user clicking on the invite must be informed that the invitation expired.

If a user is ever invited again to the topic the day counter must be reset.

(this is all particularly problematic for sites such as parley where access is restricted)

Posts: 15

Participants: 4

Read full topic

Error while importing posts

$
0
0

Michael wrote:

We're working on some import code, after successfully importing many posts the code crashes with this

#<Discourse::InvalidAccess: can_create? failed>
/var/www/discourse/lib/guardian/ensure_magic.rb:9:in `method_missing'
/var/www/discourse/lib/post_creator.rb:193:in `setup_topic'
/var/www/discourse/lib/post_creator.rb:57:in `block in create'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:202:in `block in transaction'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:210:in `within_new_transaction'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:202:in `transaction'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/transactions.rb:209:in `transaction'
/var/www/discourse/lib/post_creator.rb:56:in `create'

Even after studying the post_creator and ensure_magic classes, I haven't got a clue what is going on here.
Before crashing, thousands of posts import successfully.

The only thing that looks remotely suspicious is some UTF-8 in the post.

What could be causing this?

Posts: 1

Participants: 1

Read full topic

Please visit our Discourse Forum! (Directory)

$
0
0

F. Randall Farmer wrote:

I know I'd like to visit various new Discourse servers once in awhile as they come up. As you'd like a visitor or two, please post your URL here and a description of the purpose of your site and any other notes...

So far, the public Discourse servers I know about are:

Posts: 102

Participants: 74

Read full topic

Qunit error and possibly related ember.js problem

$
0
0

Hunter wrote:

I am encountering two problems, which may or may not be related, and would like to know if anyone else is having similar issues.
When I run autospec I get:

Running Qunit: spec
QUnit loaded in 277093 ms
[object Object]
/vagrant/lib/autospec/run-qunit.js:27
TypeError: 'undefined' is not an object (evaluating 'system.stdout.write')

  /vagrant/lib/autospec/run-qunit.js:27
  :/modules/webpage.js:143
TypeError: 'undefined' is not an object (evaluating 'context.source
                            .replace(/[^\S\n]+at[^\S\n]+/g, "")
                            .split("\n")[1]
                            .replace')

  phantomjs://webpage.evaluate():27
  http://localhost:60099/assets/qunit.js?body=1:1600 in runLoggingCallbacks
  http://localhost:60099/assets/qunit.js?body=1:993
  http://localhost:60099/assets/qunit.js?body=1:1239

TIME OUT :(

Additionally, my IDE (AptanaStudio3) is telling me that there is a syntax error in tmp/ember-rails/ember.js, which I have not modified. Specifically, it says syntax error: unexpected token "debugger" with regards to line 26884

Ember.Handlebars.registerHelper('debugger', function(options) {
  debugger;
});

})();

Additionally, I have tried deleting the trailing })(); but it reappears during the rspec portion of autospec's run. When I delete it after it reappears, but before Qunit runs it the Qunit failure persists. I noticed this problem on a production branch, but it persists after switching to master which, is running the latest version of Discourse with no changes of my own.

Posts: 4

Participants: 2

Read full topic

Rake Aborted Issue After Setup - Using Discourse Docker

$
0
0

DAB Lucide wrote:

I'm running the Discourse Docker setup and it will not let me use the rake command. I first found this out when I tried to install the Adsense Plugin I ran the rake command with and without the bundle exec and it always aborts the task.

Without bundle exec

root@cid:/var/www/discourse# rake plugin:install repo=http://github.com/discoursehosting/discourse-adsense --trace
rake aborted!
You have already activated rake 0.9.6, but your Gemfile requires rake 10.1.1. Using bundle exec may solve this.
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:33:in `block in setup'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:19:in `setup'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/setup.rb:7:in `<top (required)>'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `require'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:in `require'
/var/www/discourse/config/boot.rb:6:in `<top (required)>'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/var/www/discourse/config/application.rb:1:in `<top (required)>'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/var/www/discourse/Rakefile:5:in `<top (required)>'
/usr/local/lib/ruby/2.0.0/rake/rake_module.rb:25:in `load'
/usr/local/lib/ruby/2.0.0/rake/rake_module.rb:25:in `load_rakefile'
/usr/local/lib/ruby/2.0.0/rake/application.rb:604:in `raw_load_rakefile'
/usr/local/lib/ruby/2.0.0/rake/application.rb:89:in `block in load_rakefile'
/usr/local/lib/ruby/2.0.0/rake/application.rb:160:in `standard_exception_handling'
/usr/local/lib/ruby/2.0.0/rake/application.rb:88:in `load_rakefile'
/usr/local/lib/ruby/2.0.0/rake/application.rb:72:in `block in run'
/usr/local/lib/ruby/2.0.0/rake/application.rb:160:in `standard_exception_handling'
/usr/local/lib/ruby/2.0.0/rake/application.rb:70:in `run'
/usr/local/bin/rake:37:in `<main>'

With bundle exec

root@cid:/var/www/discourse# bundle exec rake plugin:install repo=http://github.com/discoursehosting/discourse-adsense --trace
rake aborted!
uninitialized constant Annotate
/var/www/discourse/lib/tasks/auto_annotate_models.rake:33:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:641:in `block in run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:641:in `each'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:641:in `run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:244:in `run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:446:in `load_tasks'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
/var/www/discourse/Rakefile:7:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/rake_module.rb:25:in `load'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/rake_module.rb:25:in `load_rakefile'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:637:in `raw_load_rakefile'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:94:in `block in load_rakefile'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:93:in `load_rakefile'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:77:in `block in run'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.0.0/bin/rake:23:in `load'
/var/www/discourse/vendor/bundle/ruby/2.0.0/bin/rake:23:in `<main>'

I decided to check to see if I had bundler installed, which it appears I do.

root@cid:/var/www/discourse# gem list

*** LOCAL GEMS ***

bigdecimal (1.2.0)
bundler (1.3.5)
io-console (0.4.2)
json (1.7.7)
minitest (4.3.2)
psych (2.0.0)
rake (0.9.6)
rdoc (4.0.0)
rubygems-update (2.1.11)
test-unit (2.0.0.0)

Any ideas on why this is happening and how to resolve it? Thanks.

Posts: 8

Participants: 3

Read full topic


Plugin tutorial #3 - How to add a button after every posts?

$
0
0

Régis Hanol wrote:

This time we're going to add a button after every post that will allow users to hide/show the post.

But first, we need to understand how these buttons are generated.

They are defined by the post_menu site setting:

This setting determine which items will appear on the post menu and their order:

This list is used by the PostMenuView which renders the menu below a post using buffered rendering for performance. We've already seen the buffer rendering in the previous tutorial. It just means that we're pushing strings into a buffer.

This view has 2 interesting methods:

render: function(buffer) {
  var post = this.get('post');
  buffer.push("<nav class='post-controls'>");
  this.renderReplies(post, buffer);

  var self = this;
  Discourse.get('postButtons').toArray().reverse().forEach(function(button) {
    var renderer = "render" + button;
    if(self[renderer]) self[renderer](post, buffer);
  });
  buffer.push("</nav>");
},

This render method is called by EmberJs whenever it needs to render the view. First, it will render the replies button (call to this.renderReplies) if there is any. Then, it will iterate through Discourse.get('postButtons') which is a basic wrapper around the post_menu site setting and will call the methods named render<Button> if it is defined on the view. For example, for the reply button, it will call the method named renderReply.

click: function(e) {
  var $target = $(e.target);
  var action = $target.data('action') || $target.parent().data('action');
  if (!action) return;

  var handler = this["click" + action.capitalize()];
  if (!handler) return;

  handler.call(this);
},

This click method is called by EmberJs whenever the user clicks on the view (that is, on any button). That method retrieve the name of the action to call by looking at the data-action attribute of the targeted element or its parent's. If an action is found, it will look for a method name click<Action> in the view and call it if it is defined in the the view. For example, if the action is reply, it will call the clickReply method.

So, these 2 methods allow us to control both the rendering of our button by defining a renderSomething method and control the behavior whenever the user clicks on the button by defining a clickSomething method.

Let's call our button hide and add it to the post_menu site setting:

We're now all set to start writing our plugin.

Let's start with our usual suspect, plugin.rb, our entry point:

# name: hide post
# about: add a button at the end of every post allowing users to hide the post
# version: 0.1
# authors: Régis Hanol

register_asset "javascripts/hide_post.js"

This only register a single asset. Let's dig into this javascript file:

Discourse.PostMenuView.reopen({

  renderHide: function(post, buffer) {
    var direction = !!post.getWithDefault("temporarily_hidden", false) ? "down" : "up";
    buffer.push('<button title="' + direction + '" data-action="hide">');
    buffer.push('<i class="fa fa-chevron-' + direction + '"></i>');
    buffer.push('</button>');
  },

  clickHide: function() {
    $("#post_" + this.get("post.post_number") + " .cooked").toggle();
    this.toggleProperty("post.temporarily_hidden");
  }

});

The first line (Discourse.PostMenuView.reopen) is the Ember way of reopening a class from another file. This allows us to add instance methods and properties that are shared across all instances of that class. Which is exactly what we want here. So, as we've seen earlier, we need to define 2 methods: renderHide and clickHide.

The renderHide method is used to render the hide button which is composed of a chevron icon. It looks for the temporarily_hidden property on post to determine the direction of the chevron.

The clickHide method is toggling the visibility of the current post via jQuery and the temporarily_hidden value.

If you try to run the plugin like so, you will notice that it works but the chevron is not changing direction. It's because it's not being rerendered whenever the value of post.temporarily_hidden is changed. To allow for that, we add a new observer using Discourse.View.renderIfChanged which will be observing that property and will internally call rerender() on the view itself.

Discourse.PostMenuView.reopen({
  shouldRerenderHideButton: Discourse.View.renderIfChanged("post.temporarily_hidden"),

  // rest of the code...
})

And voilà.

Here's a screenshot with the button on the right (the chevron)

When you click on it, it hides the post and the chevron changes direction

Hope you enjoyed it smile

As usual, sources are available on GitHub.

Posts: 5

Participants: 3

Read full topic

Cmd-Enter support

$
0
0

Patrick Lightbody wrote:

I was under the impression that Cmd-Enter worked for creating new topics and replying to existing ones. I thought I had done it personally a few months back, but I think my memory is playing tricks with me. So... let's consider this a feature request smile GitHub and Gmail are both good examples of supporting Cmd-Enter as a quick way to submit long-form text forms like this. I'd love to see Discourse do it too!

Posts: 1

Participants: 1

Read full topic

Single sign-on with self-hosted Wordpress install

$
0
0

Curtis Herbert wrote:

I'm assisting in running a Wordpress-based site. It's still pretty new, so although it started by using bbPress as the forum software, we're not past the point of no return. There are a lot of hacks we're going to have to do to get bbPress to work right (no post-preview support, for example) so I'm really eyeing up Discourse.

Is it possible to have Discourse use the existing Wordpress install as the source of logins? I'm looking to keep the site single sign-on (the one advantage bbPress gives). I'm ok if I need to script an initial migration and then all future ones are automatic. Anyone have experience with this?

Posts: 5

Participants: 4

Read full topic

Category & Sub-category Relation

$
0
0

Ray wrote:

I had my gt4stinger.com forum setup with some parent categories which contain sub-categories.

I was playing around with functionality and user experience and thought that perhaps 1 level hierarchy, using categories, is perhaps the best way so I decided to remove all parent categories that had sub-categories and it looks like I've orphaned all of the sub-categories since it doesn't show in the category section.

Here you can see I have 7 current parent categories and I [naively] expected that by deleting a parent category, the sub-category would automatically assume a parent category.
http://gt4stinger.com/categories

Is this a bug? Though it looks like there wasn't a protocol for this type of situation yet? Thank you in advance Discourse team. I'm thoroughly enjoying the Discourse experience thus far!

Posts: 3

Participants: 2

Read full topic

Welcome Régis Hanol to the Discourse team

$
0
0

Jeff Atwood wrote:

The Discourse Team has always been intentionally small. We did have plans to add a team member sometime after the public launch of the project. But we wanted just the right person, someone brave enough to take on the risk of a project as broadly ambitious as Discourse, someone willing to prove to us that…


This topic is for comments on the original blog entry at: http://blog.discourse.org/2013/09/welcome-regis-hanol-to-the-discourse-team/

Posts: 11

Participants: 8

Read full topic

Viewing all 60739 articles
Browse latest View live




Latest Images