diff --git a/README.markdown b/README.markdown index 6dcff2b..bce7ecf 100755 --- a/README.markdown +++ b/README.markdown @@ -1,3 +1,5 @@ +**NOTE** The last stable version is 0.8.6. Now I try to moved code to Rails 3.2.2 and add Boostrap from Tweeter as default theme. Not all sources that you can find in _MASTER_ branch were already moved, so some views can be broken. + ## Introduction _MailR_ is a IMAP mail client based on _Ruby on Rails_ platform. diff --git a/app/assets/stylesheets/mailr.css.sass b/app/assets/stylesheets/mailr.css.sass index 32b115a..5596978 100755 --- a/app/assets/stylesheets/mailr.css.sass +++ b/app/assets/stylesheets/mailr.css.sass @@ -31,3 +31,21 @@ table.header text-align: right font-weight: bold padding-right: 10px + +p.help-block + font-size: 10px + +.custom_pagination + text-align: right + em.current + font-weight: bold + font-size: 16px + +table.records + font-size: 12px + td + padding: 4px + +iframe + width: 700px + height: 800px diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8384d89..9440b5a 100755 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -90,12 +90,6 @@ class ApplicationController < ActionController::Base ##################################### private section ########################################## - private - - def plugins_configuration - WillPaginate::ViewHelpers.pagination_options[:previous_label] = t(:previous_page,:scope=>:common) - WillPaginate::ViewHelpers.pagination_options[:next_label] = t(:next_page,:scope=>:common) - end end diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 5e88477..f3593e8 100755 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -80,7 +80,7 @@ class UserController < ApplicationController #@server.user_id = @user.id #@server.save Prefs.create_default(@user) - Server.create_defaults(@user) + Server.create_server(@user,@server.name) flash[:success] = t(:setup_done,:scope=>:user) redirect_to :action => 'login' else diff --git a/app/helpers/folder_helper.rb b/app/helpers/folder_helper.rb index 1102dd9..5b54202 100755 --- a/app/helpers/folder_helper.rb +++ b/app/helpers/folder_helper.rb @@ -1,19 +1,25 @@ module FolderHelper - def folder_link(folder) + def folder_link(options={}) + + folder = options[:folder] + active = "" + if options[:active] + active = "icon-white" + end folder.parent.empty? ? name = folder.name : name = folder.parent.gsub(/\./,'#') + "#" + folder.name if folder.isInbox? - name_shown = t(:inbox_name,:scope => :folder) + name_shown = "" + t(:inbox_name,:scope => :folder) elsif folder.isSent? - name_shown = t(:sent_name,:scope => :folder) + name_shown = "" + t(:sent_name,:scope => :folder) elsif folder.isDrafts? - name_shown = t(:drafts_name,:scope => :folder) + name_shown = "" + t(:drafts_name,:scope => :folder) elsif folder.isTrash? - name_shown = t(:trash_name,:scope => :folder) + name_shown = "" +t(:trash_name,:scope => :folder) else - name_shown = folder.name.capitalize + name_shown = "" + folder.name.capitalize end if folder.isTrash? diff --git a/app/helpers/messages_helper.rb b/app/helpers/messages_helper.rb index f370e21..7a3b327 100755 --- a/app/helpers/messages_helper.rb +++ b/app/helpers/messages_helper.rb @@ -98,6 +98,9 @@ module MessagesHelper html << link_to(Message.human_attribute_name(f), {:controller => 'messages',:action => 'index',:sort_field => f,:sort_dir => dir}, {:class=>"header"}) html << "" end + if @current_folder == @drafts_folder + html << " " + end html end diff --git a/app/models/server.rb b/app/models/server.rb index 02b4f41..97d2dbb 100755 --- a/app/models/server.rb +++ b/app/models/server.rb @@ -12,9 +12,13 @@ class Server < ActiveRecord::Base where(:for_smtp=>true).first end - def self.create_defaults(user) + def self.create_default(user) + create_server(user,"localhost") + end + + def self.create_server(user,server) create( :user_id=>user.id, - :name=>"localhost", + :name=>server, :port=>$defaults['imap_port'], :use_ssl=>false, :use_tls=>false, @@ -22,7 +26,7 @@ class Server < ActiveRecord::Base :for_imap=>true ) create( :user_id=>user.id, - :name=>"localhost", + :name=>server, :port=>$defaults['smtp_port'], :use_ssl=>false, :use_tls=>false, diff --git a/app/views/common/_click_button.html.haml b/app/views/common/_click_button.html.haml deleted file mode 100755 index cf933d1..0000000 --- a/app/views/common/_click_button.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -- size ||= "btn-small" -- type ||= "btn-primary" - -%button{:class=>"btn #{size} #{type}",:type=>"submit",:onclick=>"window.location='#{url}'"} - %i{:class=>"#{icon}"} - = t(text.to_sym, :scope => scope.to_sym) diff --git a/app/views/common/_form_button.html.haml b/app/views/common/_form_button.html.haml deleted file mode 100755 index 3543b03..0000000 --- a/app/views/common/_form_button.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -.control-group - .controls - %button{:class=>"btn btn-primary",:type=>"submit"} - = text diff --git a/app/views/common/_form_button_icon.html.haml b/app/views/common/_form_button_icon.html.haml deleted file mode 100755 index f1e33a6..0000000 --- a/app/views/common/_form_button_icon.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -- size ||= "btn-small" -- type ||= "btn-primary" - -%button{:class=>"btn #{size} #{type}",:type=>"submit", :name=>"#{name}"} - %i{:class=>"#{icon_class}"} - = text diff --git a/app/views/folders/_list.html.haml b/app/views/folders/_list.html.haml index 16b75d4..33b7862 100755 --- a/app/views/folders/_list.html.haml +++ b/app/views/folders/_list.html.haml @@ -10,7 +10,7 @@ - @folders_shown.each do |folder| - if folder == @current_folder %li{:class=>"active"} - = folder_link(folder) + = folder_link(:folder=>folder,:active=>true) - else %li - = folder_link(folder) + = folder_link(:folder=>folder,:active=>false) diff --git a/app/views/internal/_version.html.erb b/app/views/internal/_version.html.erb deleted file mode 100755 index 881c09d..0000000 --- a/app/views/internal/_version.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -

