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
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/application.js4
-rw-r--r--app/assets/stylesheets/projects.css.scss41
-rw-r--r--app/controllers/projects_controller.rb42
-rw-r--r--app/helpers/application_helper.rb21
-rw-r--r--app/models/note.rb1
-rw-r--r--app/models/project.rb37
-rw-r--r--app/models/snippet.rb6
-rw-r--r--app/views/commits/_commits.html.haml4
-rw-r--r--app/views/commits/_diff.html.haml51
-rw-r--r--app/views/commits/_diff_head.html.haml24
-rw-r--r--app/views/commits/_text_file.html.haml15
-rw-r--r--app/views/commits/show.js.haml4
-rw-r--r--app/views/notes/_form.html.haml4
-rw-r--r--app/views/notes/_notes.html.haml17
-rw-r--r--app/views/notes/_show.html.haml12
-rw-r--r--app/views/notes/create.js.haml2
-rw-r--r--app/views/projects/_recent_commits.html.haml4
-rw-r--r--app/views/projects/_recent_messages.html.haml6
-rw-r--r--app/views/projects/_top_menu.html.haml2
-rw-r--r--app/views/projects/_tree_file.html.haml11
-rw-r--r--app/views/projects/empty.html.erb7
-rw-r--r--app/views/projects/show.html.haml7
-rw-r--r--app/views/projects/wall.html.haml28
-rw-r--r--app/views/snippets/show.html.haml3
-rw-r--r--app/views/team_members/_show.html.haml6
-rw-r--r--app/views/team_members/show.html.haml28
26 files changed, 253 insertions, 134 deletions
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index 01e3b416526..024dfe1182a 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -16,3 +16,7 @@ $(function(){
$('select#branch').selectmenu({style:'popup', width:200});
$('select#tag').selectmenu({style:'popup', width:200});
});
+
+function updatePage(){
+ $.ajax({type: "GET", url: location.href, dataType: "script"});
+}
diff --git a/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss
index 860523b046a..8caa2810e78 100644
--- a/app/assets/stylesheets/projects.css.scss
+++ b/app/assets/stylesheets/projects.css.scss
@@ -491,8 +491,14 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
background: white;
}
p {
- margin-bottom: 3px;
- font-size: 12px;
+ margin-bottom: 4px;
+ font-size: 13px;
+ color:#111;
+ }
+ }
+ cite {
+ &.ago {
+ color:#666;
}
}
}
@@ -515,7 +521,7 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
}
.note_content {
float:left;
- width:750px;
+ width:650px;
}
.issue_notes {
@@ -605,7 +611,9 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
}
}
-.message{
+.commit,
+.message,
+#notes-list{
.author {
background: #eaeaea;
color: #333;
@@ -614,3 +622,28 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
margin-right:5px;
}
}
+
+/* Note textare */
+#note_note {
+ height:100px;
+ width:97%;
+ font-size:14px;
+}
+
+.wall_page {
+ #note_note {
+ height:25px;
+ }
+ .attach_holder {
+ display:none;
+ }
+}
+
+.field_with_errors {
+ input[type="text"],
+ input[type="password"],
+ textarea
+ {
+ background: none repeat scroll 0 0 #FFBBBB
+ }
+}
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 8ce3ca97ccb..54d19af7511 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -60,24 +60,21 @@ class ProjectsController < ApplicationController
end
def show
- if @project.repo_exists?
- @date = case params[:view]
- when "week" then Date.today - 7.days
- else Date.today
- end.at_beginning_of_day
-
- @heads = @project.repo.heads
- @commits = @heads.map do |h|
- @project.repo.log(h.name, nil, :since => @date)
- end.flatten.uniq { |c| c.id }
-
- @commits.sort! do |x, y|
- y.committed_date <=> x.committed_date
- end
-
- @messages = project.notes.since(@date).limit(40).order("created_at DESC")
- else
- return render "projects/empty"
+ return render "projects/empty" unless @project.repo_exists?
+ @date = case params[:view]
+ when "week" then Date.today - 7.days
+ when "day" then Date.today
+ else nil
+ end
+
+ if @date
+ @date = @date.at_beginning_of_day
+
+ @commits = @project.commits_since(@date)
+ @messages = project.notes.since(@date).order("created_at DESC")
+ else
+ @commits = @project.fresh_commits
+ @messages = project.notes.fresh.limit(10)
end
end
@@ -86,8 +83,15 @@ class ProjectsController < ApplicationController
#
def wall
- @notes = @project.common_notes
@note = Note.new
+ @notes = @project.common_notes.order("created_at DESC")
+
+ @notes = case params[:view]
+ when "week" then @notes.since((Date.today - 7.days).at_beginning_of_day)
+ when "all" then @notes.all
+ when "day" then @notes.since(Date.today.at_beginning_of_day)
+ else @notes.fresh.limit(10)
+ end
end
#
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index c389fd4a904..0895eb0d1ba 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -53,25 +53,4 @@ module ApplicationHelper
[projects, default_nav, project_nav].flatten.to_json
end
- def handle_file_type(file_name, mime_type = nil)
- if file_name =~ /(\.rb|\.ru|\.rake|Rakefile|\.gemspec|\.rbx|Gemfile)$/
- :ruby
- elsif file_name =~ /\.py$/
- :python
- elsif file_name =~ /(\.pl|\.scala|\.c|\.cpp|\.java|\.haml|\.html|\.sass|\.scss|\.xml|\.php|\.erb)$/
- $1[1..-1].to_sym
- elsif file_name =~ /\.js$/
- :javascript
- elsif file_name =~ /\.sh$/
- :bash
- elsif file_name =~ /\.coffee$/
- :coffeescript
- elsif file_name =~ /\.yml$/
- :yaml
- elsif file_name =~ /\.md$/
- :minid
- else
- :text
- end
- end
end
diff --git a/app/models/note.rb b/app/models/note.rb
index 71fd9dcd136..e3dabce4791 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -24,6 +24,7 @@ class Note < ActiveRecord::Base
scope :last_week, where("created_at >= :date", :date => (Date.today - 7.days))
scope :since, lambda { |day| where("created_at >= :date", :date => (day)) }
+ scope :fresh, order("created_at DESC")
mount_uploader :attachment, AttachmentUploader
end
diff --git a/app/models/project.rb b/app/models/project.rb
index f51bd9b3ad4..5262e55245d 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -35,7 +35,8 @@ class Project < ActiveRecord::Base
:presence => true
validate :check_limit
-
+ validate :repo_name
+
after_destroy :destroy_gitosis_project
after_save :update_gitosis_project
@@ -126,6 +127,34 @@ class Project < ActiveRecord::Base
end
end
+ def heads
+ @heads ||= repo.heads
+ end
+
+ def fresh_commits
+ commits = heads.map do |h|
+ repo.commits(h.name, 10)
+ end.flatten.uniq { |c| c.id }
+
+ commits.sort! do |x, y|
+ y.committed_date <=> x.committed_date
+ end
+
+ commits[0..10]
+ end
+
+ def commits_since(date)
+ commits = heads.map do |h|
+ repo.log(h.name, nil, :since => date)
+ end.flatten.uniq { |c| c.id }
+
+ commits.sort! do |x, y|
+ y.committed_date <=> x.committed_date
+ end
+
+ commits
+ end
+
def tree(fcommit, path = nil)
fcommit = commit if fcommit == :head
tree = fcommit.tree
@@ -140,6 +169,12 @@ class Project < ActiveRecord::Base
errors[:base] << ("Cant check your ability to create project")
end
+ def repo_name
+ if path == "gitosis-admin"
+ errors.add(:path, " like 'gitosis-admin' is not allowed")
+ end
+ end
+
def valid_repo?
repo
rescue
diff --git a/app/models/snippet.rb b/app/models/snippet.rb
index 0a54fee7e2f..95d6a07d545 100644
--- a/app/models/snippet.rb
+++ b/app/models/snippet.rb
@@ -1,4 +1,6 @@
class Snippet < ActiveRecord::Base
+ include Utils::Colorize
+
belongs_to :project
belongs_to :author, :class_name => "User"
has_many :notes, :as => :noteable
@@ -28,6 +30,10 @@ class Snippet < ActiveRecord::Base
".js", ".sh", ".coffee", ".yml", ".md"
]
end
+
+ def colorize
+ system_colorize(content, file_name)
+ end
end
# == Schema Information
#
diff --git a/app/views/commits/_commits.html.haml b/app/views/commits/_commits.html.haml
index 5a3ba3a7f46..94a1bd1b995 100644
--- a/app/views/commits/_commits.html.haml
+++ b/app/views/commits/_commits.html.haml
@@ -15,8 +15,8 @@
= link_to "Browse Code", tree_project_path(@project, :commit_id => commit.id), :class => "lite_button", :style => "float:right"
= link_to truncate(commit.id.to_s, :length => 16), project_commit_path(@project, :id => commit.id), :class => "lite_button", :style => "width:120px;float:right"
%span
- %span
- [ #{commit.author} ]
+ %span.author
+ = commit.author
= time_ago_in_words(commit.committed_date)
ago
= more_commits_link if @commits.size > 99
diff --git a/app/views/commits/_diff.html.haml b/app/views/commits/_diff.html.haml
index dff99bf12f0..2807e0903da 100644
--- a/app/views/commits/_diff.html.haml
+++ b/app/views/commits/_diff.html.haml
@@ -1,28 +1,5 @@
-- require "utils"
-.file_stats
- - @commit.diffs.each do |diff|
- - if diff.deleted_file
- %span.removed_file
- %a{:href => "##{diff.a_path}"}
- = diff.a_path
- = image_tag "blueprint_delete.png"
- - elsif diff.renamed_file
- %span.moved_file
- %a{:href => "##{diff.b_path}"}
- = diff.a_path
- = "->"
- = diff.b_path
- = image_tag "blueprint_notice.png"
- - elsif diff.new_file
- %span.new_file
- %a{:href => "##{diff.b_path}"}
- = diff.b_path
- = image_tag "blueprint_add.png"
- - else
- %span.edit_file
- %a{:href => "##{diff.b_path}"}
- = diff.b_path
- = image_tag "blueprint_info.png"
+.file_stats= render "commits/diff_head"
+
- @commit.diffs.each do |diff|
- next if diff.diff.empty?
- file = (@commit.tree / diff.b_path)
@@ -32,27 +9,15 @@
- if diff.deleted_file
%strong{:id => "#{diff.b_path}"}= diff.a_path
- else
- %strong{:id => "#{diff.b_path}"}= diff.b_path
+ = link_to tree_file_project_path(@project, @commit.id, diff.b_path) do
+ %strong{:id => "#{diff.b_path}"}= diff.b_path
%br/
.diff_file_content
- - if file.mime_type =~ /application|text/ && !Utils.binary?(file.data)
- - lines_arr = diff.diff.lines.to_a
- - line_old = lines_arr[2].match(/-(\d)/)[0].to_i.abs rescue 0
- - line_new = lines_arr[2].match(/\+(\d)/)[0].to_i.abs rescue 0
- - lines = lines_arr[3..-1].join
- - lines.each_line do |line|
- = diff_line(line, line_new, line_old)
- - if line[0] == "+"
- - line_new += 1
- - elsif
- - line[0] == "-"
- - line_old += 1
- - else
- - line_new += 1
- - line_old += 1
- - elsif file.mime_type =~ /image/
+ - if file.text?
+ = render :partial => "commits/text_file", :locals => { :diff => diff }
+ - elsif file.image?
.diff_file_content_image
- %img{:src => "data:image/jpeg;base64,#{Base64.encode64(file.data)}"}
+ %img{:src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
- else
%p
%center No preview for this file type
diff --git a/app/views/commits/_diff_head.html.haml b/app/views/commits/_diff_head.html.haml
new file mode 100644
index 00000000000..922c35990af
--- /dev/null
+++ b/app/views/commits/_diff_head.html.haml
@@ -0,0 +1,24 @@
+- @commit.diffs.each do |diff|
+ - if diff.deleted_file
+ %span.removed_file
+ %a{:href => "##{diff.a_path}"}
+ = diff.a_path
+ = image_tag "blueprint_delete.png"
+ - elsif diff.renamed_file
+ %span.moved_file
+ %a{:href => "##{diff.b_path}"}
+ = diff.a_path
+ = "->"
+ = diff.b_path
+ = image_tag "blueprint_notice.png"
+ - elsif diff.new_file
+ %span.new_file
+ %a{:href => "##{diff.b_path}"}
+ = diff.b_path
+ = image_tag "blueprint_add.png"
+ - else
+ %span.edit_file
+ %a{:href => "##{diff.b_path}"}
+ = diff.b_path
+ = image_tag "blueprint_info.png"
+
diff --git a/app/views/commits/_text_file.html.haml b/app/views/commits/_text_file.html.haml
new file mode 100644
index 00000000000..b20aa8afe40
--- /dev/null
+++ b/app/views/commits/_text_file.html.haml
@@ -0,0 +1,15 @@
+- lines_arr = diff.diff.lines.to_a
+- line_old = lines_arr[2].match(/-(\d)/)[0].to_i.abs rescue 0
+- line_new = lines_arr[2].match(/\+(\d)/)[0].to_i.abs rescue 0
+- lines = lines_arr[3..-1].join
+- lines.each_line do |line|
+ = diff_line(line, line_new, line_old)
+ - if line[0] == "+"
+ - line_new += 1
+ - elsif
+ - line[0] == "-"
+ - line_old += 1
+ - else
+ - line_new += 1
+ - line_old += 1
+
diff --git a/app/views/commits/show.js.haml b/app/views/commits/show.js.haml
index 2c46689b1ed..cec1fe28348 100644
--- a/app/views/commits/show.js.haml
+++ b/app/views/commits/show.js.haml
@@ -1,6 +1,8 @@
-:plain
+-#:plain
$("#side-commit-preview").remove();
var side = $("<div id='side-commit-preview'></div>");
side.html("#{escape_javascript(render "commits/show")}");
$("##{dom_id(@project)}").parent().append(side);
$("##{dom_id(@project)}").addClass("span-14");
+:plain
+ $("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");
diff --git a/app/views/notes/_form.html.haml b/app/views/notes/_form.html.haml
index 8eaf968c803..ca56a2450a0 100644
--- a/app/views/notes/_form.html.haml
+++ b/app/views/notes/_form.html.haml
@@ -12,9 +12,9 @@
= f.label :note
%cite (255 symbols only)
%br
- = f.text_area :note, :style => "width:97%;height:100px", :size => 255
+ = f.text_area :note, :size => 255
- %div
+ %div.attach_holder
= f.label :attachment
%cite (less than 10 MB)
%br
diff --git a/app/views/notes/_notes.html.haml b/app/views/notes/_notes.html.haml
index c93a47239fb..2d110162eca 100644
--- a/app/views/notes/_notes.html.haml
+++ b/app/views/notes/_notes.html.haml
@@ -1,9 +1,12 @@
-%ul#notes-list= render "notes/notes_list"
+- if controller.action_name == "wall"
+ %ul#notes-list= render "notes/notes_list"
-%br
-%br
-- if can? current_user, :write_note, @project
- = render "notes/form"
+- else
+ %ul#notes-list= render "notes/notes_list"
+ %br
+ %br
+ - if can? current_user, :write_note, @project
+ = render "notes/form"
:javascript
$('.delete-note').live('ajax:success', function() {
@@ -23,7 +26,3 @@
$(function(){
var int =self.setInterval("updatePage()", 20000);
});
-
- function updatePage(){
- $.ajax({type: "GET", url: location.href, dataType: "script"});
- }
diff --git a/app/views/notes/_show.html.haml b/app/views/notes/_show.html.haml
index 2b0a6d2ebcd..ee9f9ffaa4b 100644
--- a/app/views/notes/_show.html.haml
+++ b/app/views/notes/_show.html.haml
@@ -1,19 +1,17 @@
%li{:id => dom_id(note)}
%div.note_author
= image_tag gravatar_icon(note.author.email), :class => "left", :width => 40, :style => "padding-right:5px;"
- %div.note_content
+ %div.note_content.left
= simple_format(html_escape(note.note))
- if note.attachment.url
Attachment:
- = link_to note.attachment_identifier, note.attachment.url
+ = link_to note.attachment_identifier, note.attachment.url, :target => "_blank"
%br
- %span
- %span
- [ #{note.author.name} ]
- &nbsp;
+ %span.author= note.author.name
+ %cite.ago
= time_ago_in_words(note.updated_at)
ago
- %br
+ %br
- if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project)
= link_to 'Remove', [@project, note], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "lbutton delete-note right negative"
.clear
diff --git a/app/views/notes/create.js.haml b/app/views/notes/create.js.haml
index 0af548ff855..15371dbce2b 100644
--- a/app/views/notes/create.js.haml
+++ b/app/views/notes/create.js.haml
@@ -1,7 +1,7 @@
- if @note.valid?
:plain
$("#new_note .errors").remove();
- $("#notes-list").append("#{escape_javascript(render(:partial => 'show', :locals => {:note => @note} ))}");
+ updatePage();
$('#note_note').val("");
- else
:plain
diff --git a/app/views/projects/_recent_commits.html.haml b/app/views/projects/_recent_commits.html.haml
index 812be93c1a3..e435ea30f00 100644
--- a/app/views/projects/_recent_commits.html.haml
+++ b/app/views/projects/_recent_commits.html.haml
@@ -9,8 +9,8 @@
= link_to truncate_commit_message(commit, 60), project_commit_path(@project, :id => commit.id)
%span
- %span
- [ #{commit.author} ]
+ %span.author
+ = commit.author.name.force_encoding("UTF-8")
%cite
= time_ago_in_words(commit.committed_date)
ago
diff --git a/app/views/projects/_recent_messages.html.haml b/app/views/projects/_recent_messages.html.haml
index 03f723da877..1af7fe3bb24 100644
--- a/app/views/projects/_recent_messages.html.haml
+++ b/app/views/projects/_recent_messages.html.haml
@@ -46,12 +46,6 @@
Attachment:
= link_to note.attachment_identifier, note.attachment.url
%br
- -#%span
- %span
- [ #{note.author.name} ]
- %cite
- = time_ago_in_words(note.created_at)
- ago
%br
.append-bottom
&nbsp;
diff --git a/app/views/projects/_top_menu.html.haml b/app/views/projects/_top_menu.html.haml
index e281b93b287..59f2533ea7f 100644
--- a/app/views/projects/_top_menu.html.haml
+++ b/app/views/projects/_top_menu.html.haml
@@ -5,7 +5,7 @@
%span= link_to "Tree", tree_project_path(@project), :class => current_page?(:controller => "projects", :action => "tree", :id => @project) ? "current" : nil
%span= link_to "Commits", project_commits_path(@project), :class => current_page?(:controller => "commits", :action => "index", :project_id => @project) ? "current" : nil
%span
- = link_to team_project_path(@project), :class => current_page?(:controller => "projects", :action => "team", :id => @project) ? "current" : nil do
+ = link_to team_project_path(@project), :class => (current_page?(:controller => "projects", :action => "team", :id => @project) || controller.controller_name == "team_members") ? "current" : nil do
Team
- if @project.users_projects.count > 0
%span{ :class => "top_menu_count" }= @project.users_projects.count
diff --git a/app/views/projects/_tree_file.html.haml b/app/views/projects/_tree_file.html.haml
index 3463bfc543f..41a2287aa8c 100644
--- a/app/views/projects/_tree_file.html.haml
+++ b/app/views/projects/_tree_file.html.haml
@@ -1,4 +1,4 @@
-- require "utils"
+:css
.view_file
.view_file_header
%strong
@@ -6,14 +6,13 @@
= link_to "raw", blob_project_path(@project, :commit_id => @commit.id, :path => params[:path] ), :class => "right", :target => "_blank"
= link_to "history", project_commits_path(@project, :path => params[:path]), :class => "right", :style => "margin-right:10px;"
%br/
- - if file.mime_type =~ /application|text/ && !Utils.binary?(file.data)
+ - if file.text?
.view_file_content
- - ft = handle_file_type(file.name, file.mime_type)
:erb
- <%= raw Albino.colorize(content, ft, :html, 'utf-8', "linenos=True") %>
- - elsif file.mime_type =~ /image/
+ <%= raw file.colorize %>
+ - elsif file.image?
.view_file_content_image
- %img{ :src => "data:image/jpeg;base64,#{Base64.encode64(file.data)}"}
+ %img{ :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
- else
%p
%center No preview for this file type
diff --git a/app/views/projects/empty.html.erb b/app/views/projects/empty.html.erb
index a8917471550..4c60facde8c 100644
--- a/app/views/projects/empty.html.erb
+++ b/app/views/projects/empty.html.erb
@@ -1,3 +1,4 @@
+<% bash_lexer = Pygments::Lexer[:bash] %>
<div class="">
<div class="git-empty">
<h2>Git global setup:</h2>
@@ -6,7 +7,7 @@ git config --global user.name "#{current_user.name}"
git config --global user.email "#{current_user.email}"
eos
%>
- <%= raw Albino.colorize(setup_str, :bash) %>
+ <%= raw bash_lexer.highlight(setup_str) %>
<br />
<br />
<h2>Next steps:</h2>
@@ -21,7 +22,7 @@ git remote add origin #{@project.url_to_repo}
git push -u origin master
eos
%>
- <%= raw Albino.colorize(repo_setup_str, :bash) %>
+ <%= raw bash_lexer.highlight(repo_setup_str) %>
<br /><br />
<h2>Existing Git Repo?</h2>
@@ -31,7 +32,7 @@ git remote add origin #{@project.url_to_repo}
git push -u origin master
eos
%>
- <%= raw Albino.colorize(exist_repo_setup_str, :bash) %>
+ <%= raw bash_lexer.highlight(exist_repo_setup_str) %>
<br /><br />
<h2>Remove this project?</h2>
diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml
index ff6078c15a0..85019ecbe5d 100644
--- a/app/views/projects/show.html.haml
+++ b/app/views/projects/show.html.haml
@@ -1,9 +1,12 @@
%div
- %h2.left Recent history
+ %h2.left History
.right
= form_tag project_path(@project), :method => :get do
.span-2
- = radio_button_tag :view, "day", (params[:view] || "day") == "day", :onclick => "this.form.submit()", :id => "day_view"
+ = radio_button_tag :view, "recent", (params[:view] || "recent") == "recent", :onclick => "this.form.submit()", :id => "recent_view"
+ = label_tag "recent_view","Recent"
+ .span-2
+ = radio_button_tag :view, "day", params[:view] == "day", :onclick => "this.form.submit()", :id => "day_view"
= label_tag "day_view","Today"
.span-2
= radio_button_tag :view, "week", params[:view] == "week", :onclick => "this.form.submit()", :id => "week_view"
diff --git a/app/views/projects/wall.html.haml b/app/views/projects/wall.html.haml
index 479bb3cfc5b..ed22478c924 100644
--- a/app/views/projects/wall.html.haml
+++ b/app/views/projects/wall.html.haml
@@ -1 +1,29 @@
+%div.wall_page
+ - if can? current_user, :write_note, @project
+ = render "notes/form"
+ .right
+ = form_tag wall_project_path(@project), :method => :get do
+ .span-2
+ = radio_button_tag :view, "recent", (params[:view] || "recent") == "recent", :onclick => "this.form.submit()", :id => "recent_view"
+ = label_tag "recent_view","Recent"
+ .span-2
+ = radio_button_tag :view, "day", params[:view] == "day", :onclick => "this.form.submit()", :id => "day_view"
+ = label_tag "day_view","Today"
+ .span-2
+ = radio_button_tag :view, "week", params[:view] == "week", :onclick => "this.form.submit()", :id => "week_view"
+ = label_tag "week_view","Week"
+ .span-2
+ = radio_button_tag :view, "all", params[:view] == "all", :onclick => "this.form.submit()", :id => "all_view"
+ = label_tag "all_view","All"
+ .clear
+ %br
+ %hr
= render "notes/notes"
+
+:javascript
+ $(function(){
+ $("#note_note").live("click", function(){
+ $(this).css("height", "100px");
+ $('.attach_holder').show();
+ });
+ });
diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml
index bb444efec79..899950b7c36 100644
--- a/app/views/snippets/show.html.haml
+++ b/app/views/snippets/show.html.haml
@@ -7,9 +7,8 @@
= @snippet.file_name
%br/
.view_file_content
- - ft = handle_file_type(@snippet.file_name)
:erb
- <%= raw Albino.colorize(@snippet.content, ft, :html, 'utf-8', "linenos=True") %>
+ <%= raw @snippet.colorize %>
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
= link_to 'Edit', edit_project_snippet_path(@project, @snippet), :class => "lbutton positive"
diff --git a/app/views/team_members/_show.html.haml b/app/views/team_members/_show.html.haml
index 6d310768afa..b9a68e6cfb0 100644
--- a/app/views/team_members/_show.html.haml
+++ b/app/views/team_members/_show.html.haml
@@ -1,8 +1,10 @@
- user = member.user
%tr{:id => dom_id(member)}
%td
- = image_tag gravatar_icon(user.email), :class => "left", :width => 40, :style => "padding:0 5px;"
- = truncate user.name, :lenght => 16
+ = link_to image_tag(gravatar_icon(user.email), :class => "left", :width => 40, :style => "padding:0 5px;"), project_team_member_path(@project, member)
+
+ = link_to truncate(user.name, :lenght => 16), project_team_member_path(@project, member)
+
%td= truncate user.email, :lenght => 16
- if can? current_user, :admin_project, @project
= form_for(member, :as => :team_member, :url => project_team_member_path(@project, member)) do |f|
diff --git a/app/views/team_members/show.html.haml b/app/views/team_members/show.html.haml
new file mode 100644
index 00000000000..d07c54f8b68
--- /dev/null
+++ b/app/views/team_members/show.html.haml
@@ -0,0 +1,28 @@
+- user = @team_member.user
+.span-2
+ = image_tag gravatar_icon(user.email), :class => "left", :width => 60, :style => "padding-right:5px;"
+%p
+ %b Name:
+ = user.name
+%p
+ %b Email:
+ = user.email
+
+%br
+
+- unless user.skype.empty?
+ .div
+ %b Skype:
+ = user.skype
+
+- unless user.linkedin.empty?
+ .div
+ %b LinkedIn:
+ = user.linkedin
+
+- unless user.twitter.empty?
+ .div
+ %b Twitter:
+ = user.twitter
+
+