Desarrollo de Plugins para Discourse - Parte 5 - Agregar una interfaz de administración

Work for me!
2018-4-29

1. Code




2. Result

4 Me gusta

Glad it worked, but It is always better to post code than pictures of code.

3 Me gusta

Thanks for reply
original post have all these code,
it’s not necessary for me to post code again.

The purpose of these picture is to show it work, give viewer a big picture view
(not for viewer to copy&paste)
(code in code editor have nicer code highlight)

If anyone runs into a testing error, I had to add id="show-tentacle" to the button component to get the tests to pass in part 6 of the tutorial:

<div class="buttons">
  {{d-button label="purple_tentacle.show" action="showTentacle" icon="eye" id="show-tentacle"}}
</div>

I found the Ember routing didn’t work until I commented out path: '/plugins' in the route-map file:

export default {
  resource: 'admin.adminPlugins',
  // path: '/plugins',
  map () {
    this.route('watch-mute')
  }
}

For some reason Ember was expecting a route at adminPlugins/watch-mute not at adminPlugins/plugins/watch-mute. Is this something I did wrong upstream in the routing call chain, or has something changed in the way Discourse/Ember handles these?

The linked discourse-akismet plugin doesn’t have that admin UI/tab/code btw. The good news is that another plugin, https://github.com/discourse/discourse-data-explorer, does have it.

1 me gusta

11 publicaciones se dividieron en un nuevo tema: ¿Cómo ejecutar código del lado del servidor al hacer clic en un botón?

Hola, solo quería decir que encontré un error en la documentación en la línea 116.
He abierto una solicitud de extracción (pull request).

1 me gusta