Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Customize the You have an empty repository page in Stash?

Svante Gustafsson Björkegren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 13, 2013

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:

You have an empty repository

To get started you will need to run these commands in your terminal.

Configure Git for the first time

git config --global user.name "your name"

git config --global user.email "your email"

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 30, 2013
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

James Holmes May 31, 2015

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,

0 votes
Paul Fallowfield December 6, 2014

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.

 

 

0 votes
Timothy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 14, 2013

You'll have to change the source code @ empty-repository-read.soy.

Svante Gustafsson Björkegren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 17, 2013

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

TAGS
AUG Leaders

Atlassian Community Events