Commit Graph

34 Commits

Author SHA1 Message Date
Lars Hjemli
eb45342e73 cgit_print_snapshot_links: use url to specify snapshot name
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-07-23 00:27:32 +02:00
Lars Hjemli
1d4aaff696 Merge branch 'master' of git://git.klever.net/patchwork/cgit
* 'master' of git://git.klever.net/patchwork/cgit:
  link raw blob from tree file view
  fix: changed view link to blob in summary.
  allow selective enabling of snapshots
  shorten snapshot names to repo basename
  introduce cgit_repobasename
  added snapshot filename to the link
  add plain uncompressed tar snapshort format
  introduced .tar.bz2 snapshots
  compress .tar.gz using gzip as a filter
  added a chk_non_negative check
  css: adjust vertical-align of commit info th cells
  add support for snapshot tarballs

Conflicts:

	ui-summary.c

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-07-22 23:57:56 +02:00
Lars Hjemli
4e9107abfe Add ui-tag.c
This file implements the tag-command, i.e. printing of annotated tags.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-07-22 23:44:57 +02:00
Michael Krelin
1cb8bedf1e introduce cgit_repobasename
that shortens reponame stripping any directories and .git suffixes, that is
 turning 'dir/repo.git/' or 'dir/repo/.git/' or alikes into mere 'repo'.

Signed-off-by: Michael Krelin <hacker@klever.net>
2007-07-21 15:24:07 +02:00
Michael Krelin
0df096f6e1 added snapshot filename to the link
- changed cgit_pageurl into cgit_fileurl with the filename parameter
 - rewritten cgit_pageurl as a wrapper around cgit_fileurl

Signed-off-by: Michael Krelin <hacker@klever.net>
2007-07-21 13:13:40 +02:00
Lars Hjemli
16a3d2779c Merge branch 'lh/menu'
* lh/menu:
  Add ofs argument to cgit_log_link and use it in ui-log.c
  Add trim_end() and use it to remove trailing slashes from repo paths
  Do not include current path in the "tree" menu link
  Add setting to enable/disable extra links on index page
  Change S/L/T to summary/log/tree
  Change "files" to "tree"
  Include querystring as part of cached filename for repo summary page
  Add more menuitems on repo pages
2007-06-29 20:32:08 +02:00
Lars Hjemli
103940fe6b Add ofs argument to cgit_log_link and use it in ui-log.c
This fixes a bug in the prev/next links on the log page: when on the default
branch the links to prev/next page would contain h=(null).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-06-29 20:31:00 +02:00
Lars Hjemli
42e459bb1f Do not include current path in the "tree" menu link
When generating the menu links on repo pages the tree link included the
current path. This made the link pretty useless whenever the current path
was set so this commit just passes NULL instead.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-06-26 17:32:08 +02:00
Lars Hjemli
1f34fb9d4f Change "files" to "tree"
This renames the menu link and the shortcut on the repo index page from
the strange "files" to the more gittish "tree".

Suggested-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-06-18 22:06:00 +02:00
Lars Hjemli
f69250358a Add version info from git-describe
A new script, gen-version.sh, is now invoked from 'make version' to generate
the file VERSION. This file contains a version identifier generated by
git-describe and is included in the Makefile.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-06-18 10:38:40 +02:00
Lars Hjemli
b8be028a30 Add more menuitems on repo pages
In an attempt to get better usability, a set of 'semistatic' menuitems
are added to the page header on all pages except the repository index.

The menuitems (summary, log, files, commit and diff) honours the current
branch and revision. To switch the current branch one can use the branch
links on the summary page.

The backlink to the repository index page is now available by clicking
the static page heading.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-06-18 08:29:53 +02:00
Lars Hjemli
4a0be58666 Add cgit_diff_link()
This adds a new function used to generate links to the diff page and uses
it everywhere such links appear (expect for single files in the diffstat
displayed on the commit page: this is now a link to the tree page).

The updated diff-page now expects zero, one or two revision specifiers, in
parameters head, id and id2. Id defaults to head unless otherwise specified,
while head (as usual) defaults to repo.defbranch. If id2 isn't specified, it
defaults to the first parent of id1.

