Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-10-12 00:00:00 +0400
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-10-12 17:19:14 +0400
commitbd34ca3c33a56550a1b42b8c150bdba61c96bfbd (patch)
tree8a4dfb097ba4e6666dc2f6565e4e71100d27db3a /app/views
parent495d29da738c8ac53406110d7c3af3f6a3a59bfc (diff)
project tile view
Diffstat (limited to 'app/views')
-rw-r--r--app/views/dashboard/index.html.haml1
-rw-r--r--app/views/layouts/application.html.haml1
-rw-r--r--app/views/projects/_list.html.haml26
-rw-r--r--app/views/projects/_projects_top_menu.html.haml16
-rw-r--r--app/views/projects/_tile.html.haml16
-rw-r--r--app/views/projects/_tree_item.html.haml2
-rw-r--r--app/views/projects/index.html.haml30
7 files changed, 65 insertions, 27 deletions
diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml
index e69de29bb2d..f4ce9a17d82 100644
--- a/app/views/dashboard/index.html.haml
+++ b/app/views/dashboard/index.html.haml
@@ -0,0 +1 @@
+timeline
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index 8ac413a1f44..3eb99da61e5 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -21,6 +21,7 @@
= render :partial => "layouts/head_panel"
.top_bar.container
= render :partial => "projects/top_menu" if @project && !@project.new_record?
+ = render :partial => "projects/projects_top_menu" if (controller.controller_name == "projects" && ["index", "new", "create"].include?(controller.action_name)) && !admin_namespace?
= render :partial => "profile/top_menu" if ["keys", "profile"].include?(controller.controller_name)
= render :partial => "admin/top_menu" if admin_namespace?
#content-container.container
diff --git a/app/views/projects/_list.html.haml b/app/views/projects/_list.html.haml
new file mode 100644
index 00000000000..82e1948c757
--- /dev/null
+++ b/app/views/projects/_list.html.haml
@@ -0,0 +1,26 @@
+-#- if current_user.can_create_project?
+ = link_to 'New Project', new_project_path, :class => "lbutton vm"
+
+%table.round-borders#projects-list
+ %tr
+ %th Name
+ %th Path
+ %th Code
+ %th Web
+ %th Git
+ %th Admin
+ %th Actions
+
+ - @projects.each do |project|
+ %tr{ :class => "project", :url => project_path(project) }
+ %td= project.name
+ %td= truncate project.url_to_repo
+ %td= project.code
+ %td= check_box_tag "read", 1, project.readers.include?(current_user), :disabled => :disabled
+ %td= check_box_tag "commit", 1, project.writers.include?(current_user), :disabled => :disabled
+ %td= check_box_tag "admin", 1, project.admins.include?(current_user), :disabled => :disabled
+ %td
+ -if can? current_user, :admin_project, project
+ = link_to 'Edit', edit_project_path(project), :class => "lbutton positive"
+%br
+
diff --git a/app/views/projects/_projects_top_menu.html.haml b/app/views/projects/_projects_top_menu.html.haml
new file mode 100644
index 00000000000..be04c57e842
--- /dev/null
+++ b/app/views/projects/_projects_top_menu.html.haml
@@ -0,0 +1,16 @@
+%div.top_project_menu
+ %span= link_to 'All', projects_path, :class => current_page?(projects_path) ? "current" : nil
+ %span= link_to "New Project", new_project_path, :class => current_page?(:controller => "projects", :action => "new") ? "current" : nil
+ %span.right
+ = link_to_function(image_tag("list_view_icon.jpg"), "switchProjectView()", :style => "border:none;box-shadow:none;")
+
+:javascript
+ function switchProjectView(){
+ $(".tile").toggle();
+ $(".list").toggle();
+ if($(".tile").is(":visible")){
+ $.cookie('project_view', 'tile', { expires: 14 });
+ } else {
+ $.cookie('project_view', 'list', { expires: 14 });
+ }
+ }
diff --git a/app/views/projects/_tile.html.haml b/app/views/projects/_tile.html.haml
new file mode 100644
index 00000000000..037aeccb228
--- /dev/null
+++ b/app/views/projects/_tile.html.haml
@@ -0,0 +1,16 @@
+- @projects.in_groups_of(3, false) do |projects|
+ - projects.each_with_index do |project, i|
+ %div{ :class => "project_thumb round-borders", :style => i == 2 ? "" : "margin-right:30px;" }
+ %div{ :class => "project", :url => project_path(project) }
+ %h2
+ = image_tag gravatar_icon(project.name), :class => "left", :width => 40, :style => "padding-right:5px;"
+ = "/" + project.code
+ %p= project.name
+ %p= project.url_to_repo
+ -#%p
+ Commit &ndash;
+ = last_commit(project)
+ %hr
+ = link_to "Browse Code", tree_project_path(project), :class => "lbutton"
+ = link_to "Commits", project_commits_path(project), :class => "lbutton", :style => "float:right;width:80px;"
+ .clear
diff --git a/app/views/projects/_tree_item.html.haml b/app/views/projects/_tree_item.html.haml
index 25575283993..7179368a0c3 100644
--- a/app/views/projects/_tree_item.html.haml
+++ b/app/views/projects/_tree_item.html.haml
@@ -1,5 +1,5 @@
- file = params[:path] ? File.join(params[:path], content.name) : content.name
-- content_commit = @repo.log(@branch, file, :max_count => 1).last
+- content_commit = @project.repo.log(@branch, file, :max_count => 1).last
- return unless content_commit
%tr{ :class => "tree-item", :url => tree_file_project_path(@project, @commit.id, file) }
%td.tree-item-file-name
diff --git a/app/views/projects/index.html.haml b/app/views/projects/index.html.haml
index a33b4f57a82..22af6b7551a 100644
--- a/app/views/projects/index.html.haml
+++ b/app/views/projects/index.html.haml
@@ -1,26 +1,4 @@
-- if current_user.can_create_project?
- = link_to 'New Project', new_project_path, :class => "lbutton vm"
-
-%table.round-borders#projects-list
- %tr
- %th Name
- %th Path
- %th Code
- %th Web
- %th Git
- %th Admin
- %th Actions
-
- - @projects.each do |project|
- %tr{ :class => "project", :url => project_path(project) }
- %td= project.name
- %td= truncate project.url_to_repo
- %td= project.code
- %td= check_box_tag "read", 1, project.readers.include?(current_user), :disabled => :disabled
- %td= check_box_tag "commit", 1, project.writers.include?(current_user), :disabled => :disabled
- %td= check_box_tag "admin", 1, project.admins.include?(current_user), :disabled => :disabled
- %td
- -if can? current_user, :admin_project, project
- = link_to 'Edit', edit_project_path(project), :class => "lbutton positive"
-%br
-
+%div{:class => "tile", :style => view_mode_style("tile")}
+ = render "tile"
+%div{:class => "list", :style => view_mode_style("list")}
+ = render "list"