-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User page: new following section #1750
Changes from 1 commit
52e195d
7e2e94d
556e259
b0c571e
cef67c5
36f9836
249641f
16987e7
57c8887
b7ef755
3be893b
cba497b
c9a6630
119a6b3
3b13350
dec7d2d
b7bce2e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
… author.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ def initialize(user) | |
can :create, Budget::Investment, budget: { phase: "accepting" } | ||
can :suggest, Budget::Investment, budget: { phase: "accepting" } | ||
can :destroy, Budget::Investment, budget: { phase: ["accepting", "reviewing"] }, author_id: user.id | ||
can :vote, Budget::Investment, budget: { phase: "selecting" } | ||
can :vote, Budget::Investment, budget: { phase: "selecting" } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^_^ /bertocq likes this |
||
can [:show, :create], Budget::Ballot, budget: { phase: "balloting" } | ||
can [:create, :destroy], Budget::Ballot::Line, budget: { phase: "balloting" } | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,15 +5,15 @@ | |
<%= proposal.summary %> | ||
</td> | ||
|
||
<% if can? :retire_form, proposal %> | ||
<% if author?(proposal) %> | ||
<td class="text-center"> | ||
<%= link_to t("users.proposals.send_notification"), | ||
new_proposal_notification_path(proposal_id: proposal.id), | ||
class: 'button hollow' %> | ||
</td> | ||
<% end %> | ||
|
||
<% if can? :new, ProposalNotification, author_id: proposal.author_id %> | ||
<% if author?(proposal) || proposal.retired? %> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It took me a bit to understand all the conditionals around this block and realize there is only 2 scenarios. Maybe this could be easier to read: <% if proposal.retired? %>
<td class="text-center">
<span class="label alert"><%= t('users.proposals.retired') %></span>
</td>
<% elsif author?(proposal) %>
<td class="text-center">
<%= link_to t('users.proposals.retire'),
retire_form_proposal_path(proposal),
class: 'button hollow alert' %>
</td>
<% end %> There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Totally agree @bertocq! We will make this change too! |
||
<td class="text-center"> | ||
<% if proposal.retired? %> | ||
<span class="label alert"><%= t('users.proposals.retired') %></span> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't really understand the reason to remove
author_or_admin?
method and its usage, can you explain a bit further? :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bertocq The main reason is that apparently it was not being used anywhere in the application.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 you're right, I did a project search and no use, although sometimes looking for the method string is not enough if you do compose de method name with a string interpolation like
send("#{this}_or_#{that}")
but that's not the case I guess based on the specs passing ^_^Nice catch & cleanup 👏 😄