Commit graph

70 commits

Author SHA1 Message Date
Jonne Haß
6dbef95951 API: return whether post or item was already reported or not 2020-02-09 11:04:59 +01:00
Jonne Haß
b1f357849b API: return post oEmbed data 2020-02-02 20:15:36 +01:00
Jonne Haß
5921cd0176 API: return post open graph metadata 2020-02-02 20:15:36 +01:00
Jonne Haß
fbd0a51829 API: return current users like, reshare and subcription status in post infos 2020-02-02 18:13:55 +01:00
Jonne Haß
52e4e9f903 API: Update post location format to floats instead of floats as strings 2019-04-27 16:04:44 +02:00
Jonne Haß
f7a27f0c07 Ignore Metrics/AbcSize Rubocop for PostPresenter#as_api_response
[ci skip]
2019-04-26 18:18:48 +02:00
Hank Grabowski
ce01946eb0 Fixed new pronto warnings after develop branch sync 2018-12-30 17:04:35 -05:00
Hank Grabowski
6798ba974c Posts API Endpoint feature complete with full unit tests 2018-11-05 08:30:54 -05:00
Frank Rousseau
c1ece44c53 Make Post API match specs
https://diaspora.github.io/api-documentation/routes/posts.html
2018-11-01 13:56:18 +01:00
Benjamin Neff
e82690963d
Add # frozen_string_literal: true to all files 2017-09-17 19:29:15 +02:00
Rete2
b556ad5211
show users vote in poll
closes #7550
2017-08-26 03:16:05 +02:00
Steffen van Bergerem
5808b84e83
Only include at most 30 likes and reshares on pageload in the SPV 2017-08-12 18:09:14 +02:00
Steffen van Bergerem
05d19e69ee
Move ExtremePostPresenter methods into PostPresenter, add #with_initial_interactions method 2017-08-12 18:09:12 +02:00
Steffen van Bergerem
951149dd24 Properly format JSON for reshares to hide 'reshare' button on already reshared posts
closes #7169

