Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how to add image in .vm file

Rakesh Kumar Saini April 10, 2018

I tried many times but don't were i am getting wrong .

atlassian-plugin.xml :

<?xml version="1.0" encoding="UTF-8"?>

<atlassian-plugin key="${atlassian.plugin.key}" 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}"/>
    <param name="plugin-icon">images/pluginIcon.png</param>
    <param name="plugin-logo">images/pluginLogo.png</param>
  </plugin-info>
  <!-- add our i18n resource -->
  <resource type="i18n" name="i18n" location="CustomPanel"/>
  <!-- add our web resources -->
  <web-resource key="CustomPanel-resources" name="CustomPanel Web Resources">
    <dependency>com.atlassian.auiplugin:ajs</dependency>
    <resource type="download" name="CustomPanel.css" location="/css/CustomPanel.css"/>
    <resource type="download" name="CustomPanel.js" location="/js/CustomPanel.js"/>
    <resource type="download" name="images/" location="images/"/>
    <context>CustomPanel</context>
  </web-resource>
  <web-panel key="aqua test cases" name="aquaServer" location="atl.jira.view.issue.right.context">
    <resource name="view" type="static" location="temp.vm"/>
  </web-panel>
</atlassian-plugin>

 

.vm file :

 

 

<html>
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  <style>
    .image{
        height:100px;
        width:100px;
        background-size: cover;
        background-repeat: no-repeat;
    }
  </style>
</head>
<body>
<div class="container">
  <!-- Trigger the modal with a button -->
  <button type="button" class="aui-button" data-toggle="modal" data-target="#myModal">Connect</button>
  <!-- Modal -->
  <div class="modal fade" id="myModal" role="dialog">
    <div class="modal-dialog">    
      <!-- Modal content-->
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">&times;</button>          
          <h4 class="modal-title">Aqua Server Configuration</h4>
        </div>        
        <div class="modal-body">        
            <img id="myImg" src="${webResourceHelper.getStaticResourcePrefix()}/download/resources/CustomPanel:CustomPanel-resources/images/connecting.jpg" width="300" height="200">
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>      
    </div>
  </div>  
</div>
</body>
</html>

0 answers

Suggest an answer

Log in or Sign up to answer