JIRA planning for each project

Can I use a design style sheet for JIRA projects?

For example, if I would like to include project X in an iframe, I would like to hide the logo and, possibly, the JIRA toolbar - for example, for certain user groups (this is only for viewing purposes, this is not a security feature)

Suppose I have to implement this myself (for example, using the webservice api) - are there templates for the standard problem page?

Thanks in advance!

+3
source share
4 answers

In JIRA is (currently undocumented) plug-in for insertion of the upper navigation components <top-navigation>.

, , , CSS. , ?hideit=true, " iframe". "", cookie.

, <top-navigation>, . script, :

#if ($hideHeaderHack)
    <style>
        \#header {display:none;}
    </style>
    HIDDEN (remove this message eventually)
#else
    NORMAL (remove this message eventually)
#end

, Atlassian Plugin SDK ( atlas-create-jira-plugin). atlassian-plugin.xml :

<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2">
    <plugin-info>
        <description>${project.description}</description>
        <version>${project.version}</version>
        <vendor name="${project.organization.name}" url="${project.organization.url}" />
    </plugin-info>

    <top-navigation key="standard-navigation-top"
                    name="Tigerblood"
                    class="com.madbean.topnavhack.TopNav" state='enabled'>
        <resource type="velocity" name="view" location="topnav.vm"/>
        <order>5</order>
    </top-navigation>

</atlassian-plugin>

( com.madbean.topnavhack.TopNav ) :

public class TopNav implements PluggableTopNavigation {
    private TopNavigationModuleDescriptor descriptor;

    public void init(TopNavigationModuleDescriptor descriptor)
    {
        this.descriptor = descriptor;
    }

    public String getHtml(HttpServletRequest request) {
        Map<String,Object> params = new HashMap<String, Object>();

        params.put("hideHeaderHack", "true".equals(request.getParameter("hideit")));

        return descriptor.getTopNavigationHtml(request, params);
    }
}

- :

./pom.xml
./src/main/java/com/madbean/topnavhack/TopNav.java
./src/main/resources/atlassian-plugin.xml
./src/main/resources/topnav.vm

Atlassian JIRA.

+9

, , , JIRA , 4.x \atlassian-jira\includes\decorators bodytop.jsp. , :

// Render all the top nav plugins for (Iterator iterator = topNavPlugins.iterator(); iterator.hasNext();) { TopNavigationModuleDescriptor topNavModuleDescriptor = (TopNavigationModuleDescriptor) iterator.next(); PluggableTopNavigation pluggableTopNavigation = (PluggableTopNavigation) topNavModuleDescriptor.getModule();

% > <%= pluggableTopNavigation.getHtml(request) % > <% } % >

jsp , bodytop.jsp, .

+2

Jira 4.2.2 , PluggableTopNavigation . , , , .

div Jira, . menu.html .

Since I would have to completely redesign the plugin for Jira 5.2, I started looking for various ways to reimplement the menu. That's what I settled in. It is not very, but it makes it so that you do not need to write a plugin.

Change the ad banner (quickly get there by typing "gg", then search for the ad banner):

<script type="text/javascript">
  jQuery(document).ready(function() {
    jQuery.get("http://path.to.server/menu.html", function(data){
        jQuery("#header").prepend('<nav class="global" role="navigation">'+data+'</nav>');
        jQuery("#top-level-id-of-navbar a").css("color", "white")
    });
  });
</script>

Replace the link menu.htmlwith your own link. The title color was inherited by the links in my menu, so I had to change them back to white after inserting the html page.

The result looks identical to Jira 4.2.2, so I'm happy.

0
source

All Articles