fixes #4816 and #6594
2016-11-03 22:44:12 +01:00
Benjamin Neff
4b020b8d61 Fix regressions from #6998
* fixed old reshares of reshares
* fixed deleted root of a reshare
2016-08-22 00:43:43 +02:00
Denis Hovart
bcace2def2 6840 : meta tags update (#6998)
* Adds a new metadata helper and methods to PostPresenter to have metas on post pages.

* Adds tests to post controller to check correctness of metas

* Add methods to PersonPresenter to have metas on profile pages

* Correct meta data helper test

* Update PersonPresenter, add test to PeopleController

* Creates TagPresenter. Display tag metas on tag index page

* Updata meta data helper spec

* Not displaying bio as the description meta on profile page for now. Privacy concerns to be cleared.

* Set meta info as hashes in presenters

* Move original hardcoded metas info to config/defaults.yml

* metas_tags include by default the general metas, update views

* Update code style, clean views

* Renames TagPresenter StreamTagPresenter, updates TagController spec

* Add a default_metas entry to diaspora.yml.example

* Align metas hash in presenters, refactor meta data helper

* Use bio as description meta if user has a public profile

* Rename StreamTagPresenter to TagStreamPresenter
2016-08-18 21:52:39 +02:00
Benjamin Neff
ecd13fc713 cleanup old attributes from code 2016-08-08 19:37:09 +02:00
Benjamin Neff
df9874b73a remove raw_message
This was only an alias for "text", and "raw_message" is also not used
for federation anymore, so we can drop it.
2016-07-17 01:40:00 +02:00
Dennis Schubert
7c197756dd Merge branch 'stable' into develop 2016-01-26 15:19:55 +01:00
Dennis Schubert
ad20bb052c Fix include_root_in_json misuse
since it is no longer exposed for instances, our post_presenter failed
hard.
2016-01-26 15:18:02 +01:00
realtin
57b7c05c4f set maptile default to OpenMapSurfer
- refactor code for toggle map function
- adjust jasmine tests for maps and add tests for SPV
- change name of access token in defaults.yml according to naming conventions
- add explanation of map use for podmins
- add location to post_presenter
- fix opening multiple maps inside the stream when clicking on a reshare location
(#5813)
2015-09-09 12:26:47 +02:00
zaziemo
298e195a8f add a map subview
- add coordinates in post_presenter
- add map to the SPV if location is provided
- add leaflet.js to render map and marker of position
- make coordinates available in frontend
- add map scss
- make stream post location clickable and redirect to the SPV
- prevent render map if no location data is provided
- add tests for coordinates
- use the leaflet gem instead of the JS assets
(#5813)
2015-09-09 12:19:38 +02:00
theworldbright
6e74ee7d21 Make PostPresenter inherit from BasePresenter
closes #6315
2015-08-23 22:49:45 +02:00
theworldbright
335b1c32aa Refactor post presenter 2015-08-23 22:49:12 +02:00
theworldbright
2a3dde1ae5 Refactor PostService and extract its tests
Squashed commits:

[ada0f09] Remove favorites from Posts table

closes #6208
2015-07-26 13:10:24 +02:00
Jonne Haß
ac52cef546 Only return the current_users participation for post interactions
closes #6007
2015-05-30 03:08:25 +02:00
Jonne Haß
73b6c75278 On reshare insert the reshare built from the response
Also make sure comments_count and the like is always set in the
response.
2015-03-23 23:02:23 +01:00
Marco Colli
eccab62e32 Allow user to enable / disable notifications for a post from stream #5350 2015-01-25 18:40:47 +01:00
Dennis Schubert
6808150920 Method calling convention and doc improvements
... and a stealth-commit of an already introduced bug prevention system.
;)
2014-11-09 07:20:30 -08:00
Dennis Schubert
92cd4e6b78 Use camo for Markdown images
just a quick proof of concept
2014-11-08 05:14:18 +01:00
Jonne Haß
09f0665225 replace deprecated usages for all 2014-08-23 16:34:01 +02:00
Jason Robinson
356096a7eb Merge pull request #4836 from MrZYX/message_renderer
Introduce message renderer
2014-04-13 15:00:46 +03:00
Hincu Petru
2ae4d41db3 Fixed 4903 and not render vote form when user is not logged 2014-04-05 14:29:07 +00:00
Jannik Streek
12fabe2fb9 finalized voting design + some design fixes + improved code 2014-03-31 18:14:07 +02:00
Jannik Streek
d0a77ce6b3 design for poll participation implemented, saving works as well 2014-03-31 18:14:07 +02:00
Jonne Haß
8280556a47 Introduce message renderer
This new class replaces all existing server side message
rendering helpers and is the new global entry point for such
needs. All models with relevant fields now expose an instance
of MessageRenderer for those. MessageRenderer acts as
gateway between the existing processing solutions for markdown,
mentions and tags and provides a very flexible interface for
all output needs. This makes the API to obtain a message
in a certain format clear. As a result of centralizing the
processing a lot of duplication is eliminated. Centralizing
the message processing also makes it clear where to change
its behaviour, add new representations and what options
are already available.
2014-03-15 17:16:17 +01:00
Fabian Rodriguez
6c8c4fc99e remove template picker functionality 2013-12-03 20:53:00 -02:00
Fabian Rodriguez
d7b8cb2997 remove #next_post_path and #previous_post_path from postpresenter 2013-12-01 20:55:48 -02:00
Jonne Haß
75d3b1598f make sure comments are sorted in ascending order from oldest to newest in the SPV 2013-08-22 16:21:51 +02:00
Fábián Tamás László
176c6826e0 opengraph POC
Fixed small-frame opengraph view

Fixed incompletely saved OpenGraphCache bug
2013-08-04 15:42:29 +02:00
Damien
f4b3f2fd1e Consider Markdown header content as post title
clarify regexp and correct some bad backtracking

add specs

rewrite regex

convert mardown style title to plain text title

fix bad indentation

add jasmine test for post-viewer.js

tries to fix bad jasmine test
2013-07-31 14:59:02 +02:00
Marco Gallardo
4aab8762fa Locator feature
added marker image for publisher, showing div for address, and added
functionality to close it when clicking 'X' image

showing marker image in publisher

renamed map-marker to locator

fixed style for map marker image in publisher

added locator.js to get user's location

loading google maps api

removed unecessary append and showing location next to publisher

moved location address inside div and  added image to close location

styled div location address an image to close location

removing location when clicking close image

cleaned code

cleaned code

showing loader while location is being obtained, translated normal js to
backbone structure, created locations db stuff, and removing location
div when clicking 'share'

refactored code; started to move code to backbone

refactored js code; moving functionality to backbone structure

created address function to make accessible address variable value

refactored locator.js

showing and removing location div from dom

created location; it belongs_to status_message

added location model and created association with status_message

added hidden field for location address and added respective code on js files to retrieve it on ajax call

saving location for status_message (post)

removing location when sharing

renamed locator backbone view to location, added template, showing
location, and saving lat and lng

prepared and added template to show location

added location to post model in order to have it accessible in backbone

retrieving location to show it in template

removed console.log XD

fixes when removing location

cleanind location_address hidden field when location is removed

more fixes; showing location when sharing

saving location just when it exists

created method to retrieve location address just when location was created

fixed issue about showing 'Near from' message when there was not any location

added style for location

cleaned code

renamed locator view

retrieving lat and lng from locator.js

saving lat and lng in location_coords

saving lat and lng

added style for input location_address

removed location_address  hidden field; the value will be taken directly from input with the location

replaced div with location for input; the user will be able to edit the place

avoiding submitting the form when pressing Enter key on new input for location

added missed spec file for location model

refactored location_view code

refactored location_view code

cleaned code

added sinon library for testing

added describes for new publisher's view functions

created test for destroyLocation function

added test for showLocation publisher view function

created test for avoidEnter publisher view function

removed unnecessary div

Created first test for locations view, added more specs, added Sinon.js,
and fixed issue with assets

loading locator.js for tests

moved location stuff to app/assets

moved locator.js and sinon.js to app/assets

fixed route for images

included locator.js to assets

fixed issue when post object is different than StatusMessage; also fixed issue with lat and lng

loading Sinon for specs

refactoring locator errorGettingposition and start replacing google maps stuff with OSM

added OpenLayers JS, osmlocator, and added them into the main js

changing the locator from Google to OSM instance

changing lat and lng value in the backbone view

removing google javascript tag in application layout

adding jasmine to locator test and removed locator.js

adding jasmine to locator test using OSM

adding Jasmine test to OSM locator

removed locator.js

removed require locator and updated schema

fixed js response; added location

since we are using OSM Locator we don't need locator-spec test

fixed spec for location view; we are not using google maps anymore

changed description of osmlocator-spec

fixed issue with status-message-location template

fixed style for location_address textbox

fixed tests for locator

moved split function to model

created test for location model

removed puts

added effect for location marker

added translations for locator

removed conflicting-unnecessary lines that were loading files for specs

removed sinon library; using sinon-rails gem

removed useless code

removed puts; added Rails.logger.error

added sinon.js file

added specific version of sinon-rails gem

improving validations sintax

using openlayers-rails gem

removed 'google API' text

using sinon gem

isolating LocationStream view

refactored validation

getting location when post is a Reshare

refactored code

fixed aligment for elements under location message

improved styling for location message

refactored begin-rescue block

getting absolute root instead of just the root

added address method to retrive address of location

removed code from Post model; also added descriptinon why it was removed

removed validation when retrieving address; with latest refactorizations we dont need them any more

interpolated location; using file in locales

fixed width for div of location

moved Sinon gem into development and test group

fixed method's description

added missed indexes

updated schema with locations table

removed openlayers-rails gem

preventing location to be saved if there are not coordinates

fixed spec; wrong closing tag
2013-05-02 17:31:53 -05:00
Jonne Haß
3fc3b249e7 End the require mess
* Rename and reorganize post fetcher to fix autoloading, also let it use
  Faradays default connection so we get nice redirects
* Add initializer to load libs at a central place
* added lib dir to autoload_once paths to increase thread safety
* Moved lib/exceptions.rb to lib/diaspora/ to conform namespacing
2013-03-21 23:37:53 +01:00
Jonne Haß
1a93ccd548 don't error out if the root of a reshare of a reshare got deleted, fixes #3546 2012-10-24 19:51:31 +02:00
Jonne Haß
e70e48d6ca some refactoring regarding the law of demeter 2012-09-23 19:33:19 +02:00
Steven Hancock
a8de3a5a3f Rails.root and File.join cleanup
- `Rails.root` is a `Pathname`, so let's use `Rails.root.join`
- Clean up most of the remaining `File.join`s
2012-06-11 03:13:20 -07:00
Florian Staudacher
788f328a77 resolve reshare root posts to the first one 2012-05-18 01:45:41 +02:00
Dennis Collinson
f6e3c1b88b seperate interactions from posts
Lazily load post interactions on show page
hella refactorz
2012-05-12 17:41:58 -07:00
Jonne Haß
7a6d325f64 looks like there are sometimes objects passed into post presenter that respond to root while root is nil 2012-05-11 14:23:05 +02:00
Dennis Collinson
3326bc5bb4 present reshares 2012-05-10 15:16:05 -07:00