diff --git a/app/controllers/BaseController.go b/app/controllers/BaseController.go index 573f373..34e0862 100644 --- a/app/controllers/BaseController.go +++ b/app/controllers/BaseController.go @@ -154,7 +154,7 @@ func (c BaseController) E404() revel.Result { } // 设置本地 -func (c BaseController) SetLocale() { +func (c BaseController) SetLocale() string { locale := string(c.Request.Locale) // zh-CN lang := locale if strings.Contains(locale, "-") { @@ -165,6 +165,7 @@ func (c BaseController) SetLocale() { lang = "en"; } c.RenderArgs["locale"] = lang; + return lang } // 设置userInfo diff --git a/app/controllers/IndexController.go b/app/controllers/IndexController.go index 27836b6..9f39cf0 100644 --- a/app/controllers/IndexController.go +++ b/app/controllers/IndexController.go @@ -17,9 +17,9 @@ func (c Index) Index() revel.Result { c.SetUserInfo() c.RenderArgs["title"] = "leanote" c.RenderArgs["openRegister"] = openRegister - c.SetLocale() + lang := c.SetLocale() - return c.RenderTemplate("home/index.html"); + return c.RenderTemplate("home/index_" + lang + ".html"); } // 建议 diff --git a/app/views/Home/footer.html b/app/views/Home/footer.html index c9e594f..7aefd36 100644 --- a/app/views/Home/footer.html +++ b/app/views/Home/footer.html @@ -15,6 +15,8 @@ <i class="fa fa-globe fa-3x icon-muted"></i> <h2>Join Us</h2> <a href="https://github.com/leanote/leanote">github leanote</a> + <br /> + QQ Group: 158716820 </div> </div> </div> diff --git a/app/views/Home/header.html b/app/views/Home/header.html index 146db1d..915b7d5 100644 --- a/app/views/Home/header.html +++ b/app/views/Home/header.html @@ -47,8 +47,11 @@ function log(o) { <ul id="blogNav" class="pull-right"> <li><a href="/index#" target="body" class="smooth-scroll">{{msg . "home"}}</a></li> + <!-- <li><a href="/index#aboutLeanote" target="#aboutLeanote" class="smooth-scroll">{{msg . "aboutLeanote"}}</a> </li> + --> <li><a href="/index#download" target="#download" class="smooth-scroll">{{msg . "download"}}</a> </li> + <li><a href="/index#donate" target="#donate" class="smooth-scroll">{{msg . "donate"}}</a> </li> <li><a id="leanoteBlog" href="http://leanote.com/blog/leanote" target="_blank" class="">{{msg . "leanoteBlog"}}</a></li> <li style="position: relative; margin-right: 3px;"> <a href="http://bbs.leanote.com" target="_blank" class="">{{msg . "discussion"}}</a> diff --git a/app/views/Home/index.html b/app/views/Home/index.html index a67264f..b7fcb4d 100644 --- a/app/views/Home/index.html +++ b/app/views/Home/index.html @@ -66,14 +66,48 @@ <h2 style="margin: 20px 0;text-align: center;">{{msg . "download"}}</h2> <div class="row"> <div style="width:300px; margin:auto; padding: 10px;"> - Linux: <a href="https://github.com/leanote/leanote/releases/download/0.4/leanote-linux-v0.4.bin.tar.gz">leanote-linux-v0.4.bin.tar.gz</a> <br /> - MacOS X: <a href="https://github.com/leanote/leanote/releases/download/0.4/leanote-mac-v0.4.bin.tar.gz">leanote-mac-v0.4.bin.tar.gz</a> <br /> + Linux : <a href="https://github.com/leanote/leanote/releases/download/0.4/leanote-linux-v0.4.bin.tar.gz">leanote-linux-v0.4.bin.tar.gz</a> <br /> + MacOS X : <a href="https://github.com/leanote/leanote/releases/download/0.4/leanote-mac-v0.4.bin.tar.gz">leanote-mac-v0.4.bin.tar.gz</a> <br /> <br /> <a href="https://github.com/leanote/leanote#3-how-to-install-leanote">{{msg . "howToInstallLeanote"}}</a> </div> </div> </div> +<div class="container" id="donate"> + <h2 style="margin: 20px 0;text-align: center;">{{msg . "donate"}}</h2> + <div class="row"> + <div style="width:500px; margin:auto; padding: 10px;"> + <p> + 您可以通过支付宝向leanote捐赠, 所捐赠的钱将用来leanote开发. + </p> + <p> + 支付宝账号: <b>pay@leanote.com</b> + </p> + <p> + 或使用支付宝扫以下二维码捐赠: + </p> + <p style="text-align: center"> + <img src="/images/leanote/leanote_alipay.jpg" style="padding: 10px; +border: 2px solid #eee; +border-radius: 10px;"/> + </p> + <p> + 我们会定期将捐赠名单发布在 <a href="http://leanote.com/blog/view/5417ecf81a910828fd000000">捐赠列表</a> + </p> + <p> + 感谢您对leanote的支持! + </p> + + <hr /> + + <p> + 有任何疑问, 建议或需其它服务或支持, 欢迎联系 <code>leanote@leanote.com</code> 或加入官方QQ群: <code>158716820</code> 谢谢! + </p> + </div> + </div> +</div> + {{template "home/footer.html"}} <script src="/js/jquery-1.9.0.min.js"></script> diff --git a/app/views/Home/index_en.html b/app/views/Home/index_en.html new file mode 100644 index 0000000..ac17e51 --- /dev/null +++ b/app/views/Home/index_en.html @@ -0,0 +1,140 @@ +{{template "home/header.html" .}} +<style> + +</style> +<section> + <div class="header"> + <h2>leanote, {{msg . "moto"}}</h2> + <p>{{msg . "moto3"}}</p> + <p> + Knowledge, Blog, Sharing, Cooperation... all in leanote + </p> + + <div> + <a class="btn btn-primary" href="https://github.com/leanote/leanote">{{msg . "fork github"}}</a> + + + <a class="btn btn-default" href="/demo">{{msg . "try"}}</a> + {{if .openRegister}} + + + OR + + + <a class="btn btn-default" href="/register">{{msg . "register"}}</a> + {{end}} + </div> + </div> + + <div class="preview" style="position: relative;"> + <div> + <div class="img-header"> + <img src="/images/home/mac-btns.png"/> + </div> + <img src="/images/home/preview2.png" style="width: 750px;" /> + </div> + <div class="mobile"> + <div class="mobile-header"> + <img src="/images/home/mac-dot.png" /> + </div> + <img class="mobile-image" src="/images/home/mobile.png" /> + </div> + </div> +</section> + +<div class="container" id="aboutLeanote"> + <h2>{{msg . "aboutLeanote"}}</h2> + <div class="row"> + <div class="col-md-3"> + <h3>{{msg . "knowledge"}}</h3> + <p>{{msg . "knowledgeInfo"}}</p> + </div> + <div class="col-md-3"> + <h3>{{msg . "share"}}</h3> + <p>{{msg . "shareInfo"}}</p> + </div> + <div class="col-md-3"> + <h3>{{msg . "cooperation"}}</h3> + <p>{{msg . "cooperationInfo"}}</p> + </div> + <div class="col-md-3"> + <h3>{{msg . "blog"}}</h3> + <p>{{msg . "blogInfo"}}</p> + </div> + </div> +</div> + +<hr /> + +<div class="container" id="download"> + <h2 style="margin: 20px 0;text-align: center;">{{msg . "download"}}</h2> + <div class="row"> + <div style="width:300px; margin:auto; padding: 10px;"> + Linux : <a href="https://github.com/leanote/leanote/releases/download/0.4/leanote-linux-v0.4.bin.tar.gz">leanote-linux-v0.4.bin.tar.gz</a> <br /> + MacOS X : <a href="https://github.com/leanote/leanote/releases/download/0.4/leanote-mac-v0.4.bin.tar.gz">leanote-mac-v0.4.bin.tar.gz</a> <br /> + <br /> + <a href="https://github.com/leanote/leanote#3-how-to-install-leanote">{{msg . "howToInstallLeanote"}}</a> + </div> + </div> +</div> + +<hr /> + +<div class="container" id="donate"> + <h2 style="margin: 20px 0;text-align: center;">{{msg . "donate"}}</h2> + <div class="row"> + <div style="width:500px; margin:auto; padding: 10px;"> + <p> + You can use <a href="http://alipay.com">alipay</a> to donate us, The donated money will be used to develop leanote. + </p> + <p> + Alipay Account: <b>pay@leanote.com</b> + </p> + <p> + Or you can use alipay app to scan the code to donate us: + </p> + <p style="text-align: center"> + <img src="/images/leanote/leanote_alipay.jpg" style="padding: 10px; +border: 2px solid #eee; +border-radius: 10px; width: 200px;"/> + </p> + <p> + The donation list will be published at <a href="http://leanote.com/blog/view/5417ecf81a910828fd000000">Donation List</a> + </p> + <p> + Thanks for your support! + </p> + + <hr /> + <p> + Any questions, suggestions or need more supports, you are welcomed to contact us via <code>leanote@leanote.com</code> or the QQ Group <code>158716820</code> Thanks! + </p> + </div> + </div> +</div> + +{{template "home/footer.html"}} + +<script src="/js/jquery-1.9.0.min.js"></script> +<script src="/js/bootstrap.js"></script> + +<script> +$(function() { + /* + var u = navigator.userAgent; + var isMobile = u.indexOf('Android')>-1 || u.indexOf('Linux')>-1; + if(isMobile || $("body").width() < 600) { + location.href = "/mobile/index"; + } + */ + // 平滑滚动 + $(".smooth-scroll").click(function(e) { + e.preventDefault(); + var t = $(this).attr("target"); + var targetOffset = $(t).offset().top - 80; + $('html,body').animate({scrollTop: targetOffset}, 300); + }); +}); +</script> +</body> +</html> \ No newline at end of file diff --git a/app/views/Home/index_zh.html b/app/views/Home/index_zh.html new file mode 100644 index 0000000..4dae8ff --- /dev/null +++ b/app/views/Home/index_zh.html @@ -0,0 +1,139 @@ +{{template "home/header.html" .}} +<style> + +</style> +<section> + <div class="header"> + <h2>leanote, {{msg . "moto"}}</h2> + <p>{{msg . "moto3"}}</p> + <p>{{msg . "moto2"}}</p> + + <div> + <a class="btn btn-primary" href="https://github.com/leanote/leanote">{{msg . "fork github"}}</a> + + + <a class="btn btn-default" href="/demo">{{msg . "try"}}</a> + {{if .openRegister}} + + + OR + + + <a class="btn btn-default" href="/register">{{msg . "register"}}</a> + {{end}} + </div> + </div> + + <div class="preview" style="position: relative;"> + <div> + <div class="img-header"> + <img src="/images/home/mac-btns.png"/> + </div> + <img src="/images/home/preview2.png" style="width: 750px;" /> + </div> + <div class="mobile"> + <div class="mobile-header"> + <img src="/images/home/mac-dot.png" /> + </div> + <img class="mobile-image" src="/images/home/mobile.png" /> + </div> + </div> +</section> + +<div class="container" id="aboutLeanote"> + <h2>{{msg . "aboutLeanote"}}</h2> + <div class="row"> + <div class="col-md-3"> + <h3>{{msg . "knowledge"}}</h3> + <p>{{msg . "knowledgeInfo"}}</p> + </div> + <div class="col-md-3"> + <h3>{{msg . "share"}}</h3> + <p>{{msg . "shareInfo"}}</p> + </div> + <div class="col-md-3"> + <h3>{{msg . "cooperation"}}</h3> + <p>{{msg . "cooperationInfo"}}</p> + </div> + <div class="col-md-3"> + <h3>{{msg . "blog"}}</h3> + <p>{{msg . "blogInfo"}}</p> + </div> + </div> +</div> + +<hr /> + +<div class="container" id="download"> + <h2 style="margin: 20px 0;text-align: center;">{{msg . "download"}}</h2> + <div class="row"> + <div style="width:300px; margin:auto; padding: 10px;"> + Linux : <a href="https://github.com/leanote/leanote/releases/download/0.4/leanote-linux-v0.4.bin.tar.gz">leanote-linux-v0.4.bin.tar.gz</a> <br /> + MacOS X : <a href="https://github.com/leanote/leanote/releases/download/0.4/leanote-mac-v0.4.bin.tar.gz">leanote-mac-v0.4.bin.tar.gz</a> <br /> + <br /> + <a href="https://github.com/leanote/leanote#3-how-to-install-leanote">{{msg . "howToInstallLeanote"}}</a> + </div> + </div> +</div> + +<hr /> + +<div class="container" id="donate"> + <h2 style="margin: 20px 0;text-align: center;">{{msg . "donate"}}</h2> + <div class="row"> + <div style="width:500px; margin:auto; padding: 10px;"> + <p> + 您可以通过<a href="http://alipay.com">支付宝</a>向leanote捐赠, 所捐赠的款项将用于开发leanote. + </p> + <p> + 支付宝账号: <b>pay@leanote.com</b> + </p> + <p> + 或使用支付宝扫以下二维码捐赠: + </p> + <p style="text-align: center"> + <img src="/images/leanote/leanote_alipay.jpg" style="padding: 10px; +border: 2px solid #eee; +border-radius: 10px; width: 200px;"/> + </p> + <p> + 我们会定期将捐赠名单发布在 <a href="http://leanote.com/blog/view/5417ecf81a910828fd000000">捐赠列表</a> + </p> + <p> + 感谢您对leanote的支持! + </p> + + <hr /> + + <p> + 有任何疑问, 建议或需其它服务或支持, 欢迎联系 <code>leanote@leanote.com</code> 或加入官方QQ群: <code>158716820</code> 谢谢! + </p> + </div> + </div> +</div> + +{{template "home/footer.html"}} + +<script src="/js/jquery-1.9.0.min.js"></script> +<script src="/js/bootstrap.js"></script> + +<script> +$(function() { + /* + var u = navigator.userAgent; + var isMobile = u.indexOf('Android')>-1 || u.indexOf('Linux')>-1; + if(isMobile || $("body").width() < 600) { + location.href = "/mobile/index"; + } + */ + // 平滑滚动 + $(".smooth-scroll").click(function(e) { + e.preventDefault(); + var t = $(this).attr("target"); + var targetOffset = $(t).offset().top - 80; + $('html,body').animate({scrollTop: targetOffset}, 300); + }); +}); +</script> +</body> +</html> \ No newline at end of file diff --git a/messages/msg.en b/messages/msg.en index 15059da..ee2b8aa 100644 --- a/messages/msg.en +++ b/messages/msg.en @@ -134,6 +134,7 @@ howToInstallLeanote=How to install leanote # attachments = Attachments +donate = Donate # error notFound=This page cann't found. diff --git a/messages/msg.zh b/messages/msg.zh index b68bf78..ca7e96b 100644 --- a/messages/msg.zh +++ b/messages/msg.zh @@ -138,6 +138,7 @@ howToInstallLeanote=leanote安装步骤 # attachments = 附件 +donate = 捐赠 # 必须要加这个, 奇怪 diff --git a/public/images/leanote/leanote_alipay.jpg b/public/images/leanote/leanote_alipay.jpg new file mode 100644 index 0000000..6614288 Binary files /dev/null and b/public/images/leanote/leanote_alipay.jpg differ