-<%= link_to (t(:version,:scope=>:common) + " " + $defaults["version"]),about_path %> -

- diff --git a/app/views/internal/about.html.erb b/app/views/internal/about.html.erb deleted file mode 100755 index 4698b30..0000000 --- a/app/views/internal/about.html.erb +++ /dev/null @@ -1,33 +0,0 @@ -<% content_for :title do %> -- <%= t(:about,:scope=>:internal) %> -<% end %> - -<% content_for :sidebar do %> -<%= content_for_sidebar %> -<% end %> - -
- -
- -

-<%= t(:current_version,:scope=>:internal) + ": " + $defaults["version"] %> -

- -
-<%= raw BlueCloth::new(render :file => 'README.markdown').to_html %> -
- -
-<%= raw BlueCloth::new(render :file => 'CHANGES').to_html %> -
- -
-<%= raw BlueCloth::new(render :file => 'TODO').to_html %> -
- - -
- diff --git a/app/views/internal/about.html.haml b/app/views/internal/about.html.haml new file mode 100755 index 0000000..bf55267 --- /dev/null +++ b/app/views/internal/about.html.haml @@ -0,0 +1,52 @@ += content_for :sidebar do + = render :partial => "sidebar/sidebar" + += content_for :title do + = t(:about,:scope=>:internal) + += render :partial => 'common/main_navigation', :locals => { :about => :active } + +.well{:style=>"padding: 5px 3pt;"} + %h3 + = t(:current_version,:scope=>:internal) + ": " + $defaults["version"] +.well + = raw BlueCloth::new(render :file => 'README.markdown').to_html +.well + = raw BlueCloth::new(render :file => 'CHANGES.markdown').to_html +.well + = raw BlueCloth::new(render :file => 'TODO.markdown').to_html + +-# + <% content_for :title do %> + - <%= t(:about,:scope=>:internal) %> + <% end %> + + <% content_for :sidebar do %> + <%= content_for_sidebar %> + <% end %> + +
+ +
+ +

