Skip to content
Snippets Groups Projects
Unverified Commit 716f3a51 authored by luap42's avatar luap42 Committed by GitHub
Browse files

Update to Co-Design 0.11.0 (#104)

Update to Co-Design 0.11.0
parent bc470ef3
No related branches found
No related tags found
No related merge requests found
......@@ -16,14 +16,6 @@
@import 'variables';
body {
font-family: $font-stack-plain !important;
}
h1, h2, h3, h4, h5, h6 {
font-family: $font-stack-display !important;
}
h1 {
font-size: 1.7em;
}
......@@ -46,33 +38,6 @@ a {
overflow-wrap: break-word;
}
details {
border-top: 1px solid $muted-graphic;
padding: 0.5em 0.5em 0.5em 2em;
summary::-webkit-details-marker {
display: none;
}
summary {
margin: 0 0 0 -2em;
}
& > summary:before {
display: inline-block;
padding: 0 0.5em;
content: '▶';
}
&[open] > summary:before {
content: '▼';
}
&:last-of-type {
border-bottom: 1px solid $muted-graphic;
}
}
a.header--site-name {
display: flex !important;
}
......@@ -99,6 +64,13 @@ a.header--site-name {
.item-list--number-value {
width: 80px !important;
margin: 0 !important;
align-self: stretch;
justify-content: flex-start;
.meter {
flex-shrink: 0;
margin-top: 1.5rem;
}
}
}
......@@ -130,8 +102,6 @@ ul.pagination li.disabled {
}
header {
font-family: $font-stack-display;
&.header {
z-index: 5;
position: relative;
......
......@@ -13,9 +13,8 @@
<link rel="icon" href="<%= SiteSetting['IconPath'] || '/assets/favicon.ico' %>" />
<%= stylesheet_link_tag "https://fonts.googleapis.com/css?family=Roboto|Roboto+Mono&display=swap" %>
<%= stylesheet_link_tag "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css" %>
<%= stylesheet_link_tag "https://unpkg.com/@codidact/co-design@0.10.0/dist/codidact.css" %>
<%= stylesheet_link_tag "https://unpkg.com/@codidact/co-design@0.11.3/dist/codidact.css" %>
<%= stylesheet_link_tag "https://cdn.jsdelivr.net/npm/select2@4.0.12/dist/css/select2.min.css" %>
<%= stylesheet_link_tag "/assets/community/#{@community.host.split('.')[0]}.css" %>
<%= stylesheet_link_tag 'application', media: 'all' %>
......@@ -23,7 +22,7 @@
<%= javascript_include_tag "https://code.jquery.com/jquery-2.2.2.min.js" %>
<%= javascript_include_tag "https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js" %>
<%= javascript_include_tag "https://cdn.jsdelivr.net/npm/select2@4.0.12/dist/js/select2.min.js" %>
<%= javascript_include_tag "https://unpkg.com/@codidact/co-design@0.10.0/js/co-design.js" %>
<%= javascript_include_tag "https://unpkg.com/@codidact/co-design@0.11.3/js/co-design.js" %>
<%= javascript_include_tag "/assets/community/#{@community.host.split('.')[0]}.js" %>
<%= javascript_include_tag 'application' %>
......
......@@ -3,6 +3,9 @@
<% show_category_tag ||= false %>
<div class="item-list--item <%= post.deleted ? 'deleted-content' : '' %>">
<div class="item-list--number-value">
<div class="meter is-question-score">
<div class="meter--bar is-<%= (post.score * 100).to_i %>%"><%= (post.score * 100).to_i %>%</div>
</div>
<span class="item-list--number">
<span class=" js-upvote-count has-font-size-subheading">+<%= post.upvote_count %></span>
</span>
......
......@@ -138,42 +138,80 @@
<div class="post--actions">
<%= link_to 'history', post_history_path(post) %> &middot;
<div class="tools">
<%= link_to generic_share_link(post), class: 'tools--item' do %>
<i class="fa fa-link"></i>
Permalink
<% end %>
<%= link_to post_history_path(post), class: 'tools--item' do %>
<i class="fa fa-history"></i>
History
<% end %>
<% if check_your_post_privilege(post, 'Edit') %>
<% if post.pending_suggested_edit? %>
<%= link_to 'review suggested edit', suggested_edit_url(post.pending_suggested_edit.id), class: "h-fw-bold" %> &middot;
<%= link_to suggested_edit_url(post.pending_suggested_edit.id), class: 'tools--item is-danger is-filled' do %>
<i class="fa fa-spell-check"></i>
Review suggested edit
<% end %>
<% else %>
<%= link_to 'edit', generic_edit_link(post) %> &middot;
<%= link_to generic_edit_link(post), class: 'tools--item' do %>
<i class="fa fa-pencil-alt"></i>
Edit
<% end %>
<% end %>
<% elsif !current_user.nil? %>
<% if post.pending_suggested_edit? %>
<span>suggested edit pending...</span> &middot;
<span class="tools--item">suggested edit pending...</span>
<% else %>
<%= link_to 'suggest edit', generic_edit_link(post) %> &middot;
<%= link_to generic_edit_link(post), class: 'tools--item' do %>
<i class="fa fa-pencil-alt"></i>
Suggest edit
<% end %>
<% end %>
<% end %>
<%= link_to 'permalink', generic_share_link(post) %> &middot;
<% if is_question && !post.closed %>
<a href="#" class="close-dialog-link">close</a> &middot;
<a href="#" class="close-dialog-link tools--item">
<i class="fa fa-lock"></i>
Close
</a>
<% elsif is_question && post.closed %>
<%= link_to 'reopen', reopen_question_path(post), method: :post, class: 'reopen-question' %> &middot;
<%= link_to reopen_question_path(post), method: :post, class: 'reopen-question tools--item' do %>
<i class="fa fa-unlock"></i>
Reopen
<% end %>
<% end %>
<% if !post.deleted %>
<%= link_to 'delete', url_for(controller: post.post_type.name.pluralize.downcase.to_sym, action: :destroy, id: post.id),
method: :delete, data: { confirm: 'Are you sure you want to delete this post?' }, class: "is-red" %>
<%= link_to url_for(controller: post.post_type.name.pluralize.downcase.to_sym, action: :destroy, id: post.id),
method: :delete, data: { confirm: 'Are you sure you want to delete this post?' }, class: "tools--item is-danger" do %>
<i class="fa fa-trash"></i>
Delete
<% end %>
<% else %>
<%= link_to 'undelete', url_for(controller: post.post_type.name.pluralize.downcase.to_sym, action: :undelete, id: post.id),
method: :post, data: { confirm: 'Undelete this question, making it visible to regular users?' }, class: "is-red" %>
<% end %> &middot;
<a href="#" class="flag-dialog-link">flag</a>
<%= link_to url_for(controller: post.post_type.name.pluralize.downcase.to_sym, action: :undelete, id: post.id),
method: :post, data: { confirm: 'Undelete this question, making it visible to regular users?' }, class: "tools--item is-danger is-filled" do %>
<i class="fa fa-undo"></i>
Restore
<% end %>
<% end %>
<a href="#" class="flag-dialog-link tools--item">
<i class="fa fa-flag"></i>
Flag
</a>
<% if current_user&.has_privilege?('SeeTools') %>
&middot; <a href="javascript:void(0);" data-modal="#mod-tools-<%= post.id %>">tools</a>
<a href="javascript:void(0);" data-modal="#mod-tools-<%= post.id %>" class="tools--item">
<i class="fa fa-wrench"></i>
Tools
</a>
<% end %>
<% flags_count = post.flags.where(handled_by_id: nil).count %>
<% if moderator? && flags_count > 0 %>
&middot; <a href="#" class="show-all-flags-dialog-link has-font-weight-bold">show <%= pluralize(flags_count, "flag") %></a>
<a href="#" class="show-all-flags-dialog-link tools--item">
<i class="fa fa-exclamation-triangle"></i>
Show <%= pluralize(flags_count, "flag") %>
</a>
<% end %>
</div>
</div>
<div class="post--action-dialog js-flag-box">
<div class="widget">
......
......@@ -5,6 +5,9 @@
<% show_category_tag ||= false %>
<div class="item-list--item <%= is_meta ? 'post__meta' : '' %> <%= post.deleted ? 'deleted-content' : '' %>">
<div class="item-list--number-value">
<div class="meter is-question-score">
<div class="meter--bar is-<%= (post.score * 100).to_i %>%"><%= (post.score * 100).to_i %>%</div>
</div>
<span class="item-list--number">
<span class="js-upvote-count has-font-size-subheading">+<%= post.upvote_count %></span>
</span>
......
......@@ -75,7 +75,7 @@ Rails.application.routes.draw do
get ':id/edit', to: 'articles#edit', as: :edit_article
patch ':id/edit', to: 'articles#update', as: :update_article
delete ':id/delete', to: 'articles#destroy', as: :destroy_article
delete ':id/undelete', to: 'articles#undelete', as: :undelete_article
post ':id/undelete', to: 'articles#undelete', as: :undelete_article
end
get 'posts/:id/history', to: 'post_history#post', as: :post_history
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment