From 49b2fb24bc0a06b41c6ff328f8a8c63b26921c31 Mon Sep 17 00:00:00 2001 From: gitlabhq Date: Fri, 11 Nov 2011 11:35:51 -0500 Subject: [PATCH] remove fluiod layout --- app/controllers/application_controller.rb | 17 ----------------- app/helpers/application_helper.rb | 4 ++-- app/views/layouts/_head_panel.html.erb | 4 +--- app/views/projects/_recent_commits.html.haml | 2 +- app/views/projects/_recent_messages.html.haml | 4 ++-- app/views/projects/_tree_item.html.haml | 2 +- 6 files changed, 7 insertions(+), 26 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7fee598e3..2580f84ea 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,9 +1,6 @@ class ApplicationController < ActionController::Base before_filter :authenticate_user! - before_filter :view_style - protect_from_forgery - helper_method :abilities, :can? rescue_from Gitosis::AccessDenied do |exception| @@ -76,20 +73,6 @@ class ApplicationController < ActionController::Base redirect_to @project unless @project.repo_exists? end - def view_style - if params[:view_style] == "collapsed" - cookies[:view_style] = "collapsed" - elsif params[:view_style] == "fluid" - cookies[:view_style] = "fluid" - end - - @view_mode = if cookies[:view_style] == "fluid" - :fluid - else - :collapsed - end - end - def respond_with_notes if params[:last_id] && params[:first_id] @notes = @notes.where("id >= ?", params[:first_id]) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9c072f629..17c831daf 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -7,7 +7,7 @@ module ApplicationHelper end def fixed_mode? - @view_mode == :fluid + true end def body_class(default_class = nil) @@ -15,7 +15,7 @@ module ApplicationHelper default_class : content_for(:body_class) - [main, @view_mode].join(" ") + [main, "collapsed"].join(" ") end def commit_name(project, commit) diff --git a/app/views/layouts/_head_panel.html.erb b/app/views/layouts/_head_panel.html.erb index 8815b17f3..7af6effd1 100644 --- a/app/views/layouts/_head_panel.html.erb +++ b/app/views/layouts/_head_panel.html.erb @@ -11,10 +11,8 @@ diff --git a/app/views/projects/_recent_commits.html.haml b/app/views/projects/_recent_commits.html.haml index 5e9eca8d0..7dfc19712 100644 --- a/app/views/projects/_recent_commits.html.haml +++ b/app/views/projects/_recent_commits.html.haml @@ -22,7 +22,7 @@ - else = image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;" .title - %p= link_to truncate(commit.safe_message, :length => fixed_mode? ? 40 : 100), project_commit_path(@project, :id => commit.id) + %p= link_to truncate(commit.safe_message, :length => 40), project_commit_path(@project, :id => commit.id) %span %span.author diff --git a/app/views/projects/_recent_messages.html.haml b/app/views/projects/_recent_messages.html.haml index 1a8c8c972..57583f5cd 100644 --- a/app/views/projects/_recent_messages.html.haml +++ b/app/views/projects/_recent_messages.html.haml @@ -7,14 +7,14 @@ %thead %th %div{ :class => "recent_message_parent"} - = link_to(truncate(dashboard_feed_title(parent), :length => fixed_mode? ? 40 : 100 ), dashboard_feed_path(@project, parent)) + = link_to(truncate(dashboard_feed_title(parent), :length => 40 ), dashboard_feed_path(@project, parent)) - notes.sort {|x,y| y.updated_at <=> x.updated_at }.each do |note| %tr %td %div.message = image_tag gravatar_icon(note.author_email), :class => "left", :width => 40, :style => "padding-right:5px;" %div.title - = link_to markdown(truncate(note.note, :length => fixed_mode? ? 40 : 100)), dashboard_feed_path(@project, parent) + "#note_#{note.id}" + = link_to markdown(truncate(note.note, :length => 40)), dashboard_feed_path(@project, parent) + "#note_#{note.id}" - if note.attachment.url %br Attachment: diff --git a/app/views/projects/_tree_item.html.haml b/app/views/projects/_tree_item.html.haml index 273d02723..1637202cb 100644 --- a/app/views/projects/_tree_item.html.haml +++ b/app/views/projects/_tree_item.html.haml @@ -12,7 +12,7 @@ = time_ago_in_words(content_commit.committed_date) ago %td.commit - = link_to truncate(content_commit.safe_message, :length => fixed_mode? ? 40 : 80), project_commit_path(@project, content_commit), :class => "tree-commit-link" + = link_to truncate(content_commit.safe_message, :length => 40), project_commit_path(@project, content_commit), :class => "tree-commit-link" - tm = @project.team_member_by_name_or_email(content_commit.author_email, content_commit.author_name) - if tm = link_to "[#{tm.user_name}]", project_team_member_path(@project, tm) -- 2.11.0