kit_cms 2.3.20 → 2.3.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/assets/images/kit/toolbar/smile.png +0 -0
 - data/app/assets/images/kit/toolbar/wink.gif +0 -0
 - data/app/assets/images/kit/toolbar/wink.png +0 -0
 - data/app/assets/javascripts/codemirror/editor.js +55 -17
 - data/app/assets/javascripts/codemirror/jquery.js +0 -1
 - data/app/assets/javascripts/codemirror/ruby.js +196 -0
 - data/app/assets/javascripts/jquery.js +3036 -2838
 - data/app/assets/javascripts/kit/utilities.js +655 -586
 - data/app/assets/stylesheets/codemirror/style.css +1 -1
 - data/app/assets/stylesheets/codemirror/theme.css +23 -3
 - data/app/assets/stylesheets/kit/calendar.css +6 -1
 - data/app/assets/stylesheets/kit/cms/cms.css +36 -0
 - data/app/assets/stylesheets/kit/forums.css +5 -1
 - data/app/assets/stylesheets/kit/kit.css +3 -1
 - data/app/controllers/account_controller.rb +306 -0
 - data/app/controllers/ad_controller.rb +2 -0
 - data/app/controllers/admin/ad_units_controller.rb +1 -1
 - data/app/controllers/admin/ad_zones_controller.rb +15 -0
 - data/app/controllers/admin/ads_controller.rb +5 -0
 - data/app/controllers/admin/block_controller.rb +1 -65
 - data/app/controllers/admin/blocks_controller.rb +2 -0
 - data/app/controllers/admin/content_controller.rb +3 -1
 - data/app/controllers/admin/dashboard_controller.rb +28 -4
 - data/app/controllers/admin/dj_controller.rb +45 -0
 - data/app/controllers/admin/help_controller.rb +1 -1
 - data/app/controllers/admin/html_asset_controller.rb +0 -12
 - data/app/controllers/admin/q_controller.rb +120 -0
 - data/app/controllers/admin/user_controller.rb +4 -4
 - data/app/controllers/api_controller.rb +34 -0
 - data/app/controllers/calendar_controller.rb +1 -1
 - data/app/controllers/form_controller.rb +3 -3
 - data/app/controllers/forum_controller.rb +39 -29
 - data/app/controllers/kit_controller.rb +42 -15
 - data/app/controllers/pages_controller.rb +25 -5
 - data/app/controllers/q_controller.rb +235 -0
 - data/app/controllers/repo_controller.rb +7 -0
 - data/app/controllers/user_controller.rb +14 -10
 - data/app/controllers/utility_controller.rb +1 -1
 - data/app/helpers/account_helper.rb +47 -0
 - data/app/helpers/admin/layouts_helper.rb +8 -0
 - data/app/helpers/admin/page_templates_helper.rb +8 -0
 - data/app/helpers/ads_helper.rb +11 -12
 - data/app/helpers/calendar_helper.rb +6 -2
 - data/app/helpers/form_data_helper.rb +1 -1
 - data/app/helpers/form_helper.rb +8 -0
 - data/app/helpers/forum_helper.rb +5 -1
 - data/app/helpers/kit_helper.rb +65 -35
 - data/app/helpers/kit_modules_helper.rb +4 -0
 - data/app/helpers/user_helper.rb +0 -28
 - data/app/jobs/page_link_job.rb +34 -0
 - data/app/jobs/queue_job.rb +134 -0
 - data/app/mailers/notification.rb +10 -0
 - data/app/mailers/queue_mailer.rb +13 -0
 - data/app/models/ad.rb +6 -6
 - data/app/models/ad_unit.rb +1 -1
 - data/app/models/ad_zone.rb +4 -0
 - data/app/models/block.rb +1 -1
 - data/app/models/delayed_job.rb +3 -0
 - data/app/models/form.rb +16 -4
 - data/app/models/html_asset.rb +19 -4
 - data/app/models/html_asset_usage.rb +3 -0
 - data/app/models/html_assetable.rb +4 -0
 - data/app/models/layout.rb +36 -6
 - data/app/models/newsletter.rb +1 -1
 - data/app/models/page.rb +36 -2
 - data/app/models/page_link.rb +5 -0
 - data/app/models/page_template.rb +22 -2
 - data/app/models/preference.rb +1 -1
 - data/app/models/q_event.rb +12 -0
 - data/app/models/q_klass.rb +5 -0
 - data/app/models/q_message.rb +9 -0
 - data/app/models/q_publisher.rb +35 -0
 - data/app/models/q_subscription.rb +7 -0
 - data/app/models/q_user.rb +29 -0
 - data/app/models/q_users_method.rb +6 -0
 - data/app/models/q_users_publisher.rb +6 -0
 - data/app/models/user.rb +127 -19
 - data/app/models/user_login.rb +4 -0
 - data/app/validators/email_validator.rb +14 -0
 - data/app/views/account/_edit.html.haml +40 -0
 - data/app/views/account/_edit_intro.html.haml +3 -0
 - data/app/views/account/_forgotten.html.haml +20 -0
 - data/app/views/account/_forgotten_intro.html.haml +5 -0
 - data/app/views/account/_sign_in.html.haml +31 -0
 - data/app/views/account/_sign_in_intro.html.haml +4 -0
 - data/app/views/account/_sign_up.html.haml +51 -0
 - data/app/views/account/_sign_up_intro.html.haml +4 -0
 - data/app/views/account/edit.html.haml +1 -0
 - data/app/views/account/forgotten.html.haml +1 -0
 - data/app/views/account/sign_in.html.haml +2 -0
 - data/app/views/account/sign_up.html.haml +1 -0
 - data/app/views/ad/_buy.html.haml +2 -1
 - data/app/views/admin/ad_zones/_form.html.haml +1 -1
 - data/app/views/admin/ad_zones/show.html.haml +2 -0
 - data/app/views/admin/blocks/_form.html.haml +11 -1
 - data/app/views/admin/dashboard/broken_links.html.haml +9 -0
 - data/app/views/admin/dashboard/system.html.haml +11 -0
 - data/app/views/admin/dj/index.html.haml +43 -0
 - data/app/views/admin/form/_form.html.haml +15 -10
 - data/app/views/admin/group/index.html.haml +1 -1
 - data/app/views/admin/help/edit.html.haml +1 -1
 - data/app/views/admin/html_asset/show.html.haml +9 -2
 - data/app/views/admin/layouts/show.html.haml +10 -16
 - data/app/views/admin/page_templates/_form.html.haml +9 -17
 - data/app/views/admin/page_templates/show.html.haml +5 -4
 - data/app/views/admin/q/events.html.haml +26 -0
 - data/app/views/admin/q/index.html.haml +28 -0
 - data/app/views/admin/q/klasses.html.haml +61 -0
 - data/app/views/admin/q/messages.html.haml +37 -0
 - data/app/views/admin/q/show.html.haml +98 -0
 - data/app/views/admin/q/subscriptions.html.haml +26 -0
 - data/app/views/admin/q/users.html.haml +27 -0
 - data/app/views/admin/snippet/edit.html.erb +1 -1
 - data/app/views/admin/snippet/new.html.erb +1 -1
 - data/app/views/admin/stylesheet/show.html.haml +1 -1
 - data/app/views/admin/user/index.html.erb +15 -6
 - data/app/views/admin/user/view.html.erb +5 -4
 - data/app/views/admin/views/_form.html.haml +3 -3
 - data/app/views/calendar/_buy_tickets.html.haml +1 -1
 - data/app/views/calendar/_calendar_entry.html.haml +1 -1
 - data/app/views/calendar/_month.html.haml +7 -7
 - data/app/views/form/_show.html.haml +1 -1
 - data/app/views/forum/_add_post.html.haml +7 -8
 - data/app/views/forum/_mod_thread.js.erb +46 -6
 - data/app/views/forum/_post_moderation.html.haml +2 -1
 - data/app/views/forum/_post_preview.html.haml +1 -9
 - data/app/views/forum/_post_scripts.js.erb +29 -5
 - data/app/views/forum/fetch_raw.html.haml +1 -0
 - data/app/views/forum/moderate.html.haml +1 -0
 - data/app/views/forum/topic_index.html.haml +4 -0
 - data/app/views/notification/{event.txt.erb → event.text.erb} +0 -0
 - data/app/views/notification/forgotten_password.text.erb +2 -0
 - data/app/views/pages/content_edit.html.haml +1 -1
 - data/app/views/pages/info.html.erb +13 -2
 - data/app/views/pages/links.html.haml +63 -0
 - data/app/views/user/edit_profile.html.haml +1 -1
 - data/app/views/utility/_cm_editor.html.erb +13 -10
 - data/app/views/utility/_cm_toolbar_markdown.html.haml +8 -1
 - data/app/views/utility/_menu.html.haml +4 -0
 - data/app/views/utility/mercury_html.html.haml +1 -0
 - data/config/initializers/elastic_search.rb +6 -3
 - data/config/initializers/extend_controller.rb +3 -0
 - data/config/initializers/string.rb +9 -6
 - data/config/initializers/warden.rb +49 -0
 - data/config/locales/en.yml +29 -1
 - data/config/routes.rb +35 -2
 - data/lib/kit_cms.rb +7 -2
 - data/lib/tasks/kit.rake +90 -2
 - metadata +139 -27
 - data/app/controllers/user/confirmations_controller.rb +0 -11
 - data/app/controllers/user/passwords_controller.rb +0 -13
 - data/app/controllers/user/registrations_controller.rb +0 -110
 - data/app/controllers/user/sessions_controller.rb +0 -33
 - data/app/controllers/user/unlocks_controller.rb +0 -13
 - data/app/views/devise/_links.erb +0 -25
 - data/app/views/devise/confirmations/new.html.erb +0 -12
 - data/app/views/devise/mailer/confirmation_instructions.html.erb +0 -5
 - data/app/views/devise/mailer/reset_password_instructions.html.erb +0 -8
 - data/app/views/devise/mailer/unlock_instructions.html.erb +0 -7
 - data/app/views/devise/passwords/edit.html.erb +0 -16
 - data/app/views/devise/passwords/new.html.erb +0 -12
 - data/app/views/devise/registrations/edit.html.erb +0 -28
 - data/app/views/devise/registrations/new.html.erb +0 -18
 - data/app/views/devise/sessions/new.html.erb +0 -18
 - data/app/views/devise/shared/_links.erb +0 -25
 - data/app/views/devise/unlocks/new.html.erb +0 -12
 - data/app/views/pages/links.html.erb +0 -8
 - data/app/views/user/shared/_links.erb +0 -25
 - data/config/initializers/devise.rb +0 -196
 - data/config/initializers/devise_extender.rb +0 -39
 
