rails_3_0
Wojciech Todryk 2011-07-21 17:59:55 +02:00
parent a7dd8c90c9
commit ab3931d08b
41 changed files with 100 additions and 110 deletions

0
.gitignore vendored Normal file → Executable file
View File

0
AUTHORS Normal file → Executable file
View File

0
README.markdown Normal file → Executable file
View File

0
UNLICENSE Normal file → Executable file
View File

View File

@ -7,12 +7,18 @@ class ApplicationController < ActionController::Base
before_filter :user_login_filter
before_filter :add_scripts
#before_filter :localize
before_filter :current_user
#filter_parameter_logging :password #upgrade to Rails3
protected
def current_user
#@current_user ||= Customer.find(logged_user)
#logger.debug "Current User: #{@current_user.inspect}"
end
def theme_resolver
CDF::CONFIG[:theme] || CDF::CONFIG[:default_theme]
end

View File

@ -43,6 +43,8 @@ class WebmailController < ApplicationController
session["return_to"] = nil
@search_field = params['search_field']
@search_value = params['search_value']
@folder_name = params['folder_name']
# handle sorting - tsort session field contains last reverse or no for field
# and lsort - last sort field
@ -98,6 +100,8 @@ class WebmailController < ApplicationController
else
@pages = Paginator.new self, folder.total, get_mail_prefs.wm_rows, @page
@messages = folder.messages(@pages.current.first_item - 1, get_mail_prefs.wm_rows, sort_query + (reverse_sort ? ' desc' : ' asc'))
#folder.synchronize_cache(@pages.current.first_item - 1, get_mail_prefs.wm_rows)
@messages = ImapMessage.getAll(@current_user.email,@folder_name,sort_query + (reverse_sort ? ' desc' : ' asc'))
end
end

View File

@ -15,12 +15,16 @@ module NavigationHelper
link_to( t(:filters), :controller=>"webmail", :action=>"filters")
end
def link_contacts
link_to( t(:contacts), contacts_path)
end
def folder_manage_link(folder)
if folder.name == CDF::CONFIG[:mail_trash] or folder.name == CDF::CONFIG[:mail_inbox] or folder.name == CDF::CONFIG[:mail_sent]
short_fn(folder)
else
short_fn(folder) + '&nbsp;' + link_to(t(:delete), folder_path(folder.name), :method => :delete)
end
end
end
def link_import_preview() "/contacts/import_preview" end
@ -29,7 +33,7 @@ module NavigationHelper
def link_contact_choose() url_for(:controller => :contacts, :action => :choose) end
def link_contact_list
link_to(t(:list), :controller => :contacts, :action => :index)
link_to(t(:list), :controller => :contacts, :action => :index)
end
def link_contact_add_one
@ -37,17 +41,17 @@ module NavigationHelper
end
def link_contact_add_multiple
link_to(t(:add_multiple), :controller => :contacts, :action => "add_multiple")
link_to(t(:add_multiple), :controller => :contacts, :action => "add_multiple")
end
def link_contact_group_list
link_to(t(:groups), :controller => :contact_group, :action => :index)
def link_contact_group_list
link_to(t(:groups), :controller => :contact_group, :action => :index)
end
def link_folders
link_to( t(:folders), :controller=>:webmail, :action=>:messages)
end
private
def short_fn(folder)
@ -57,4 +61,15 @@ module NavigationHelper
folder.name
end
end
def main_navigation(active)
s = ""
s += "<ul class=\"wat-cf\">"
active == :folders ? s += "<li class=\"first active\">#{link_folders}</li>" : s += "<li class=\"first\">#{links_folders}</li>"
active == :compose ? s += "<li class=\"active\">#{link_send_mail}</li>" : s += "<li>#{link_send_mail}</li>"
active == :prefs ? s += "<li class=\"active\">#{link_mail_prefs}</li>" : s += "<li>#{link_mail_prefs}</li>"
active == :filters ? s += "<li class=\"active\">#{link_mail_filters}</li>" : s += "<li>#{link_mail_filters}</li>"
active == :contacts ? s += "<li class=\"active\">#{link_contacts}</li>" : s += "<li>#{link_contacts}</li>"
s += "</ul>"
end
end

