User can create group

This commit is contained in:
Dmitriy Zaporozhets 2013-01-24 17:47:09 +02:00
parent d9027df5b5
commit f6c482c06f
12 changed files with 117 additions and 31 deletions

View file

@ -5,7 +5,7 @@
(#{groups.count})
- if current_user.can_create_group?
%span.right
= link_to new_admin_group_path, class: "btn very_small info" do
= link_to new_group_path, class: "btn very_small info" do
%i.icon-plus
New Group
%ul.well-list

View file

@ -0,0 +1,21 @@
%h3.page_title New Group
%hr
= form_for @group do |f|
- if @group.errors.any?
.alert-message.block-message.error
%span= @group.errors.full_messages.first
.clearfix
= f.label :name do
Group name is
.input
= f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left"
 
= f.submit 'Create group', class: "btn primary"
%hr
.padded
%ul
%li Group is kind of directory for several projects
%li All created groups are private
%li People within a group see only projects they have access to
%li All projects of group will be stored in group directory
%li You will be able to move existing projects into group

View file

@ -17,7 +17,7 @@
= link_to new_project_path, title: "Create New Project", class: 'has_bottom_tooltip', 'data-original-title' => 'New project' do
%i.icon-plus
%li
= link_to profile_path, title: "Your Profile", class: 'has_bottom_tooltip', 'data-original-title' => 'Your profile' do
= link_to profile_path, title: "My Profile", class: 'has_bottom_tooltip', 'data-original-title' => 'Your profile' do
%i.icon-user
%li.separator
%li

View file

@ -15,6 +15,12 @@
%span Namespace
.input
= f.select :namespace_id, namespaces_options(params[:namespace_id] || :current_user), {}, {class: 'chosen'}
- elsif current_user.can_create_group?
.clearfix
.input.light
Need a group for several projects?
= link_to new_group_path, class: "btn very_small" do
Create a group
%hr
%p.padded
New projects are private by default. You choose who can see the project and commit to repository.

View file

@ -0,0 +1,23 @@
.ui-box
%h5.title
Profile
%ul.well-list
%li
%strong Email
%span.right= mail_to @user.email
- unless @user.skype.blank?
%li
%strong Skype
%span.right= @user.skype
- unless @user.linkedin.blank?
%li
%strong LinkedIn
%span.right= @user.linkedin
- unless @user.twitter.blank?
%li
%strong Twitter
%span.right= @user.twitter
- unless @user.bio.blank?
%li
%strong Bio
%span.right= @user.bio

View file

@ -3,6 +3,11 @@
%h3.page_title
= image_tag gravatar_icon(@user.email, 90), class: "avatar s90"
= @user.name
- if @user == current_user
.right
= link_to profile_path, class: 'btn small' do
%i.icon-edit
Edit Profile
%br
%small @#{@user.username}
%br
@ -12,26 +17,5 @@
%h5 Recent events
= render @events
.span4
.ui-box
%h5.title Profile
%ul.well-list
%li
%strong Email
%span.right= mail_to @user.email
- unless @user.skype.blank?
%li
%strong Skype
%span.right= @user.skype
- unless @user.linkedin.blank?
%li
%strong LinkedIn
%span.right= @user.linkedin
- unless @user.twitter.blank?
%li
%strong Twitter
%span.right= @user.twitter
- unless @user.bio.blank?
%li
%strong Bio
%span.right= @user.bio
= render 'profile'
= render 'projects'