How could I change the template or add additional partial page to /admin/ page?

56 views
Skip to first unread message

Hoàng Tiến Đạt

unread,
Jun 12, 2015, 11:34:38 AM6/12/15
to mayoca...@googlegroups.com
I'm having a project on my university. My project is to add aditional module to Mayocat.
Please let me know how to change the template of /admin/ page, or how to add aditional partial page to /admin/ page?
I tried to change the html files in <mayocat_source_directory>/shop/client/src/main/resources/assets/client/partials/ but the change doesn't reflect to /admin/. No matter what I tried to change, nothing happen.

The module i'm going to add is to let the site admins edit multiple product information on the same page. I'm going to create a view with excel-like table (using handsontable). Then user done editing, I will use jQuery to send what user edited to an API i created.
If possible, please give me some advices on how to do it. (Just how to place my html file, where to put my API code, and how to config things).

It is very urgent because I have to get it done in tomorrow. 
What i would like to know is just how to place my html file, where to put API code, how to config things. I can handle everything else. Just because the mayocat structure seems to be too complicated to me.

I'M VERY GRATEFUL FOR ANY HELP.

Jérôme Velociter

unread,
Jun 12, 2015, 11:59:48 AM6/12/15
to mayoca...@googlegroups.com, thenewwo...@gmail.com
Hi Hoàng,

Are you running mayocat from intelliJ or from the command line ?

If you are running it from command line, assets should reload correctly when you edit them / refresh the admin UI.

If you are running from intelliJ, you need to add assets to the application classpath. See http://www.mayocat.org/building-guide, the section "Adding the client assets to the application classpath"

Hope this helps,

Jérôme

Hoàng Tiến Đạt

unread,
Jun 12, 2015, 12:06:27 PM6/12/15
to mayoca...@googlegroups.com, thenewwo...@gmail.com
I'm running mayocat from command line (start_development.sh)
I don't know what happening.
I even tried to delete all html files in assets. Yet, the /admin/ page still appeared as if there was nothing happened.

Jérôme Velociter

unread,
Jun 12, 2015, 12:17:46 PM6/12/15
to mayoca...@googlegroups.com, thenewwo...@gmail.com
What files are you modifying in assets/ ?

If you modify templates that are loaded via AJAX, sometimes angular caches them too aggressively and you don't see the changes. In which case you can add a URL parameter to the templateUrl so that it forces a by-pass of the template cache.

Jerome

Hoàng Tiến Đạt

unread,
Jun 12, 2015, 12:18:25 PM6/12/15
to mayoca...@googlegroups.com, thenewwo...@gmail.com
By the way, does mayocat use caching or something like that?
I tried to delete all html file in assets. Then when i load /admin/ page, the pages that i visited before seems to work normally, but the pages that i've never visited before is "not found".
I'm grateful to you for your quick reply.

On Friday, June 12, 2015 at 10:59:48 PM UTC+7, Jérôme Velociter wrote:

Hoàng Tiến Đạt

unread,
Jun 12, 2015, 12:37:07 PM6/12/15
to mayoca...@googlegroups.com, thenewwo...@gmail.com
Thank you very much. I've fixed the problem.
It's due to angular caches.

Jerome Velociter

unread,
Jun 12, 2015, 1:37:43 PM6/12/15
to Hoàng Tiến Đạt, mayoca...@googlegroups.com
Glad I could help !

For info, when you delete all assets, I think the reason you still see
the admin page working is because mayocat falls back on the assets
bundled as classpath resources in the jar.

Jérôme
> --
> You received this message because you are subscribed to the Google Groups
> "mayocat-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mayocat-user...@googlegroups.com.
> To post to this group, send email to mayoca...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mayocat-users/4e248edc-1a4f-43c7-b24f-63775546c6ae%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Hoàng Tiến Đạt

unread,
Jun 19, 2015, 4:37:52 AM6/19/15
to mayoca...@googlegroups.com, thenewwo...@gmail.com, jerome.v...@gmail.com
Thank you very much.
By the way, how could I change the port of mayocat site? I see it mentioned in mayocat building guide but I don't know where to change the port in mayocat.yml file.

Jerome Velociter

unread,
Jun 19, 2015, 4:56:29 AM6/19/15
to Hoàng Tiến Đạt, mayoca...@googlegroups.com
Hi,

You can check https://dropwizard.github.io/dropwizard/manual/configuration.html

Check the "Extending from the default server configuration" section,
that should do the trick. Note I'm not sure dropwizard (thus mayocat)
can run on port 80 - I know it wasn't some time ago, maybe it's
possible now (if that's what you're trying to do). We usually run it
behind a reverse proxy.

Jérôme

On Fri, Jun 19, 2015 at 10:37 AM, Hoàng Tiến Đạt
> https://groups.google.com/d/msgid/mayocat-users/18bca215-a5c7-4035-9791-debd0f7f6ca8%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages