decidim-feeds_ui 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE-AGPLv3.txt +661 -0
  3. data/README.md +37 -0
  4. data/Rakefile +9 -0
  5. data/app/controllers/decidim/feeds_ui/admin/application_controller.rb +23 -0
  6. data/app/controllers/decidim/feeds_ui/application_controller.rb +19 -0
  7. data/app/controllers/decidim/feeds_ui/users_controller.rb +47 -0
  8. data/app/helpers/decidim/feeds_ui/application_helper.rb +21 -0
  9. data/app/models/decidim/feeds_ui/application_record.rb +10 -0
  10. data/app/packs/entrypoints/decidim_feeds_ui.js +5 -0
  11. data/app/packs/images/decidim/feeds_ui/DigifondsGefoerdert.png +0 -0
  12. data/app/packs/images/decidim/feeds_ui/icon.svg +1 -0
  13. data/app/packs/images/decidim/feeds_ui/mitgestalten-logo.png +0 -0
  14. data/app/packs/src/decidim/feeds_ui/feeds_ui.js +41 -0
  15. data/app/packs/stylesheets/decidim/feeds_ui/feeds_ui.scss +230 -0
  16. data/app/permissions/decidim/feeds_ui/admin/permissions.rb +23 -0
  17. data/app/permissions/decidim/feeds_ui/permissions.rb +27 -0
  18. data/app/views/decidim/feeds_ui/users/_users_list.html.erb +26 -0
  19. data/app/views/decidim/feeds_ui/users/filter_users.js.erb +2 -0
  20. data/app/views/decidim/feeds_ui/users/index.html.erb +30 -0
  21. data/app/views/decidim/feeds_ui/users/user_profile.html.erb +24 -0
  22. data/app/views/layouts/decidim/_admin_links.html.erb +3 -0
  23. data/app/views/layouts/decidim/_logo.html.erb +10 -0
  24. data/app/views/layouts/decidim/footer/_main.html.erb +4 -0
  25. data/app/views/layouts/decidim/footer/_mini.html.erb +57 -0
  26. data/app/views/layouts/decidim/header/_links_mobile_top.html.erb +32 -0
  27. data/app/views/layouts/decidim/header/_main.html.erb +31 -0
  28. data/app/views/layouts/decidim/header/_main_links_desktop.html.erb +31 -0
  29. data/app/views/layouts/decidim/header/_main_links_dropdown.html.erb +39 -0
  30. data/app/views/layouts/decidim/header/_main_links_mobile.html.erb +57 -0
  31. data/app/views/layouts/decidim/header/_menu.html.erb +0 -0
  32. data/config/assets.rb +9 -0
  33. data/config/i18n-tasks.yml +10 -0
  34. data/config/locales/bs.yml +29 -0
  35. data/config/locales/de.yml +29 -0
  36. data/config/locales/en.yml +29 -0
  37. data/config/locales/hr.yml +29 -0
  38. data/config/locales/it.yml +29 -0
  39. data/config/locales/sr.yml +29 -0
  40. data/config/locales/tr.yml +29 -0
  41. data/lib/decidim/feeds_ui/admin.rb +8 -0
  42. data/lib/decidim/feeds_ui/admin_engine.rb +27 -0
  43. data/lib/decidim/feeds_ui/engine.rb +50 -0
  44. data/lib/decidim/feeds_ui/menu.rb +18 -0
  45. data/lib/decidim/feeds_ui/test/factories.rb +7 -0
  46. data/lib/decidim/feeds_ui/version.rb +11 -0
  47. data/lib/decidim/feeds_ui.rb +10 -0
  48. metadata +154 -0
