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

Is there a broadcast function?

$
0
0

Ted Pearlman wrote:

I'd love to use an @ mention of something like @everyone to broadcast to my entire discourse community. Does this exist or is there another way to do it?

Posts: 9

Participants: 5

Read full topic


One line messages appear empty

$
0
0

Hedi Harzallah wrote:

My discourse was working just fine.
I recently noticed that messages that are written only one line appear empty.
When I edit the message, I see original text.
I have to add a line break for the message to show.
Do you have an idea on how I can solve this issue ?

ps : I'm on the latest version of discourse

Posts: 5

Participants: 2

Read full topic

How to restore the test seed data?

$
0
0

Zhao Shuai wrote:

The two errors in vagrant:

-bash: pg_dumps/production-image.sql: No such file or directory

-bash: pg_dumps/development-image.sql: No such file or directory

Posts: 1

Participants: 1

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: 9

Participants: 4

Read full topic

{VAGRANT Method - Error} stdin: is not a tty AND mount.nfs: access denied by server while mounting

$
0
0

D Iff wrote:

When I run vagrant up, it's ok before this line:

Preparing to edit /etc/exports. Administrator privileges will be required...

After above prompt, it asks for password, and here is the error that occurs:

[sudo] password for diff:
nfsd running
sudo: /usr/bin/exportfs: command not found
==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mount -o 'vers=3,udp' 192.168.10.1:'/home/diff/discourse' /vagrant
Stdout from the command:
Stderr from the command:
stdin: is not a tty
mount.nfs: access denied by server while mounting 192.168.10.1:/home/diff/discourse

Posts: 4

Participants: 2

Read full topic

Firefox: Middle-click triggers pop-up blocker

$
0
0

ComputerDruid wrote:

Middle clicking (to open in a new tab) on a topic triggers Firefox's pop-up blocker.

This doesn't make sense to me, given that middle clicking on an ordinary link opens in a new tab without this. Is discourse intercepting middle-clicks somehow?

Right-clicking on the link (if you aim VERY carefully), and selecting "Open in new tab" works as expected, but this is a pain compared to the much-easier-to-execute middle click.

Edit: You don't actually have to aim carefully to right-click on the link, you have to right-click twice. The first right-click acts as if you'd right-clicked on the page, and the second one as if you'd right-clicked a link. Right-clicking before middle-clicking also works. This is really weird.

Posts: 71

Participants: 17

Read full topic

Remove data-href behavior

$
0
0

Phil wrote:

in the middle-click bug thread, we discussed the click tracking behavior and found no justification for the behavior of mutilating links by moving href to data-href.

my changes included that, but a more atomic fix of the middle click behavior was pulled instead. this doesn’t mean we shouldn’t also fix the data-href stuff (unless someone explains a good reason for it to be done)

@eviltrout, @radq: any thoughts or insights?

Posts: 1

Participants: 1

Read full topic

WIP - changing ownership of posts

$
0
0

Kane York wrote:

The UI is pretty much done, now I need to do the server side:

https://github.com/riking/discourse/compare/discourse:master...riking:change-owner

Please go through the diff and point out any coding errors. I'll go through it for style and the JSDoc before making a PR. Also, be prepared for force-pushes to that branch.

I've imposed these restrictions on reposessing posts:

  • All selected posts must be by the same author
  • If you click 'select with replies' it won't work
  • Staff Admin only (unimplemented - TL4 will see the change ownership dialog but fail)

The first two restrictions came about because I was having trouble with the select with replies, then I realized that it wouldn't be very useful to change ownership of an entire reply chain anyways.

The third restriction is up for debate.

