Changeset 8fa4996


Ignore:
Timestamp:
Feb 15, 2011 3:22:57 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
4d59570
Parents:
eb7e1d2
Message:
  • i2psnark: Details link shuffle, mostly restore 0.8.3 behavior
File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java

    reb7e1d2 r8fa4996  
    858858        out.write(statusString + "</td>\n\t");
    859859
     860        // (i) icon column
    860861        out.write("<td class=\"" + rowClass + "\">");
     862        if (isValid && meta.getAnnounce() != null) {
     863            // Link to local details page - note that trailing slash on a single-file torrent
     864            // gets us to the details page instead of the file.
     865            //StringBuilder buf = new StringBuilder(128);
     866            //buf.append("<a href=\"").append(snark.getBaseName())
     867            //   .append("/\" title=\"").append(_("Torrent details"))
     868            //   .append("\"><img alt=\"").append(_("Info")).append("\" border=\"0\" src=\"")
     869            //   .append(_imgPath).append("details.png\"></a>");
     870            //out.write(buf.toString());
     871
     872            // Link to tracker details page
     873            String trackerLink = getTrackerLink(meta.getAnnounce(), snark.getInfoHash());
     874            if (trackerLink != null)
     875                out.write(trackerLink);
     876        }
     877
     878        // File type icon column
     879        out.write("</td>\n<td class=\"" + rowClass + "\">");
    861880        if (isValid) {
     881            // Link to local details page - note that trailing slash on a single-file torrent
     882            // gets us to the details page instead of the file.
    862883            StringBuilder buf = new StringBuilder(128);
    863884            buf.append("<a href=\"").append(snark.getBaseName())
    864885               .append("/\" title=\"").append(_("Torrent details"))
    865                .append("\"><img alt=\"").append(_("Info")).append("\" border=\"0\" src=\"")
    866                .append(_imgPath).append("details.png\"></a>");
    867              out.write(buf.toString());
    868         }
    869 
    870         out.write("</td>\n<td class=\"" + rowClass + "\">");
    871         StringBuilder buf = null;
     886               .append("\">");
     887            out.write(buf.toString());
     888        }
     889        String icon;
     890        if (isMultiFile)
     891            icon = "folder";
     892        else if (isValid)
     893            icon = toIcon(meta.getName());
     894        else
     895            icon = "magnet";
     896        if (isValid) {
     897            out.write(toImg(icon, _("Info")));
     898            out.write("</a>");
     899        } else {
     900            out.write(toImg(icon));
     901        }
     902
     903        // Torrent name column
     904        out.write("</td><td class=\"snarkTorrentName " + rowClass + "\">");
    872905        if (remaining == 0 || isMultiFile) {
    873             buf = new StringBuilder(128);
     906            StringBuilder buf = new StringBuilder(128);
    874907            buf.append("<a href=\"").append(snark.getBaseName());
    875908            if (isMultiFile)
     
    883916            out.write(buf.toString());
    884917        }
    885         String icon;
    886         if (isMultiFile)
    887             icon = "folder";
    888         else if (isValid)
    889             icon = toIcon(meta.getName());
    890         else
    891             icon = "magnet";
    892         if (remaining == 0 || isMultiFile) {
    893             out.write(toImg(icon, _("Open")));
    894             out.write("</a>");
    895         } else {
    896             out.write(toImg(icon));
    897         }
    898         out.write("</td><td class=\"snarkTorrentName " + rowClass + "\">");
    899         if (remaining == 0 || isMultiFile)
    900             out.write(buf.toString());
    901918        out.write(filename);
    902919        if (remaining == 0 || isMultiFile)
     
    11701187        out.write(":<td><input type=\"text\" name=\"newURL\" size=\"85\" value=\"" + newURL + "\"");
    11711188        out.write("title=\"");
    1172         out.write(_("Torrent file must originate from an I2P-based tracker"));
     1189        out.write(_("Enter the torrent file download URL (I2P only), magnet link, or maggot link"));
    11731190        out.write("\"> \n");
    11741191        // not supporting from file at the moment, since the file name passed isn't always absolute (so it may not resolve)
Note: See TracChangeset for help on using the changeset viewer.