Matthew Marshall avatar Matthew Marshall committed e1cfbf4

Added short help for pushing for the first time.

Comments (0)

Files changed (6)

hgtemplates/freehg/summary.tmpl

-
-<div class="page_header">
-<form action="{url}log">
-    {sessionvars%hiddenformentry}
-    <div class="search">
-        Search: <input type="text" name="rev"  />
-    </div>
-    </form>
-    <h2><a href="{url}">#repo|escape#</a> / summary</h2>
-</div>
-        
-<div class="page_nav">
-    summary |
-    <a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
-    <a href="{url}log{sessionvars%urlparameter}">changelog</a> |
-    <a href="{url}tags{sessionvars%urlparameter}">tags</a> |
-    <a href="{url}file/#node|short#{sessionvars%urlparameter}">manifest</a>#archives%archiveentry#
-     | <a href="{url}edit/">edit</a><br/>
-</div>
 
 <dl>
     <dt>description</dt><dd>#desc#</dd>

htdocs/static/freehg.css

 div.page_body .linenr {color:#555; padding-right:2px;}
 
 .box {background-color:#d9d9d9;}
+p.box {width:390px;}
+code {color:#555}
 
 dd p {margin:0pt;}
 def summary(request, username, reponame):
     repo = get_object_or_404(Repo, name=reponame, owner__username=username)
     hgrepo = hg.repository(ui.ui(), repo.file_path)
+    has_tip = hgrepo.changelog.tip() != '\x00'*20
     from mercurial.hgweb.hgweb_mod import hgweb
     from mercurial.hgweb.common import style_map
     from mercurial import templater
     return render_to_response('repos/summary.html',
         dict(
             repo=repo,
+            has_tip=has_tip,
             content=u''.join(content),
         ), context_instance=RequestContext(request)
     )

templates/about.html

 <p>I sit down to write an About page and get stage fright.  (I'll never make it as a concert pianist!)</p>
 
 <p>If you have any questions, comments, or suggestions about this site, I would love to hear from you. <a href="http://matthewmarshall.org/contact/">My email address etc. is here.</a></p>
+<p>No quack.</p>
 </div>
 
 {% endblock %}

templates/frontpage.html

             var elem = $('<a href="#" class="showmore" style="display:block;margin-bottom:12px;>Show more options</'+'a>').click(function(){
                 $(this).hide();
                 $(this).siblings('.form-row:hidden').show();
+                return false;
             });
             if ($(this).children('.more-options-placeholder')){
                 $(this).children('.more-options-placeholder').replaceWith(elem);

templates/repos/summary.html

 {% block title %}{{repo.get_long_name}} summary{% endblock %}
 
 {% block content %}
-{{content|safe}}
+
+<div class="page_header">
+<form action="{{repo.get_absolute_url}}log">
+    <div class="search">
+        Search: <input type="text" name="rev"  />
+    </div>
+    </form>
+    <h2><a href="{{repo.get_absolute_url}}">{{repo.get_long_name}}</a> / summary</h2>
+</div>
+        
+<div class="page_nav">
+    summary |
+    <a href="{{repo.get_absolute_url}}shortlog{sessionvars%urlparameter}">shortlog</a> |
+    <a href="{{repo.get_absolute_url}}log{sessionvars%urlparameter}">changelog</a> |
+    <a href="{{repo.get_absolute_url}}tags{sessionvars%urlparameter}">tags</a> |
+    <a href="{{repo.get_absolute_url}}file/#node|short#{sessionvars%urlparameter}">manifest</a>{% comment %}FIXME: put links to archives here.{% endcomment %}
+     | <a href="{{repo.get_absolute_url}}edit/">edit</a><br/>
+</div>
+
+
+    {% if not has_tip %}
+
+        <p class="box">
+            This repository doesn't have any changesets.  You can push changes from your local repository like this:<br />
+            <code>
+hg push http://freehg.org{{repo.get_absolute_url}}</code>
+        </p>
+    {% endif %}
+
+    {{content|safe}}
+
+
 {% comment %}<div class="page-nav">
 summary |
 <a href="{{repo.get_absolute_url}}shortlog/">shortlog</a> |
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.