OSDN Git Service

middle panel
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>
Mon, 12 Dec 2011 17:22:01 +0000 (19:22 +0200)
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>
Mon, 12 Dec 2011 17:22:01 +0000 (19:22 +0200)
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/style.scss
app/helpers/application_helper.rb
app/views/commits/index.html.haml
app/views/layouts/_middle_panel.html.haml [new file with mode: 0644]
app/views/layouts/project.html.haml
app/views/refs/_tree.html.haml

index 902358f..0257002 100644 (file)
@@ -529,3 +529,41 @@ h4.dash-tabs {
     background: #eaeaea;
   }
 }
+
+h4.middle-panel { 
+  margin: 0; 
+  border-bottom: 1px solid #ccc; 
+  padding: 10px 10px;
+  font-size: 11px;
+  padding-left:20px;
+  background: #F7F7F7;
+  height:30px;
+
+  .project_name {
+    float:left;
+    width:160px;
+    margin-right:30px;
+    font-size:16px;
+    font-weight:bold;
+    padding:5px 7px;
+    color:#777;
+  }
+
+  .git_url_wrapper {
+    padding:0px;
+    margin:0px;
+    float:left;
+
+    .git-url {
+      padding:0px;
+      margin:0px;
+      font-size: 12px;
+      border-radius: 5px;
+      color: #666; 
+      box-shadow: 0 1px 2px rgba(0,0,0,.2) inset;
+      padding:  7px 0 5px 30px;
+      background: white url('images.png') no-repeat 8px -40px; 
+      width: 250px;
+    }
+  }
+}
index 3ba2662..690761e 100644 (file)
@@ -606,7 +606,6 @@ body.project-page .project-container{ position: relative; float: left; width: 10
 body.project-page .page-title{margin-bottom: 0}
 body.project-page .project-sidebar {width: 180px;  left: 0; top: 0; height: 100%; bottom: 0;  position: absolute; background-color: #f7f7f7; float: left; display: inline-block; background: #f7f7f7; padding: 20px 0 20px 2%; margin: 0; }
 
-body.project-page input.text.git-url,
 body.projects-page input.text.git-url { font-size: 12px; border-radius: 5px; color: #666; box-shadow: 0 1px 2px rgba(0,0,0,.2) inset; padding:  8px 0 8px 30px;  margin-bottom: 20px;  background: white url('images.png') no-repeat 8px -40px; width: 136px}
 body.projects-page input.text.git-url {margin:10px 0 0 }
 .git_url_wrapper { margin-right:50px }
index 4706708..2dd652e 100644 (file)
@@ -48,7 +48,7 @@ module ApplicationHelper
 
   def grouped_options_refs(destination = :tree)
     options = [
-      ["Branch", @repo.heads.map(&:name) ],
+      ["Branch", @project.repo.heads.map(&:name) ],
       [ "Tag", @project.tags ]
     ]
 
index fb8d039..274f8c2 100644 (file)
@@ -3,17 +3,15 @@
 -#%a.right.button{:href => "#"} Download
 -#-if can? current_user, :admin_project, @project
   %a.right.button.blue{:href => "#"} EDIT
-%h2.icon
-  %span
-  %d
-    = link_to project_commits_path(@project) do
-      = @project.name
-    - if params[:path]
+- if params[:path]
+  %h2.icon
+    %span
+    %d
+      = link_to project_commits_path(@project) do
+        = @project.code
       \/
       %a{:href => "#"}= params[:path].split("/").join(" / ")
 
-.right= render :partial => "projects/refs", :locals => { :destination => :commits }
-
 %div{:id => dom_id(@project)}
   #commits_list= render "commits"
 .clear
diff --git a/app/views/layouts/_middle_panel.html.haml b/app/views/layouts/_middle_panel.html.haml
new file mode 100644 (file)
index 0000000..662b4f3
--- /dev/null
@@ -0,0 +1,7 @@
+%h4.middle-panel 
+  .project_name= truncate @project.name, :length => 20
+  .git_url_wrapper
+    %input.git-url.text{:id => "", :name => "", :readonly => "", :type => "text", :value => @project.url_to_repo, :class => "one_click_select"}
+  - if @project.repo_exists?
+    .right= render :partial => "projects/refs", :locals => { :destination => controller.controller_name == "commits" ? "commits" : "tree" }
+
index 8a39dec..3dbb69c 100644 (file)
     = render :partial => "layouts/flash"
     #container
       = render :partial => "layouts/head_panel"
+      = render :partial => "layouts/middle_panel" if @project && !@project.new_record?
       .project-container
         .project-sidebar
           .fixed
-            .git_url_wrapper
-              %input.git-url.text{:id => "", :name => "", :readonly => "", :type => "text", :value => @project.url_to_repo, :class => "one_click_select"}
             %aside
               = link_to "Activities", project_path(@project), :class => current_page?(:controller => "projects", :action => "show", :id => @project) ? "current" : nil
               = link_to "Tree", tree_project_ref_path(@project,  @project.root_ref), :class => current_page?(:controller => "refs", :action => "tree", :project_id => @project, :id => @ref || @project.root_ref ) ? "current" : nil
index 502a6a4..7400aa6 100644 (file)
@@ -8,7 +8,6 @@
         \/
         = link
       &nbsp;
-  .right= render :partial => "projects/refs", :locals => { :destination => :tree }
 .clear
 #tree-content-holder
   - if tree.is_blob?