summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2007-10-25 10:40:16 +0200
committerLars Hjemli <hjemli@gmail.com>2007-10-27 10:53:27 +0200
commitfe211c7eef6c7d3e39486d6a7484d3b4debff88f (patch)
tree1b77d4b541cd5848ae1ad8d48e17e7d0f1a8b017
parentef1cc6ef941cedf2e34fa1ed34ca8cd8a0cfdacc (diff)
downloadcgit-fe211c7eef6c7d3e39486d6a7484d3b4debff88f.tar.gz
cgit-fe211c7eef6c7d3e39486d6a7484d3b4debff88f.tar.bz2
cgit-fe211c7eef6c7d3e39486d6a7484d3b4debff88f.zip
Add support for config param summary-tags
This parameter can be used to specify max number of tags to show on the summary page. If not specified, all tags are printed. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r--cgit.h1
-rw-r--r--shared.c3
-rw-r--r--ui-summary.c10
3 files changed, 11 insertions, 3 deletions
diff --git a/cgit.h b/cgit.h
index 75e919b..53e1336 100644
--- a/cgit.h
+++ b/cgit.h
@@ -143,6 +143,7 @@ extern int cgit_cache_dynamic_ttl;
extern int cgit_cache_static_ttl;
extern int cgit_cache_max_create_time;
extern int cgit_summary_log;
+extern int cgit_summary_tags;
extern int cgit_max_msg_len;
extern int cgit_max_repodesc_len;
diff --git a/shared.c b/shared.c
index d815cb1..7e5eaba 100644
--- a/shared.c
+++ b/shared.c
@@ -38,6 +38,7 @@ int cgit_cache_dynamic_ttl = 5;
int cgit_cache_static_ttl = -1;
int cgit_cache_max_create_time = 5;
int cgit_summary_log = 0;
+int cgit_summary_tags = 0;
int cgit_renamelimit = -1;
int cgit_max_msg_len = 60;
@@ -181,6 +182,8 @@ void cgit_global_config_cb(const char *name, const char *value)
cgit_max_commit_count = atoi(value);
else if (!strcmp(name, "summary-log"))
cgit_summary_log = atoi(value);
+ else if (!strcmp(name, "summary-tags"))
+ cgit_summary_tags = atoi(value);
else if (!strcmp(name, "agefile"))
cgit_agefile = xstrdup(value);
else if (!strcmp(name, "renamelimit"))
diff --git a/ui-summary.c b/ui-summary.c
index 43582da..3d5eda8 100644
--- a/ui-summary.c
+++ b/ui-summary.c
@@ -162,7 +162,7 @@ static void cgit_print_branches()
cgit_print_branch(list.refs[i]);
}
-static void cgit_print_tags()
+static void cgit_print_tags(int maxcount)
{
struct reflist list;
int i;
@@ -174,8 +174,12 @@ static void cgit_print_tags()
if (list.count == 0)
return;
qsort(list.refs, list.count, sizeof(*list.refs), cmp_tag_age);
+ if (!maxcount)
+ maxcount = list.count;
+ else if (maxcount > list.count)
+ maxcount = list.count;
print_tag_header();
- for(i=0; i<list.count; i++)
+ for(i=0; i<maxcount; i++)
print_tag(list.refs[i]);
}
@@ -206,6 +210,6 @@ void cgit_print_summary()
html("<tr class='nohover'><td colspan='4'>&nbsp;</td></tr>");
cgit_print_branches();
html("<tr class='nohover'><td colspan='4'>&nbsp;</td></tr>");
- cgit_print_tags();
+ cgit_print_tags(cgit_summary_tags);
html("</table>");
}
an> Small bugfix 2008-01-18 r651@Devoty: necoro | 2008-01-18 02:41:51 +0100Necoro3-393/+513 adjust changelog and translation 2008-01-18 r643@Devoty: necoro | 2008-01-16 18:55:49 +0100Necoro14-249/+525 Fixed small bug in PackageTable.cb_package_revert_clicked r646@Devoty: necoro | 2008-01-18 00:12:30 +0100 Make tabpositions being configurable by the user r647@Devoty: necoro | 2008-01-18 01:38:19 +0100 Renamed 'shm' to '_shm' to not hide the global one r648@Devoty: necoro | 2008-01-18 01:38:29 +0100 Renamed 'shm' to '_shm' to not hide the global one r649@Devoty: necoro | 2008-01-18 02:34:43 +0100 Added update queues; general UI improvement 2008-01-14 r634@Devoty: necoro | 2008-01-14 23:48:24 +0100Necoro3-1/+4 Removed the broken plugins until they get replaced 2008-01-14 r632@Devoty: necoro | 2008-01-14 23:44:52 +0100Necoro3-175/+181 small changes 2008-01-14(no commit message)Necoro10-758/+1014 2008-01-14 r621@Devoty: necoro | 2008-01-14 20:21:40 +0100Necoro2-21/+61 adjust changelog r622@Devoty: necoro | 2008-01-14 21:01:11 +0100 Some new views 2008-01-14 r618@Devoty: necoro | 2008-01-14 20:19:05 +0100Necoro2-35/+57 An ALL category 2008-01-14 r617@Devoty: necoro | 2008-01-14 19:12:59 +0100Necoro2-10/+10 Remove unnecessairy loads of the shm module 2008-01-14 r609@Devoty: necoro | 2008-01-14 17:04:38 +0100Necoro9-394/+477 Allowed '-' and '_' in key names. Also use group names instead of their number. r610@Devoty: necoro | 2008-01-14 17:05:42 +0100 Disabled saving of the queues r611@Devoty: necoro | 2008-01-14 17:08:53 +0100 Added the possibility to permanently en-/disable plugins r612@Devoty: necoro | 2008-01-14 17:14:09 +0100 adjust changelog and translations r613@Devoty: necoro | 2008-01-14 17:40:53 +0100 Dropdown should be localized too 2008-01-14 r605@Devoty: necoro | 2008-01-14 11:43:34 +0100Necoro2-26/+129 Updated shm module to version 1.1.4 2008-01-14 r603@Devoty: necoro | 2008-01-14 11:30:26 +0100Necoro4-26/+38 Improved 'update world'; really support new use defaults 2008-01-11 r598@Devoty: necoro | 2008-01-10 16:36:29 +0100Necoro4-10/+50 Handle the new useflag format correctly 2008-01-11 r597@Devoty: necoro | 2008-01-10 14:12:35 +0100Necoro1-3/+3 updated todo 2008-01-10 r595@Devoty: necoro | 2008-01-10 04:04:15 +0100Necoro1-52/+3 Re-Introduced etc-proposals 2008-01-09 r586@Devoty: necoro | 2008-01-09 14:54:18 +0100Necoro1-1/+1 Disabled catapult till it is really usable 2007-12-06 r577@Devoty: necoro | 2007-12-06 20:37:36 +0100Necoro1-1/+1 Fixed desktop file 2007-12-06 r572@Devoty: necoro | 2007-11-28 08:48:15 +0100Necoro1-0/+1 2007-11-27 r570@Devoty: necoro | 2007-11-27 02:08:21 +0100Necoro3-84/+108 Added scrollbars to update window