* project settings split in 4 tabs
* prototype.js upgraded to 1.5.0_rc1 git-svn-id: http://redmine.rubyforge.org/svn/trunk@181 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
b9ef10fe3f
commit
190fef513f
@ -22,16 +22,16 @@ class IssueCategoriesController < ApplicationController
|
|||||||
def edit
|
def edit
|
||||||
if request.post? and @category.update_attributes(params[:category])
|
if request.post? and @category.update_attributes(params[:category])
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to :controller => 'projects', :action => 'settings', :id => @project
|
redirect_to :controller => 'projects', :action => 'settings', :tab => 'categories', :id => @project
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@category.destroy
|
@category.destroy
|
||||||
redirect_to :controller => 'projects', :action => 'settings', :id => @project
|
redirect_to :controller => 'projects', :action => 'settings', :tab => 'categories', :id => @project
|
||||||
rescue
|
rescue
|
||||||
flash[:notice] = "Categorie can't be deleted"
|
flash[:notice] = "Categorie can't be deleted"
|
||||||
redirect_to :controller => 'projects', :action => 'settings', :id => @project
|
redirect_to :controller => 'projects', :action => 'settings', :tab => 'categories', :id => @project
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -16,21 +16,21 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
class MembersController < ApplicationController
|
class MembersController < ApplicationController
|
||||||
layout 'base'
|
layout 'base'
|
||||||
before_filter :find_project, :authorize
|
before_filter :find_project, :authorize
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
if request.post? and @member.update_attributes(params[:member])
|
if request.post? and @member.update_attributes(params[:member])
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to :controller => 'projects', :action => 'settings', :id => @project
|
redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@member.destroy
|
@member.destroy
|
||||||
flash[:notice] = l(:notice_successful_delete)
|
flash[:notice] = l(:notice_successful_delete)
|
||||||
redirect_to :controller => 'projects', :action => 'settings', :id => @project
|
redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def find_project
|
def find_project
|
||||||
|
@ -138,7 +138,7 @@ class ProjectsController < ApplicationController
|
|||||||
@issue_category = @project.issue_categories.build(params[:issue_category])
|
@issue_category = @project.issue_categories.build(params[:issue_category])
|
||||||
if @issue_category.save
|
if @issue_category.save
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
redirect_to :action => 'settings', :id => @project
|
redirect_to :action => 'settings', :tab => 'categories', :id => @project
|
||||||
else
|
else
|
||||||
settings
|
settings
|
||||||
render :action => 'settings'
|
render :action => 'settings'
|
||||||
@ -151,7 +151,7 @@ class ProjectsController < ApplicationController
|
|||||||
@version = @project.versions.build(params[:version])
|
@version = @project.versions.build(params[:version])
|
||||||
if request.post? and @version.save
|
if request.post? and @version.save
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
redirect_to :action => 'settings', :id => @project
|
redirect_to :action => 'settings', :tab => 'versions', :id => @project
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -161,7 +161,7 @@ class ProjectsController < ApplicationController
|
|||||||
if request.post?
|
if request.post?
|
||||||
if @member.save
|
if @member.save
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
redirect_to :action => 'settings', :id => @project
|
redirect_to :action => 'settings', :tab => 'members', :id => @project
|
||||||
else
|
else
|
||||||
settings
|
settings
|
||||||
render :action => 'settings'
|
render :action => 'settings'
|
||||||
|
@ -22,16 +22,16 @@ class VersionsController < ApplicationController
|
|||||||
def edit
|
def edit
|
||||||
if request.post? and @version.update_attributes(params[:version])
|
if request.post? and @version.update_attributes(params[:version])
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to :controller => 'projects', :action => 'settings', :id => @project
|
redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@version.destroy
|
@version.destroy
|
||||||
redirect_to :controller => 'projects', :action => 'settings', :id => @project
|
redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
|
||||||
rescue
|
rescue
|
||||||
flash[:notice] = "Unable to delete version"
|
flash[:notice] = "Unable to delete version"
|
||||||
redirect_to :controller => 'projects', :action => 'settings', :id => @project
|
redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
|
||||||
end
|
end
|
||||||
|
|
||||||
def download
|
def download
|
||||||
|
@ -1,13 +1,24 @@
|
|||||||
<h2><%=l(:label_settings)%></h2>
|
<h2><%=l(:label_settings)%></h2>
|
||||||
|
|
||||||
|
<div class="tabs">
|
||||||
|
<ul>
|
||||||
|
<li><%= link_to l(:label_information_plural), {}, :id=> "tab-info", :onclick => "showTab('info'); this.blur(); return false;" %></li>
|
||||||
|
<li><%= link_to l(:label_member_plural), {}, :id=> "tab-members", :onclick => "showTab('members'); this.blur(); return false;" %></li>
|
||||||
|
<li><%= link_to l(:label_version_plural), {}, :id=> "tab-versions", :onclick => "showTab('versions'); this.blur(); return false;" %></li>
|
||||||
|
<li><%= link_to l(:label_issue_category_plural), {}, :id=> "tab-categories", :onclick => "showTab('categories'); this.blur(); return false;" %></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="tab-content-info" class="tab-content">
|
||||||
<% if authorize_for('projects', 'edit') %>
|
<% if authorize_for('projects', 'edit') %>
|
||||||
<% labelled_tabular_form_for :project, @project, :url => { :action => "edit", :id => @project } do |f| %>
|
<% labelled_tabular_form_for :project, @project, :url => { :action => "edit", :id => @project } do |f| %>
|
||||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||||
<%= submit_tag l(:button_save) %>
|
<%= submit_tag l(:button_save) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<br />
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="tab-content-members" class="tab-content" style="display:none;">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<h3><%=l(:label_member_plural)%></h3>
|
<h3><%=l(:label_member_plural)%></h3>
|
||||||
<%= error_messages_for 'member' %>
|
<%= error_messages_for 'member' %>
|
||||||
@ -36,7 +47,7 @@
|
|||||||
<% if authorize_for('projects', 'add_member') %>
|
<% if authorize_for('projects', 'add_member') %>
|
||||||
<hr />
|
<hr />
|
||||||
<label><%=l(:label_member_new)%></label><br/>
|
<label><%=l(:label_member_new)%></label><br/>
|
||||||
<%= start_form_tag :controller => 'projects', :action => 'add_member', :id => @project %>
|
<%= start_form_tag :controller => 'projects', :action => 'add_member', :tab => 'members', :id => @project %>
|
||||||
<select name="member[user_id]">
|
<select name="member[user_id]">
|
||||||
<%= options_from_collection_for_select @users, "id", "display_name", @member.user_id %>
|
<%= options_from_collection_for_select @users, "id", "display_name", @member.user_id %>
|
||||||
</select>
|
</select>
|
||||||
@ -47,7 +58,9 @@
|
|||||||
<%= end_form_tag %>
|
<%= end_form_tag %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="tab-content-versions" class="tab-content" style="display:none;">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<h3><%=l(:label_version_plural)%></h3>
|
<h3><%=l(:label_version_plural)%></h3>
|
||||||
<table>
|
<table>
|
||||||
@ -68,8 +81,9 @@
|
|||||||
<%= link_to l(:label_version_new), :controller => 'projects', :action => 'add_version', :id => @project %>
|
<%= link_to l(:label_version_new), :controller => 'projects', :action => 'add_version', :id => @project %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="tab-content-categories" class="tab-content" style="display:none;">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<h3><%=l(:label_issue_category_plural)%></h3>
|
<h3><%=l(:label_issue_category_plural)%></h3>
|
||||||
<table>
|
<table>
|
||||||
@ -95,7 +109,7 @@
|
|||||||
</table>
|
</table>
|
||||||
<% if authorize_for('projects', 'add_issue_category') %>
|
<% if authorize_for('projects', 'add_issue_category') %>
|
||||||
<hr />
|
<hr />
|
||||||
<%= start_form_tag :action => 'add_issue_category', :id => @project %>
|
<%= start_form_tag :action => 'add_issue_category', :tab => 'categories', :id => @project %>
|
||||||
<label for="issue_category_name"><%=l(:label_issue_category_new)%></label><br/>
|
<label for="issue_category_name"><%=l(:label_issue_category_new)%></label><br/>
|
||||||
<%= error_messages_for 'issue_category' %>
|
<%= error_messages_for 'issue_category' %>
|
||||||
<%= text_field 'issue_category', 'name', :size => 25 %>
|
<%= text_field 'issue_category', 'name', :size => 25 %>
|
||||||
@ -103,3 +117,7 @@
|
|||||||
<%= end_form_tag %>
|
<%= end_form_tag %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<%= tab = params[:tab] ? h(params[:tab]) : 'info'
|
||||||
|
javascript_tag "showTab('#{tab}');" %>
|
@ -16,4 +16,18 @@ function addFileField() {
|
|||||||
p = document.getElementById("attachments_p");
|
p = document.getElementById("attachments_p");
|
||||||
p.appendChild(document.createElement("br"));
|
p.appendChild(document.createElement("br"));
|
||||||
p.appendChild(f);
|
p.appendChild(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
function showTab(name) {
|
||||||
|
var f = $$('div#content .tab-content');
|
||||||
|
for(var i=0; i<f.length; i++){
|
||||||
|
Element.hide(f[i]);
|
||||||
|
}
|
||||||
|
var f = $$('div.tabs a');
|
||||||
|
for(var i=0; i<f.length; i++){
|
||||||
|
Element.removeClassName(f[i], "selected");
|
||||||
|
}
|
||||||
|
Element.show('tab-content-' + name);
|
||||||
|
Element.addClassName('tab-' + name, "selected");
|
||||||
|
return false;
|
||||||
}
|
}
|
1170
public/javascripts/prototype.js
vendored
1170
public/javascripts/prototype.js
vendored
File diff suppressed because it is too large
Load Diff
@ -215,6 +215,30 @@ font-family: Trebuchet MS,Georgia,"Times New Roman",serif;
|
|||||||
#content dt{font-weight:bold; margin-bottom:5px;}
|
#content dt{font-weight:bold; margin-bottom:5px;}
|
||||||
#content dd{margin:0 0 10px 15px;}
|
#content dd{margin:0 0 10px 15px;}
|
||||||
|
|
||||||
|
#content .tabs{height: 2.6em;}
|
||||||
|
#content .tabs ul{margin:0;}
|
||||||
|
#content .tabs ul li{
|
||||||
|
float:left;
|
||||||
|
list-style-type:none;
|
||||||
|
white-space:nowrap;
|
||||||
|
margin-right:8px;
|
||||||
|
background:#fff;
|
||||||
|
}
|
||||||
|
#content .tabs ul li a{
|
||||||
|
display:block;
|
||||||
|
font-size: 0.9em;
|
||||||
|
text-decoration:none;
|
||||||
|
line-height:1em;
|
||||||
|
padding:4px;
|
||||||
|
border: 1px solid #c0c0c0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content .tabs ul li a.selected, #content .tabs ul li a:hover{
|
||||||
|
background-color: #80b0da;
|
||||||
|
border: 1px solid #80b0da;
|
||||||
|
color: #fff;
|
||||||
|
text-decoration:none;
|
||||||
|
}
|
||||||
|
|
||||||
/***********************************************/
|
/***********************************************/
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user