mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-19 17:46:07 +10:00
Merge branch 'feature/project_labels' of /home/git/repositories/gitlab/gitlabhq
This commit is contained in:
@@ -69,5 +69,14 @@ ul.bordered-list {
|
||||
display: block;
|
||||
margin: 0px;
|
||||
&:last-child { border:none }
|
||||
|
||||
&.active {
|
||||
background: #f9f9f9;
|
||||
a { font-weight: bold; }
|
||||
}
|
||||
|
||||
&.light {
|
||||
a { color: #777; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ class DashboardController < ApplicationController
|
||||
@projects
|
||||
end
|
||||
|
||||
@projects = @projects.tagged_with(params[:label]) if params[:label].present?
|
||||
@projects = @projects.search(params[:search]) if params[:search].present?
|
||||
@projects = @projects.page(params[:page]).per(30)
|
||||
end
|
||||
|
||||
@@ -3,6 +3,10 @@ module ProjectsHelper
|
||||
"You are going to remove #{user.name} from #{project.name} project team. Are you sure?"
|
||||
end
|
||||
|
||||
def projects_labels
|
||||
Project.tag_counts_on(:labels).map(&:name)
|
||||
end
|
||||
|
||||
def link_to_project project
|
||||
link_to project do
|
||||
title = content_tag(:strong, project.name)
|
||||
|
||||
@@ -28,12 +28,14 @@ class Project < ActiveRecord::Base
|
||||
include Gitlab::ShellAdapter
|
||||
extend Enumerize
|
||||
|
||||
attr_accessible :name, :path, :description, :default_branch, :issues_tracker,
|
||||
attr_accessible :name, :path, :description, :default_branch, :issues_tracker, :label_list,
|
||||
:issues_enabled, :wall_enabled, :merge_requests_enabled, :snippets_enabled, :issues_tracker_id,
|
||||
:wiki_enabled, :public, :import_url, :last_activity_at, as: [:default, :admin]
|
||||
|
||||
attr_accessible :namespace_id, :creator_id, as: :admin
|
||||
|
||||
acts_as_taggable_on :labels
|
||||
|
||||
attr_accessor :import_url
|
||||
|
||||
# Relations
|
||||
|
||||
@@ -20,6 +20,15 @@
|
||||
= nav_tab :scope, 'joined' do
|
||||
= link_to "Joined", projects_dashboard_path(scope: 'joined')
|
||||
|
||||
%p.light Filter by label:
|
||||
%ul.bordered-list
|
||||
- projects_labels.each do |label|
|
||||
%li{ class: (label == params[:label]) ? 'active' : 'light' }
|
||||
= link_to projects_dashboard_path(scope: params[:scope], label: label) do
|
||||
%i.icon-tag
|
||||
= label
|
||||
|
||||
|
||||
.span9
|
||||
= form_tag projects_dashboard_path, method: 'get' do
|
||||
%fieldset.dashboard-search-filter
|
||||
@@ -49,6 +58,10 @@
|
||||
.left
|
||||
- if project.description.present?
|
||||
%span.light= project.description
|
||||
- project.labels.each do |label|
|
||||
%span.label.label-info
|
||||
%i.icon-tag
|
||||
= label.name
|
||||
|
||||
.pull-right.light
|
||||
%small.light
|
||||
|
||||
@@ -57,6 +57,15 @@
|
||||
authentication.
|
||||
It will also be listed on the #{link_to "public access directory", public_root_path}.
|
||||
|
||||
%fieldset.features
|
||||
%legend
|
||||
Labels:
|
||||
.control-group
|
||||
= f.label :label_list, "Labels", class: 'control-label'
|
||||
.controls
|
||||
= f.text_field :label_list, maxlength: 2000, class: "xxlarge"
|
||||
%p.hint Separate with comma.
|
||||
|
||||
%fieldset.features
|
||||
%legend
|
||||
Features:
|
||||
|
||||
Reference in New Issue
Block a user