Screenshot (I'm pretty sure this includes everything I changed in layout and CSS):

Posts: 4

Participants: 2

Read full topic


Upgrade to `latest-version` through docker

$
0
0

Leo Bergnéhr wrote:

I love the docker hosting you've done, but I ran into something today when I was going to upgrade to the latest version:

This is what I get from the /admin/docker log after clicking upgrade:

$ cd /var/www/discourse && git pull
You are not currently on a branch, so I cannot use any
'branch..merge' in your configuration file.
Please specify which branch you want to merge with on the command
line and try again (e.g. 'git pull ').
See git-pull(1) for details.

This is my /var/docker/containers/app.yml

params
  # ssh key here ...
  # git revision to run
  version: latest-release

I think it's the first time I'm running with the latest-release tag and think that might be the problem. I'm having trouble finding some more info on that particular parameter and what's reasonable to set it to.

Before running the upgrade through /admin/docker I upgraded to the latest docker and pulled the latest bits from the docker repo, then did a launcher destroy/boostrap/start app cycle.

Posts: 4

Participants: 2

Read full topic

Support auto-highlighting for preformatted code

$
0
0

Nathan Rijksen wrote:

Highlightjs offers "auto highlighting" out of the box. It'd be nice if this functionality could be exposed to Discourse through an admin pref (eg. "Auto highlight preformatted code"). I understand this won't be relevant for all forums but for some forums (such as the one I manage) it is highly preferable.

Posts: 8

Participants: 3

Read full topic

Audio html5 tag

$
0
0

Martin Broerse wrote:

I just added an audio tag like this to link a podcast.

but is does not show up. How should a Podcast or other audio file be linked? It is correct in the preview.

Posts: 30

Participants: 5

Read full topic

Cannot put HTML tag in Topic title

$
0
0

Anton wrote:

Trying to input this text for title:

In code block url was converted to <a> tag

But getting this:

In code block url was converted to tag

Posts: 10

Participants: 6

Read full topic

Backslashes in Discourse upgrade instructions

$
0
0

zchrykng wrote:

Not sure if this has been mentioned somewhere else already, but there appears to be an error in the text for the upgrade instructions email. It is a minor error, but could be confusing to some people.

It currently reads Upgrade by visiting \admin\docker, refreshing the page a few times, and pressing the "upgrade" button.

and probably should read Upgrade by visiting /admin/docker, refreshing the page a few times, and pressing the "upgrade" button.

I would submit a pull request myself, but I could not find where the text was located.

Posts: 3

Participants: 2

Read full topic

How would you migrate the wordpress.org forum to Discourse?

$
0
0

Erlend Sogge Heggen wrote:

The wordpress.org support forum is a high-traffic, high-volume forum, with probably hundreds of new posts a day.

It's got three particularly interesting categories:

These are special because they're not primarily accessed via the forum/category index. Instead, they're accessed via distributed embeds, sectioned off by tags.

In other words, no one's gonna be writing their support request for Co Authors Plus in the Plugins & Hacks forum. They'll do it via the plugin's dedicated support forum, which automatically adds the 'co-authors-plus' tag needed for a post to show up in that embedded forum. (This also adds the handy benefit of being able to cross-post between two plugins in the occasional case when a post relates to both.)

It works the same way for themes. I'm not quite sure how it works for reviews but the post-flow is the same.

Another similar example is Vanilla Forum plugins.


Hypothetically speaking, say you were asked to convert the entire WP Support forum to Discourse. How would you do it?

Posts: 5

Participants: 3

Read full topic

Any mass email functionality?


Is there a way to link a twitter account to an already created account?

$
0
0

Juan Manuel Formoso wrote:

I installed a new instance of discourse and created my admin account, later I enabled sign up with twitter.

Is there a way to link my twitter account with that account created with username and password?

Posts: 5

Participants: 2

Read full topic

Operation not permitted when upgrading Docker Manager

$
0
0

Jeff Atwood wrote:

This is what i get when i try upgrading the docker manager:

Log

$ cd /var/www/discourse/plugins/docker_manager && git pull
error: unable to unlink old 'app/assets/javascripts/docker_manager.js' (Operation not permitted)
error: unable to unlink old 'app/views/docker_manager/admin/_git_status.html.erb' (Operation not permitted)
error: unable to unlink old 'app/views/docker_manager/admin/index.html.erb' (Operation not permitted)
error: unable to unlink old 'lib/docker_manager/upgrader.rb' (Operation not permitted)
Updating 866ebd6..4e34f7b

Posts: 1

Participants: 1

Read full topic

One topic on our Discourse showing up empty

Do I need to destroy and bootstrap again every time I change a setting?

$
0
0

Juan Manuel Formoso wrote:

I started playing with my instance before I had a domain set up. When I had it, I had to change my container/app.yml and add it in DISCOURSE_HOSTNAME

Is the only (or at least recommended) way to have it refreshed a destroy/bootstrap/start?

Posts: 2

Participants: 2

Read full topic

Every time I attach media in WordPress, a separate topic is created

$
0
0

Jeff Atwood wrote:

I have a problem with the plugin, every time I attach media (eg. a photo) a separate entry is created on Discourse (as if it were a valid post, not only an attachment). Anybody experienced this?

Posts: 1

Participants: 1

Read full topic

Viewing all 60678 articles
Browse latest View live




Latest Images