diff --git a/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss index dbc7d820952ec72bf9a0f0704dbb2579e0ad0c83..d6aaec73e6e863a4ee512da18e524539bdd9a80f 100644 --- a/app/assets/stylesheets/projects.css.scss +++ b/app/assets/stylesheets/projects.css.scss @@ -588,3 +588,7 @@ tr.line_notes_row { } } } + +.new-project-hodler { + padding:20px; +} diff --git a/app/assets/stylesheets/style.scss b/app/assets/stylesheets/style.scss index 9acb8d0ea47cfd9c3a689e34c3ed167444ee684c..01ef6c345d031a91bf18643e62f8ba8f1d595b2c 100644 --- a/app/assets/stylesheets/style.scss +++ b/app/assets/stylesheets/style.scss @@ -712,8 +712,8 @@ body, button, input, select, textarea { .errors_holder { background:#D30; color:#fff; - border:1px solid $lite_border_color; @include round-borders-all(4px); + border:1px solid #a30; padding:5px; list-style:none; font-weight: bold; @@ -723,3 +723,33 @@ body, button, input, select, textarea { padding:10px; } } + +.notice_holder { + background:#DDF4FB; + color:#444; + border:1px solid #C6EDF9; + @include round-borders-all(4px); + padding:5px; + list-style:none; + font-weight: bold; + text-shadow: 0 -1px 0 rgba(255, 255, 255, 0.25); + + li { + padding:10px; + } +} + +.alert_holder { + background:#FDF5D9; + color:#444; + border:1px solid #FCEEC1; + @include round-borders-all(4px); + padding:5px; + list-style:none; + font-weight: bold; + text-shadow: 0 -1px 0 rgba(255, 255, 255, 0.25); + + li { + padding:10px; + } +} diff --git a/app/models/repository.rb b/app/models/repository.rb index 0bf1bc18ece8625b3c8756fbfcc0b1f94112b5be..f4fdfe54b572c47147675895fb1e215da65e5e29 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -74,9 +74,9 @@ class Repository end def repo_exists? - repo && !repo.branches.empty? + @repo_exists ||= (repo && !repo.branches.empty?) rescue - false + @repo_exists = false end def tags diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml index c52c48683f945e5191c7289d74c40ddd8e03a1c4..1b27ddaf6d5bb878761c94edd883cdd5b1dc069b 100644 --- a/app/views/layouts/project.html.haml +++ b/app/views/layouts/project.html.haml @@ -26,18 +26,19 @@ = link_to project_path(@project), :class => project_tab_class do Project - = link_to "Repository", project_repository_path(@project), :class => repository_tab_class - = link_to "Tree", tree_project_ref_path(@project, @project.root_ref), :class => tree_tab_class - = link_to "Commits", project_commits_path(@project), :class => (controller.controller_name == "commits") ? "current" : nil - = link_to "Network", graph_project_path(@project), :class => current_page?(:controller => "projects", :action => "graph", :id => @project) ? "current" : nil - = link_to project_issues_filter_path(@project), :class => (controller.controller_name == "issues") ? "current" : nil do - Issues - = link_to wall_project_path(@project), :class => current_page?(:controller => "projects", :action => "wall", :id => @project) ? "current" : nil do - Wall - - if @project.common_notes.today.count > 0 - %span{ :class => "number" }= @project.common_notes.today.count - = link_to project_merge_requests_path(@project), :class => (controller.controller_name == "merge_requests") ? "current" : nil do - Requests + - if @project.repo_exists? + = link_to "Repository", project_repository_path(@project), :class => repository_tab_class + = link_to "Tree", tree_project_ref_path(@project, @project.root_ref), :class => tree_tab_class + = link_to "Commits", project_commits_path(@project), :class => (controller.controller_name == "commits") ? "current" : nil + = link_to "Network", graph_project_path(@project), :class => current_page?(:controller => "projects", :action => "graph", :id => @project) ? "current" : nil + = link_to project_issues_filter_path(@project), :class => (controller.controller_name == "issues") ? "current" : nil do + Issues + = link_to wall_project_path(@project), :class => current_page?(:controller => "projects", :action => "wall", :id => @project) ? "current" : nil do + Wall + - if @project.common_notes.today.count > 0 + %span{ :class => "number" }= @project.common_notes.today.count + = link_to project_merge_requests_path(@project), :class => (controller.controller_name == "merge_requests") ? "current" : nil do + Requests diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml index 2fc6f9d9a9a9ee85b248fccfacf9afb3df7daff9..421e840982437fda5781061f1624816a360945a1 100644 --- a/app/views/projects/_form.html.haml +++ b/app/views/projects/_form.html.haml @@ -6,13 +6,9 @@ = @project.name .clear - if @project.errors.any? - #error_explanation - %h2 - = pluralize(@project.errors.count, "error") - prohibited this project from being saved: - %ul - - @project.errors.full_messages.each do |msg| - %li= msg + %ul.errors_holder + - @project.errors.full_messages.each do |msg| + %li= msg %table %tr %td= f.label :name diff --git a/app/views/projects/empty.html.erb b/app/views/projects/empty.html.erb deleted file mode 100644 index b85f801edd0d67b0622559dc658e27d6d4b463db..0000000000000000000000000000000000000000 --- a/app/views/projects/empty.html.erb +++ /dev/null @@ -1,39 +0,0 @@ -<% bash_lexer = Pygments::Lexer[:bash] %> -
-
-

Git global setup:

-<% setup_str = < - <%= raw bash_lexer.highlight(setup_str) %> -
-
-

Next steps:

-<% repo_setup_str = < - <%= raw bash_lexer.highlight(repo_setup_str) %> - -

-

Existing Git Repo?

-<% exist_repo_setup_str = < - <%= raw bash_lexer.highlight(exist_repo_setup_str) %> - -
-
-
diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..f089c6ec46b39eef780b485778a4f101bb3534f6 --- /dev/null +++ b/app/views/projects/empty.html.haml @@ -0,0 +1,39 @@ +- if current_user.require_ssh_key? + %ul.errors_holder + %li You have no ssh keys added yo tour profile. + %li You wont be able to pull/push repository. + %li Visit profile → keys and add public key of every machine you want to use for work with gitlabhq. + + +%ul.alert_holder + %li You should push repository to proceed. + %li After push you will be able to browse code, commits etc. + +- bash_lexer = Pygments::Lexer[:bash] +%div.git-empty + %h3 Git global setup: + - setup_str = ["git config --global user.name \"#{current_user.name}\"", + "git config --global user.email \"#{current_user.email}\""].join("\n") + = raw bash_lexer.highlight(setup_str) + + %br + %br + %h3 Create Repository + - repo_setup_str = ["mkdir #{@project.path}", + "cd #{@project.path}", + "git init", + "touch README", + "git add README", + "git commit -m 'first commit'", + "git remote add origin #{@project.url_to_repo}", + "git push -u origin master"].join("\n") + + = raw bash_lexer.highlight(repo_setup_str) + + %br + %br + %h3 Existing Git Repo? + - exist_repo_setup_str = ["cd existing_git_repo", + "git remote add origin #{@project.url_to_repo}", + "git push -u origin master"].join("\n") + = raw bash_lexer.highlight(exist_repo_setup_str) diff --git a/app/views/projects/files.html.haml b/app/views/projects/files.html.haml index 0d1ba8e80828d0761a7d5b02a75efe929f089d52..8ea4ac8a1307de096916dbba3a55cd936d5eac8e 100644 --- a/app/views/projects/files.html.haml +++ b/app/views/projects/files.html.haml @@ -12,6 +12,7 @@ = time_ago_in_words(note.created_at) ago - else - %h3 All files attached to project wall, issues etc will be displayed here + .notice_holder + %li All files attached to project wall, issues etc will be displayed here diff --git a/app/views/snippets/index.html.haml b/app/views/snippets/index.html.haml index cdc3356299bdaf0bcd5efd3ddf6f2709c03ffc2d..c7c4c6b132452bd6e8739fe4cf312c92a21fdce6 100644 --- a/app/views/snippets/index.html.haml +++ b/app/views/snippets/index.html.haml @@ -4,3 +4,9 @@ %div{ :class => "update-data ui-box ui-box-small ui-box-big" } .data = render @snippets.fresh +- else + .notice_holder + %li Snippets do not exist yet. + - if can? current_user, :write_snippet, @project + %li You can add a new one by clicking on plus icon + diff --git a/config/database.yml b/config/database.yml index 51a4dd459dc12673ad440debb28f499c89550022..ff126d9ce705d9086e4ca07ea5bbafe94d96a4b5 100644 --- a/config/database.yml +++ b/config/database.yml @@ -20,6 +20,6 @@ test: production: adapter: sqlite3 - database: db/production.sqlite3 + database: db/development.sqlite3 pool: 5 timeout: 5000