+ <%= t(:current_version,:scope=>:internal) + ": " + $defaults["version"] %> +

+ +
+ <%= raw BlueCloth::new(render :file => 'README.markdown').to_html %> +
+ +
+ <%= raw BlueCloth::new(render :file => 'CHANGES').to_html %> +
+ +
+ <%= raw BlueCloth::new(render :file => 'TODO').to_html %> +
+ + +
+ diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb deleted file mode 100755 index adcc493..0000000 --- a/app/views/layouts/application.html.erb +++ /dev/null @@ -1,36 +0,0 @@ - - - - - <%= t(:mailr,:scope=>:common) %> - <%= yield :title %> - - - - <%=stylesheet_link_tag current_theme_stylesheet_path('olive') %> - <%=stylesheet_link_tag current_theme_stylesheet_path('calendar_olive') %> - <%=stylesheet_link_tag current_theme_stylesheet_path('jquery-ui-dialog') %> - <%=stylesheet_link_tag current_theme_stylesheet_path('jquery-ui-custom') %> - - <%=javascript_include_tag current_theme_javascript_path('jquery') %> - <%=javascript_include_tag current_theme_javascript_path('jquery-ui') %> - <%=javascript_include_tag current_theme_javascript_path('rails') %> - <%=javascript_include_tag current_theme_javascript_path('application') %> - - - - -
- -
- <%= render :partial=>'layouts/flash', :object => flash %> - <%= calendar_window(:title=>t(:calendar,:scope=>:common)) %> - <%= yield %> -
-
- - diff --git a/app/views/messages/_attachment.html.erb b/app/views/messages/_attachment.html.erb deleted file mode 100755 index 0ff539b..0000000 --- a/app/views/messages/_attachment.html.erb +++ /dev/null @@ -1,19 +0,0 @@ - -<%= link_to attachment.filename_charseted, attachment_download_path(attachment.parent_id,attachment.idx) %> - - -<%= attachment.main_type %>/<%= attachment.sub_type %> - - -<%= attachment.charset %> - - -<%= attachment.content_transfer_encoding %> - - -<%= size_formatter(attachment.getSize) %> - - -<%= link_to image_tag(current_theme_image_path('download.png')), attachment_download_path(attachment.parent_id,attachment.idx) %> - - diff --git a/app/views/messages/_attachments.html.erb b/app/views/messages/_attachments.html.erb deleted file mode 100755 index 5d051a7..0000000 --- a/app/views/messages/_attachments.html.erb +++ /dev/null @@ -1,13 +0,0 @@ -
-<%= t(:attachments,:scope=>:message) %> - - -<% trclass = :even %> -<% for idx in 0..@attachments.size-1 %> - - <%= render :partial => 'attachment', :object => @attachments[idx] %> - -<% trclass == :even ? trclass = :odd : trclass = :even %> -<% end %> -
-
diff --git a/app/views/messages/_file_attach.html.erb b/app/views/messages/_file_attach.html.erb deleted file mode 100755 index a809654..0000000 --- a/app/views/messages/_file_attach.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<%= check_box_tag "files[]", file_attach[:name] %> -<%= file_attach[:name] %> -<%= size_formatter(file_attach[:size]) %> -  diff --git a/app/views/messages/_file_attachs.html.erb b/app/views/messages/_file_attachs.html.erb deleted file mode 100755 index 683b1f8..0000000 --- a/app/views/messages/_file_attachs.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -
-<%= t(:attachments,:scope=>:message) %> -<% if not @attachments.size.zero? %> -<% trclass = :even %> - -<% @attachments.each do |a| %> - -<%= render :partial => 'messages/file_attach', :object => a %> - -<% trclass == :even ? trclass = :odd : trclass = :even %> -<% end %> -
-<%= raw single_action('delete_marked','compose','minus.png') %> -<% end %> -
- diff --git a/app/views/messages/_file_select.html.erb b/app/views/messages/_file_select.html.erb deleted file mode 100755 index 3279115..0000000 --- a/app/views/messages/_file_select.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -
-:  -<%= file_field 'file', 'data' %> -<%= raw single_action('upload','compose','up.png') %> -
- - - - diff --git a/app/views/messages/_header.html.erb b/app/views/messages/_header.html.erb deleted file mode 100755 index 1017ea1..0000000 --- a/app/views/messages/_header.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -
- <%= raw show_param_view(@message,"from_addr",address_formatter(@from,:show)) %> - <%= raw show_param_view(@message,"to_addr",address_formatter(@to,:show)) %> - <% if not @cc.nil? %> - <%= raw show_param_view(@message,"cc_addr","CC jest") %> - <% end %> - <% if not @bcc.nil? %> - <%= raw show_param_view(@message,"bcc_addr","BCC jest ") %> - <% end %> - <%= raw show_param_view(@message,"subject",subject_formatter(@message,:show)) %> - <%= raw show_param_view(@message,"date",date_formatter(@date)) %> - <%= hidden_field_tag 'uids[]', @message.uid %> - <%= hidden_field_tag 'source', 'show' %> -
diff --git a/app/views/messages/_html_part.html.erb b/app/views/messages/_html_part.html.erb deleted file mode 100755 index 7beb3d0..0000000 --- a/app/views/messages/_html_part.html.erb +++ /dev/null @@ -1,3 +0,0 @@ - - diff --git a/app/views/messages/_html_part.html.haml b/app/views/messages/_html_part.html.haml new file mode 100755 index 0000000..5636fc2 --- /dev/null +++ b/app/views/messages/_html_part.html.haml @@ -0,0 +1,3 @@ +%iframe{:frameborder=>"0",:src=>"#{html_body_path(@message.uid)}"}/ + + diff --git a/app/views/messages/_image.html.erb b/app/views/messages/_image.html.erb deleted file mode 100755 index f9cc663..0000000 --- a/app/views/messages/_image.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -
-<%= image_tag(attachment_download_path(image.parent_id,image.idx), :size => @current_user.prefs.msg_image_thumbnail_size, :alt=>image.filename, :title=>image.filename) %> -
-<%= link_to (image.filename,attachment_download_path(image.parent_id,image.idx)) %> -<%= size_formatter(image.getSize) %> -
-
- diff --git a/app/views/messages/_images.html.erb b/app/views/messages/_images.html.erb deleted file mode 100755 index afeea6d..0000000 --- a/app/views/messages/_images.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -
- -<% for idx in 0..@images.size-1 %> -<%= render :partial => 'image', :object => @images[idx] %> -<% end %> - -
-
diff --git a/app/views/messages/_message.html.haml b/app/views/messages/_message.html.haml index bd5cdbd..6aec26f 100755 --- a/app/views/messages/_message.html.haml +++ b/app/views/messages/_message.html.haml @@ -9,30 +9,10 @@ = address_formatter(message.from_addr,:index) %td = subject_formatter(message,:index) -%td +%td{:nowrap=>"nowrap"} = date_formatter(message.date) %td = size_formatter(message.size) -%td - - if @current_folder == @drafts_folder +- if @current_folder == @drafts_folder + %td = link_to(t(:edit,:scope=>:message),edit_path(message.uid)) - - else -   - - --# - <%= check_box_tag "uids[]", message.uid %> - <%= attachment_formatter(message) %> - <% if @current_folder == @sent_folder || @current_folder == @drafts_folder %> - <%= address_formatter(message.to_addr,:index) %> - <% else %> - <%= address_formatter(message.from_addr,:index) %> - <% end %> - <%= subject_formatter(message,:index) %> - <%= date_formatter(message.date) %> - <%= size_formatter(message.size) %> - <% if @current_folder == @drafts_folder %> - <%= link_to(t(:edit,:scope=>:message),edit_path(message.uid)) %> - <% else %> - <%= raw(' ') %> - <% end %> diff --git a/app/views/messages/_messages.html.haml b/app/views/messages/_messages.html.haml index 3ac2ed8..ca6777f 100755 --- a/app/views/messages/_messages.html.haml +++ b/app/views/messages/_messages.html.haml @@ -8,9 +8,9 @@ \: = @messages.total_entries -= will_paginate @messages += will_paginate @messages, :class => "custom_pagination bottom-pix18" -%table{:class=>"table table-bordered"} +%table{:class=>"table table-bordered records"} %thead %tr %th @@ -18,15 +18,12 @@ %th %i{:class=>"icon-file"} = raw headers_links - %th -   %tbody - @messages.each do |m| - m.unseen == true ? unseen = "unseen" : unseen = "" %tr{:class=>"#{unseen}"} = render :partial => 'messages/message', :locals => {:message => m} - -= will_paginate @messages += will_paginate @messages , :class => "custom_pagination bottom-pix18" diff --git a/app/views/messages/_new.html.erb b/app/views/messages/_new.html.erb deleted file mode 100755 index 8ec1896..0000000 --- a/app/views/messages/_new.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -
-<%= raw form_field( @message, - "to_addr", - nil, - "joe@domain.com"+', '+ t(:not_contain_at,:scope=>:compose), - address_formatter(@message.to_addr,@operation) - ) %> -<%= raw form_field( @message, - "subject", - nil, - t(:subject_of_the_message,:scope=>:compose), - subject_formatter(@message.subject,@operation) - ) %> -<%= raw area_field( @message, - "body", - nil, - t(:write_your_message_here,:scope=>:compose), - body_formatter(@message.body,@operation), - 80, - 20 - ) %> -
-<% if !@olduid.nil? %> -<%= hidden_field_tag 'olduid', @olduid %> -<% end %> -<%= raw group_action(@buttons) %> - diff --git a/app/views/messages/_search.html.erb b/app/views/messages/_search.html.erb deleted file mode 100755 index cee5c10..0000000 --- a/app/views/messages/_search.html.erb +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/app/views/messages/_single_ops.html.erb b/app/views/messages/_single_ops.html.erb deleted file mode 100755 index d38a73a..0000000 --- a/app/views/messages/_single_ops.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -
-<%= raw group_action_text(@multi1_buttons,t(:to_folder,:scope=>:folder)+ " " + simple_select_for_folders("folder","target",@folders_shown,'',true)) %> -<%= raw group_action(@multi3_buttons) %> - -
-
-        <%= @plain_header %>
-    
-
-
diff --git a/app/views/messages/compose.html.erb b/app/views/messages/compose.html.erb deleted file mode 100755 index 510cbbe..0000000 --- a/app/views/messages/compose.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -<% content_for :sidebar do %> -<%= content_for_sidebar %> -<% end %> - -<% content_for :title do %> -- <%= t(:compose,:scope=>:compose) %> -<% end %> - -
- -
-