View File

@ -149,11 +149,11 @@ module WebmailHelper
def message_size(size)
if size / (1024*1024) > 0
return "#{(size / (1024*1024)).round}&nbsp;MB"
return "#{(size / (1024*1024)).round} MB"
elsif size / 1024 > 0
return "#{(size / (1024)).round}&nbsp;KB"
return "#{(size / (1024)).round} kB"
else
return "#{size}&nbsp;B"
return "#{size} B"
end
end

0
app/views/contents_moved_to_original_theme_directory Normal file → Executable file
View File

0
arts/logo2.xcf Normal file → Executable file
View File

0
arts/logo3.xcf Normal file → Executable file
View File

0
config/database.yml.example Normal file → Executable file
View File

View File

@ -14,7 +14,7 @@ pl:
filters: Filtry
contacts: Kontakty
search: Szukaj
search_txt: Szukaj w polu wiadomości
search_txt: ciąg znaków
refresh: Odśwież
operations: Akcje
operations_txt: Akcje na zaznaczonych wiadomościach
@ -70,3 +70,8 @@ pl:
add_to_contacts: Dodaj do kontaktów
want_to_empty_trash_message: Czy chcesz opróznic kosz?
site_link: https://github.com/lmanolov/mailr
marked_messages: zaznaczone wiadomości
to_folder: do folderu
message_field: Pole wiadomości
no_messages_found: Nie znaleziono żadnych wiadomości

0
public/images/logo3.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

0
public/images/logo3_dark.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

0
public/javascripts/.gitkeep Normal file → Executable file
View File

0
public/javascripts/application.js Normal file → Executable file
View File

0
public/javascripts/controls.js vendored Normal file → Executable file
View File

0
public/javascripts/dragdrop.js vendored Normal file → Executable file
View File

0
public/javascripts/effects.js vendored Normal file → Executable file
View File

0
public/javascripts/prototype.js vendored Normal file → Executable file
View File

0
public/javascripts/rails.js Normal file → Executable file
View File

0
themes/olive/README.olive Normal file → Executable file
View File

0
themes/olive/images/.gitkeep Normal file → Executable file
View File

0
themes/olive/images/key.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 612 B

After

Width:  |  Height:  |  Size: 612 B

0
themes/olive/images/logo_small.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

0
themes/olive/javascripts/.gitkeep Normal file → Executable file
View File

0
themes/olive/stylesheets/.gitkeep Normal file → Executable file
View File

24
themes/olive/stylesheets/base.css Normal file → Executable file
View File

