Commit e64a174968fc58929e862f8214e700f26ecaa3c0
1 parent
96b53a9f
Exists in
master
and in
4 other branches
project membership widget. css fixes
Showing
7 changed files
with
54 additions
and
41 deletions
Show diff stats
app/assets/stylesheets/reset_bootstrap.scss
app/controllers/projects_controller.rb
app/models/users_project.rb
... | ... | @@ -32,6 +32,14 @@ class UsersProject < ActiveRecord::Base |
32 | 32 | c.update_project(project.path, project) |
33 | 33 | end |
34 | 34 | end |
35 | + | |
36 | + def project_access_human | |
37 | + Project.access_options.key(self.project_access) | |
38 | + end | |
39 | + | |
40 | + def repo_access_human | |
41 | + Repository.access_options.key(self.repo_access) | |
42 | + end | |
35 | 43 | end |
36 | 44 | # == Schema Information |
37 | 45 | # | ... | ... |
app/views/devise/sessions/new.html.erb
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | <%= f.password_field :password, :class => "text bottom", :placeholder => "Password" %> |
5 | 5 | |
6 | 6 | <% if devise_mapping.rememberable? -%> |
7 | - <div class="clearfix"> <%= f.label :remember_me %><%= f.check_box :remember_me %></div> | |
7 | + <div class="clearfix"> <%= f.label :remember_me %> <%= f.check_box :remember_me %></div> | |
8 | 8 | <% end -%> |
9 | 9 | <br/> |
10 | 10 | <%= f.submit "Sign in", :class => "primary btn" %> | ... | ... |
app/views/layouts/_project_side_right.html.haml
... | ... | @@ -4,43 +4,5 @@ |
4 | 4 | - else |
5 | 5 | - if content_for? :sidebar_top_block |
6 | 6 | = yield :sidebar_top_block |
7 | - - else | |
8 | - - if can? current_user, :write_project, @project | |
9 | - .alert-message.block-message.info | |
10 | - You have access to create new issue or merge request. | |
11 | - %div | |
12 | - = link_to new_project_issue_path(@project), :title => "New Issue", :class => "btn small" do | |
13 | - New Issue » | |
14 | - %div | |
15 | - = link_to new_project_merge_request_path(@project), :title => "New Merge Request", :class => "btn small" do | |
16 | - New Merge Request » | |
17 | - | |
18 | - - if current_user.projects.count > 0 | |
19 | - %div.entry | |
20 | - %h5 | |
21 | - Recent Projects: | |
22 | - %ul | |
23 | - - current_user.projects.order("id DESC").limit(5).each do |project| | |
24 | - %li | |
25 | - = link_to project_path(project) do | |
26 | - = project.name | |
27 | - = link_to "More » ", projects_path | |
28 | - | |
29 | - -#%h4 | |
30 | - -#Recent Issues: | |
31 | - -#%ul | |
32 | - -#- current_user.assigned_issues.order("id DESC").limit(5).each do |issue| | |
33 | - -#%li | |
34 | - -#= link_to project_issue_path(issue.project, issue) do | |
35 | - -#= truncate issue.title | |
36 | - | |
37 | - | |
38 | - -#%h4 | |
39 | - -#Recent Requests: | |
40 | - -#%ul | |
41 | - -#- current_user.assigned_merge_requests.order("id DESC").limit(5).each do |issue| | |
42 | - -#%li | |
43 | - -#= link_to project_merge_request_path(issue.project, issue) do | |
44 | - -#= truncate issue.title | |
45 | - | |
46 | - | |
7 | + = render "widgets/project_member" | |
8 | + = render "widgets/recent_projects" | ... | ... |
... | ... | @@ -0,0 +1,28 @@ |
1 | +- member = @project.team_member_by_id(current_user.id) | |
2 | +.widget | |
3 | + .media-grid | |
4 | + %li | |
5 | + = link_to project_team_member_path(@project, member), :title => current_user.name do | |
6 | + = image_tag gravatar_icon(current_user.email, 90), :class => "thumbnail" | |
7 | + .row | |
8 | + .span4 | |
9 | + %h4 | |
10 | + = truncate(current_user.name, :lenght => 24) | |
11 | + - if @project.owner == current_user | |
12 | + %span.label Project Owner | |
13 | + | |
14 | + .span3 | |
15 | + %span.label= member.project_access_human | |
16 | + %span.label= member.repo_access_human | |
17 | + | |
18 | + - if can? current_user, :write_project, @project | |
19 | + %hr | |
20 | + .span3 | |
21 | + %p You have access to create new issue or merge request. | |
22 | + %div | |
23 | + = link_to new_project_issue_path(@project), :title => "New Issue", :class => "" do | |
24 | + New Issue » | |
25 | + %div | |
26 | + = link_to new_project_merge_request_path(@project), :title => "New Merge Request", :class => "" do | |
27 | + New Merge Request » | |
28 | + | ... | ... |
... | ... | @@ -0,0 +1,10 @@ |
1 | +- if current_user.projects.count > 0 | |
2 | + %div.widget | |
3 | + %h4 | |
4 | + Recent Projects: | |
5 | + %ul | |
6 | + - current_user.projects.order("id DESC").limit(5).each do |project| | |
7 | + %li | |
8 | + = link_to project_path(project) do | |
9 | + = project.name | |
10 | + = link_to "More » ", projects_path | ... | ... |