@@ -0,0 +1,57 @@
1
+ <div class="mini-footer">
2
+ <nav class="w-auto" role="navigation" aria-label="Legal">
3
+ <%= render partial: "layouts/decidim/footer/main_legal" %>
4
+ </nav>
5
+ <div class="row">
6
+ <a rel="decidim noopener" class="small_logo icona flex"
7
+ href="https://decidim.org/"
8
+ target="_blank"
9
+ data-external-link="false">
10
+ <svg viewBox="0 0 108 90" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="svg-logo" role="img" aria-label="decidim">
11
+ <g id="decidim-logo" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
12
+ <g id="decidim-logo-mobile--inv" fill="currentcolor" fill-rule="nonzero">
13
+ <path d="M107.709524,73.8095238 C107.706894,82.3061988 100.817311,89.1922289 92.3206359,89.1904762 C83.8239607,89.1887228 76.9372197,82.2998504 76.9380961,73.8031751 C76.9389724,65.3064997 83.8271341,58.4190476 92.3238095,58.4190476 C100.821875,58.421677 107.709524,65.3114578 107.709524,73.8095238 Z"></path>
14
+ <rect x="36.9285714" y="0" width="30.7761905" height="89.1904762" rx="6.46"></rect>
15
+ <path d="M-1.18047875e-05,36.9 L-1.18047875e-05,36.9 C-0.00505500327,32.8157177 1.61355136,28.8969168 4.49934355,26.0066589 C7.38513573,23.1164009 11.301429,21.4917368 15.3857143,21.4904762 L27.7,21.4904762 C29.3978458,21.4930984 30.7735683,22.8688209 30.7761905,24.5666667 L30.7761905,86.1142857 C30.7761905,86.9301422 30.4520928,87.7125832 29.8751951,88.2894809 C29.2982975,88.8663785 28.5158564,89.1904762 27.7,89.1904762 L15.3857143,89.1904762 C6.89136634,89.1878496 0.00525599759,82.3038705 -1.18047875e-05,73.8095238 L-1.18047875e-05,36.9 Z"></path>
16
+ </g>
17
+ </g>
18
+ </svg>
19
+ </a>
20
+ <a rel="license noopener" class="small_logo icona flex"
21
+ href="http://creativecommons.org/licenses/by-sa/4.0/"
22
+ target="_blank"
23
+ data-external-link="false">
24
+ <svg viewBox="0 0 215 65" version="1.1" xmlns="http://www.w3.org/2000/svg" class="svg-logo" role="img" aria-label="<%=t("layouts.decidim.footer.cc_by_license")%>">
25
+ <g id="cc-by-sa" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
26
+ <g id="cc-by-sa--inv" fill="currentcolor" fill-rule="nonzero">
27
+ <g id="sa" transform="translate(150.000000, 0.000000)">
28
+ <circle cx="31.944" cy="32.631" r="29.105"></circle>
29
+ <path d="M32.443,0.5 C41.394,0.5 48.974,3.605 55.185,9.815 C61.393,15.987 64.5,23.548 64.5,32.5 C64.5,41.454 61.451,48.957 55.355,55.014 C48.918,61.338 41.279,64.5 32.443,64.5 C23.794,64.5 16.29,61.357 9.929,55.071 C3.644,48.786 0.5,41.264 0.5,32.501 C0.5,23.778 3.644,16.216 9.929,9.816 C16.138,3.605 23.643,0.5 32.443,0.5 Z M32.557,6.272 C25.281,6.272 19.129,8.844 14.1,13.987 C8.88,19.283 6.271,25.454 6.271,32.5 C6.271,39.625 8.861,45.757 14.041,50.9 C19.222,56.082 25.393,58.671 32.555,58.671 C39.678,58.671 45.889,56.062 51.184,50.843 C56.213,45.967 58.727,39.853 58.727,32.5 C58.727,25.187 56.174,19.015 51.071,13.987 C46.004,8.842 39.832,6.272 32.557,6.272 Z M18.271,27.985 C18.88,24.061 20.46,21.023 23.013,18.871 C25.565,16.719 28.669,15.643 32.327,15.643 C37.354,15.643 41.356,17.263 44.327,20.499 C47.298,23.737 48.784,27.89 48.784,32.956 C48.784,37.871 47.241,41.956 44.157,45.212 C41.069,48.468 37.071,50.098 32.155,50.098 C28.536,50.098 25.412,49.013 22.784,46.841 C20.155,44.669 18.575,41.584 18.041,37.584 L26.1,37.584 C26.29,41.47 28.633,43.413 33.129,43.413 C35.375,43.413 37.186,42.441 38.557,40.499 C39.93,38.557 40.616,35.965 40.616,32.728 C40.616,29.337 39.987,26.757 38.731,24.985 C37.473,23.214 35.665,22.328 33.301,22.328 C29.033,22.328 26.634,24.213 26.101,27.984 L28.444,27.984 L22.102,34.327 L15.759,27.984 L18.271,27.985 L18.271,27.985 Z" fill="#FFFFFF"></path>
30
+ </g>
31
+ <g id="by" transform="translate(75.000000, 0.000000)">
32
+ <circle cx="32.637" cy="32.806" r="28.276"></circle>
33
+ <path d="M32.443,0.5 C41.431,0.5 49.013,3.585 55.185,9.757 C61.393,15.967 64.5,23.548 64.5,32.5 C64.5,41.491 61.451,48.976 55.355,54.956 C48.879,61.319 41.242,64.5 32.443,64.5 C23.794,64.5 16.29,61.356 9.929,55.07 C3.644,48.784 0.5,41.262 0.5,32.5 C0.5,23.739 3.644,16.158 9.929,9.758 C16.101,3.585 23.604,0.5 32.443,0.5 Z M32.557,6.272 C25.281,6.272 19.129,8.825 14.1,13.929 C8.88,19.263 6.271,25.454 6.271,32.501 C6.271,39.587 8.861,45.721 14.041,50.899 C19.222,56.081 25.393,58.67 32.555,58.67 C39.678,58.67 45.889,56.063 51.184,50.842 C56.213,46.004 58.727,39.89 58.727,32.499 C58.727,25.223 56.174,19.034 51.071,13.928 C45.967,8.824 39.795,6.272 32.557,6.272 Z M41.129,24.557 L41.129,37.642 L37.473,37.642 L37.473,53.184 L27.529,53.184 L27.529,37.643 L23.873,37.643 L23.873,24.557 C23.873,23.985 24.073,23.5 24.472,23.1 C24.873,22.701 25.359,22.5 25.929,22.5 L39.073,22.5 C39.606,22.5 40.083,22.7 40.501,23.1 C40.918,23.5 41.129,23.986 41.129,24.557 Z M28.042,16.329 C28.042,13.321 29.527,11.815 32.5,11.815 C35.473,11.815 36.957,13.319 36.957,16.329 C36.957,19.3 35.471,20.786 32.5,20.786 C29.529,20.786 28.042,19.3 28.042,16.329 Z" fill="#FFFFFF"></path>
34
+ </g>
35
+ <g id="cc">
36
+ <circle cx="32.785" cy="32.501" r="28.836"></circle>
37
+ <path d="M32.441,0.5 C41.392,0.5 49.013,3.625 55.298,9.872 C58.306,12.881 60.593,16.32 62.155,20.186 C63.716,24.053 64.499,28.157 64.499,32.5 C64.499,36.881 63.726,40.986 62.185,44.813 C60.642,48.641 58.365,52.023 55.357,54.956 C52.234,58.041 48.691,60.404 44.728,62.042 C40.767,63.68 36.671,64.499 32.443,64.499 C28.215,64.499 24.167,63.691 20.3,62.07 C16.434,60.452 12.967,58.109 9.9,55.043 C6.833,51.977 4.5,48.519 2.9,44.671 C1.3,40.823 0.5,36.767 0.5,32.5 C0.5,28.271 1.309,24.205 2.928,20.3 C4.547,16.395 6.9,12.9 9.985,9.814 C16.08,3.606 23.565,0.5 32.441,0.5 Z M32.557,6.272 C25.243,6.272 19.09,8.825 14.099,13.929 C11.584,16.482 9.651,19.348 8.299,22.529 C6.945,25.71 6.27,29.034 6.27,32.501 C6.27,35.93 6.945,39.235 8.299,42.414 C9.652,45.597 11.584,48.435 14.099,50.93 C16.613,53.426 19.45,55.329 22.614,56.645 C25.775,57.959 29.09,58.616 32.557,58.616 C35.985,58.616 39.307,57.951 42.53,56.617 C45.749,55.282 48.651,53.36 51.243,50.846 C56.233,45.97 58.727,39.856 58.727,32.502 C58.727,28.959 58.079,25.607 56.784,22.445 C55.491,19.283 53.604,16.465 51.13,13.987 C45.984,8.844 39.795,6.272 32.557,6.272 Z M32.156,27.187 L27.869,29.416 C27.411,28.465 26.85,27.797 26.184,27.416 C25.517,27.036 24.898,26.845 24.326,26.845 C21.47,26.845 20.04,28.73 20.04,32.502 C20.04,34.216 20.402,35.586 21.125,36.615 C21.849,37.644 22.916,38.159 24.326,38.159 C26.193,38.159 27.507,37.244 28.27,35.416 L32.212,37.416 C31.374,38.979 30.212,40.207 28.726,41.102 C27.242,41.998 25.603,42.445 23.812,42.445 C20.955,42.445 18.649,41.57 16.897,39.816 C15.145,38.064 14.269,35.626 14.269,32.503 C14.269,29.455 15.155,27.037 16.926,25.246 C18.697,23.456 20.935,22.5599981 23.641,22.5599981 C27.604,22.558 30.441,24.101 32.156,27.187 Z M50.613,27.187 L46.384,29.416 C45.927,28.465 45.364,27.797 44.698,27.416 C44.03,27.036 43.391,26.845 42.784,26.845 C39.927,26.845 38.497,28.73 38.497,32.502 C38.497,34.216 38.86,35.586 39.583,36.615 C40.306,37.644 41.372,38.159 42.784,38.159 C44.649,38.159 45.964,37.244 46.725,35.416 L50.725,37.416 C49.85,38.979 48.668,40.207 47.184,41.102 C45.698,41.998 44.079,42.445 42.327,42.445 C39.431,42.445 37.118,41.57 35.386,39.816 C33.65,38.064 32.784,35.626 32.784,32.503 C32.784,29.455 33.669,27.037 35.442,25.246 C37.212,23.456 39.45,22.5599981 42.155,22.5599981 C46.117,22.558 48.938,24.101 50.613,27.187 Z" fill="#FFFFFF"></path>
38
+ </g>
39
+ </g>
40
+ </g>
41
+ </svg>
42
+ </a>
43
+ </div>
44
+ <div class="row footer_mitgestalten">
45
+ <a href="https://wien.arbeiterkammer.at/digifonds" target="_blank" rel="decidim noopener" class="footer_logo" data-external-link="false">
46
+ <span class="sr-only"><%=t("layouts.decidim.footer.AK_gefoerdert")%></span>
47
+ <%= image_pack_tag("media/images/DigifondsGefoerdert.png", alt: t("layouts.decidim.footer.link_neues_fenster")) %>
48
+ </a>
49
+ <a rel="decidim noopener"
50
+ href="https://partizipationsbuero.at/"
51
+ target="_blank"
52
+ class="footer_logo flex"
53
+ data-external-link="false">
54
+ <%= image_pack_tag("media/images/mitgestalten-logo.png", alt: "Mitgestalten Partizipiationsbüro") %>
55
+ </a>
56
+ </div>
57
+ </div>
@@ -0,0 +1,32 @@
1
+ <% if current_user %>
2
+ <div>
3
+ <% link_class = current_page?(decidim.account_path) ? 'active' : '' %>
4
+
5
+ <% if false %>
6
+ <%= link_to decidim.account_path, class: "links-mobile-top__item #{link_class}" do %>
7
+ <%= icon "user-smile-line" %>
8
+ <span class="text-secondary"><%= t("layouts.decidim.user_profile.account") %></span>
9
+ <% end %>
10
+ <% end %>
11
+
12
+ <button id="dropdown-trigger-links-mobile-search" class="links-mobile-top__item" data-component="dropdown" data-target="dropdown-menu-search-mobile" data-autofocus="input-search-mobile">
13
+ <%= icon "search-line" %><span><%= t("decidim.search.term_input_placeholder") %></span>
14
+ </button>
15
+
16
+ <%= link_to '/pages/info', class: "links-mobile-top__item" do %>
17
+ <%= icon "information-line" %><span><%= t("decidim.components.feeds_ui.topMenu.information") %></span>
18
+ <% end %>
19
+
20
+ <%= link_to decidim.destroy_user_session_path, method: :delete, class: "links-mobile-top__item" do %>
21
+ <%#= icon "user-smile-line" %>
22
+ <span class="text-secondary whitespace-nowrap"><%= t("decidim.components.feeds_ui.userMenu.sign_out") %></span>
23
+ <% end %>
24
+
25
+ </div>
26
+ <% if current_user.notifications.any? %>
27
+ <%= link_to decidim.notifications_path, class: "links-mobile-top__item notification" do %>
28
+ <%= icon "notification-line" %>
29
+ <span class="feeds__notification sr-only"><%= t("decidim.components.feeds_ui.topMenu.notification") %></span>
30
+ <% end %>
31
+ <% end %>
32
+ <% end %>
@@ -0,0 +1,31 @@
1
+ <div id="main-bar" class="main-bar__container">
2
+ <div class="main-bar">
3
+ <div class="main-bar__logo">
4
+ <%= render partial: "layouts/decidim/logo", locals: { organization: current_organization } %>
5
+ </div>
6
+ <div class="main-bar__search">
7
+ <%= render partial: "layouts/decidim/header/main_search" %>
8
+ </div>
9
+ <div class="main-bar__links-desktop">
10
+ <%= render partial: "layouts/decidim/header/main_links_desktop" %>
11
+ </div>
12
+
13
+ <div>
14
+ <div class="main-bar__links-mobile-top">
15
+ <%= render partial: "layouts/decidim/header/links_mobile_top" %>
16
+ </div>
17
+
18
+ <%# Sticky menu mobile %>
19
+ <% if current_user %>
20
+ <div class="main-bar__links-mobile">
21
+ <%= render partial: "layouts/decidim/header/main_links_mobile" %>
22
+ </div>
23
+ <% end %>
24
+
25
+
26
+ <%# Overlay menus mobile %>
27
+ <%= render partial: "layouts/decidim/header/main_links_mobile_search" %>
28
+ <%= render partial: "layouts/decidim/header/main_links_mobile_account" if current_user %>
29
+ </div>
30
+ </div>
31
+ </div>
@@ -0,0 +1,31 @@
1
+ <div>
2
+ <%= link_to '/pages/info', class: "links-mobile-top__item" do %>
3
+ <%= icon "information-line" %><span><%= t("decidim.components.feeds_ui.topMenu.information") %></span>
4
+ <% end %>
5
+ </div>
6
+
7
+ <% if !current_user %>
8
+ <div>
9
+ <%= link_to decidim.new_user_session_path, class: "main-bar__links-desktop__item", "aria-label": t("layouts.decidim.header.log_in") do %>
10
+ <%= icon "login-box-line" %><span><%= t("layouts.decidim.header.log_in") %></span>
11
+ <% end %>
12
+ </div>
13
+ <% else %>
14
+ <div class="main-bar__dropdown-container">
15
+ <button id="trigger-dropdown-account" class="main-bar__dropdown-trigger" data-component="dropdown" data-target="dropdown-menu-account">
16
+ <% unread_data = current_user_unread_data %>
17
+ <% if unread_data[:unread_items] %>
18
+ <%= content_tag :span, "", class: "main-bar__notification", data: unread_data %>
19
+ <% end %>
20
+ <span class="main-bar__links-desktop__item">
21
+ <%= icon "user-smile-line" %>
22
+ <span><%= t("layouts.decidim.user_profile.account") %></span>
23
+ </span>
24
+ </button>
25
+ <div id="dropdown-menu-account" aria-hidden="true">
26
+ <ul class="dropdown dropdown__bottom main-bar__dropdown">
27
+ <%= render partial: "layouts/decidim/header/main_links_dropdown", locals: { unread_data: } %>
28
+ </ul>
29
+ </div>
30
+ </div>
31
+ <% end %>
@@ -0,0 +1,39 @@
1
+ <% unread_data ||= current_user_unread_data %>
2
+ <li>
3
+ <%= link_to decidim.account_path, class: "dropdown__item" do %>
4
+ <%= icon "user-smile-line" %>
5
+ <span class="text-secondary"><%= t("layouts.decidim.user_menu.profile") %></span>
6
+ <% end %>
7
+ </li>
8
+ <li>
9
+ <%= link_to decidim.notifications_path, class: "dropdown__item" do %>
10
+ <%= icon "notification-3-line" %>
11
+ <span class="text-secondary"><%= t("layouts.decidim.user_menu.notifications") %></span>
12
+ <% if unread_data[:unread_notifications] %>
13
+ <%= content_tag :span, "", class: "main-bar__dropdown-notification", data: unread_data %>
14
+ <% end %>
15
+ <% end %>
16
+ </li>
17
+ <li>
18
+ <%= link_to decidim.conversations_path, class: "dropdown__item" do %>
19
+ <%= icon "mail-send-line" %>
20
+ <span class="text-secondary"><%= t("layouts.decidim.user_menu.conversations") %></span>
21
+ <% if unread_data[:unread_conversations] %>
22
+ <%= content_tag :span, "", class: "main-bar__dropdown-notification", data: unread_data %>
23
+ <% end %>
24
+ <% end %>
25
+ </li>
26
+ <% if allowed_to? :read, :admin_dashboard %>
27
+ <li>
28
+ <%= link_to decidim_admin.root_path, class: "dropdown__item" do %>
29
+ <%= icon "dashboard-line" %>
30
+ <span class="text-secondary"><%= t("layouts.decidim.user_menu.admin_dashboard") %></span>
31
+ <% end %>
32
+ </li>
33
+ <% end %>
34
+ <li>
35
+ <%= link_to decidim.destroy_user_session_path, method: :delete, class: "dropdown__item" do %>
36
+ <%= icon "logout-box-r-line" %>
37
+ <span class="text-secondary"><%= t("layouts.decidim.user_menu.log_out") %></span>
38
+ <% end %>
39
+ </li>
@@ -0,0 +1,57 @@
1
+ <%= link_to decidim.root_url, class: "main-bar__links-mobile__item order-1" do %>
2
+ <%= icon "home-5-line" %><span><%= t("decidim.components.feeds_ui.mainMenu.home") %></span>
3
+ <% end %>
4
+
5
+ <% if current_user.admin? %>
6
+ <%= link_to decidim_admin.root_path, class: "main-bar__links-mobile__item order-5" do %>
7
+ <%= icon "home-gear-line" %>
8
+ <span class="text-secondary text-center"><%= t("decidim.components.feeds_ui.mainMenu.admin") %></span>
9
+ <% end %>
10
+ <% else %>
11
+ <% if false %>
12
+ <button id="dropdown-trigger-links-mobile-search" class="main-bar__links-mobile__item order-2" data-component="dropdown" data-target="dropdown-menu-search-mobile" data-autofocus="input-search-mobile">
13
+ <%= icon "group-2-line" %><span><%= t("decidim.components.feeds_ui.mainMenu.group") %></span>
14
+ </button>
15
+ <% end %>
16
+
17
+ <% link_class = current_page?("/pages/groups") ? 'active' : '' %>
18
+ <%= link_to "/pages/groups", class: "main-bar__links-mobile__item order-2 #{link_class}" do %>
19
+ <%= icon "group-2-line" %><span><%= t("decidim.components.feeds_ui.mainMenu.group") %></span>
20
+ <% end %>
21
+ <% end %>
22
+
23
+ <% if controller.controller_name != 'conversations' %>
24
+ <button class="btn circle main-bar__links-mobile__item posts__post_newElement-opener order-3" aria-expanded="false" aria-controls="posts__post_newElement" aria-haspopup="posts__post_newElement" type="button">
25
+ <%= icon "close-circle-line" %>
26
+ <span class="sr-only"><%= t("decidim.components.posts.newFeed.openButton") %></span>
27
+ </button>
28
+ <% else %>
29
+ <button id="start-conversation-dialog-button" type="button" class="btn circle main-bar__links-mobile__item order-3" data-dialog-open="conversation">
30
+ <span class="sr-only"><%= t("new_conversation", scope: "decidim.messaging.conversations.index") %></span>
31
+ <%= icon "close-circle-line" %>
32
+ </button>
33
+ <% end %>
34
+
35
+ <% order_class = current_user.admin? ? 'order-2' : 'order-4' %>
36
+
37
+ <% user_url = current_user.admin? ? decidim_admin.officializations_path : decidim_feeds_ui.allusers_path %>
38
+ <% link_class = current_page?(decidim_feeds_ui.allusers_path) ? 'active' : '' %>
39
+ <%= link_to user_url, class: "main-bar__links-mobile__item #{order_class} #{link_class}" do %>
40
+ <%= icon "team-line" %><span><%= t("decidim.components.feeds_ui.mainMenu.user") %></span>
41
+ <% end %>
42
+
43
+ <% if current_user.admin? %>
44
+ <%= link_to decidim_admin.newsletters_path, class: "main-bar__links-mobile__item order-4" do %>
45
+ <%= icon "mail-add-line" %>
46
+ <span><%= t("decidim.admin.menu.newsletters") %></span>
47
+ <% end %>
48
+ <% else %>
49
+ <% link_class = current_page?(decidim.conversations_path) ? 'active' : '' %>
50
+ <%= link_to decidim.conversations_path, class: "main-bar__links-mobile__item order-5 #{link_class}" do %>
51
+ <%= icon "chat-4-line" %>
52
+ <span><%= t("decidim.components.feeds_ui.mainMenu.messenger") %></span>
53
+ <% if current_user.unread_conversations.any? %>
54
+ <span class="absolute translate-x-5 h-2 w-2 rounded-full bg-feeds-notification" data-unread-conversations="true" data-unread-items="true"></span>
55
+ <% end %>
56
+ <% end %>
57
+ <% end %>
File without changes
data/config/assets.rb ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ base_path = File.expand_path("..", __dir__)
4
+
5
+ Decidim::Webpacker.register_path("#{base_path}/app/packs")
6
+ Decidim::Webpacker.register_entrypoints(
7
+ decidim_feeds_ui: "#{base_path}/app/packs/entrypoints/decidim_feeds_ui.js"
8
+ )
9
+ Decidim::Webpacker.register_stylesheet_import("stylesheets/decidim/feeds_ui/feeds_ui")
@@ -0,0 +1,10 @@
1
+ ---
2
+
3
+ base_locale: en
4
+ locales: [en]
5
+
6
+ ignore_unused:
7
+ - "decidim.components.feeds_ui.name"
8
+
9
+ ignore_missing:
10
+ - decidim.participatory_processes.scopes.global
@@ -0,0 +1,29 @@
1
+ ---
2
+ bs:
3
+ layouts:
4
+ decidim:
5
+ footer:
6
+ link_neues_fenster: Link otvara novi prozor
7
+ AK_gefoerdert: Podržano od DIGIFONDS AK Wien
8
+ decidim:
9
+ components:
10
+ feeds_ui:
11
+ name: FeedsUi
12
+ mainMenu:
13
+ home: Početna
14
+ user: Korisnik
15
+ group: Grupe
16
+ messenger: Messenger
17
+ admin: Admin
18
+ userMenu:
19
+ sign_out: Odjava
20
+ topMenu:
21
+ information: Info
22
+ notification: Postoje %{variable_name} nova obavještenja
23
+ user:
24
+ filter:
25
+ title: Traži
26
+ name: Ime
27
+ interest: Interes
28
+ block: Stubište / Zgrada / Kvart
29
+ noUser: Nema pronađenih korisnika
@@ -0,0 +1,29 @@
1
+ ---
2
+ de:
3
+ layouts:
4
+ decidim:
5
+ footer:
6
+ link_neues_fenster: Link öffnet einen neuen Fenster
7
+ AK_gefoerdert: Gefördert durch DIGIFONDS AK Wien
8
+ decidim:
9
+ components:
10
+ feeds_ui:
11
+ name: FeedsUi
12
+ mainMenu:
13
+ home: Start
14
+ user: User
15
+ group: Gruppen
16
+ messenger: Messenger
17
+ admin: Admin
18
+ userMenu:
19
+ sign_out: Abmelden
20
+ topMenu:
21
+ information: Info
22
+ notification: Es gibt %{variable_name} neue Notifikationen
23
+ user:
24
+ filter:
25
+ title: Suche
26
+ name: Name
27
+ interest: Interessen
28
+ block: Stiege / Anlage / Quartier
29
+ noUser: Keine Nutzer*Innen gefundene
@@ -0,0 +1,29 @@
1
+ ---
2
+ en:
3
+ layouts:
4
+ decidim:
5
+ footer:
6
+ link_neues_fenster: Link opens a new window
7
+ AK_gefoerdert: Supported by DIGIFONDS AK Wien
8
+ decidim:
9
+ components:
10
+ feeds_ui:
11
+ name: FeedsUi
12
+ mainMenu:
13
+ home: Start
14
+ user: User
15
+ group: Groups
16
+ messenger: Messenger
17
+ admin: Admin
18
+ userMenu:
19
+ sign_out: Sign out
20
+ topMenu:
21
+ information: Info
22
+ notification: There are %{variable_name} new notifications
23
+ user:
24
+ filter:
25
+ title: Search
26
+ name: Name
27
+ interest: Interest
28
+ block: Staircase / Building / District
29
+ noUser: No users found
@@ -0,0 +1,29 @@
1
+ ---
2
+ hr:
3
+ layouts:
4
+ decidim:
5
+ footer:
6
+ link_neues_fenster: Link otvara novi prozor
7
+ AK_gefoerdert: Podržano od DIGIFONDS AK Wien
8
+ decidim:
9
+ components:
10
+ feeds_ui:
11
+ name: FeedsUi
12
+ mainMenu:
13
+ home: Početna
14
+ user: Korisnik
15
+ group: Grupe
16
+ messenger: Glasnik
17
+ admin: Admin
18
+ userMenu:
19
+ sign_out: Odjava
20
+ topMenu:
21
+ information: Informacije
22
+ notification: Ima %{variable_name} novih obavijesti
23
+ user:
24
+ filter:
25
+ title: Pretraživanje
26
+ name: Ime
27
+ interest: Interes
28
+ block: Stub / Zgrada / Distrikt
29
+ noUser: Nema pronađenih korisnika
@@ -0,0 +1,29 @@
1
+ ---
2
+ it:
3
+ layouts:
4
+ decidim:
5
+ footer:
6
+ link_neues_fenster: Link apre una nuova finestra
7
+ AK_gefoerdert: Supportato da DIGIFONDS AK Wien
8
+ decidim:
9
+ components:
10
+ feeds_ui:
11
+ name: FeedsUi
12
+ mainMenu:
13
+ home: Start
14
+ user: User
15
+ group: Gruppi
16
+ messenger: Messenger
17
+ admin: Admin
18
+ userMenu:
19
+ sign_out: Esci
20
+ topMenu:
21
+ information: Info
22
+ notification: Ci sono %{variable_name} nuove notifiche
23
+ user:
24
+ filter:
25
+ title: ricerca
26
+ name: Nome
27
+ interest: Interesse
28
+ block: Scala / Struttura / Quartiere
29
+ noUser: Nessun utente trovato
@@ -0,0 +1,29 @@
1
+ ---
2
+ sr:
3
+ layouts:
4
+ decidim:
5
+ footer:
6
+ link_neues_fenster: Link otvara novi prozor
7
+ AK_gefoerdert: Podržano od DIGIFONDS AK Wien
8
+ decidim:
9
+ components:
10
+ feeds_ui:
11
+ name: FeedsUi
12
+ mainMenu:
13
+ home: Početna
14
+ user: Korisnik
15
+ group: Grupe
16
+ messenger: Glasnik
17
+ admin: Admin
18
+ userMenu:
19
+ sign_out: Odjava
20
+ topMenu:
21
+ information: Informacije
22
+ notification: Ima %{variable_name} novih obaveštenja
23
+ user:
24
+ filter:
25
+ title: Traži
26
+ name: Ime
27
+ interest: Interes
28
+ block: Stepenište / Zgrada / Okrug
29
+ noUser: Nema pronađenih korisnika
@@ -0,0 +1,29 @@
1
+ ---
2
+ tr:
3
+ layouts:
4
+ decidim:
5
+ footer:
6
+ link_neues_fenster: Link yeni bir pencere açar
7
+ AK_gefoerdert: DIGIFONDS AK Wien tarafından desteklenmektedir
8
+ decidim:
9
+ components:
10
+ feeds_ui:
11
+ name: FeedsUi
12
+ mainMenu:
13
+ home: Başlangıç
14
+ user: Kullanıcı
15
+ group: Gruplar
16
+ messenger: Mesajlaşma
17
+ admin: Yönetici
18
+ userMenu:
19
+ sign_out: Çıkış yap
20
+ topMenu:
21
+ information: Bilgi
22
+ notification: '%{variable_name} yeni bildirim var'
23
+ user:
24
+ filter:
25
+ title: Aramak
26
+ name: İsim
27
+ interest: İlgi
28
+ block: Merdiven / Bina / Bölge
29
+ noUser: Kullanıcı bulunamadı
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module FeedsUi
5
+ module Admin
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module FeedsUi
5
+ # This is the engine that runs on the public interface of `FeedsUi`.
6
+ class AdminEngine < ::Rails::Engine
7
+ isolate_namespace Decidim::FeedsUi::Admin
8
+
9
+ paths["db/migrate"] = nil
10
+ paths["lib/tasks"] = nil
11
+
12
+ routes do
13
+ # Add admin engine routes here
14
+ # resources :feeds_ui do
15
+ # collection do
16
+ # resources :exports, only: [:create]
17
+ # end
18
+ # end
19
+ # root to: "feeds_ui#index"
20
+ end
21
+
22
+ def load_seed
23
+ nil
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails"
4
+ require "decidim/core"
5
+
6
+ require "decidim/feeds_ui/menu"
7
+
8
+ module Decidim
9
+ module FeedsUi
10
+ # This is the engine that runs on the public interface of feeds_ui.
11
+ class Engine < ::Rails::Engine
12
+
13
+ isolate_namespace Decidim::FeedsUi
14
+
15
+ routes do
16
+ # Add engine routes here
17
+ # resources :feeds_ui
18
+ # root to: "feeds_ui#index"
19
+ get '/allusers', to: 'users#index'
20
+ get '/user_profile/:id', to: 'users#user_profile', as: 'user_profile'
21
+ get '/filter_users', to: 'users#filter_users', as: 'filter_users'
22
+ end
23
+
24
+ # this should make /allusers available at /feeds_ui/allusers
25
+ initializer "decidim_feeds_ui.mount_routes" do
26
+ Decidim::Core::Engine.routes do
27
+ mount Decidim::FeedsUi::Engine, at: "/feeds_ui", as: "decidim_feeds_ui"
28
+ end
29
+ end
30
+
31
+ initializer "decidim_feeds_ui.webpacker.assets_path" do
32
+ Decidim.register_assets_path File.expand_path("app/packs", root)
33
+ end
34
+
35
+ initializer "decidim_feeds_ui.add_cells_view_paths" do
36
+ Cell::ViewModel.view_paths << File.expand_path("#{Decidim::FeedsUi::Engine.root}/app/cells")
37
+ Cell::ViewModel.view_paths << File.expand_path("#{Decidim::FeedsUi::Engine.root}/app/views")
38
+ end
39
+
40
+ initializer "decidim_feeds_ui.register_icons" do
41
+ Decidim.icons.register(name: "notification-line", icon: "notification-line", category: "system", description: "", engine: :feeds_ui)
42
+ Decidim.icons.register(name: "filter-2-line", icon: "filter-2-line", category: "system", description: "", engine: :feeds_ui)
43
+ end
44
+
45
+ # initializer "decidim_feeds_ui.menu" do
46
+ # Decidim::FeedsUi::Menu.register_user_menu!
47
+ # end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module FeedsUi
5
+ class Menu
6
+ def self.register_user_menu!
7
+ Decidim.menu :user_menu do |menu|
8
+ menu.add_item :sign_out,
9
+ t("sign_out", scope: "decidim.components.feeds_ui.userMenu"),
10
+ decidim.destroy_user_session_path,
11
+ position: 1000,
12
+ active: :exact,
13
+ method: :delete
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "decidim/core/test/factories"
4
+
5
+ FactoryBot.define do
6
+ # Add engine factories here
7
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ # This holds the decidim-meetings version.
5
+ module FeedsUi
6
+ VERSION = "1.0.0"
7
+ COMPAT_DECIDIM_VERSION = [">= 0.28.0", "< 0.29"].freeze
8
+ COMPAT_FEEDS_VERSION = [">= 1.0.0", "< 2"].freeze
9
+ COMPAT_POSTS_VERSION = [">= 1.0.0", "< 2"].freeze
10
+ end
11
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "decidim/feeds_ui/admin"
4
+ require "decidim/feeds_ui/engine"
5
+ require "decidim/feeds_ui/admin_engine"
6
+
7
+ module Decidim
8
+ module FeedsUi
9
+ end
10
+ end