<%= t(:new_message,:scope=>:compose) %>

-
- <%= form_tag(composed_path, :multipart => true) %> - <%= render :partial => 'messages/new' %> - <%= render :partial=> 'messages/file_attachs' %> - <%= render :partial => 'messages/file_select' %> - -
-
- diff --git a/app/views/messages/html_body.html.erb b/app/views/messages/html_body.html.erb deleted file mode 100755 index b1f0d7c..0000000 --- a/app/views/messages/html_body.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -<%= raw @body -%> - diff --git a/app/views/messages/html_body.html.haml b/app/views/messages/html_body.html.haml new file mode 100755 index 0000000..6afcbbc --- /dev/null +++ b/app/views/messages/html_body.html.haml @@ -0,0 +1,2 @@ += raw @body + diff --git a/app/views/messages/index2.html.erb b/app/views/messages/index2.html.erb deleted file mode 100755 index d93e092..0000000 --- a/app/views/messages/index2.html.erb +++ /dev/null @@ -1,33 +0,0 @@ -<% content_for :sidebar do %> -<%= content_for_sidebar %> -<% end %> - -<% content_for :title do %> -- <%= t(:messages,:scope=>:message) %> -<% end %> - -
- -
- <%= form_tag({:controller=>'messages_ops', :action=>'multi'},{:name=>'messages'})%> - - <% if @current_folder.nil? %> -