@ -16,10 +16,10 @@
.wat-cf {display: block;}
/* End hide from IE-mac */
h1 { margin: 15px 0; font-size: 22px; font-weight: normal; }
h2 { font-size: 22px; margin: 15px 0; font-weight: normal;}
h3 { font-size: 18px; margin: 10px 0; font-weight: normal;}
h4 { font-size: 16px; margin: 10px 0; font-weight: normal;}
h1 { margin: 15px 0; font-size: 10px; font-weight: normal; }
h2 { font-size: 22px; margin: 7px 0; font-weight: normal;}
h3 { font-size: 18px; margin: 5px 0; font-weight: normal;}
h4 { font-size: 16px; margin: 5px 0; font-weight: normal;}
hr {height: 1px; border: 0; }
p { margin: 15px 0;}
a img { border: none; }
@ -58,7 +58,7 @@ body {
}
.actions-bar {
padding: 10px 1px;
padding: 5px 1px;
}
.actions-bar .actions {
@ -85,15 +85,15 @@ body {
#sidebar .block {
margin-bottom: 20px;
padding-bottom: 10px;
padding-bottom: 1px;
}
#sidebar .block .content {
padding: 0 15px;
padding: 5px;
}
#sidebar ul.navigation li {
padding: 3px 10px;
padding: 3px;
}
#sidebar .block .sidebar-block, #sidebar .notice {
@ -200,7 +200,7 @@ body {
}
.table th {
padding: 10px;
padding: 5px;
font-weight: bold;
text-align: left;
}
@ -218,7 +218,7 @@ body {
}
.table td {
padding: 10px;
padding: 5px;
}
.table td.last {
@ -395,3 +395,7 @@ button.button:hover, a.button:hover {
button.button:active, a.button:active {
background-color:#e5e5e5;
}
div.block h3 a {
color: white;
}

19
themes/olive/stylesheets/style.css Normal file → Executable file
View File

@ -69,7 +69,7 @@ p {
#main .block .content {
background: #FFF;
padding-top: 1px;
padding: 10px;
}
#main .block .content h2 {
@ -344,3 +344,20 @@ ul.list li .item .avatar {
height: 65;
background-color: #EFF3E4;
}
div.block div.actions-bar {
margin: 5px;
}
tr.notseen td.subject {
font-weight: bold;
}
input,select {
background-color: #EFF3E4;
border: 1px solid #5E634E;
color: #black;
margin: 5px 0 0;
}

0
themes/olive/views/layouts/.gitkeep Normal file → Executable file
View File

0
themes/olive/views/login/index.html.erb Normal file → Executable file
View File

View File

@ -1,9 +1,13 @@
<div class="block">
<h3><%=t :folders %> <%= link_to t(:add_edit_folder), folders_path %></h3>
<h3><%=t :folders %> <%= link_to t(:add_edit_folder), folders_path %> <%= link_refresh %></h3>
<div class="content">
<ul class="navigation">
<% @folders.each do |folder| -%>
<li><%= raw folder_link(folder) %></li>
<% end -%>
</ul>
<input name="logout" type="submit" value ="<%= t :logout %>" onclick="window.location='<%= url_for(:controller => :login, :action => :logout) %>'" />
</div>
</div>

View File

@ -6,9 +6,9 @@
<td class="from"><%= short_address(message_row.from_addr) %></td>
<% end %>
<td class="subject"><div class='cutField'>
<%= link_to(parse_subject(message_row.subject) << "&nbsp;" , :controller=>'webmail', :action=>'message', :msg_id=>message_row.uid)%>
<%= link_to(parse_subject(message_row.subject) << " " , :controller=>'webmail', :action=>'message', :msg_id=>message_row.uid)%>
</td>
<td class="date"><%= message_date(message_row.date) %></td>
<td class="size"><%= message_size(message_row.size) %></td>
<td class="attachind"><%= message_row.content_type == 'multipart' ? image_tag(current_theme_image_path('attachment.png')) : '&nbsp;' %></td>
<td class="attachind"><%= message_row.content_type == 'multipart' ? image_tag(current_theme_image_path('attachment.png')) : ' ' %></td>
</tr>

View File

@ -1,13 +1,7 @@
<a href='#' onclick='toggle_msg_search(true);'>
<%= t :search%><img id='img_msg_search' alt='open' src="<%= current_theme_image_path(@srch_img_src+'.gif') %>"/>
</a>
<div id="msg_search" class='<%=@srch_class%>'>
<%= t :search_txt %>&nbsp;
<select name="search_field">
<%= options_for_select(CDF::CONFIG[:mail_search_fields], @search_field)%>
</select>&nbsp;
<label for="search_value"><%= t :for %></label>&nbsp;
<input type="text" name="search_value" value="<%=@search_value%>" size='16' id='search_value'/>&nbsp;
<%= submit_tag(t(:search), :name=>'op')%>&nbsp;
<%= submit_tag(t(:show_all), :name=>'op')%>
</div>
<p>
<%= t :message_field %>
<select name="search_field">
<%= options_for_select(CDF::CONFIG[:mail_search_fields], @search_field)%>
</select> <label for="search_value"> <%= t :search_txt %>
</label> <input type="text" name="search_value" value="<%=@search_value%>" size='16' id='search_value'/> <%= submit_tag(t(:search), :name=>'op')%> <%= submit_tag(t(:show_all), :name=>'op')%>
</p>

View File

@ -1,80 +1,21 @@
<h1><%= t :mailbox %></h1>
<div id="header">
<ul id="primary">
<li><span><%= t :folders %></span>
<ul id="secondary">
<li><%=link_refresh%></li>
</ul>
</li>
<li><%=link_send_mail%></li>
<li><%=link_mail_prefs%></li>
<li><%=link_mail_filters%></li>
<li><%=link_main%></li>
</ul>
</div>
<div id="tab_main">
<div id="tab_content">
<% content_for :logo do %>
<%= render :partial => 'shared/logo' %>
<% end %>
<% content_for :sidebar do %>
<%= render :partial => 'shared/folders' %>
<% end %>
<div id="messages">
<div id="msglist">
<h2><%= @folder_name %></h2>
<%= form_tag({:controller=>'webmail', :action=>'messages'})%>
<div class='notviscode'><input type="submit" name="op" value="<%= t :search %>" /></div>
<input type="hidden" name="page" value="<%=@page%>"/>
<a href='#' onclick='toggle_msg_operations(true);'>
<%=t :operations%><img id='img_msgops' alt='open' src="<%= current_theme_image_path(@ops_img_src+'.gif') %>"/>
</a>
<div id="msgops" class='<%=@ops_class%>'>
<h4><%= t :operations_txt %></h4>
<span id="opch">
<%= submit_tag(t(:delete), :name=>'op')%>
<%= submit_tag(t(:copy), :name=> 'op')%>
<%= submit_tag(t(:move), :name=>'op')%>
<%= submit_tag(t(:mark_read), :name=>'op')%>
<%= submit_tag(t(:mark_unread), :name=>'op')%>
</span><br/>
<span id="destp">
<%= t :destination_txt %>&nbsp;
<select name="cpdest" size="1">
<% for folder in @folders %>
<option value="<%=folder.name%>"><%=folder.name%></option>
<% end %>
</select>
</span>
<div class="block" id="block-tables">
<div class="secondary-navigation">
<%= raw main_navigation(:folders) %>
</div>
<div class="content">
<%= form_tag({:controller=>'webmail', :action=>'messages'})%>
<%= render :partial => 'shared/msg_ops' %>
<%= render :partial => "search" %>
<%= render :partial => 'shared/messages' %>
</form>
</div>
<%= render :partial => "search" %>
<%= page_navigation_webmail @pages if @pages.page_count > 1 %>
<table width='98%'>
<thead>
<tr>
<th width="1%"><input type="checkbox" name="allbox" onclick="checkAll(this.form)" style="margin: 0 0 0 4px" /></th>
<% if @folder_name == CDF::CONFIG[:mail_sent] %>
<th width="20%"><%= link_to(t(:to), :controller=>:webmail, :action=>:messages, :op=>'SORT', :page=>@page, :scc=>'to_flat')%></th>
<% else %>
<th width="20%"><%= link_to(t(:from), :controller=>:webmail, :action=>:messages, :op=>'SORT', :page=>@page, :scc=>'from_flat')%></th>
<% end%>
<th width='60%'><%= link_to(t(:subject), :controller=>:webmail, :action=>:messages, :op=>'SORT', :page=>@page, :scc=>'subject')%></th>
<th><%= link_to(t(:date), :controller=>:webmail, :action=>:messages, :op=>'SORT', :page=>@page, :scc=>'date')%></th>
<th><%= link_to(t(:size), :controller=>:webmail, :action=>:messages, :op=>'SORT', :page=>@page, :scc=>'size')%></th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<% for message in @messages %>
<%= render :partial => 'message_row', :object => message %>
<% end %>
</tbody>
</table>
<%= page_navigation_webmail @pages if @pages.page_count > 1 %>
</form>
</div>
</div>
</div>
</div>

0
themes/original/images/.gitkeep Normal file → Executable file
View File

0
themes/original/images/logo.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

0
themes/original/javascripts/.gitkeep Normal file → Executable file
View File

0
themes/original/views/layouts/.gitkeep Normal file → Executable file
View File

0
themes/original/views/layouts/public.html.erb Normal file → Executable file
View File