| 
         @@ -17,6 +17,7 @@ $(document).ready(function() { 
     | 
|
| 
       17 
17 
     | 
    
         
             
            });
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
       19 
19 
     | 
    
         
             
            var editing_id = null;
         
     | 
| 
      
 20 
     | 
    
         
            +
            var use_markdown_editor = <%= use_markdown_editor %>;
         
     | 
| 
       20 
21 
     | 
    
         | 
| 
       21 
22 
     | 
    
         
             
            function user_edit_post(post_id) {
         
     | 
| 
       22 
23 
     | 
    
         
             
              if (editing_id!=null) {
         
     | 
| 
         @@ -25,9 +26,16 @@ function user_edit_post(post_id) { 
     | 
|
| 
       25 
26 
     | 
    
         
             
              var bod = $('#body_'+post_id);
         
     | 
| 
       26 
27 
     | 
    
         
             
              bod.append('<div id="popup_form"></div>');
         
     | 
| 
       27 
28 
     | 
    
         
             
              div = $('#popup_form');
         
     | 
| 
      
 29 
     | 
    
         
            +
              if (use_markdown_editor) {
         
     | 
| 
      
 30 
     | 
    
         
            +
                div.append('Post: <div style="width:95%; z-index: 0;" id="topic_post_body_edit"></div>');
         
     | 
| 
      
 31 
     | 
    
         
            +
                $('#topic_post_body_edit').load("/forums/post/"+post_id+"?editor=1");
         
     | 
| 
      
 32 
     | 
    
         
            +
              }  
         
     | 
| 
      
 33 
     | 
    
         
            +
              else {
         
     | 
| 
      
 34 
     | 
    
         
            +
                div.append('Post: <textarea style="width:95%;" rows="18" id="topic_post_body_edit"></textarea>');
         
     | 
| 
      
 35 
     | 
    
         
            +
                $('#topic_post_body_edit').load("/forums/post/"+post_id);
         
     | 
| 
      
 36 
     | 
    
         
            +
              }
         
     | 
| 
       28 
37 
     | 
    
         | 
| 
       29 
     | 
    
         
            -
               
     | 
| 
       30 
     | 
    
         
            -
              // TODO Markdown editor
         
     | 
| 
      
 38 
     | 
    
         
            +
              $('div#posts div.edit').hide();
         
     | 
| 
       31 
39 
     | 
    
         
             
              div.append('<br/><input type="button" onClick="user_save_edit();" value="Save"/>');
         
     | 
| 
       32 
40 
     | 
    
         
             
              $('#topic_post_body_edit').load("/forums/post/"+post_id);
         
     | 
| 
       33 
41 
     | 
    
         
             
              editing_id = post_id;
         
     | 
| 
         @@ -36,7 +44,15 @@ function user_edit_post(post_id) { 
     | 
|
| 
       36 
44 
     | 
    
         | 
| 
       37 
45 
     | 
    
         
             
            function user_save_edit() {
         
     | 
| 
       38 
46 
     | 
    
         
             
              var id = editing_id;
         
     | 
| 
       39 
     | 
    
         
            -
              var bod 
     | 
| 
      
 47 
     | 
    
         
            +
              var bod;
         
     | 
| 
      
 48 
     | 
    
         
            +
              if (use_markdown_editor) {
         
     | 
| 
      
 49 
     | 
    
         
            +
                bod = get_editor_by_name('topic_post_body_edit').getValue();
         
     | 
| 
      
 50 
     | 
    
         
            +
                deregister_editor_by_name('topic_post_body_edit');
         
     | 
| 
      
 51 
     | 
    
         
            +
              } 
         
     | 
| 
      
 52 
     | 
    
         
            +
              else {
         
     | 
| 
      
 53 
     | 
    
         
            +
                bod = $('#topic_post_body_edit').val();
         
     | 
| 
      
 54 
     | 
    
         
            +
              }
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
       40 
56 
     | 
    
         
             
              $('#popup_form').remove();
         
     | 
| 
       41 
57 
     | 
    
         
             
              editing_id = null;
         
     | 
| 
       42 
58 
     | 
    
         | 
| 
         @@ -87,7 +103,16 @@ function show_post() { 
     | 
|
| 
       87 
103 
     | 
    
         
             
            }
         
     | 
| 
       88 
104 
     | 
    
         | 
| 
       89 
105 
     | 
    
         
             
            function validate_post() {
         
     | 
| 
       90 
     | 
    
         
            -
              var msgbody =  
     | 
| 
      
 106 
     | 
    
         
            +
              var msgbody = "";
         
     | 
| 
      
 107 
     | 
    
         
            +
             
     | 
| 
      
 108 
     | 
    
         
            +
              if (use_markdown_editor) {
         
     | 
| 
      
 109 
     | 
    
         
            +
                var editor = get_editor_by_name("topic_post[body]");
         
     | 
| 
      
 110 
     | 
    
         
            +
                msgbody = editor.getValue();
         
     | 
| 
      
 111 
     | 
    
         
            +
              }
         
     | 
| 
      
 112 
     | 
    
         
            +
              else {
         
     | 
| 
      
 113 
     | 
    
         
            +
                msgbody = $('#topic_post_body').val();
         
     | 
| 
      
 114 
     | 
    
         
            +
              }
         
     | 
| 
      
 115 
     | 
    
         
            +
             
     | 
| 
       91 
116 
     | 
    
         
             
              if (msgbody.length<2) {
         
     | 
| 
       92 
117 
     | 
    
         
             
                alert("You must write something!");
         
     | 
| 
       93 
118 
     | 
    
         
             
                return false;
         
     | 
| 
         @@ -107,7 +132,6 @@ function validate_post() { 
     | 
|
| 
       107 
132 
     | 
    
         
             
              <% end %>	
         
     | 
| 
       108 
133 
     | 
    
         
             
              $('#topic_post_submit').val('Saving...');
         
     | 
| 
       109 
134 
     | 
    
         
             
              $('#topic_post_submit').attr('disabled', true);
         
     | 
| 
       110 
     | 
    
         
            -
              $('#topic_post_body').focus();
         
     | 
| 
       111 
135 
     | 
    
         
             
              return true;
         
     | 
| 
       112 
136 
     | 
    
         
             
            }
         
     | 
| 
       113 
137 
     | 
    
         | 
| 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            = cm_editor("topic_post_body_#{is_mod ? 'mod' : 'edit'}", {:value=>@post.raw_body, :mode=>"markdown", :theme=>"neat", :dont_show_mode=>true, :dont_show_line_numbers=>true, :show_toolbar=>true, :height=>300, :width=>800}).html_safe 
         
     | 
| 
         @@ -2,6 +2,10 @@ 
     | 
|
| 
       2 
2 
     | 
    
         
             
              - content_for :page_scripts do
         
     | 
| 
       3 
3 
     | 
    
         
             
                = render :partial=>"topic_index", :formats=>[:js]
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
      
 5 
     | 
    
         
            +
            - content_for :head do
         
     | 
| 
      
 6 
     | 
    
         
            +
              = javascript_include_tag "codemirror/editor"
         
     | 
| 
      
 7 
     | 
    
         
            +
              = stylesheet_link_tag "codemirror/editor"
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
       5 
9 
     | 
    
         
             
            #forums.clearfix
         
     | 
| 
       6 
10 
     | 
    
         | 
| 
       7 
11 
     | 
    
         
             
              = render :partial=>"introduction"
         
     | 
| 
         
            File without changes
         
     | 
| 
         @@ -19,9 +19,12 @@ return false; 
     | 
|
| 
       19 
19 
     | 
    
         
             
                <%# TODO: render(:partial=>"favourite_link", :locals=>{:page_url=>@page.full_path }) %>
         
     | 
| 
       20 
20 
     | 
    
         
             
              </div>
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
      
 22 
     | 
    
         
            +
              <% unless @page.is_stub? %>
         
     | 
| 
       22 
23 
     | 
    
         
             
              <div class="clearfix">
         
     | 
| 
       23 
24 
     | 
    
         
             
                <%= icon_to "View", @page.full_path, false, :method=>:get %> <%= icon_to("Edit", @page.full_path+"?edit=1") unless @page.is_stub? || @page.locked? %>
         
     | 
| 
       24 
25 
     | 
    
         
             
              </div>
         
     | 
| 
      
 26 
     | 
    
         
            +
              <% end %>
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
       25 
28 
     | 
    
         
             
              <h1 class="summary_icon" style="margin-top: 20px;">Summary</h1>
         
     | 
| 
       26 
29 
     | 
    
         
             
              <div class="clearfix">
         
     | 
| 
       27 
30 
     | 
    
         
             
                <%= icon_to "Edit Info", "/page/#{@page.id}/edit"  unless @page.locked? %> 
         
     | 
| 
         @@ -70,6 +73,12 @@ return false; 
     | 
|
| 
       70 
73 
     | 
    
         
             
                  <td>Path:</td>
         
     | 
| 
       71 
74 
     | 
    
         
             
                  <td colspan='2'><%= @page.full_path %></td>
         
     | 
| 
       72 
75 
     | 
    
         
             
                </tr>
         
     | 
| 
      
 76 
     | 
    
         
            +
             
     | 
| 
      
 77 
     | 
    
         
            +
                <tr>
         
     | 
| 
      
 78 
     | 
    
         
            +
                  <td>Links To This Page:</td>
         
     | 
| 
      
 79 
     | 
    
         
            +
                  <td colspan="2"><%= PageLink.sys(_sid).where(:url=>@page.full_path).count %></td>
         
     | 
| 
      
 80 
     | 
    
         
            +
                </tr>
         
     | 
| 
      
 81 
     | 
    
         
            +
             
     | 
| 
       73 
82 
     | 
    
         
             
                <tr>
         
     | 
| 
       74 
83 
     | 
    
         
             
                  <td>Template:</td>
         
     | 
| 
       75 
84 
     | 
    
         
             
                  <td><%= link_to(@page.page_template.name, "/admin/page_templates/#{@page.page_template_id}") rescue '' %></td>
         
     | 
| 
         @@ -203,9 +212,11 @@ return false; 
     | 
|
| 
       203 
212 
     | 
    
         | 
| 
       204 
213 
     | 
    
         
             
              <tr class="advanced">
         
     | 
| 
       205 
214 
     | 
    
         
             
                <td colspan="3">
         
     | 
| 
       206 
     | 
    
         
            -
                  <p>Show:  
     | 
| 
      
 215 
     | 
    
         
            +
                  <p>Show: 
         
     | 
| 
      
 216 
     | 
    
         
            +
                  <%= icon_to "Links", "/page/#{@page.id}/links", false %>
         
     | 
| 
      
 217 
     | 
    
         
            +
                  <%= icon_to "Page Analysis", "/db/content/analyse/#{@page.id}", false, :class=>"icon_stack advanced" %>
         
     | 
| 
       207 
218 
     | 
    
         
             
                  <%= icon_to "Content", "/page/#{@page.id}/contents", false, :class=>"advanced"  %>
         
     | 
| 
       208 
     | 
    
         
            -
                  <%= icon_to "Blocks Used 
     | 
| 
      
 219 
     | 
    
         
            +
                  <%= icon_to "Blocks Used", "/admin/block_instances?page_id=#{@page.id}", false, :class=>"advanced" %>
         
     | 
| 
       209 
220 
     | 
    
         
             
                  <%= icon_to_function "Access Permissions", "$('#access').slideDown(); $('#show_access_link').hide();",false, {:id=>'show_access_link', :class=>"icon_stack"} %>
         
     | 
| 
       210 
221 
     | 
    
         
             
                  </p>
         
     | 
| 
       211 
222 
     | 
    
         
             
                </td>
         
     | 
| 
         @@ -0,0 +1,63 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            - content_for :main do 
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
              %h1.page_icon Page '#{@page.title}' Links
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
              .link
         
     | 
| 
      
 6 
     | 
    
         
            +
                = icon_to "Page Info", "/page/#{@page.id}/info"
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
              - if @page.needs_crawl
         
     | 
| 
      
 9 
     | 
    
         
            +
                .warning(style="margin-top: 10px; color: red;")
         
     | 
| 
      
 10 
     | 
    
         
            +
                  This information may be out of date. You can
         
     | 
| 
      
 11 
     | 
    
         
            +
                  = link_to "force an update", "/page/#{@page.id}/links?refresh=1"
         
     | 
| 
      
 12 
     | 
    
         
            +
                  but be aware it make take some time.  Alternatively one will happen automatically soon.
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
              - else 
         
     | 
| 
      
 15 
     | 
    
         
            +
                - unless @page.updated_crawl
         
     | 
| 
      
 16 
     | 
    
         
            +
                  .warning(style="margin-top: 10px; color: red;")
         
     | 
| 
      
 17 
     | 
    
         
            +
                    This page hasn't been processed for link information. You can
         
     | 
| 
      
 18 
     | 
    
         
            +
                    = link_to "force an update", "/page/#{@page.id}/links?refresh=1"
         
     | 
| 
      
 19 
     | 
    
         
            +
                    but it will take some time to process.
         
     | 
| 
      
 20 
     | 
    
         
            +
                
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
              - links = @page.page_links.order(:url).limit(500).all
         
     | 
| 
      
 23 
     | 
    
         
            +
              %h3 
         
     | 
| 
      
 24 
     | 
    
         
            +
                Pages This One Links To:
         
     | 
| 
      
 25 
     | 
    
         
            +
                - if links.size==500
         
     | 
| 
      
 26 
     | 
    
         
            +
                  Showing the first 500 but there are more
         
     | 
| 
      
 27 
     | 
    
         
            +
                - else
         
     | 
| 
      
 28 
     | 
    
         
            +
                  = links.size
         
     | 
| 
      
 29 
     | 
    
         
            +
              %ul.link_list
         
     | 
| 
      
 30 
     | 
    
         
            +
                - links.each do |page|
         
     | 
| 
      
 31 
     | 
    
         
            +
                  %li
         
     | 
| 
      
 32 
     | 
    
         
            +
                    - other_page = Page.sys(_sid).where(:full_path=>page.url).first rescue nil
         
     | 
| 
      
 33 
     | 
    
         
            +
                    .title.clearfix(class="http_#{page.http_status}")
         
     | 
| 
      
 34 
     | 
    
         
            +
                      .left
         
     | 
| 
      
 35 
     | 
    
         
            +
                        = link_to truncate(page.url, :length=>80), page.url
         
     | 
| 
      
 36 
     | 
    
         
            +
                      - if other_page
         
     | 
| 
      
 37 
     | 
    
         
            +
                        = other_page.title
         
     | 
| 
      
 38 
     | 
    
         
            +
                        [
         
     | 
| 
      
 39 
     | 
    
         
            +
                        = link_to other_page.status.name, "/page/#{other_page.id}/info"
         
     | 
| 
      
 40 
     | 
    
         
            +
                        ]
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
              - links = PageLink.sys(_sid).order(:url).where(:url=>@page.full_path).limit(500).all
         
     | 
| 
      
 44 
     | 
    
         
            +
              %h3 
         
     | 
| 
      
 45 
     | 
    
         
            +
                Pages Linking To This One:
         
     | 
| 
      
 46 
     | 
    
         
            +
                - if links.size==500
         
     | 
| 
      
 47 
     | 
    
         
            +
                  Showing the first 500 but there are mot
         
     | 
| 
      
 48 
     | 
    
         
            +
                - else
         
     | 
| 
      
 49 
     | 
    
         
            +
                  = links.size
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
      
 51 
     | 
    
         
            +
              %ul.link_list
         
     | 
| 
      
 52 
     | 
    
         
            +
                - links.each do |page|
         
     | 
| 
      
 53 
     | 
    
         
            +
                  %li
         
     | 
| 
      
 54 
     | 
    
         
            +
                    .title.clearfix(class="http_#{page.http_status}")
         
     | 
| 
      
 55 
     | 
    
         
            +
                      .left
         
     | 
| 
      
 56 
     | 
    
         
            +
                        = link_to truncate(page.page.full_path, :length=>80), page.page.full_path
         
     | 
| 
      
 57 
     | 
    
         
            +
                      - if page.page
         
     | 
| 
      
 58 
     | 
    
         
            +
                        = page.page.title
         
     | 
| 
      
 59 
     | 
    
         
            +
                        [
         
     | 
| 
      
 60 
     | 
    
         
            +
                        = link_to page.page.status.name, "/page/#{page.page.id}/info"
         
     | 
| 
      
 61 
     | 
    
         
            +
                        ]
         
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
         @@ -1,6 +1,8 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <div class='markdown_instance'>
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
       1 
3 
     | 
    
         
             
            <script type="text/javascript">
         
     | 
| 
       2 
4 
     | 
    
         
             
              $(document).ready(function() {
         
     | 
| 
       3 
     | 
    
         
            -
                  var  
     | 
| 
      
 5 
     | 
    
         
            +
                  var editor_element = parent.document.getElementById('<%= options[:id] %>');
         
     | 
| 
       4 
6 
     | 
    
         
             
                  var options = { 
         
     | 
| 
       5 
7 
     | 
    
         
             
                  <% unless options[:dont_show_line_numbers] %>
         
     | 
| 
       6 
8 
     | 
    
         
             
                  lineNumbers: true, 
         
     | 
| 
         @@ -10,37 +12,38 @@ 
     | 
|
| 
       10 
12 
     | 
    
         
             
                  lineWrapping: true, 
         
     | 
| 
       11 
13 
     | 
    
         
             
                  matchBrackets: true, 
         
     | 
| 
       12 
14 
     | 
    
         
             
                  collapseRange: true, 
         
     | 
| 
       13 
     | 
    
         
            -
                  mode : '<%= mode %>'};
         
     | 
| 
       14 
     | 
    
         
            -
                  var  
     | 
| 
       15 
     | 
    
         
            -
                   
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
      
 15 
     | 
    
         
            +
                  mode : '<%= options[:mode] %>'};
         
     | 
| 
      
 16 
     | 
    
         
            +
                  var editor = parent.CodeMirror.fromTextArea(editor_element, options);
         
     | 
| 
      
 17 
     | 
    
         
            +
                  register_editor(editor, "<%= options[:id] %>", "<%= name %>");
         
     | 
| 
      
 18 
     | 
    
         
            +
                  editor.focus();
         
     | 
| 
       17 
19 
     | 
    
         
             
              <% height = options[:height] %>
         
     | 
| 
       18 
20 
     | 
    
         
             
              <% width = options[:width] %>
         
     | 
| 
       19 
21 
     | 
    
         
             
              <% if height || width %>
         
     | 
| 
       20 
22 
     | 
    
         
             
                <% width = width ?  "\"#{width}\"" : 'null' %>
         
     | 
| 
       21 
23 
     | 
    
         
             
                <% height = height ?  "\"#{height}\"" : 'null' %>
         
     | 
| 
       22 
     | 
    
         
            -
                <%= " 
     | 
| 
      
 24 
     | 
    
         
            +
                <%= "editor.setSize(#{width}, #{height})".html_safe %>
         
     | 
| 
       23 
25 
     | 
    
         
             
              <% end %>
         
     | 
| 
       24 
26 
     | 
    
         | 
| 
       25 
27 
     | 
    
         
             
              });
         
     | 
| 
       26 
28 
     | 
    
         
             
            </script>
         
     | 
| 
       27 
29 
     | 
    
         | 
| 
       28 
30 
     | 
    
         
             
            <% unless options[:dont_show_mode] %>
         
     | 
| 
       29 
     | 
    
         
            -
            <div class='editor_mode'>Mode: <%= (mode=='htmlmixed' ? 'html' : mode).upcase %>
         
     | 
| 
      
 31 
     | 
    
         
            +
            <div class='editor_mode'>Mode: <%= (options[:mode]=='htmlmixed' ? 'html' : options[:mode]).upcase %>
         
     | 
| 
       30 
32 
     | 
    
         
             
            </div>
         
     | 
| 
       31 
33 
     | 
    
         
             
            <% end %>
         
     | 
| 
       32 
34 
     | 
    
         | 
| 
       33 
35 
     | 
    
         
             
            <% if options[:show_toolbar] %>
         
     | 
| 
       34 
36 
     | 
    
         
             
            <div class='toolbar'>
         
     | 
| 
       35 
     | 
    
         
            -
              <%= render :partial=>"utility/cm_toolbar_#{mode}", :locals=>{:name=> 
     | 
| 
      
 37 
     | 
    
         
            +
              <%= render :partial=>"utility/cm_toolbar_#{options[:mode]}", :locals=>{:name=>options[:id]} %>
         
     | 
| 
       36 
38 
     | 
    
         
             
            </div>
         
     | 
| 
       37 
39 
     | 
    
         
             
            <% end %>
         
     | 
| 
       38 
40 
     | 
    
         | 
| 
       39 
     | 
    
         
            -
            <%=  
     | 
| 
      
 41 
     | 
    
         
            +
            <textarea id="<%= options[:id] %>" name="<%= name %>"><%= options[:value] %></textarea>
         
     | 
| 
       40 
42 
     | 
    
         | 
| 
       41 
43 
     | 
    
         
             
            <% unless options[:no_preview] %>
         
     | 
| 
       42 
     | 
    
         
            -
            <div id="preview_<%=  
     | 
| 
      
 44 
     | 
    
         
            +
            <div id="preview_<%= options[:id] %>" class='markdown_preview' style='display: none;'>
         
     | 
| 
       43 
45 
     | 
    
         
             
              Please wait whilst the preview loads
         
     | 
| 
       44 
46 
     | 
    
         
             
            </div>
         
     | 
| 
       45 
47 
     | 
    
         
             
            <% end %>
         
     | 
| 
       46 
48 
     | 
    
         | 
| 
      
 49 
     | 
    
         
            +
            </div>
         
     | 
| 
         @@ -1,6 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            - rand = rand(100000)
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
3 
     | 
    
         
             
            %ul.markdown.clearfix(id="tb_#{rand}")
         
     | 
| 
       5 
4 
     | 
    
         | 
| 
       6 
5 
     | 
    
         
             
              %li.bold(data-cmd="undo" data-hint="Undo")
         
     | 
| 
         @@ -37,6 +36,14 @@ 
     | 
|
| 
       37 
36 
     | 
    
         
             
              %li.spacer.pre(data-cmd="pre" data-hint="Preformatted")
         
     | 
| 
       38 
37 
     | 
    
         
             
                = image_tag "/assets/kit/toolbar/formatted.png"
         
     | 
| 
       39 
38 
     | 
    
         
             
                %label Formatted
         
     | 
| 
      
 39 
     | 
    
         
            +
              - if Preference.get_cached(_sid, "forum_use_smilies")=='true'
         
     | 
| 
      
 40 
     | 
    
         
            +
                %li.smile(data-cmd="smile" data-hint="Smile")
         
     | 
| 
      
 41 
     | 
    
         
            +
                  = image_tag "/assets/kit/toolbar/smile.png"
         
     | 
| 
      
 42 
     | 
    
         
            +
                  %label Smile
         
     | 
| 
      
 43 
     | 
    
         
            +
                %li.spacer.wink(data-cmd="wink" data-hint="Wink")
         
     | 
| 
      
 44 
     | 
    
         
            +
                  = image_tag "/assets/kit/toolbar/wink.png"
         
     | 
| 
      
 45 
     | 
    
         
            +
                  %label Wink
         
     | 
| 
      
 46 
     | 
    
         
            +
             
     | 
| 
       40 
47 
     | 
    
         
             
              %li.pre(data-cmd="preview" data-hint="Preview")
         
     | 
| 
       41 
48 
     | 
    
         
             
                = image_tag "/assets/kit/toolbar/preview.png"
         
     | 
| 
       42 
49 
     | 
    
         
             
                %label Preview
         
     | 
| 
         @@ -86,6 +86,8 @@ 
     | 
|
| 
       86 
86 
     | 
    
         
             
                        %a.ads_wicon(href="/admin/advertisments") Advertisments
         
     | 
| 
       87 
87 
     | 
    
         
             
                    %p.advanced
         
     | 
| 
       88 
88 
     | 
    
         
             
                      %a.menu_wicon(href="/menus") Menus
         
     | 
| 
      
 89 
     | 
    
         
            +
                    %p.advanced
         
     | 
| 
      
 90 
     | 
    
         
            +
                      %a.notificationqueue_wicon(href="/admin/q") Notification Queue
         
     | 
| 
       89 
91 
     | 
    
         | 
| 
       90 
92 
     | 
    
         
             
                - if can?(:use, :design) 
         
     | 
| 
       91 
93 
     | 
    
         
             
                  %li
         
     | 
| 
         @@ -119,6 +121,8 @@ 
     | 
|
| 
       119 
121 
     | 
    
         
             
                        %a(href="/admin/dashboard/errors") Errors
         
     | 
| 
       120 
122 
     | 
    
         
             
                      %p
         
     | 
| 
       121 
123 
     | 
    
         
             
                        %a(href="/admin/dashboard/logfile") Log File
         
     | 
| 
      
 124 
     | 
    
         
            +
                      %p
         
     | 
| 
      
 125 
     | 
    
         
            +
                        %a(href="/admin/dj") Delayed Job Queue
         
     | 
| 
       122 
126 
     | 
    
         
             
                    %p
         
     | 
| 
       123 
127 
     | 
    
         
             
                      %a.help_wicon(href="/db/help") Help
         
     | 
| 
       124 
128 
     | 
    
         | 
| 
         @@ -22,6 +22,7 @@ 
     | 
|
| 
       22 
22 
     | 
    
         
             
              var options = { lineNumbers: true, theme: 'blackboard', indentUnit: 2, lineWrapping: true, matchBrackets: true  , collapseRange: true};
         
     | 
| 
       23 
23 
     | 
    
         
             
              html_editor = parent.CodeMirror.fromTextArea(editor_a, options);
         
     | 
| 
       24 
24 
     | 
    
         
             
              html_editor.focus();
         
     | 
| 
      
 25 
     | 
    
         
            +
              parent.$('.CodeMirror').css('height', ($(window).height()-40) + 'px');
         
     | 
| 
       25 
26 
     | 
    
         
             
              }
         
     | 
| 
       26 
27 
     | 
    
         | 
| 
       27 
28 
     | 
    
         
             
              function the_editor() {
         
     | 
| 
         @@ -1,7 +1,10 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
      
 1 
     | 
    
         
            +
            module ElasticSearch
         
     | 
| 
      
 2 
     | 
    
         
            +
                INDEX_NAME = (Rails.configuration.es_index_name rescue Rails.application.class.to_s.split("::").first).downcase
         
     | 
| 
       2 
3 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
            Tire::Model::Search.index_prefix  
     | 
| 
      
 4 
     | 
    
         
            +
                Tire::Model::Search.index_prefix INDEX_NAME
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
                Tire.configure { logger 'log/search.log', :level => 'info' }
         
     | 
| 
      
 7 
     | 
    
         
            +
            end
         
     | 
| 
       4 
8 
     | 
    
         | 
| 
       5 
     | 
    
         
            -
            Tire.configure { logger 'log/search.log', :level => 'info' }
         
     | 
| 
       6 
9 
     | 
    
         | 
| 
       7 
10 
     | 
    
         | 
| 
         @@ -2,6 +2,7 @@ module DomainController 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
              attr_accessor :kit_system
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
       5 
6 
     | 
    
         
             
              def licensed(c = nil)
         
     | 
| 
       6 
7 
     | 
    
         
             
                if c!=nil
         
     | 
| 
       7 
8 
     | 
    
         
             
                  function = c
         
     | 
| 
         @@ -50,6 +51,8 @@ module DomainController 
     | 
|
| 
       50 
51 
     | 
    
         
             
                        break
         
     | 
| 
       51 
52 
     | 
    
         
             
                    end
         
     | 
| 
       52 
53 
     | 
    
         
             
                  end
         
     | 
| 
      
 54 
     | 
    
         
            +
             
         
     | 
| 
      
 55 
     | 
    
         
            +
                  session[:system_id] = nil
         
     | 
| 
       53 
56 
     | 
    
         | 
| 
       54 
57 
     | 
    
         
             
                  if system_id
         
     | 
| 
       55 
58 
     | 
    
         
             
                    session[:system_id] = system_id
         
     | 
| 
         @@ -20,6 +20,12 @@ class String 
     | 
|
| 
       20 
20 
     | 
    
         
             
                options[:filter_styles] ||= true
         
     | 
| 
       21 
21 
     | 
    
         
             
                options[:autolink] ||= true
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
      
 23 
     | 
    
         
            +
                if options[:smilies]
         
     | 
| 
      
 24 
     | 
    
         
            +
                  text = text.gsub(/\:smile\:/, '+smile+smile+')
         
     | 
| 
      
 25 
     | 
    
         
            +
                  text = text.gsub(/\:wink\:/, '+smile+wink+')
         
     | 
| 
      
 26 
     | 
    
         
            +
                  text = text.gsub(/\:wall\:/, '+smile+wall+')
         
     | 
| 
      
 27 
     | 
    
         
            +
                end 
         
     | 
| 
      
 28 
     | 
    
         
            +
                
         
     | 
| 
       23 
29 
     | 
    
         
             
                r = Maruku.new(text)
         
     | 
| 
       24 
30 
     | 
    
         | 
| 
       25 
31 
     | 
    
         
             
                options.each do |k,v|
         
     | 
| 
         @@ -30,12 +36,9 @@ class String 
     | 
|
| 
       30 
36 
     | 
    
         | 
| 
       31 
37 
     | 
    
         
             
                d = r.to_html.gsub(/!YOUTUBE!([0-9a-zA-Z\_\-]{5,15})!/i,  '<br/><iframe width="560" height="315" src="http://www.youtube.com/embed/\1" frameborder="0" allowfullscreen></iframe><br/>')  unless options[:strict_markdown] || options[:no_youtube]
         
     | 
| 
       32 
38 
     | 
    
         
             
                d = d.gsub(/!VIMEO!([0-9]{6,9})!/i,  '<br/><iframe src="http://player.vimeo.com/video/\1" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe><br/>') unless options[:strict_markdown] || options[:no_youtube]
         
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
                 
     | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
       36 
     | 
    
         
            -
                  d.gsub!(/:wink:/, '<img src="/assets/smilies/wink.gif" height="20" width="20" />')
         
     | 
| 
       37 
     | 
    
         
            -
                  d.gsub!(/:wall:/, '<img src="/assets/smilies/wall.gif" height="20" width="20" />')
         
     | 
| 
       38 
     | 
    
         
            -
                end 
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                d = d.gsub(/\+smile\+([a-z0-9]+)\+/i, '<img src="/assets/smilies/\1.gif" class="smiley" />')
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
       39 
42 
     | 
    
         
             
                return d
         
     | 
| 
       40 
43 
     | 
    
         
             
              end
         
     | 
| 
       41 
44 
     | 
    
         | 
| 
         @@ -0,0 +1,49 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            Rails.configuration.middleware.use RailsWarden::Manager do |manager|
         
     | 
| 
      
 2 
     | 
    
         
            +
                manager.default_strategies :cookie, :token, :email
         
     | 
| 
      
 3 
     | 
    
         
            +
                manager.failure_app = AccountController
         
     | 
| 
      
 4 
     | 
    
         
            +
              end
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
              Warden::Strategies.add(:cookie) do
         
     | 
| 
      
 7 
     | 
    
         
            +
                def valid?
         
     | 
| 
      
 8 
     | 
    
         
            +
                  cookies[:sign_in]
         
     | 
| 
      
 9 
     | 
    
         
            +
                end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                def authenticate!
         
     | 
| 
      
 12 
     | 
    
         
            +
                  u = User.cookie_authenticate(session[:system_id], cookies[:sign_in])
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
                  success!(u) if u
         
     | 
| 
      
 15 
     | 
    
         
            +
                end
         
     | 
| 
      
 16 
     | 
    
         
            +
              end
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
              Warden::Strategies.add(:email) do
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
                def valid?
         
     | 
| 
      
 21 
     | 
    
         
            +
                  session[:system_id] && 
         
     | 
| 
      
 22 
     | 
    
         
            +
                    (
         
     | 
| 
      
 23 
     | 
    
         
            +
                      ( params[:email] && params[:password] ) ||
         
     | 
| 
      
 24 
     | 
    
         
            +
                      ( params[:user] && params[:user][:email] && params[:user][:password] )
         
     | 
| 
      
 25 
     | 
    
         
            +
                    )
         
     | 
| 
      
 26 
     | 
    
         
            +
                end
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
                def authenticate!
         
     | 
| 
      
 29 
     | 
    
         
            +
                  u = User.authenticate(session[:system_id], params[:email] || (params[:user] && params[:user][:email]), params[:password] || (params[:user] && params[:user][:password]))
         
     | 
| 
      
 30 
     | 
    
         
            +
                  success!(u) if u
         
     | 
| 
      
 31 
     | 
    
         
            +
                end
         
     | 
| 
      
 32 
     | 
    
         
            +
              end
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
              Warden::Strategies.add(:token) do
         
     | 
| 
      
 35 
     | 
    
         
            +
                def valid?
         
     | 
| 
      
 36 
     | 
    
         
            +
                  session[:system_id] && params[(Preference.get_cached(session[:system_id], "account_token_param") || 'token').to_sym]
         
     | 
| 
      
 37 
     | 
    
         
            +
                end
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
                def authenticate!
         
     | 
| 
      
 40 
     | 
    
         
            +
                  system_id = nil
         
     | 
| 
      
 41 
     | 
    
         
            +
                  
         
     | 
| 
      
 42 
     | 
    
         
            +
                  u = User.token_authenticate(session[:system_id], params[(Preference.get_cached(session[:system_id], "account_token_param") || 'token').to_sym]
         
     | 
| 
      
 43 
     | 
    
         
            +
            )
         
     | 
| 
      
 44 
     | 
    
         
            +
                  success!(u) if u
         
     | 
| 
      
 45 
     | 
    
         
            +
                end
         
     | 
| 
      
 46 
     | 
    
         
            +
             
     | 
| 
      
 47 
     | 
    
         
            +
              end
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
             
     |