Commit 3ba392b3 authored by gitlabhq's avatar gitlabhq

new ref switch

parent 5f900772
This diff is collapsed.
This diff is collapsed.
......@@ -706,3 +706,16 @@ table.highlighttable pre{
line-height:16px !important;
font-size:12px !important;
}
.project-refs-form {
span {
background: none !important;
position:static !important;
width:auto !important;
height: auto !important;
}
}
.project-refs-select {
width:200px;
}
......@@ -57,19 +57,13 @@ class ApplicationController < ActionController::Base
end
def load_refs
@branch = unless params[:branch].blank?
params[:branch]
else
nil
end
@tag = unless params[:tag].blank?
params[:tag]
else
nil
end
@ref = @branch || @tag || "master"
unless params[:ref].blank?
@ref = params[:ref]
else
@branch = params[:branch].blank? ? nil : params[:branch]
@tag = params[:tag].blank? ? nil : params[:tag]
@ref = @branch || @tag || "master"
end
end
def render_404
......
......@@ -32,6 +32,15 @@ module ApplicationHelper
"Never"
end
def grouped_options_refs
options = [
["Branch", @repo.heads.map(&:name) ],
[ "Tag", @project.tags ]
]
grouped_options_for_select(options, @ref)
end
def markdown(text)
RDiscount.new(text, :autolink, :no_pseudo_protocols, :safelink, :smart, :filter_html).to_html.html_safe
end
......
- content_for(:body_class, "project-page commits-page")
.left
= form_tag project_commits_path(@project), :method => :get do
= select_tag "branch", options_for_select(@repo.heads.map(&:name), @branch), :onchange => "this.form.submit();", :class => "", :prompt => "Branches"
.left
= form_tag project_commits_path(@project), :method => :get do
= select_tag "tag", options_for_select(@project.tags, @tag), :onchange => "this.form.submit();", :class => "", :prompt => "Tags"
.clear
%br
-#%a.right.button{:href => "#"} Download
-#-if can? current_user, :admin_project, @project
%a.right.button.blue{:href => "#"} EDIT
%h2.icon
%span
%a.project-name{:href => "#"}
%i.arrow>
Project
&nbsp;
%d
%a{:href => "#"}
= @ref
- if params[:path]
&nbsp;
%d
= link_to project_commits_path(@project) do
= @project.name
- if params[:path]
\/
%a{:href => "#"}= params[:path].split("/").join(" / ")
.right= render "projects/refs"
%div{:id => dom_id(@project)}
= render "commits"
= form_tag project_commits_path(@project), :method => :get, :class => "project-refs-form" do
= select_tag "ref", grouped_options_refs, :onchange => "this.form.submit();", :class => "project-refs-select"
:javascript
$(function(){
$('.project-refs-select').chosen();
})
.left
= form_tag tree_project_path(@project), :method => :get do
= select_tag "branch", options_for_select(@repo.heads.map(&:name), @branch), :onchange => "this.form.submit();", :class => "", :prompt => "Branches"
.left
= form_tag tree_project_path(@project), :method => :get do
= select_tag "tag", options_for_select(@project.tags, @tag), :onchange => "this.form.submit();", :class => "", :prompt => "Tags"
.clear
%br
-#%a.right.button{:href => "#"} Download
-#-if can? current_user, :admin_project, @project
......@@ -14,14 +5,9 @@
#tree-breadcrumbs
%h2.icon
%span
= link_to tree_project_path(@project, :path => nil, :commit_id => @commit.try(:id)), :remote => true, :class => 'project-name' do
%i.arrow>
= @project.name
&nbsp;
%d
%a{:href => "#"}
= @ref
= link_to tree_project_path(@project, :path => nil, :commit_id => @commit.try(:id)), :remote => true do
= @project.name
- if params[:path]
- part_path = ""
- params[:path].split("\/").each do |part|
......@@ -30,7 +16,8 @@
- part_path = part
\/
= link_to truncate(part, :length => 40), tree_file_project_path(@project, :path => part_path, :commit_id => @commit.try(:id), :branch => @branch, :tag => @tag), :remote => :true
&nbsp;
.right= render "projects/refs"
.clear
#tree-content-holder
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment