mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Show nuber of attachments in summary view if >5
SVN revision: 2095
This commit is contained in:
parent
0687171ecf
commit
cc3e5c4d76
99
src/elogd.c
99
src/elogd.c
@ -16300,7 +16300,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp
|
|||||||
char str[NAME_LENGTH], ref[256], *nowrap, sclass[80], format[256], file_name[MAX_PATH_LENGTH], *slist,
|
char str[NAME_LENGTH], ref[256], *nowrap, sclass[80], format[256], file_name[MAX_PATH_LENGTH], *slist,
|
||||||
*svalue, comment[256];
|
*svalue, comment[256];
|
||||||
char display[NAME_LENGTH], attr_icon[80];
|
char display[NAME_LENGTH], attr_icon[80];
|
||||||
int i, j, i_line, index, colspan, n_attachments, line_len, thumb_status, max_line_len, n_lines,
|
int i, j, n, i_line, index, colspan, n_attachments, line_len, thumb_status, max_line_len, n_lines,
|
||||||
max_n_lines;
|
max_n_lines;
|
||||||
BOOL skip_comma;
|
BOOL skip_comma;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
@ -16442,18 +16442,28 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp
|
|||||||
rsputs2(lbs, absolute_link, display);
|
rsputs2(lbs, absolute_link, display);
|
||||||
|
|
||||||
rsputs(" ");
|
rsputs(" ");
|
||||||
for (i = 0; i < MAX_ATTACHMENTS; i++)
|
for (i = n = 0; i < MAX_ATTACHMENTS; i++)
|
||||||
if (attachment && attachment[i][0]) {
|
if (attachment && attachment[i][0])
|
||||||
strlcpy(str, attachment[i], sizeof(str));
|
n++;
|
||||||
str[13] = 0;
|
if (n > 5) {
|
||||||
sprintf(ref, "../%s/%s/%s", lbs->name, str, attachment[i] + 14);
|
if (highlight != message_id)
|
||||||
url_encode(ref, sizeof(ref)); /* for file names with special characters like "+" */
|
rsprintf("<a href=\"%s\">", ref);
|
||||||
|
rsprintf("<b>%dx", n);
|
||||||
rsprintf("<a href=\"%s\" target=\"_blank\">", ref);
|
rsprintf("<img border=\"0\" align=\"absmiddle\" src=\"attachment.png\"></b></a>");
|
||||||
rsprintf("<img border=\"0\" align=\"absmiddle\" src=\"attachment.png\" alt=\"%s\" title=\"%s\"></a>",
|
} else {
|
||||||
attachment[i]+14, attachment[i]+14);
|
for (i = 0; i < MAX_ATTACHMENTS; i++)
|
||||||
}
|
if (attachment && attachment[i][0]) {
|
||||||
|
strlcpy(str, attachment[i], sizeof(str));
|
||||||
|
str[13] = 0;
|
||||||
|
sprintf(ref, "../%s/%s/%s", lbs->name, str, attachment[i] + 14);
|
||||||
|
url_encode(ref, sizeof(ref)); /* for file names with special characters like "+" */
|
||||||
|
|
||||||
|
rsprintf("<a href=\"%s\" target=\"_blank\">", ref);
|
||||||
|
rsprintf("<img border=\"0\" align=\"absmiddle\" src=\"attachment.png\" alt=\"%s\" title=\"%s\"></a>",
|
||||||
|
attachment[i]+14, attachment[i]+14);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (highlight != message_id)
|
if (highlight != message_id)
|
||||||
rsprintf("</a>\n", ref);
|
rsprintf("</a>\n", ref);
|
||||||
else
|
else
|
||||||
@ -16762,17 +16772,28 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp
|
|||||||
if (strieq(mode, "Threaded")) {
|
if (strieq(mode, "Threaded")) {
|
||||||
|
|
||||||
rsputs(" ");
|
rsputs(" ");
|
||||||
for (i = 0; i < MAX_ATTACHMENTS; i++)
|
|
||||||
if (attachment && attachment[i][0]) {
|
|
||||||
strlcpy(str, attachment[i], sizeof(str));
|
|
||||||
str[13] = 0;
|
|
||||||
sprintf(ref, "../%s/%s/%s", lbs->name, str, attachment[i] + 14);
|
|
||||||
url_encode(ref, sizeof(ref)); /* for file names with special characters like "+" */
|
|
||||||
|
|
||||||
rsprintf("<a href=\"%s\" target=\"_blank\">", ref);
|
for (i = n = 0; i < MAX_ATTACHMENTS; i++)
|
||||||
rsprintf("<img border=\"0\" align=\"absmiddle\" src=\"attachment.png\" alt=\"%s\" title=\"%s\"></a>",
|
if (attachment && attachment[i][0])
|
||||||
attachment[i]+14, attachment[i]+14);
|
n++;
|
||||||
}
|
if (n > 5) {
|
||||||
|
if (highlight != message_id)
|
||||||
|
rsprintf("<a href=\"%s\">", ref);
|
||||||
|
rsprintf("<b>%dx", n);
|
||||||
|
rsprintf("<img border=\"0\" align=\"absmiddle\" src=\"attachment.png\"></b></a>");
|
||||||
|
} else {
|
||||||
|
for (i = 0; i < MAX_ATTACHMENTS; i++)
|
||||||
|
if (attachment && attachment[i][0]) {
|
||||||
|
strlcpy(str, attachment[i], sizeof(str));
|
||||||
|
str[13] = 0;
|
||||||
|
sprintf(ref, "../%s/%s/%s", lbs->name, str, attachment[i] + 14);
|
||||||
|
url_encode(ref, sizeof(ref)); /* for file names with special characters like "+" */
|
||||||
|
|
||||||
|
rsprintf("<a href=\"%s\" target=\"_blank\">", ref);
|
||||||
|
rsprintf("<img border=\"0\" align=\"absmiddle\" src=\"attachment.png\" alt=\"%s\" title=\"%s\"></a>",
|
||||||
|
attachment[i]+14, attachment[i]+14);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (highlight != message_id)
|
if (highlight != message_id)
|
||||||
rsprintf("</a>\n");
|
rsprintf("</a>\n");
|
||||||
@ -16868,17 +16889,27 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp
|
|||||||
/* show attachment icons */
|
/* show attachment icons */
|
||||||
rsputs("<td class=\"listatt\"> ");
|
rsputs("<td class=\"listatt\"> ");
|
||||||
|
|
||||||
for (i = 0; i < MAX_ATTACHMENTS; i++)
|
for (i = n = 0; i < MAX_ATTACHMENTS; i++)
|
||||||
if (attachment && attachment[i][0]) {
|
if (attachment && attachment[i][0])
|
||||||
strlcpy(str, attachment[i], sizeof(str));
|
n++;
|
||||||
str[13] = 0;
|
if (n > 5) {
|
||||||
sprintf(ref, "../%s/%s/%s", lbs->name, str, attachment[i] + 14);
|
if (highlight != message_id)
|
||||||
url_encode(ref, sizeof(ref)); /* for file names with special characters like "+" */
|
rsprintf("<a href=\"%s\">", ref);
|
||||||
|
rsprintf("<b>%dx", n);
|
||||||
rsprintf("<a href=\"%s\" target=\"_blank\">", ref);
|
rsprintf("<img border=\"0\" align=\"absmiddle\" src=\"attachment.png\"></b></a>");
|
||||||
rsprintf("<img border=\"0\" align=\"absmiddle\" src=\"attachment.png\" alt=\"%s\" title=\"%s\"></a>",
|
} else {
|
||||||
attachment[i]+14, attachment[i]+14);
|
for (i = 0; i < MAX_ATTACHMENTS; i++)
|
||||||
}
|
if (attachment && attachment[i][0]) {
|
||||||
|
strlcpy(str, attachment[i], sizeof(str));
|
||||||
|
str[13] = 0;
|
||||||
|
sprintf(ref, "../%s/%s/%s", lbs->name, str, attachment[i] + 14);
|
||||||
|
url_encode(ref, sizeof(ref)); /* for file names with special characters like "+" */
|
||||||
|
|
||||||
|
rsprintf("<a href=\"%s\" target=\"_blank\">", ref);
|
||||||
|
rsprintf("<img border=\"0\" align=\"absmiddle\" src=\"attachment.png\" alt=\"%s\" title=\"%s\"></a>",
|
||||||
|
attachment[i]+14, attachment[i]+14);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rsputs(" </td>");
|
rsputs(" </td>");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user