main.tpl 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. {*
  2. * Main
  3. *
  4. * Main page template
  5. *
  6. * @author Christopher Han <xiphux@gmail.com>
  7. * @copyright Copyright (c) 2011 Christopher Han
  8. * @packge GitPHP
  9. * @subpackage Template
  10. *}
  11. <!DOCTYPE html>
  12. <html lang="{$currentprimarylocale}">
  13. <!-- gitphp web interface {$version}, (C) 2006-2011 Christopher Han <xiphux@gmail.com> -->
  14. <head>
  15. <title>
  16. {block name=title}
  17. {$pagetitle}
  18. {/block}
  19. </title>
  20. {block name=feeds}
  21. {/block}
  22. {block name=links}
  23. {/block}
  24. {if file_exists('css/gitphp.min.css')}
  25. <link rel="stylesheet" href="{$baseurl}/css/gitphp.min.css" type="text/css" />
  26. {else}
  27. <link rel="stylesheet" href="{$baseurl}/css/gitphp.css" type="text/css" />
  28. {/if}
  29. {if file_exists("css/$stylesheet.min.css")}
  30. <link rel="stylesheet" href="{$baseurl}/css/{$stylesheet}.min.css" type="text/css" />
  31. {else}
  32. <link rel="stylesheet" href="{$baseurl}/css/{$stylesheet}.css" type="text/css" />
  33. {/if}
  34. <link rel="stylesheet" href="{$baseurl}/css/ext/jquery.qtip.min.css" type="text/css" />
  35. {block name=css}
  36. {/block}
  37. {if $javascript}
  38. <script type="text/javascript">
  39. var require = {
  40. baseUrl: '{$baseurl}/js',
  41. paths: {
  42. jquery: [
  43. {if $googlejs}
  44. '//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min',
  45. {/if}
  46. 'ext/jquery-1.8.2.min'
  47. ],
  48. d3: 'ext/d3.v2.min',
  49. qtip: 'ext/jquery.qtip.min',
  50. modernizr: 'ext/modernizr.custom'
  51. },
  52. config: {
  53. 'modules/snapshotformats': {
  54. formats: {
  55. {foreach from=$snapshotformats key=format item=extension name=formats}
  56. "{$format}": "{$extension}"{if !$smarty.foreach.formats.last},{/if}
  57. {/foreach}
  58. }
  59. },
  60. {if $project}
  61. 'modules/getproject': {
  62. project: '{$project->GetProject()}'
  63. },
  64. {/if}
  65. {if $debug}
  66. 'common': {
  67. debug: true
  68. },
  69. {/if}
  70. 'modules/geturl': {
  71. baseurl: '{$baseurl}/'
  72. },
  73. 'modules/resources': {
  74. resources: {
  75. Loading: "{t escape='js'}Loading…{/t}",
  76. LoadingBlameData: "{t escape='js'}Loading blame data…{/t}",
  77. Snapshot: "{t escape='js'}snapshot{/t}",
  78. NoMatchesFound: '{t escape=no}No matches found for "%1"{/t}',
  79. UsernameLabel: "{t escape='js'}username:{/t}",
  80. PasswordLabel: "{t escape='js'}password:{/t}",
  81. Login: "{t escape='js'}login{/t}",
  82. AnErrorOccurredWhileLoggingIn: "{t escape='js'}An error occurred while logging in{/t}",
  83. LoginTitle: "{t escape='js'}Login{/t}",
  84. UsernameIsRequired: "{t escape='js'}Username is required{/t}",
  85. PasswordIsRequired: "{t escape='js'}Password is required{/t}"
  86. }
  87. }
  88. }
  89. };
  90. {block name=javascript}
  91. {if file_exists('js/common.min.js')}
  92. require.paths.common = 'common.min';
  93. {/if}
  94. require.deps = ['common'];
  95. {/block}
  96. </script>
  97. <script type="text/javascript" src="{$baseurl}/js/ext/require.js"></script>
  98. {/if}
  99. </head>
  100. <body>
  101. <div class="page_header">
  102. {if $loginenabled}
  103. <div class="login">
  104. {if $loggedinuser}
  105. <a href="{geturl action=logout}" />{t 1=$loggedinuser}logout %1{/t}</a>
  106. {else if $action == 'login'}
  107. {t}login{/t}
  108. {else}
  109. <a href="{geturl action=login}" class="loginLink" />{t}login{/t}</a>
  110. {/if}
  111. </div>
  112. {/if}
  113. {if $supportedlocales}
  114. <div class="lang_select">
  115. <form action="{$requesturl}" method="get" id="frmLangSelect">
  116. <div>
  117. {foreach from=$requestvars key=var item=val}
  118. {if $var != "l"}
  119. <input type="hidden" name="{$var}" value="{$val|escape}" />
  120. {/if}
  121. {/foreach}
  122. <label for="selLang">{t}language:{/t}</label>
  123. <select name="l" id="selLang">
  124. {foreach from=$supportedlocales key=locale item=language}
  125. <option {if $locale == $currentlocale}selected="selected"{/if} value="{$locale}">{if $language}{$language} ({$locale}){else}{$locale}{/if}</option>
  126. {/foreach}
  127. </select>
  128. <input type="submit" value="{t}set{/t}" id="btnLangSet" />
  129. </div>
  130. </form>
  131. </div>
  132. {/if}
  133. {block name=header}
  134. <a href="{geturl}">{if $homelink}{$homelink}{else}{t}projects{/t}{/if}</a> /
  135. {/block}
  136. </div>
  137. {block name=main}
  138. {/block}
  139. <div class="page_footer">
  140. {block name=footer}
  141. {/block}
  142. </div>
  143. <div class="attr_footer">
  144. <a href="http://www.gitphp.org/" target="_blank">GitPHP by Chris Han</a>
  145. </div>
  146. </body>
  147. </html>