show the edit links only when the user is logged in
authorChristian Thaeter <ct@pipapo.org>
Sun, 10 Feb 2008 03:53:35 +0000 (04:53 +0100)
committerChristian Thaeter <ct@pipapo.org>
Sun, 10 Feb 2008 03:53:35 +0000 (04:53 +0100)
src/object_blob.c
src/object_tree.c

index 3e14e57..10d72a1 100644 (file)
@@ -43,12 +43,13 @@ webgit_object_blob_menu_action (struct webgit_repo_info* repo, unsigned char* sh
                // TODO: "blame <br />",
                // TODO: "Back to tree <br />",
                // TODO: ,
+               query->ssign ?
                webgit_object_link (query, html ("Edit <br />"),
                                    "repo", query->repo,
                                    "ref", query->head,
                                    "commit", query->commit,
                                    "path", query->path,
-                                   "action", "edit"),
+                                   "action", "edit") : html (),
                webgit_object_tree_parent_link (query, "<<%s"),
                webgit_summary_link (query, repo, html("Summary")), "<br />",
                webgit_main_link (query, html ("Main"))
index 7dccffd..36ce101 100644 (file)
@@ -174,13 +174,16 @@ webgit_html_tree (const unsigned char *sha1, const char *base, int baselen,
                                                               "commit", query_in_flight->commit,
                                                               "path", pathname,
                                                               "action", "raw"),
-                                          " ",
-                                          webgit_object_link (query_in_flight, html ("Edit <br />"),
-                                                              "repo", query_in_flight->repo,
-                                                              "ref", query_in_flight->head,
-                                                              "commit", query_in_flight->commit,
-                                                              "path", pathname,
-                                                              "action", "edit")
+                                          query_in_flight->ssign ?
+                                          html (
+                                                " ",
+                                                webgit_object_link (query_in_flight, html ("edit"),
+                                                                    "repo", query_in_flight->repo,
+                                                                    "ref", query_in_flight->head,
+                                                                    "commit", query_in_flight->commit,
+                                                                    "path", pathname,
+                                                                    "action", "edit")
+                                                ) : html ()
                                           )
                                     ),
                               html_nl()