Commits

Maxim Podkolzine committed 5785a9d

Improve the code to get rid of "torrentIcon" in the URL

  • Participants
  • Parent commits 93d1ae0

Comments (0)

Files changed (2)

server/resources/torrentLinks.jsp

 <%@ include file="/include.jsp" %>
 <script type="text/javascript">
-  BS.Torrents.icon = '<c:url value="${torrentIcon}"/>';
+  BS.Torrents.icon = "${teamcityPluginResourcesPath}torrent.png";
   BS.Torrents.trackTreeEvents();
 </script>

server/src/jetbrains/buildServer/artifactsMirror/web/TorrentLinksExtension.java

 import jetbrains.buildServer.web.openapi.SimplePageExtension;
 import org.jetbrains.annotations.NotNull;
 
-import javax.servlet.http.HttpServletRequest;
-import java.util.Map;
-
 /**
  * @author Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
  * @since 8.0
  */
 public class TorrentLinksExtension extends SimplePageExtension {
-  private final PluginDescriptor myDescriptor;
-
   public TorrentLinksExtension(@NotNull PagePlaces pagePlaces,
                                @NotNull PluginDescriptor descriptor) {
     super(pagePlaces, PlaceId.ALL_PAGES_FOOTER, "torrent-links", descriptor.getPluginResourcesPath("torrentLinks.jsp"));
-    myDescriptor = descriptor;
     addJsFile(descriptor.getPluginResourcesPath("torrentLinks.js"));
     register();
   }
-
-  @Override
-  public void fillModel(@NotNull Map<String, Object> model, @NotNull HttpServletRequest request) {
-    super.fillModel(model, request);
-    model.put("torrentIcon", myDescriptor.getPluginResourcesPath("torrent.png"));
-  }
 }