From be1b40802dcbfd59ecdd3c7439fc48d6cec97e2b Mon Sep 17 00:00:00 2001 From: randx Date: Fri, 6 Jul 2012 03:05:12 +0300 Subject: [PATCH] Api page in help --- app/assets/stylesheets/gitlab_bootstrap.scss | 34 ++++++++++++++++++++++++++++++++++ app/views/help/api.html.haml | 41 +++++++++++++++++++++++++++++++++++++++++ app/views/help/index.html.haml | 3 +++ config/routes.rb | 1 + 4 files changed, 79 insertions(+), 0 deletions(-) create mode 100644 app/views/help/api.html.haml diff --git a/app/assets/stylesheets/gitlab_bootstrap.scss b/app/assets/stylesheets/gitlab_bootstrap.scss index 1b86cdd..4f1ffa3 100644 --- a/app/assets/stylesheets/gitlab_bootstrap.scss +++ b/app/assets/stylesheets/gitlab_bootstrap.scss @@ -634,3 +634,37 @@ pre.logs { line-height:18px; } } + +/** + * File content holder + * + */ +.file_holder { + border:1px solid #CCC; + margin-bottom:1em; + -moz-box-shadow: 0 0 3px #ddd; + -webkit-box-shadow: 0 0 3px #ddd; + box-shadow: 0 0 3px #ddd; + + .file_title { + border-bottom: 1px solid #bbb; + background:#eee; + background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #eee), to(#dfdfdf)); + background-image: -webkit-linear-gradient(#eee 6.6%, #dfdfdf); + background-image: -moz-linear-gradient(#eee 6.6%, #dfdfdf); + background-image: -o-linear-gradient(#eee 6.6%, #dfdfdf); + margin: 0; + font-weight: normal; + font-weight: bold; + text-align: left; + color: #666; + padding: 9px 10px; + height:18px; + + } + .file_content { + &.wiki { + padding:20px; + } + } +} diff --git a/app/views/help/api.html.haml b/app/views/help/api.html.haml new file mode 100644 index 0000000..008e06d --- /dev/null +++ b/app/views/help/api.html.haml @@ -0,0 +1,41 @@ +%h3 API +.back_link + = link_to help_path do + ← to index +%hr + +%ol + %li + %a{:href => "#README"} README + %li + %a{:href => "#Projects"} Projects + %li + %a{:href => "#Users"} Users + +.file_holder#README + .file_title + %i.icon-file + README + .file_content.wiki + = preserve do + = markdown File.read(Rails.root.join("doc", "api", "README.md")) + +%br + +.file_holder#projects + .file_title + %i.icon-file + Projects + .file_content.wiki + = preserve do + = markdown File.read(Rails.root.join("doc", "api", "projects.md")) + +%br + +.file_holder#users + .file_title + %i.icon-file + Users + .file_content.wiki + = preserve do + = markdown File.read(Rails.root.join("doc", "api", "users.md")) diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml index 25b9e3e..b6c5271 100644 --- a/app/views/help/index.html.haml +++ b/app/views/help/index.html.haml @@ -22,3 +22,6 @@ %li %h5= link_to "Web Hooks", help_web_hooks_path + + %li + %h5= link_to "API", help_api_path diff --git a/config/routes.rb b/config/routes.rb index af99109..3b33ed8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -26,6 +26,7 @@ Gitlab::Application.routes.draw do get 'help' => 'help#index' get 'help/permissions' => 'help#permissions' get 'help/workflow' => 'help#workflow' + get 'help/api' => 'help#api' get 'help/web_hooks' => 'help#web_hooks' # -- libgit2 0.21.2