Sha256: 1a066daa675e9700d45c74a56fda567cdc382f1636de6aaacf837436b375143d

Contents?: true

Size: 1.95 KB

Versions: 3

Compression:

Stored size: 1.95 KB

Contents

<ul class="list-group">
    <% @paths.each do |path| %>
        <li class="list-group-item">
            <% part_of_path_mapped_to_identity_global_path = path.split('/').each.with_index.inject({}) do |acc, (part_of_path, i)| %>
                <% acc[i] = part_of_path %>
                <% acc[part_of_path] = File.join('/dropbox/', path.split('/').take(i +  1).join('/')) %>
                <% acc %>
            <% end %>

            <%= link_to 'dropbox', root_path %>
            <% path.split('/').reject(&:blank?).each do |part_of_path| %>
              <SPAN>/</SPAN>     

              <% if path.file? && path.to_s =~ /.*?#{Regexp.escape(part_of_path)}\Z/ %>
                <span style="color: purple"><%= path.split('/').last %></span>
              <% else %>
                <%= link_to(part_of_path, directory_path(part_of_path_mapped_to_identity_global_path[part_of_path])) %>
              <% end %>
            <% end %>

            <% if path.modified_at.present? %>
              was modified
              <%= time_ago_in_words(path.modified_at) %>
            <% end %>
            <% if path =~ /\.zip\Z/ %>
                <%= button_to('Unzip', unzips_path(unzip: {zip_file_path: path.global_path})) %>
            <% end %>

            <% if path.file? %>
              <% case File.extname(path.file_system_path) %>
              <% when '.shp' %>
                <%= link_to 'View', ezii_os_file_path(path.global_path) %>
              <% when '.xlsx' %>
                <%= link_to 'View', ezii_os_file_path(path.global_path) %>
              <% when '.pdf' %>
                <%= link_to 'View', ezii_os_file_path(path.global_path) %>
              <% when '.jpg' %>
                <%= link_to 'View', ezii_os_file_path(path.global_path) %>
              <% when '.erb' %>
                <%= link_to('Show INLINE (admin only)', ezii_os_file_path(path.global_path, admin: true)) %>
              <% end %>
            <% end %>
        </li>
    <% end %>
</ul>

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
jester-data-8.0.0 app/views/directories/show.html.erb
ezii-os-5.2.1 app/views/directories/show.html.erb
ezii-os-2.0.1 app/views/directories/show.html.erb