Hi,
When creating a new repository in Stash you are directed to a page with a number of instructions for how to start populate the repo.
Is it possible to customize this page?
I have located the soy-template to:
<stash-install>/atlassian-stash/static/page/repository/empty/empty-repository.soy
and that the following foreach clause builds the page
<h2>{stash_i18n('stash.web.repository.empty.heading', 'You have an empty repository')}</h2> <p>{stash_i18n('stash.web.repository.empty.description', 'To get started you will need to run these commands in your terminal.')}</p>
{foreach $webPanel in getWebPanels('stash.web.repository.empty', [ 'project' : $project, 'repository' : $repository ])} {$webPanel|noAutoescape} {/foreach}
My question is how to intercept one loop in this foreach and change the output for it.
Any ideas?
Rgrds
// Svante
This is how the page look like:
To get started you will need to run these commands in your terminal.
git config --global user.name "your name"
git config --global user.email "your email"
Community moderators have prevented the ability to post new answers.
Hi Svante,
In general I really wouldn't recommend modifying those files. It's going to be annoying to upgrade Stash and you'll have to keep reapplying your changes.
Those webpanels are calls to external plugins so that the page can be customised. The content I suspect you want to modify will be in the the git-scm plugin, which doesn't have soy files you can hack directly.
I would suggest writing your own plugin to add extra content to that page (and give it a low weight to force it to the top). Let me know if you need a hand with that. Basically you need something like in your atlassian-plugin.xml (where our default weight is 10, so you need something smaller).
<web-panel key="empty-git-message" weight="5" location="stash.web.repository.empty"> <resource name="view" type="soy" location="your.plugin:server-soy-templates/org.example.templateName"/> </web-panel> <stash-resource key="server-soy-templates" name="Server Side Soy Templates"> <directory location="/templates/" /> </stash-resource>
And a soy file in the templates directory:
{namespace org.example}
/** */
{template .templateName}
Content goes here
{/template}
I hope that helps.
Charles
Hi, I'm new to Atlassian plugin development but am trying to implement my first plugin to modify the empty repository page to be more helpful to users. I've managed to add content to the pull-requests page using the instructions at the link below, but can't seem to modify the empty repository page. https://developer.atlassian.com/stash/docs/latest/tutorials-and-examples/pull-request-overview.html The tutorial above includes a dependency on pull-request-web-panels, is a similar dependency required here? And if so, where in the documentation can I tell what dependencies need to be included? Cheers,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could use css and JQuery to hide the content you want removing and add your own web panels with a weight so they appear at the right place.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You'll have to change the source code @ empty-repository-read.soy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Timothy,
Yea, I have found the Soy-template but I don't know how to change this file to update one specifc paragraph in the page.
Do you have any ideas?
Rgrds,
// Svante
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.