From 6a58deb53630de59fc05d2dacd272463901c42d8 Mon Sep 17 00:00:00 2001 From: randx Date: Sun, 1 Jul 2012 00:35:24 +0300 Subject: [PATCH] UI changes: * .page_title class added. Used for better page headers * improved help page * added back links for help pages * show app version & revision on help page --- app/assets/stylesheets/gitlab_bootstrap.scss | 25 +++++++++++++++++++++++++ app/views/commits/_commit_box.html.haml | 2 +- app/views/dashboard/issues.html.haml | 3 ++- app/views/dashboard/merge_requests.html.haml | 2 +- app/views/help/index.html.haml | 15 +++++++++++---- app/views/help/permissions.html.haml | 3 +++ app/views/help/web_hooks.html.haml | 12 ++++++++++-- app/views/help/workflow.html.haml | 3 +++ app/views/hooks/_data_ex.html.erb | 3 ++- app/views/issues/index.html.haml | 2 +- app/views/issues/show.html.haml | 2 +- app/views/keys/index.html.haml | 7 +++++-- app/views/keys/show.html.haml | 2 +- app/views/merge_requests/index.html.haml | 2 +- app/views/merge_requests/show/_mr_title.html.haml | 2 +- app/views/milestones/index.html.haml | 2 +- app/views/profile/password.html.haml | 5 ++--- app/views/profile/show.html.haml | 2 +- app/views/profile/token.html.haml | 11 ++++++----- app/views/projects/graph.html.haml | 2 +- app/views/projects/team.html.haml | 6 ++---- config/initializers/gitlab/10_app.rb | 4 ++++ config/initializers/gitlab/20_grit_ext.rb | 28 ++++++++++++++++++++++++++++ config/initializers/gitlab/30_resque_queues.rb | 1 + config/initializers/gitlabhq/20_grit_ext.rb | 28 ---------------------------- config/initializers/gitlabhq/30_resque_queues.rb | 1 - 26 files changed, 114 insertions(+), 61 deletions(-) create mode 100644 config/initializers/gitlab/10_app.rb create mode 100644 config/initializers/gitlab/20_grit_ext.rb create mode 100644 config/initializers/gitlab/30_resque_queues.rb delete mode 100644 config/initializers/gitlabhq/20_grit_ext.rb delete mode 100644 config/initializers/gitlabhq/30_resque_queues.rb diff --git a/app/assets/stylesheets/gitlab_bootstrap.scss b/app/assets/stylesheets/gitlab_bootstrap.scss index c4491b3..087db6b 100644 --- a/app/assets/stylesheets/gitlab_bootstrap.scss +++ b/app/assets/stylesheets/gitlab_bootstrap.scss @@ -281,6 +281,7 @@ table.no-borders { font-size:13px; background: #474D57; color:#fff; + font-weight:bold; font-family: monospace; } } @@ -590,3 +591,27 @@ ul.breadcrumb { border-top:1px solid #eee; } } + +input[type=text] { + &.large_text { + padding:6px; + font-size:16px; + } +} + +p { + &.slead { + color:#456; + font-size:16px; + margin-bottom: 12px; + font-weight: 200; + line-height: 24px; + } +} + +h3.page_title { + color:#456; + font-size:20px; + font-weight: 600; + line-height: 28px; +} diff --git a/app/views/commits/_commit_box.html.haml b/app/views/commits/_commit_box.html.haml index 2097d87..32c9de5 100644 --- a/app/views/commits/_commit_box.html.haml +++ b/app/views/commits/_commit_box.html.haml @@ -12,7 +12,7 @@ %i.icon-download-alt Get Patch   - %h3.commit-title + %h3.commit-title.page_title = commit_msg_with_link_to_issues(@project, @commit.title) - if @commit.description.present? %pre.commit-description diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml index 6f623b2..ca87fc6 100644 --- a/app/views/dashboard/issues.html.haml +++ b/app/views/dashboard/issues.html.haml @@ -1,8 +1,9 @@ -%h3 +%h3.page_title Issues %small (assigned to you) %small.right #{@issues.total_count} issues +%br .clearfix - if @issues.any? - @issues.group_by(&:project).each do |group| diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml index a7a78f5..ce3cd6b 100644 --- a/app/views/dashboard/merge_requests.html.haml +++ b/app/views/dashboard/merge_requests.html.haml @@ -1,4 +1,4 @@ -%h3 +%h3.page_title Merge Requests %small (authored or assigned to you) %small.right #{@merge_requests.total_count} merge requests diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml index 649811e..25b9e3e 100644 --- a/app/views/help/index.html.haml +++ b/app/views/help/index.html.haml @@ -1,9 +1,13 @@ -%h3.cgray +%h3.page_title GITLAB - %span.right v2.6 + .right + %span= Gitlab::Version + %small= Gitlab::Revision %hr -%h4 Self Hosted Git Management -%h4 Fast, secure and stable solution based on Ruby on Rails & Gitolite. +%p.lead + Self Hosted Git Management + %br + Fast, secure and stable solution based on Ruby on Rails & Gitolite. %hr @@ -15,3 +19,6 @@ %li %h5= link_to "Permissions", help_permissions_path + + %li + %h5= link_to "Web Hooks", help_web_hooks_path diff --git a/app/views/help/permissions.html.haml b/app/views/help/permissions.html.haml index 19f39ac..860cfc8 100644 --- a/app/views/help/permissions.html.haml +++ b/app/views/help/permissions.html.haml @@ -1,4 +1,7 @@ %h3 Permissions +.back_link + = link_to help_path do + ← to index %hr .row diff --git a/app/views/help/web_hooks.html.haml b/app/views/help/web_hooks.html.haml index 0e63237..3acea62 100644 --- a/app/views/help/web_hooks.html.haml +++ b/app/views/help/web_hooks.html.haml @@ -1,7 +1,15 @@ %h3 Web hooks -%br +.back_link + = link_to help_path do + ← to index +%hr -%p Application will send POST request with some data like example below: +%p.slead + Every Gitlab project can trigger a web server whenever the repo is pushed to. + %br + Web Hooks can be used to update an external issue tracker, trigger CI builds, update a backup mirror, or even deploy to your production server. + %br + GITLAB will send POST request with commits information on every push. %h5 Hooks request example: = render "hooks/data_ex" diff --git a/app/views/help/workflow.html.haml b/app/views/help/workflow.html.haml index 945ab87..7db8133 100644 --- a/app/views/help/workflow.html.haml +++ b/app/views/help/workflow.html.haml @@ -1,5 +1,8 @@ - bash_lexer = Pygments::Lexer[:bash] %h3 Workflow +.back_link + = link_to help_path do + ← to index %hr %ol.help diff --git a/app/views/hooks/_data_ex.html.erb b/app/views/hooks/_data_ex.html.erb index 838b7da..8d3de3f 100644 --- a/app/views/hooks/_data_ex.html.erb +++ b/app/views/hooks/_data_ex.html.erb @@ -36,7 +36,8 @@ :email => "gitlabdev@dv6700.(none)" } } - ] + ], + total_commits_count => 3 } eos %> diff --git a/app/views/issues/index.html.haml b/app/views/issues/index.html.haml index b7e98ec..a8d0e9c 100644 --- a/app/views/issues/index.html.haml +++ b/app/views/issues/index.html.haml @@ -1,6 +1,6 @@ = render "issues/head" .issues_content - %h3 + %h3.page_title Issues %small (#{@issues.total_count}) .right diff --git a/app/views/issues/show.html.haml b/app/views/issues/show.html.haml index cd7ad57..8ffc9c2 100644 --- a/app/views/issues/show.html.haml +++ b/app/views/issues/show.html.haml @@ -1,4 +1,4 @@ -%h3 +%h3.page_title Issue ##{@issue.id} %small diff --git a/app/views/keys/index.html.haml b/app/views/keys/index.html.haml index 56ca4e8..35cda17 100644 --- a/app/views/keys/index.html.haml +++ b/app/views/keys/index.html.haml @@ -1,8 +1,11 @@ -%h3 +%h3.page_title SSH Keys = link_to "Add new", new_key_path, :class => "btn small right" -%br +%hr +%p.slead + SSH key allows you to establish a secure connection between your computer and Gitlab + %table#keys-table.admin-table %thead diff --git a/app/views/keys/show.html.haml b/app/views/keys/show.html.haml index 75b703b..79f5125 100644 --- a/app/views/keys/show.html.haml +++ b/app/views/keys/show.html.haml @@ -1,4 +1,4 @@ -%h3 +%h3.page_title Public key: = @key.title %small diff --git a/app/views/merge_requests/index.html.haml b/app/views/merge_requests/index.html.haml index 7eed3b9..5210b95 100644 --- a/app/views/merge_requests/index.html.haml +++ b/app/views/merge_requests/index.html.haml @@ -1,4 +1,4 @@ -%h3 +%h3.page_title Merge Requests - if can? current_user, :write_issue, @project = link_to new_project_merge_request_path(@project), :class => "right btn small", :title => "New Merge Request" do diff --git a/app/views/merge_requests/show/_mr_title.html.haml b/app/views/merge_requests/show/_mr_title.html.haml index 837bbd9..ec32d56 100644 --- a/app/views/merge_requests/show/_mr_title.html.haml +++ b/app/views/merge_requests/show/_mr_title.html.haml @@ -1,4 +1,4 @@ -%h3 +%h3.page_title = "Merge Request ##{@merge_request.id}:"   %span.pretty_label.branch= @merge_request.source_branch diff --git a/app/views/milestones/index.html.haml b/app/views/milestones/index.html.haml index 89d3b61..ed85166 100644 --- a/app/views/milestones/index.html.haml +++ b/app/views/milestones/index.html.haml @@ -1,6 +1,6 @@ = render "issues/head" .milestones_content - %h3 + %h3.page_title Milestones - if can? current_user, :admin_milestone, @project = link_to "New Milestone", new_project_milestone_path(@project), :class => "right btn small", :title => "New Milestone" diff --git a/app/views/profile/password.html.haml b/app/views/profile/password.html.haml index 7ef1547..1662f4d 100644 --- a/app/views/profile/password.html.haml +++ b/app/views/profile/password.html.haml @@ -1,9 +1,8 @@ -%h3 Password +%h3.page_title Password %hr = form_for @user, :url => profile_password_path, :method => :put do |f| .data - .alert.alert-info - %span After successful password update you will be redirected to login page where you should login with new password + %p.slead After successful password update you will be redirected to login page where you should login with new password -if @user.errors.any? .alert-message.block-message.error %ul diff --git a/app/views/profile/show.html.haml b/app/views/profile/show.html.haml index 48f9f93..b268901 100644 --- a/app/views/profile/show.html.haml +++ b/app/views/profile/show.html.haml @@ -1,6 +1,6 @@ .profile_avatar_holder = image_tag gravatar_icon(@user.email, 90), :class => "styled_image" -%h3 +%h3.page_title = @user.name %br %small diff --git a/app/views/profile/token.html.haml b/app/views/profile/token.html.haml index 199a4e0..3a0ec90 100644 --- a/app/views/profile/token.html.haml +++ b/app/views/profile/token.html.haml @@ -1,16 +1,17 @@ -%h3 +%h3.page_title Private token %span.cred.right keep it in secret! %hr = form_for @user, :url => profile_reset_private_token_path, :method => :put do |f| .data - .alert.alert-info - %p Private token used to access application resources without authentication. - %p * required for rss feed + %p.slead + Private token used to access application resources without authentication. + %br + It can be used for atom feed or API %p.cgray - if current_user.private_token - = text_field_tag "token", current_user.private_token + = text_field_tag "token", current_user.private_token, :class => "xxlarge large_text" - else You don`t have one yet. Click generate to fix it. .actions diff --git a/app/views/projects/graph.html.haml b/app/views/projects/graph.html.haml index 804ad9d..76ada99 100644 --- a/app/views/projects/graph.html.haml +++ b/app/views/projects/graph.html.haml @@ -1,4 +1,4 @@ -%h3 Project Network Graph +%h3.page_title Project Network Graph %br .graph_holder %h4 diff --git a/app/views/projects/team.html.haml b/app/views/projects/team.html.haml index 664d6c0..90be041 100644 --- a/app/views/projects/team.html.haml +++ b/app/views/projects/team.html.haml @@ -1,16 +1,14 @@ = render "project_head" -%h3 +%h3.page_title Team Members %small (#{@project.users_projects.count}) - if can? current_user, :admin_team_member, @project - .alert.alert-info + %p.slead = link_to new_project_team_member_path(@project), :class => "btn small right", :title => "New Team Member" do New Team Member Read more about project permissions %strong= link_to "here", help_permissions_path, :class => "vlink" - %br - To open team member profile - click on avatar. = render :partial => "team", :locals => {:project => @project} diff --git a/config/initializers/gitlab/10_app.rb b/config/initializers/gitlab/10_app.rb new file mode 100644 index 0000000..f6314ff --- /dev/null +++ b/config/initializers/gitlab/10_app.rb @@ -0,0 +1,4 @@ +module Gitlab + Version = File.read(Rails.root.join("VERSION")) + Revision = `git log --pretty=format:'%h' -n 1` +end diff --git a/config/initializers/gitlab/20_grit_ext.rb b/config/initializers/gitlab/20_grit_ext.rb new file mode 100644 index 0000000..ad8ea10 --- /dev/null +++ b/config/initializers/gitlab/20_grit_ext.rb @@ -0,0 +1,28 @@ +require 'grit' +require 'pygments' + +Grit::Git.git_timeout = GIT_OPTS["git_timeout"] +Grit::Git.git_max_size = GIT_OPTS["git_max_size"] + +Grit::Blob.class_eval do + include Linguist::BlobHelper + + def data + @data ||= @repo.git.cat_file({:p => true}, id) + Gitlab::Encode.utf8 @data + end +end + +Grit::Diff.class_eval do + def old_path + Gitlab::Encode.utf8 @a_path + end + + def new_path + Gitlab::Encode.utf8 @b_path + end + + def diff + Gitlab::Encode.utf8 @diff + end +end diff --git a/config/initializers/gitlab/30_resque_queues.rb b/config/initializers/gitlab/30_resque_queues.rb new file mode 100644 index 0000000..5b0087a --- /dev/null +++ b/config/initializers/gitlab/30_resque_queues.rb @@ -0,0 +1 @@ +Resque.watch_queue(PostReceive.instance_variable_get("@queue")) diff --git a/config/initializers/gitlabhq/20_grit_ext.rb b/config/initializers/gitlabhq/20_grit_ext.rb deleted file mode 100644 index ad8ea10..0000000 --- a/config/initializers/gitlabhq/20_grit_ext.rb +++ /dev/null @@ -1,28 +0,0 @@ -require 'grit' -require 'pygments' - -Grit::Git.git_timeout = GIT_OPTS["git_timeout"] -Grit::Git.git_max_size = GIT_OPTS["git_max_size"] - -Grit::Blob.class_eval do - include Linguist::BlobHelper - - def data - @data ||= @repo.git.cat_file({:p => true}, id) - Gitlab::Encode.utf8 @data - end -end - -Grit::Diff.class_eval do - def old_path - Gitlab::Encode.utf8 @a_path - end - - def new_path - Gitlab::Encode.utf8 @b_path - end - - def diff - Gitlab::Encode.utf8 @diff - end -end diff --git a/config/initializers/gitlabhq/30_resque_queues.rb b/config/initializers/gitlabhq/30_resque_queues.rb deleted file mode 100644 index 5b0087a..0000000 --- a/config/initializers/gitlabhq/30_resque_queues.rb +++ /dev/null @@ -1 +0,0 @@ -Resque.watch_queue(PostReceive.instance_variable_get("@queue")) -- libgit2 0.21.2