Commit 415516b2 authored by gitlabhq's avatar gitlabhq

Merge branch 'dev'

parents 8a8fa8b0 687290a0
This diff is collapsed.
This diff is collapsed.
...@@ -706,3 +706,16 @@ table.highlighttable pre{ ...@@ -706,3 +706,16 @@ table.highlighttable pre{
line-height:16px !important; line-height:16px !important;
font-size:12px !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;
}
...@@ -292,7 +292,7 @@ body.login-page{background-color: #f1f1f1; padding-top: 10%} ...@@ -292,7 +292,7 @@ body.login-page{background-color: #f1f1f1; padding-top: 10%}
/* General */ /* General */
#container{background-color: white; overflow: hidden;} #container{background-color: white; overflow: hidden;}
/*#container{margin: auto; width: 980px; border: 1px solid rgba(0,0,0,.22); border-top: 0; box-shadow: 0 0 0px 4px rgba(0,0,0,.04)}*/ body.collapsed #container{margin: auto; width: 980px; border: 1px solid rgba(0,0,0,.22); border-top: 0; box-shadow: 0 0 0px 4px rgba(0,0,0,.04)}
......
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :view_style
protect_from_forgery protect_from_forgery
helper_method :abilities, :can? helper_method :abilities, :can?
...@@ -57,20 +59,14 @@ class ApplicationController < ActionController::Base ...@@ -57,20 +59,14 @@ class ApplicationController < ActionController::Base
end end
def load_refs def load_refs
@branch = unless params[:branch].blank? unless params[:ref].blank?
params[:branch] @ref = params[:ref]
else else
nil @branch = params[:branch].blank? ? nil : params[:branch]
end @tag = params[:tag].blank? ? nil : params[:tag]
@tag = unless params[:tag].blank?
params[:tag]
else
nil
end
@ref = @branch || @tag || "master" @ref = @branch || @tag || "master"
end end
end
def render_404 def render_404
render :file => File.join(Rails.root, "public", "404"), :layout => false, :status => "404" render :file => File.join(Rails.root, "public", "404"), :layout => false, :status => "404"
...@@ -79,4 +75,12 @@ class ApplicationController < ActionController::Base ...@@ -79,4 +75,12 @@ class ApplicationController < ActionController::Base
def require_non_empty_project def require_non_empty_project
redirect_to @project unless @project.repo_exists? redirect_to @project unless @project.repo_exists?
end end
def view_style
if params[:view_style] == "collapsed"
cookies[:view_style] = "collapsed"
elsif params[:view_style] == "fluid"
cookies[:view_style] = ""
end
end
end end
...@@ -4,6 +4,14 @@ module ApplicationHelper ...@@ -4,6 +4,14 @@ module ApplicationHelper
"http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user_email)}?s=40&d=identicon" "http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user_email)}?s=40&d=identicon"
end end
def body_class(default_class = nil)
main = content_for(:body_class).blank? ?
default_class :
content_for(:body_class)
[main, cookies[:view_style]].join(" ")
end
def commit_name(project, commit) def commit_name(project, commit)
if project.commit.id == commit.id if project.commit.id == commit.id
"master" "master"
...@@ -32,6 +40,15 @@ module ApplicationHelper ...@@ -32,6 +40,15 @@ module ApplicationHelper
"Never" "Never"
end end
def grouped_options_refs
options = [
["Branch", @repo.heads.map(&:name) ],
[ "Tag", @project.tags ]
]
grouped_options_for_select(options, @ref)
end
def markdown(text) def markdown(text)
RDiscount.new(text, :autolink, :no_pseudo_protocols, :safelink, :smart, :filter_html).to_html.html_safe RDiscount.new(text, :autolink, :no_pseudo_protocols, :safelink, :smart, :filter_html).to_html.html_safe
end end
......
...@@ -8,7 +8,7 @@ class Key < ActiveRecord::Base ...@@ -8,7 +8,7 @@ class Key < ActiveRecord::Base
validates :key, validates :key,
:presence => true, :presence => true,
:uniqueness => true, :uniqueness => true,
:length => { :within => 0..1024 } :length => { :within => 0..1600 }
before_save :set_identifier before_save :set_identifier
after_save :update_gitosis after_save :update_gitosis
......
- content_for(:body_class, "project-page commits-page") - 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 -#%a.right.button{:href => "#"} Download
-#-if can? current_user, :admin_project, @project -#-if can? current_user, :admin_project, @project
%a.right.button.blue{:href => "#"} EDIT %a.right.button.blue{:href => "#"} EDIT
%h2.icon %h2.icon
%span %span
%a.project-name{:href => "#"}
%i.arrow>
Project
&nbsp;
%d %d
%a{:href => "#"} = link_to project_commits_path(@project) do
= @ref = @project.name
- if params[:path] - if params[:path]
&nbsp; \/
%d
%a{:href => "#"}= params[:path].split("/").join(" / ") %a{:href => "#"}= params[:path].split("/").join(" / ")
.right= render :partial => "projects/refs", :locals => { :destination => project_commits_path(@project) }
%div{:id => dom_id(@project)} %div{:id => dom_id(@project)}
= render "commits" = render "commits"
<!-- Page Header --> <!-- Page Header -->
<header> <header>
<h1 class="logo"> <h1 class="logo">
<a href="/">GITLAB</a></h1> <a href="/">GITLAB</a>
<div class="login-top"> </h1>
<div class="account-box">
<%= link_to profile_path, :class => "pic" do %> <%= link_to profile_path, :class => "pic" do %>
<%= image_tag gravatar_icon(current_user.email) %> <%= image_tag gravatar_icon(current_user.email) %>
<% end %> <% end %>
<a href="#" class="arrow-up"></a>
<div class="account-links">
<%= link_to profile_path, :class => "username" do %> <%= link_to profile_path, :class => "username" do %>
<%= current_user.name %> <%#= current_user.name %>
Your profile
<% end %> <% end %>
<%= link_to "Fluid layout", url_for( :view_style => 'fluid' ) if cookies[:view_style] == "collapsed"%>
<%= link_to "Fixed layout", url_for( :view_style => 'collapsed' ) unless cookies[:view_style] == "collapsed"%>
<%= link_to 'Logout', destroy_user_session_path, :class => "logout", :method => :delete %> <%= link_to 'Logout', destroy_user_session_path, :class => "logout", :method => :delete %>
</div> </div>
</div><!-- .account-box -->
<div class="search"> <div class="search">
<%= text_field_tag "search", nil, :placeholder => "Search", :class => "search-input" %> <%= text_field_tag "search", nil, :placeholder => "Search", :class => "search-input" %>
</div> </div>
...@@ -26,23 +36,10 @@ ...@@ -26,23 +36,10 @@
<span></span>Admin <span></span>Admin
<% end %> <% end %>
</nav> </nav>
</header> </header>
<!-- eo Page Header --> <!-- eo Page Header -->
<div id="header-panel" style="display:none">
<div class="container">
<div class="span-24">
<div class="span-10">
<span class="search-holder">
</span>
</div>
<div class="right">
<%= link_to truncate(@project.name, :length => 20), project_path(@project), :class => "current button" if @project && !@project.new_record? %>
</div>
</div>
</div>
</div>
<% if current_user %> <% if current_user %>
<%= javascript_tag do %> <%= javascript_tag do %>
$(function() { $(function() {
......
...@@ -6,11 +6,10 @@ ...@@ -6,11 +6,10 @@
= stylesheet_link_tag "application" = stylesheet_link_tag "application"
= javascript_include_tag "application" = javascript_include_tag "application"
= csrf_meta_tags = csrf_meta_tags
%link{:href => "/assets/favicon.png", :rel => "icon", :type => "image/png"}/
= javascript_tag do = javascript_tag do
REQ_URI = "#{request.env["REQUEST_URI"]}"; REQ_URI = "#{request.env["REQUEST_URI"]}";
REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; REQ_REFFER = "#{request.env["HTTP_REFERER"]}";
%body{ :class => content_for?(:body_class) ? yield(:body_class) : 'project-page', :id => yield(:boyd_id)} %body{ :class => body_class('project-page'), :id => yield(:boyd_id)}
#container #container
= render :partial => "layouts/flash" = render :partial => "layouts/flash"
= render :partial => "layouts/head_panel" = render :partial => "layouts/head_panel"
......
...@@ -10,11 +10,10 @@ ...@@ -10,11 +10,10 @@
= stylesheet_link_tag "application" = stylesheet_link_tag "application"
= javascript_include_tag "application" = javascript_include_tag "application"
= csrf_meta_tags = csrf_meta_tags
%link{:href => "/assets/favicon.png", :rel => "icon", :type => "image/png"}/
= javascript_tag do = javascript_tag do
REQ_URI = "#{request.env["REQUEST_URI"]}"; REQ_URI = "#{request.env["REQUEST_URI"]}";
REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; REQ_REFFER = "#{request.env["HTTP_REFERER"]}";
%body{ :class => yield(:body_class), :id => yield(:boyd_id)} %body{ :class => body_class, :id => yield(:boyd_id)}
#container #container
= render :partial => "layouts/flash" = render :partial => "layouts/flash"
= render :partial => "layouts/head_panel" = render :partial => "layouts/head_panel"
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
= stylesheet_link_tag "application" = stylesheet_link_tag "application"
= javascript_include_tag "application" = javascript_include_tag "application"
= csrf_meta_tags = csrf_meta_tags
%link{:href => "/assets/favicon.png", :rel => "icon", :type => "image/png"}/
= javascript_tag do = javascript_tag do
REQ_URI = "#{request.env["REQUEST_URI"]}"; REQ_URI = "#{request.env["REQUEST_URI"]}";
REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; REQ_REFFER = "#{request.env["HTTP_REFERER"]}";
......
...@@ -6,11 +6,10 @@ ...@@ -6,11 +6,10 @@
= stylesheet_link_tag "application" = stylesheet_link_tag "application"
= javascript_include_tag "application" = javascript_include_tag "application"
= csrf_meta_tags = csrf_meta_tags
%link{:href => "/assets/favicon.png", :rel => "icon", :type => "image/png"}/
= javascript_tag do = javascript_tag do
REQ_URI = "#{request.env["REQUEST_URI"]}"; REQ_URI = "#{request.env["REQUEST_URI"]}";
REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; REQ_REFFER = "#{request.env["HTTP_REFERER"]}";
%body{ :class => content_for?(:body_class) ? yield(:body_class) : 'project-page', :id => yield(:boyd_id)} %body{ :class => body_class('project-page'), :id => yield(:boyd_id)}
#container #container
= render :partial => "layouts/flash" = render :partial => "layouts/flash"
= render :partial => "layouts/head_panel" = render :partial => "layouts/head_panel"
......
...@@ -6,11 +6,10 @@ ...@@ -6,11 +6,10 @@
= stylesheet_link_tag "application" = stylesheet_link_tag "application"
= javascript_include_tag "application" = javascript_include_tag "application"
= csrf_meta_tags = csrf_meta_tags
%link{:href => "/assets/favicon.png", :rel => "icon", :type => "image/png"}/
= javascript_tag do = javascript_tag do
REQ_URI = "#{request.env["REQUEST_URI"]}"; REQ_URI = "#{request.env["REQUEST_URI"]}";
REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; REQ_REFFER = "#{request.env["HTTP_REFERER"]}";
%body{ :class => content_for?(:body_class) ? yield(:body_class) : 'project-page', :id => yield(:boyd_id)} %body{ :class => body_class('project-page'), :id => yield(:boyd_id)}
#container #container
= render :partial => "layouts/flash" = render :partial => "layouts/flash"
= render :partial => "layouts/head_panel" = render :partial => "layouts/head_panel"
......
= form_tag destination, :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 -#%a.right.button{:href => "#"} Download
-#-if can? current_user, :admin_project, @project -#-if can? current_user, :admin_project, @project
...@@ -14,14 +5,9 @@ ...@@ -14,14 +5,9 @@
#tree-breadcrumbs #tree-breadcrumbs
%h2.icon %h2.icon
%span %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 %d
%a{:href => "#"} = link_to tree_project_path(@project, :path => nil, :commit_id => @commit.try(:id)), :remote => true do
= @ref = @project.name
- if params[:path] - if params[:path]
- part_path = "" - part_path = ""
- params[:path].split("\/").each do |part| - params[:path].split("\/").each do |part|
...@@ -30,7 +16,8 @@ ...@@ -30,7 +16,8 @@
- part_path = part - 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 = 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 :partial => "projects/refs", :locals => { :destination => tree_project_path(@project) }
.clear .clear
#tree-content-holder #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