forked from openSUSE/open-build-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[webui] First step of more useful user home / start page
- Loading branch information
Showing
3 changed files
with
218 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,203 @@ | ||
<% @pagetitle = "Home of #{@displayed_user}" %> | ||
<% @crumb_list = [@pagetitle] %> | ||
|
||
<h3><%= @pagetitle %></h3> | ||
|
||
<h4>User Info</h4> | ||
|
||
<p><strong>Profile picture:</strong></p> | ||
<table> | ||
<tr> | ||
<td><a href="http://gravatar.com/emails"><%= user_icon(@displayed_user.login, 60) if @displayed_user.email %></a></td> | ||
<td>Profile pictures are provided by <a href="http://gravatar.com/">Gravatar</a>,<br/> and are based on your email address | ||
<a href="http://gravatar.com/emails" class="block avatar"><span>Update your picture...</span></a> | ||
</td> | ||
</tr> | ||
</table> | ||
|
||
<p> | ||
<strong>Real name:</strong> | ||
<% if @displayed_user.realname && !@displayed_user.realname.to_s.empty? %> | ||
<%= h(@displayed_user.realname) %> | ||
<% else %> | ||
<em>No real name set.</em> | ||
<% end %> | ||
</p> | ||
<p><strong>Email address:</strong> <%= mail_to(@displayed_user.email) %></p> | ||
|
||
<% if @displayed_user.to_s == session[:login] %> | ||
<p><%= image_tag('icons/user_edit.png') %> <%= link_to("Edit user data", :controller => "user", :action => "edit") %></p> | ||
<% if defined?( CHANGE_PASSWD ) && CHANGE_PASSWD == 'on' %> | ||
<p><%= image_tag('icons/key.png') %> <%= link_to("Change password", :controller => "user", :action => "change_my_password") %></p> | ||
<% end %> | ||
<% end %> | ||
<% @pagetitle = 'Home' %> | ||
<% @layouttype = 'custom' %> | ||
<% @crumb_list = ['User', @displayed_user] %> | ||
<% if not @displayed_user.groups.empty? %> | ||
<h4>Groups Memberships</h4> | ||
<ul> | ||
<% @displayed_user.groups.each do |group| %> | ||
<li><%= group %> </li> | ||
<% end %> | ||
</ul> | ||
<% content_for :content_for_head do %> | ||
<%= stylesheet_link_tag 'jquery.dataTables' %> | ||
<% end %> | ||
<%= javascript_include_tag 'jquery.dataTables.min' %> | ||
|
||
<div class="grid_6 box box-shadow alpha"> | ||
<table class="user-detail"> | ||
<tbody> | ||
<tr> | ||
<td rowspan="3"> | ||
<a href="http://gravatar.com/emails"><%= user_icon(@displayed_user.login, 56) if @displayed_user.email %></a> | ||
</td> | ||
<td class="textright"><b>Name:</b></td> | ||
<td> | ||
<%= h(@displayed_user.realname) %> | ||
<%= link_to(image_tag('icons/user_edit.png'), :controller => "user", :action => "edit") %> | ||
<% if @displayed_user.to_s == session[:login] %> | ||
<% if defined?( CHANGE_PASSWD ) && CHANGE_PASSWD == 'on' %> | ||
<%= link_to(image_tag('icons/key.png'), :controller => "user", :action => "change_my_password") %> | ||
<% end %> | ||
<% end %> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td class="textright"><b>Mail:</b></td> | ||
<td><%= mail_to(@displayed_user.email) %></td> | ||
</tr> | ||
<tr> | ||
<td class="textright"><b>Project:</b></td> | ||
<td><%= link_to("home:#{@displayed_user.value('login')}", :controller => 'project', :action => 'show', :project => "home:#{@displayed_user.value('login')}") %></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
<div class="grid_10 box box-shadow omega"> | ||
</div> | ||
<%= render :partial => 'main/news' %> | ||
|
||
<div class="grid_16 box box-shadow alpha omega"> | ||
<div class="box-header header-tabs"> | ||
<ul id="user_select"> | ||
<li class="selected"> | ||
<a class="user_select_link" id="user_select_link_0" href="#"> | ||
Request Inbox <span id="request_in_count"></span> | ||
</a> | ||
</li> | ||
<li> | ||
<a class="user_select_link" id="user_select_link_1" href="#"> | ||
Request Outbox <span id="request_out_count"></span> | ||
</a> | ||
</li> | ||
<li> | ||
<a class="user_select_link" id="user_select_link_2" href="#"> | ||
Projects <% if not @projects.empty? %>(<%= @projects.length %>)<% end %> | ||
</a> | ||
</li> | ||
<li> | ||
<a class="user_select_link" id="user_select_link_3" href="#"> | ||
Packages <% if not @packages.empty? %>(<%= @packages.length %>)<% end %> | ||
</a> | ||
</li> | ||
<li> | ||
<a class="user_select_link" id="user_select_link_4" href="#"> | ||
Groups <% if not @displayed_user.groups.empty? %>(<%= @displayed_user.groups.length %>)<% end %> | ||
</a> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<div class="user_display" id="user_display_0"> | ||
<h4>Incomming</h4> | ||
</div> | ||
<div class="user_display" style="display:none" id="user_display_1"> | ||
<h4>Outgoing</h4> | ||
</div> | ||
|
||
<div class="user_display" style="display: none" id="user_display_2"> | ||
<% if not @projects.empty? %> | ||
<table id="user_projects_table"> | ||
<thead> | ||
<tr> | ||
<th>Project</th> | ||
<% @roles.each do |role| %> | ||
<th><%= role.capitalize %></th> | ||
<% end %> | ||
<th>Watched</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @projects.each do |project| %> | ||
<tr> | ||
<td><%= link_to(project, :controller => 'project', :action => 'show', :project => project) %></td> | ||
<% @roles.each do |role| %> | ||
<td>TODO</td> | ||
<% end %> | ||
<td>TODO</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
<% else %> | ||
<p>No roles in any project yet!</p> | ||
<% end %> | ||
</div> | ||
<div class="user_display" style="display: none" id="user_display_3"> | ||
<% if not @packages.empty? %> | ||
<table id="user_packages_table"> | ||
<thead> | ||
<tr> | ||
<th>Project</th> | ||
<th>Package</th> | ||
<% @roles.each do |role| %> | ||
<th><%= role.capitalize %></th> | ||
<% end %> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @packages.each do |project, pkgs| %> | ||
<% pkgs.each do |package| %> | ||
<tr> | ||
<td><%= link_to(project, :controller => 'project', :action => 'show', :project => project) %></td> | ||
<td><%= link_to(package, :controller => 'package', :action => 'show', :project => project, :package => package) %></td> | ||
<% @roles.each do |role| %> | ||
<td>TODO</td> | ||
<% end %> | ||
</tr> | ||
<% end %> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
<% else %> | ||
<p>No roles in any package yet!</p> | ||
<% end %> | ||
</div> | ||
<div class="user_display" style="display: none" id="user_display_4"> | ||
<% if not @displayed_user.groups.empty? %> | ||
<table id="user_groups_table"> | ||
<thead> | ||
<tr> | ||
<th>Group</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @displayed_user.groups.each do |group| %> | ||
<tr> | ||
<td><%= group %></td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
<% else %> | ||
<p>No membership in any group yet!</p> | ||
<% end %> | ||
</div> | ||
</div> | ||
|
||
<h4>Related Links</h4> | ||
<ul> | ||
<li><%= link_to('Home project', :controller => 'project', :action => 'show', :project => "home:#{@displayed_user.to_s}") %></li> | ||
<li><%= link_to('Involved projects', :action => 'list_my', :user => @displayed_user.to_s) %></li> | ||
<li><%= link_to('Involved requests', :action => 'requests', :user => @displayed_user.to_s) %></li> | ||
</ul> | ||
<% javascript_tag do %> | ||
$('.user_select_link').click(function (event) { | ||
$('#user_select li.selected').attr('class', ''); | ||
$(event.target).parent().attr('class', 'selected') | ||
$('.user_display').hide(); | ||
index = event.target.id.split('user_select_link_')[1] | ||
$('#user_display_' + index).show(); | ||
}); | ||
|
||
$(document).ready(function() { | ||
$.extend($.fn.dataTable.defaults, { | ||
'iDisplayLength': 25, | ||
}); | ||
|
||
<% if not @projects.empty? %> | ||
$('#user_projects_table').dataTable({ | ||
'aoColumns': [ | ||
null, | ||
<% @roles.length.times do %> | ||
{'bSortable': false}, | ||
<% end %> | ||
null, | ||
] | ||
}); | ||
<% end %> | ||
<% if not @packages.empty? %> | ||
$('#user_packages_table').dataTable({ | ||
'aoColumns': [ | ||
null, | ||
null, | ||
<% @roles.length.times do %> | ||
{'bSortable': false}, | ||
<% end %> | ||
] | ||
}); | ||
<% end %> | ||
<% if not @displayed_user.groups.empty? %> | ||
$('#user_groups_table').dataTable(); | ||
<% end %> | ||
}); | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters