Commit 5fb1b9ff authored by gitlabhq's avatar gitlabhq

view refactoring

parent 5e12f10c
class Admin::MailerController < ApplicationController class Admin::MailerController < ApplicationController
layout "admin"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :authenticate_admin! before_filter :authenticate_admin!
......
class Admin::ProjectsController < ApplicationController class Admin::ProjectsController < ApplicationController
layout "admin"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :authenticate_admin! before_filter :authenticate_admin!
......
class Admin::TeamMembersController < ApplicationController class Admin::TeamMembersController < ApplicationController
layout "admin"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :authenticate_admin! before_filter :authenticate_admin!
......
class Admin::UsersController < ApplicationController class Admin::UsersController < ApplicationController
layout "admin"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :authenticate_admin! before_filter :authenticate_admin!
......
class KeysController < ApplicationController class KeysController < ApplicationController
layout "profile"
respond_to :js respond_to :js
def index def index
......
class ProfileController < ApplicationController class ProfileController < ApplicationController
layout "profile"
def show def show
@user = current_user @user = current_user
end end
......
...@@ -28,6 +28,8 @@ module ApplicationHelper ...@@ -28,6 +28,8 @@ module ApplicationHelper
else else
"Never" "Never"
end end
rescue
"Never"
end end
def markdown(text) def markdown(text)
......
%div.top_project_menu
%span= link_to "Users", admin_users_path, :style => "width:50px;", :class => controller.controller_name == "users" ? "current" : nil
%span= link_to "Projects", admin_projects_path, :style => "width:50px;", :class => controller.controller_name == "projects" ? "current" : nil
%span= link_to "Teams", admin_team_members_path, :style => "width:50px;", :class => controller.controller_name == "team_members" ? "current" : nil
%span= link_to "Emails", admin_emails_path, :style => "width:50px;", :class => controller.controller_name == "mailer" ? "current" : nil
%table %table
%tr %thead
%th Name %th Name
%th Code %th Code
%th Path %th Path
......
- @admin_team_members.group_by(&:project).sort.each do |project, members| - @admin_team_members.group_by(&:project).sort.each do |project, members|
%h3= link_to project.name, [:admin, project] %h3= link_to project.name, [:admin, project]
%table %table
%tr %thead
%th Name %th Name
%th Email %th Email
%th Read %th Read
......
%table %table
%tr %thead
%th Admin %th Admin
%th Name %th Name
%th Email %th Email
......
!!!
%html
%head
%title
GitLab #{" - #{@project.name}" if @project && !@project.new_record?}
= stylesheet_link_tag "application"
= javascript_include_tag "application"
= csrf_meta_tags
%link{:href => "/assets/favicon.png", :rel => "icon", :type => "image/png"}/
= javascript_tag do
REQ_URI = "#{request.env["REQUEST_URI"]}";
REQ_REFFER = "#{request.env["HTTP_REFERER"]}";
%body{ :class => content_for?(:body_class) ? yield(:body_class) : 'project-page', :id => yield(:boyd_id)}
#container
= render :partial => "layouts/flash"
= render :partial => "layouts/head_panel"
.project-container
.project-sidebar
.fixed
%aside
= link_to "Users", admin_users_path, :class => controller.controller_name == "users" ? "current" : nil
= link_to "Projects", admin_projects_path, :class => controller.controller_name == "projects" ? "current" : nil
= link_to "Teams", admin_team_members_path, :class => controller.controller_name == "team_members" ? "current" : nil
= link_to "Emails", admin_emails_path, :class => controller.controller_name == "mailer" ? "current" : nil
.project-content
= yield
...@@ -19,11 +19,5 @@ ...@@ -19,11 +19,5 @@
= render :partial => "layouts/flash" = render :partial => "layouts/flash"
= render :partial => "layouts/head_panel" = render :partial => "layouts/head_panel"
%div{ :id => "main", :role => "main", :class => "container_4" } %div{ :id => "main", :role => "main", :class => "container_4" }
- if @project && !@project.new_record?
.top_bar.container= render :partial => "projects/top_menu"
- if ["keys", "profile"].include?(controller.controller_name)
.top_bar.container= render :partial => "profile/top_menu"
- if admin_namespace?
.top_bar.container= render :partial => "admin/top_menu"
= render :partial => "layouts/page_title" = render :partial => "layouts/page_title"
= yield = yield
!!!
%html
%head
%title
GitLab #{" - #{@project.name}" if @project && !@project.new_record?}
= stylesheet_link_tag "application"
= javascript_include_tag "application"
= csrf_meta_tags
%link{:href => "/assets/favicon.png", :rel => "icon", :type => "image/png"}/
= javascript_tag do
REQ_URI = "#{request.env["REQUEST_URI"]}";
REQ_REFFER = "#{request.env["HTTP_REFERER"]}";
%body{ :class => content_for?(:body_class) ? yield(:body_class) : 'project-page', :id => yield(:boyd_id)}
#container
= render :partial => "layouts/flash"
= render :partial => "layouts/head_panel"
.project-container
.project-sidebar
.fixed
%aside
= link_to "Profile", profile_path, :class => current_page?(:controller => "profile", :action => :show) ? "current" : nil
= link_to "Password", profile_password_path, :class => current_page?(:controller => "profile", :action => :password) ? "current" : nil
= link_to keys_path, :class => controller.controller_name == "keys" ? "current" : nil do
Keys
- unless current_user.keys.empty?
%span{ :class => "number" }= current_user.keys.count
.project-content
= yield
%div.top_project_menu
%span= link_to "Profile", profile_path, :class => current_page?(:controller => "profile", :action => :show) ? "current" : nil
%span= link_to "Password", profile_password_path, :style => "width:70px;", :class => current_page?(:controller => "profile", :action => :password) ? "current" : nil
%span= link_to "Keys", keys_path, :class => controller.controller_name == "keys" ? "current" : nil
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