<%= t(:no_selected,:scope=>:folder) %>

- <% end %> - - <% if @messages.size.zero? %> -
-
<%= t(:no_in,:scope=>:message) %>
-
- <% else %> - <%= render :partial => 'multi_ops' %> - <%= render :partial => 'messages' %> - <% end %> - - -
-
- - diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb deleted file mode 100755 index 1718862..0000000 --- a/app/views/messages/show.html.erb +++ /dev/null @@ -1,43 +0,0 @@ -<% content_for :sidebar do %> -<%= content_for_sidebar %> -<% end %> - -<% content_for :title do %> -- <%= subject_formatter(@message,:show) %> -<% end %> - -
- -
- <%= form_tag(messages_ops_single_path)%> - <%= render :partial => 'header' %> - <%= render :partial => 'single_ops' %> - - <% if not @attachments.size.zero? %> - <%= render :partial => 'attachments' %> - <% end %> - - <% if not @images.size.zero? %> - <%= render :partial => 'images' %> - <% end %> - - <% if not @html_part.nil? %> - <%= render :partial => 'html_part' %> - <% else %> -
- <% if @text_part.nil? %> -

- <%= t(:no_content,:scope => :message) %> -

- <% else %> - <%= raw content_text_plain_for_render(@text_part) %> - <% end %> -
- <% end %> - -
-
- - diff --git a/app/views/user/login.html.haml b/app/views/user/login.html.haml index 4a39651..fbf86c9 100755 --- a/app/views/user/login.html.haml +++ b/app/views/user/login.html.haml @@ -8,7 +8,7 @@ = render :partial => "common/input_password_form_field",:locals => { :model => 'user',:attr => 'password'} .control-group .controls - = render :partial => "common/button",:locals => { :name=>'login', :caption => t(:please_login,:scope=>:user), :icon =>'icon-lock icon-white'} - + = render :partial => "common/button",:locals => { :name=>'login_button', :caption => t(:please_login,:scope=>:user), :icon =>'icon-lock icon-white'} +%hr/ diff --git a/app/views/user/setup.html.haml b/app/views/user/setup.html.haml index 50bf954..57913c4 100755 --- a/app/views/user/setup.html.haml +++ b/app/views/user/setup.html.haml @@ -12,4 +12,9 @@ = render :partial => "common/input_form_desc_field",:locals => {:object => @user,:attr => 'first_name',:label => nil,:example => 'Joe',:value => params[:user] ? params[:user][:first_name] : ""} = render :partial => "common/input_form_desc_field",:locals => {:object => @user,:attr => 'last_name',:label => nil,:example => 'Doe',:value => params[:user] ? params[:user][:last_name] : ""} = render :partial => "common/input_form_desc_field",:locals => {:object => @server,:attr => 'name',:label => nil,:example => 'server.domain',:value => params[:server] ? params[:server][:name] : ""} - = render :partial => "common/form_button_icon",:locals => { :text => t(:send_config,:scope=>:user), :icon_class =>'icon-ok icon-white'} + .control-group + .controls + = render :partial => "common/button",:locals => { :name=>'send', + :caption => t(:send_config,:scope=>:user), + :icon =>'icon-ok icon-white'} +%hr/ diff --git a/config/locales/en.yml b/config/locales/en.yml index 0ca154d..a809c27 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,4 +1,8 @@ en: + will_paginate: + previous_label: "← Previous" + next_label: "Next →" + page_gap: "…" activerecord: attributes: prefs: diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 42b02e6..127d68b 100755 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -1,4 +1,8 @@ pl: + will_paginate: + previous_label: "← Poprzednia" + next_label: "Następna →" + page_gap: "…" date: day_names: [Niedziela, Poniedziałek, Wtorek, Środa, Czwartek, Piątek, Sobota] abbr_day_names: [Ni, Po, Wt, Śr, Cz, Pi, So] @@ -192,7 +196,7 @@ pl: logout: Wyloguj has_no_domain: Użytkownik nie ma ustawionej domeny send_config: Wyślij - no_config: W bazie nie znaleziono żadnego użytkownika. Prawdopodobnie aplikacja nie została jeszcze skonfigurowana. Wypełnij poniższy formularz, aby dokonać podtsawowej konfiguracji. + no_config: W bazie nie znaleziono żadnego użytkownika. Prawdopodobnie aplikacja nie została jeszcze skonfigurowana. Wypełnij poniższy formularz, aby dokonać podstawowej konfiguracji. internal: imap_error: Błąd protokołu IMAP diff --git a/lib/mail_plugin_extension.rb b/lib/mail_plugin_extension.rb index efd44bd..7a1f679 100755 --- a/lib/mail_plugin_extension.rb +++ b/lib/mail_plugin_extension.rb @@ -6,19 +6,19 @@ module Mail attr_accessor :idx,:parent_id - #def decoded_and_charseted - #begin - #if not charset.upcase == 'UTF-8' - #charset.nil? ? source_charset = $defaults["msg_unknown_charset"] : source_charset = charset - #charseted = Iconv.iconv("UTF-8",source_charset,decoded).first - #else - #charseted = decoded - #end - #rescue - #decoded - #end + def decoded_and_charseted + begin + if not charset.upcase == 'UTF-8' + charset.nil? ? source_charset = $defaults["msg_unknown_charset"] : source_charset = charset + charseted = Iconv.iconv("UTF-8",source_charset,decoded).first + else + charseted = decoded + end + rescue + decoded + end - #end + end def isImage? not (content_type =~ /^image/).nil? @@ -58,74 +58,74 @@ module Mail attr_accessor :idx,:parent_id - #def isImage? - #not (content_type =~ /^image/).nil? - #end + def isImage? + not (content_type =~ /^image/).nil? + end - #def isText? - #not (content_type =~ /^text\/plain/).nil? - #end + def isText? + not (content_type =~ /^text\/plain/).nil? + end - #def isHtml? - #not (content_type =~ /^text\/html/).nil? - #end + def isHtml? + not (content_type =~ /^text\/html/).nil? + end - #def getSize - #body.raw_source.size - #end + def getSize + body.raw_source.size + end - #def decoded_and_charseted - #begin - #if not charset.upcase == 'UTF-8' - #charset.nil? ? source_charset = $defaults["msg_unknown_charset"] : source_charset = charset - #charseted = Iconv.iconv("UTF-8",source_charset,decoded).first - #else - #charseted = decoded - #end - #rescue - #decoded - #end + def decoded_and_charseted + begin + if not charset.upcase == 'UTF-8' + charset.nil? ? source_charset = $defaults["msg_unknown_charset"] : source_charset = charset + charseted = Iconv.iconv("UTF-8",source_charset,decoded).first + else + charseted = decoded + end + rescue + decoded + end - #end + end end - #class Field - #def charseted - #begin - #if value =~ /\=\?([\w\-]+)\?/ - #source_charset = $1 - #if source_charset.upcase == 'UTF-8' - #return decoded - #end - #else - #source_charset = $defaults["msg_unknown_charset"] - #end - #Iconv.iconv("UTF-8",source_charset,decoded).first - #rescue - #decoded - #end - #end - #end + class Field + def charseted + begin + if value =~ /\=\?([\w\-]+)\?/ + source_charset = $1 + if source_charset.upcase == 'UTF-8' + return decoded + end + else + source_charset = $defaults["msg_unknown_charset"] + end + Iconv.iconv("UTF-8",source_charset,decoded).first + rescue + decoded + end + end + end - #class Address - #def charseted - #begin - #if value =~ /\=\?([\w\-]+)\?/ - #source_charset = $1 - #if source_charset.upcase == 'UTF-8' - #return decoded - #end - #else - #source_charset = $defaults["msg_unknown_charset"] - #end - #Iconv.iconv("UTF-8",source_charset,decoded).first - #rescue - #decoded - #end - #end - #end + class Address + def charseted + begin + if value =~ /\=\?([\w\-]+)\?/ + source_charset = $1 + if source_charset.upcase == 'UTF-8' + return decoded + end + else + source_charset = $defaults["msg_unknown_charset"] + end + Iconv.iconv("UTF-8",source_charset,decoded).first + rescue + decoded + end + end + end #class Part #def filename_charseted