The most important change is of course that now all repo pages (summary, log,
tree, commit and diff) has support for passing on the current branch and
revision, i.e. the road is now open for a 'static' menu with links to all
of these pages.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-06-17 18:12:03 +02:00
Lars Hjemli
42a7eb9c73 Add cgit_commit_link() + support for id=sha1 to commit view
This adds a function to generate links to the commit page and extends said
page to use id from querystring as primary revision specified (fallback to
h).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-06-17 14:53:02 +02:00
Lars Hjemli
48c487d72d Add git_log_link() and fix bug in generic repolink function
The generic repolink function compared head with cgit_query_head, which
almost always would be the same pointer. The test now compares with
repo.defbranch, which is the wanted behavour.

Bug discovered while adding cgit_log_link(), so this commit also contain
that change.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-06-17 13:57:51 +02:00
Lars Hjemli
486c87ec29 ui-shared: use strcmp() to compare strings
Somehow a couple of pointer comparisions crept into the new repolink()
and cgit_tree_link() functions. Fix it.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-06-17 12:58:59 +02:00
Lars Hjemli
44947bfcdc Add and use cgit_tree_link()
This creates a new function used to generate links to 'tree' page and uses
the function everywhere a link to the 'tree' page is generated.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-06-17 01:39:05 +02:00
Ondrej Jirman
1a63cfcc3d Use &amp; instead of & in URLs.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-31 10:18:38 +02:00
Lars Hjemli
7dc99a4bbb Bad html: it's nice to add alt-attributes
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-24 00:08:36 +02:00
Lars Hjemli
ef473df0b3 Bad html: <form> should have an action-attribute
Don't know how the href-attribute got in there...

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-24 00:06:25 +02:00
Lars Hjemli
5db39170b6 Add cgit_print_age() function
This function can be used to print relative dates, just as in gitweb. Next
step will be to actually use the new function.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-22 23:12:41 +02:00
Lars Hjemli
30ccdcaa74 Enable url=value querystring parameter
This makes is possible to use repo-urls like '/pub/scm/git/git.git' and
even add path specifications, like '/pub/scm/git/git.git/log/documentation'.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-18 22:51:01 +02:00
Lars Hjemli
723469962b Make git_pageurl handle NULL querystrings
This is suddenly useful after the repo.defbranch-related changes.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-16 02:06:28 +02:00
Lars Hjemli
ea2831f1c8 Don't hardcode urls when SCRIPT_NAME is available
Also, let the makefile define the name of the installed cgi and
use that definition as a default value for cgit_script_name variable.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-15 00:48:31 +02:00
Lars Hjemli
6fb7d09fea ui-shared.c: fix whitespace breakage
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-15 00:22:17 +02:00
Lars Hjemli
66cacd053b Layout update 2007-02-21 00:24:36 +01:00
Lars Hjemli
ab2ab95f09 Add support for snapshots
Make a link from the commit viewer to a snapshot of the corresponding tree.

Currently only zip-format is supported.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-02-08 13:58:58 +01:00
Lars Hjemli
bb3e7950c3 Fix search for non-virtual urls
When cgit don't use virtual urls, the current repo and page
url parameters must be included in the search form as hidden
input fields.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-02-03 13:10:26 +01:00
Lars Hjemli
8596cda71d Change global document layout
Use a document-wide table for the main layout

Signed-off-by: Lars Hjemli <larsh@slaptop.hjemli.net>
2007-01-28 11:33:55 +01:00
Lars Hjemli
f98e72684b Use long instead of int when converting from TTL to seconds
Just to be really, really sure about embarrasing overflow settings

Signed-off-by: Lars Hjemli <larsh@hal-2004.(none)>
2007-01-05 18:20:23 +01:00
Lars Hjemli
e39d738c39 Add generic support for search box in page header
This adds the ability to show a search box in any pageheader with correct href and
hidden form data, but does not enable the box on any pages.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-28 02:01:49 +01:00
Lars Hjemli
0de2055b75 Make repo header a link to summary page
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-16 00:49:37 +01:00
Lars Hjemli
148fb9622c Move cgit_print_date into ui-shared, reuse in ui-summary
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-16 00:33:28 +01:00
Lars Hjemli
74620f12e4 Move functions for repolist output into ui-repolist.c
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-11 16:49:18 +01:00
Lars Hjemli
5a106eb09b Move common output-functions into ui-shared.c
While at it, replace the cgit_[lib_]error constants with a proper function

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-11 16:38:30 +01:00